CN113765886B - Multimedia playing method and device, storage medium and electronic equipment - Google Patents

Multimedia playing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113765886B
CN113765886B CN202110892252.XA CN202110892252A CN113765886B CN 113765886 B CN113765886 B CN 113765886B CN 202110892252 A CN202110892252 A CN 202110892252A CN 113765886 B CN113765886 B CN 113765886B
Authority
CN
China
Prior art keywords
media
server
media resource
transmission control
control protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110892252.XA
Other languages
Chinese (zh)
Other versions
CN113765886A (en
Inventor
林锦添
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202110892252.XA priority Critical patent/CN113765886B/en
Publication of CN113765886A publication Critical patent/CN113765886A/en
Application granted granted Critical
Publication of CN113765886B publication Critical patent/CN113765886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1069Session establishment or de-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/764Media network packet handling at the destination 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a multimedia playing method, a device, a storage medium and electronic equipment, and relates to the technical field of Internet, wherein the method comprises the following steps: sending a target connection request to a server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments; circularly sending an acquisition request of the media resource segment to the server through the target transmission control protocol link; based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and closing the target transmission control protocol link when the multimedia is played to a preset state. The method and the device effectively improve the playing effect of the multimedia.

Description

Multimedia playing method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of internet, in particular to a multimedia playing method, a device, a storage medium and electronic equipment.
Background
With the popularization of the internet, users often have a requirement of acquiring multimedia resources from the network to play multimedia, and the playing effect of the multimedia resources is related to the network transmission process, the local buffer size of the playing terminal, and the like.
At present, when multimedia playing, the multimedia resource request needs to consume more time in the multimedia playing process due to the instability of the network transmission process, small local buffer area of the playing terminal and other reasons, which easily causes resource underload, causes playing jam and affects the user experience.
Disclosure of Invention
The embodiment of the application provides a multimedia playing scheme which can effectively improve the playing effect of multimedia.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
according to one embodiment of the present application, a multimedia playing method includes: sending a target connection request to a server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments; circularly sending an acquisition request of the media resource segment to the server through the target transmission control protocol link; based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and closing the target transmission control protocol link when the multimedia is played to a preset state.
In some embodiments of the present application, the sending, to a server, a target connection request, where the target connection request is used to instruct the server to establish a target transmission control protocol link that allows a loop to request a media resource segment, includes: creating a local socket; establishing a transmission control protocol link between the local socket and a server socket created by the server; and based on the local socket, sending the target connection request to the server socket through the transmission control protocol link so as to instruct the server to adjust the transmission control protocol link to be a target transmission control protocol link allowing cyclic request of media resource fragments.
In some embodiments of the present application, the media resource segment comprises a plurality of; the circularly sending, by the target transmission control protocol link, an acquisition request of a media resource segment to the server, and constructing media analysis data meeting a preset analysis condition in a local buffer area based on the media resource segment requested by the acquisition request, including: sending a first acquisition request to the server through the target transmission control protocol link so as to receive a first media resource segment returned by the server; according to the first media resource segment, a second acquisition request is sent to the server through the target transmission control protocol link so as to receive a second media resource segment returned by the server; constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the first media resource segment and the second media resource segment; circularly sending a subsequent acquisition request to the server through the target transmission control protocol link so as to receive a subsequent media resource segment circularly returned by the server; and continuously constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the returned subsequent media resource fragments.
In some embodiments of the present application, the sending, according to the first media resource segment, a second acquisition request to the server through the target transmission control protocol link includes: analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; and sending the second acquisition request to the server through the target transmission control protocol link.
In some embodiments of the present application, the constructing media parsing data meeting a preset parsing condition in a local buffer based on the first media resource segment and the second media resource segment includes: analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate media analysis data meeting preset analysis conditions in the local buffer area.
In some embodiments of the present application, the closing the target tcp link when the multimedia is played to a predetermined play state includes: acquiring an analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished according to the analysis state; and closing the target transmission control protocol link when the multimedia playing is determined to be finished.
In some embodiments of the present application, the target tcp link is established between a local socket and a server socket created by the server; and closing the target transmission control protocol link when the multimedia playing is determined to be finished, wherein the method comprises the following steps: and closing the local socket when the multimedia playing is determined to be finished.
According to one embodiment of the present application, a multimedia playing device includes: the system comprises an establishing module, a request processing module and a request processing module, wherein the establishing module is used for sending a target connection request to a server, and the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments; a request module, configured to send, through the target transmission control protocol link, a request for acquiring a media resource segment to the server in a cyclic manner; the construction module is used for constructing media analysis data meeting preset analysis conditions in the local buffer zone based on the media resource fragments requested by the acquisition request; the playing module is used for acquiring the media analysis data from the local buffer zone and playing the media analysis data in a multimedia mode; and the closing module is used for closing the target transmission control protocol link when the multimedia is played to a preset state.
According to another embodiment of the present application, a storage medium has stored thereon computer readable instructions, which when executed by a processor of a computer, cause the computer to perform the method described in the embodiments of the present application.
According to another embodiment of the present application, an electronic device may include: a memory storing computer readable instructions; and a processor for reading the computer readable instructions stored in the memory to perform the method according to the embodiment of the present application.
In the embodiment of the application, a target connection request is sent to a server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments; circularly sending an acquisition request of the media resource fragments to a server through a target transmission control protocol link; based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area; acquiring media analysis data from a local buffer area, and performing multimedia playing on the media analysis data; and closing the target transmission control protocol link when the multimedia is played to a preset state.
In this way, by establishing the target transmission control protocol link allowing to circularly request the media resource segments, time consumption in the link connection process is avoided, further, by circularly requesting the media resource segments, media analysis data meeting preset analysis conditions is constructed in the local buffer area, and multimedia playing is performed, resource underload can be reliably avoided, meanwhile, multimedia playing is efficiently performed, and further, the time consumption of the multimedia resource request is effectively reduced as a whole, simultaneously, resource underload is reliably avoided, playing jamming is effectively avoided, multimedia playing effect is improved, and user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 shows a schematic diagram of a system to which embodiments of the present application may be applied.
Fig. 2 shows a flowchart of a multimedia playing method according to an embodiment of the present application.
Fig. 3 shows a block diagram of a multimedia playing device according to one embodiment of the present application.
Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In the following description, specific embodiments of the present application will be described with reference to steps and symbols performed by one or more computers, unless otherwise indicated. Thus, these steps and operations will be referred to in several instances as being performed by a computer, which as referred to herein performs operations that include processing units by the computer that represent electronic signals that represent data in a structured form. This operation transforms the data or maintains it in place in the computer's memory system, which may reconfigure or otherwise alter the computer's operation in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of the present application are described in the foregoing text and are not meant to be limiting, and one skilled in the art will recognize that various steps and operations described below may also be implemented in hardware.
Fig. 1 shows a schematic diagram of a system 100 to which embodiments of the present application may be applied. As shown in fig. 1, the system 100 may include a server 101, a first terminal 102, and a second terminal 103. The first terminal 102 and the second terminal 103 may be any computer device, such as a television, a computer, a mobile phone, a smart watch, and a home appliance. The server 101 may be a server cluster or a cloud service, etc.
The server 101 may be connected to the first terminal 102 and the second terminal 103 by wired or wireless connection.
In one implementation of this example, the first terminal 102 or the second terminal 103 may send a target connection request to the server, where the target connection request is used to instruct the server to establish a target transmission control protocol link that allows for looping of requested media resource segments; circularly sending an acquisition request of the media resource fragments to a server through a target transmission control protocol link; based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area; acquiring media analysis data from a local buffer area, and performing multimedia playing on the media analysis data; and closing the target transmission control protocol link when the multimedia is played to a preset state.
Fig. 2 schematically shows a flow chart of a method of multimedia playing according to one embodiment of the present application. The main body of execution of the multimedia playing method may be any device, such as the first terminal 102 or the second terminal 103 shown in fig. 1.
As shown in fig. 2, the multimedia playing method may include steps S210 to S250.
Step S210, a target connection request is sent to a server, wherein the target connection request is used for instructing the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments;
step S220, circularly sending a media resource segment acquisition request to a server through a target transmission control protocol link;
step S230, based on the media resource segment requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area;
step S240, media analysis data is obtained from the local buffer area, and multimedia playing is carried out on the media analysis data;
step S250, when the multimedia is played to a preset state, the target transmission control protocol link is closed.
The specific procedure of each step performed when multimedia playing is described below.
In step S210, a target connection request is sent to the server, the target connection request being used to instruct the server to establish a target transmission control protocol link that allows looping of requested media resource segments.
In this example embodiment, the target connection request may be a request sent by the terminal to the server, where the target connection request may carry a predetermined instruction field, and after the server receives the target connection request, if the target connection request includes the predetermined instruction field, a target transmission control protocol link that allows the loop request media resource segment may be established between the server and the terminal according to the predetermined instruction field.
The predetermined instruction field may be a long link field (keep-alive field), and may instruct the server to set a transmission control protocol link that has been established between the terminal and the server to a state that is maintained uninterrupted, thereby establishing a target transmission control protocol link that allows cyclic request of media resource segments.
The transmission control protocol link is a transmission control protocol based communication link and the transmission control protocol (TCP, transmission Control Protocol) is a connection-oriented, reliable, byte stream based transport layer communication protocol. The target transmission control protocol link is a transmission control protocol link that allows for looping of requested media resource segments, i.e. allows for looping of requests to the server based on the established target transmission control protocol link.
In one mode, if a transmission control protocol link corresponding to a single request is adopted, a request can be requested from a server to a part of media resource fragment files, the transmission control protocol link needs to be disconnected after each request is completed, the cyclic request of media resource fragments is not allowed, if multiple requests are carried out, the transmission control protocol link needs to be established for multiple times, and the transmission control protocol link needs to be disconnected for multiple times, so that the transmission control protocol link is established based on 3 network data packet interactions of the transmission control protocol connection, the disconnection of the transmission control protocol link is based on 4 network data packet interactions of the transmission control protocol disconnection, more time is consumed when multiple times of disconnection are established, and the local multimedia playing process is greatly influenced. In one way, if all media resource segments of the multimedia to be played are obtained directly from the client through one request, the local buffer is under very high pressure, and the playing effect is also affected.
And further, a target connection request is sent to the server to instruct the server to establish a target transmission control protocol link allowing cyclic request of the media resource fragments, so that efficient segmentation request of the media resource fragments in the subsequent steps can be effectively ensured.
In one embodiment, step S210, sending a target connection request to a server, where the target connection request is used to instruct the server to establish a target transmission control protocol link that allows a loop to request a media resource segment, includes:
creating a local socket; establishing a transmission control protocol link between a local socket and a server socket created by a server; based on the local socket, a target connection request is sent to the server socket over the transmission control protocol link to instruct the server to adjust the transmission control protocol link to a target transmission control protocol link that allows for looping of the requested media resource segments.
The local Socket is a Socket at the terminal side, and the Socket is a Socket for describing the terminal address and the port of the terminal; the server socket is a socket on the server side, and the server socket is a socket for describing the address and the port of the server in the server.
The transmission control protocol link between the local socket and the server socket created by the server is established, byte level data can be efficiently and highly-efficiently transmitted based on the local socket, and then the server adjusts the transmission control protocol link to be a target transmission control protocol link allowing cyclic request of media resource fragments, and in the subsequent steps, the media field fragment files can be efficiently and reliably requested through the target transmission control protocol link based on the local socket and the server socket.
In step S220, a request for acquiring a media resource segment is sent to the server in a loop over the target transmission control protocol link.
In this exemplary embodiment, the manner of sending the acquisition request in a loop may be to send the acquisition request to the server at a certain time interval until the acquisition of the media resource segment file of the multimedia to be played is completed or the acquisition request is stopped to be sent under a specific end condition (for example, the user clicks the end play button). Wherein, the acquisition request of the media resource segment can be circularly sent to the server through the local socket.
In step S230, media parsing data meeting preset parsing conditions is built in the local buffer based on the media resource segment requested by the acquisition request.
In this example embodiment, the preset parsing condition refers to that a player in the terminal may parse data meeting a playing standard, and in one example, the preset parsing condition is that the player may parse one frame of audio or video compressed data. The method comprises the steps of analyzing the requested media resource fragments to obtain media analysis data corresponding to the media resource fragments, combining the media analysis data corresponding to the media resource fragments, and constructing the media analysis data meeting preset analysis conditions in a local buffer zone, wherein the local buffer zone can be a memory (e.g. DDR memory) in the terminal.
Based on the media resource fragments requested by the acquisition request, media analysis data meeting preset analysis conditions are built in the local buffer, and the player can circularly acquire the media analysis data meeting the preset analysis conditions from the local buffer for playing on the basis of circularly requesting the media resource fragments under the condition that the local buffer is smaller.
In one embodiment, a media asset segment includes a plurality of; the circularly sending, by the target transmission control protocol link, an acquisition request of a media resource segment to the server, and constructing media analysis data meeting a preset analysis condition in a local buffer area based on the media resource segment requested by the acquisition request, including:
Sending a first acquisition request to a server through a target transmission control protocol link so as to receive a first media resource fragment returned by the server; according to the first media resource segment, a second acquisition request is sent to the server through a target transmission control protocol link so as to receive a second media resource segment returned by the server; based on the first media resource segment and the second media resource segment, constructing media analysis data meeting preset analysis conditions in a local buffer area; circularly sending a subsequent acquisition request to a server through a target transmission control protocol link so as to receive a subsequent media resource segment circularly returned by the server; and continuously constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the returned subsequent media resource fragments.
The multimedia resource corresponding to the multimedia to be played (such as audio, video or audio-video) in the server may be composed of a plurality of (at least 1 or at least 2) media resource segments, the first acquisition request may be a request for acquiring the media resource segment of the multimedia to be played for the first time, after the server returns the first media resource segment in response to the first acquisition request, the server may parse the first media resource segment to obtain audio-video text data (i.e., first media parse data) in the first media resource segment, length information of the first media resource segment, and so on, and may buffer the first media parse data to the local buffer.
Then, the server may generate a second acquisition request according to the length information of the first media resource segment and the preset analysis condition, so as to acquire a second media resource segment capable of constructing media analysis data meeting the preset analysis condition, then analyze audio and video text data (i.e., second media analysis data) in the second media resource segment, and merge and cache the second media analysis data and the first media analysis data into a local buffer area, so as to construct the media analysis data meeting the preset analysis condition in the local buffer area.
And then, the player can acquire the media analysis data meeting the preset analysis conditions from the local buffer zone to play the multimedia, meanwhile, the terminal can circularly generate a subsequent acquisition request according to the length information of the remaining media analysis data in the local buffer zone according to the steps, circularly send the subsequent acquisition request to the server through the target transmission control protocol link, receive the subsequent media resource fragments circularly returned by the server, continuously construct the media analysis data meeting the preset analysis conditions in the local buffer zone based on the returned subsequent media analysis data of the subsequent media resource fragments, and acquire and play the media analysis data.
In one embodiment, sending a second acquisition request to a server over the target transport control protocol link according to the first media resource segment includes:
analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; and sending a second acquisition request to the server through the target transmission control protocol link.
The length threshold of the preset parsing condition may be a length threshold of media parsing data required when the player plays multimedia (for example, a length threshold of media parsing data of a frame of audio or video compression data may be parsed), a difference value is obtained by subtracting a length value in the length information of the first media resource segment from the length threshold, the difference value may generate a second acquisition request, for example, when the difference value is a positive value, a second acquisition request carrying a request value greater than or equal to the difference value may be generated, and the server may return a responsive second media resource segment according to the request value, so as to ensure that media parsing data meeting the preset parsing condition is constructed in the body buffer area.
Similarly, the subsequent acquisition request may be generated according to the length threshold and the length information of the media parsing data remaining after the playing in the local buffer.
In one embodiment, constructing media parsing data meeting a preset parsing condition in a local buffer based on the first media resource segment and the second media resource segment includes:
analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate the media analysis data meeting the preset analysis conditions in the local buffer area.
The media resource segment is a resource segment which is transmitted in a byte stream form and comprises text data, namely length information and the like, and after the terminal receives the first media resource segment and the second media resource segment, the terminal can analyze the first media resource segment and the second media resource segment to obtain text data of multimedia, such as text data of audio and video, namely first media analysis data and second media analysis data. And then the first media analysis data and the second media analysis data are combined and stored in the local buffer area, the media analysis data which accords with the preset analysis conditions can be generated in the local buffer area, and after the first media analysis data and the second media analysis data are combined, the player only needs to acquire part of the media analysis data corresponding to the length threshold value required by playing the multimedia from the local buffer area for playing.
In step S240, the media parsing data is obtained from the local buffer, and multimedia playing is performed on the media parsing data.
In this example embodiment, the player may obtain, from the local buffer, only a portion of the media parsing data corresponding to the length threshold required for playing the multimedia, and then parse the portion of the media parsing data according to the playing format to obtain multimedia compressed data (for example, a frame of complete audio compressed data or video compressed data), then send the multimedia compressed data to the corresponding decoder, wait for the output data output by the decoder, where the video output data corresponding to the decoder output video compressed data may be a frame of YUV data, the audio output data corresponding to the audio compressed data may be a frame of PCM data, the video output data may be sent to the image renderer for display and playing, and the audio output data may be sent to the audio system for further post-processing.
In step S250, when the multimedia is played to a predetermined state, the target transmission control protocol link is closed.
In this exemplary embodiment, the multimedia to be played is played completely or it may be determined that the multimedia is played to a predetermined state under a specific end condition (e.g., the user clicks an end play button). Then, the target transmission control protocol link is disconnected, so that the multimedia playing can be finished, the whole playing process is smooth, and the playing effect is effectively improved.
In one embodiment, closing the target transmission control protocol link when the multimedia is played to a predetermined play state comprises:
acquiring an analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished according to the analysis state; and closing the target transmission control protocol link when the multimedia playing is determined to be finished.
The parsing state is a state of parsing the multimedia compression data based on the media parsing data, and can determine that the multimedia playing is finished when the media parsing data is not used for parsing the multimedia compression data in the local buffer for a predetermined period of time. Therefore, the closing control of the target transmission control protocol link can be carried out according to the analysis state in the local buffer zone, and the overall reliability of the circulating request and the construction of the media analysis data is further ensured.
In one embodiment, a target transmission control protocol link is established between a local socket and a server socket created by a server; when the multimedia playing is determined to be finished, closing the target transmission control protocol link, including: when it is determined that the multimedia play is finished, the local socket is closed.
In this way, based on steps S210 to S250, by establishing the target transmission control protocol link that allows to circularly request the media resource segment, time consumption in the link connection process is avoided, further, by circularly requesting the media resource segment, media analysis data meeting preset analysis conditions is established in the local buffer area, and multimedia playing is performed, so that resource underload can be reliably avoided, and meanwhile, multimedia playing is efficiently performed, and further, time consumption of the multimedia resource request is effectively reduced as a whole, and meanwhile, resource underload is reliably avoided, playing jamming is effectively avoided, multimedia playing effect is improved, and user experience is improved.
In order to facilitate better implementation of the multimedia playing method provided by the embodiment of the application, the embodiment of the application also provides a multimedia playing device based on the multimedia playing method. The meaning of the nouns is the same as that of the multimedia playing method, and specific implementation details can be referred to the description of the method embodiment. Fig. 3 shows a block diagram of a multimedia playing device according to one embodiment of the present application.
As shown in fig. 3, the multimedia playing device 300 may include a setup module 310, a request module 320, a construction module 330, a playing module 340, and a closing module 350.
The establishing module 310 may be configured to send a target connection request to a server, where the target connection request is configured to instruct the server to establish a target transmission control protocol link that allows for looping of requested media resource segments; the request module 320 may be configured to send, in a loop, a request for obtaining a media resource segment to the server via the target tcp link; the construction module 330 may be configured to construct, in the local buffer, media parsing data that meets a preset parsing condition based on the media resource segment requested by the acquisition request; the playing module 340 may be configured to obtain the media parsing data from the local buffer, and perform multimedia playing on the media parsing data; the shutdown module 350 may be configured to shutdown the target tcp link when the multimedia is played to a predetermined state.
In one embodiment, the establishing module 310 includes: a local creation unit for creating a local socket; a link establishing unit, configured to establish a transmission control protocol link between the local socket and a server socket created by the server; and the link adjustment unit is used for sending the target connection request to the server socket through the transmission control protocol link based on the local socket so as to instruct the server to adjust the transmission control protocol link to be a target transmission control protocol link allowing cyclic request of media resource fragments.
In one embodiment, the media asset segment comprises a plurality of media asset segments; the request module 320 includes: a first request unit, configured to send a first acquisition request to the server through the target transmission control protocol link, so as to receive a first media resource segment returned by the server; a second request unit, configured to send a second acquisition request to the server through the target transmission control protocol link according to the first media resource segment, so as to receive a second media resource segment returned by the server; the building block 330 includes: the first construction unit is used for constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the first media resource segment and the second media resource segment; the request module 320 further includes: a continuous request unit, configured to send a subsequent acquisition request to the server in a circulating manner through the target transmission control protocol link, so as to receive a subsequent media resource segment returned by the server in a circulating manner; the building block 330 further comprises: and the continuous construction unit is used for continuously constructing the media analysis data meeting the preset analysis conditions in the local buffer zone based on the returned subsequent media resource fragments.
In an embodiment, the second request unit is configured to: analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; and sending the second acquisition request to the server through the target transmission control protocol link.
In an embodiment, the first construction unit is configured to: analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate media analysis data meeting preset analysis conditions in the local buffer area.
In one embodiment, the shutdown module 350 includes: the state acquisition unit is used for acquiring the analysis state of the media analysis data in the local buffer area; the end determining unit is used for determining whether the multimedia playing is ended or not according to the analysis state; and the determining closing unit is used for closing the target transmission control protocol link when the multimedia playing is determined to be finished.
In one embodiment, the target transmission control protocol link is established between the local socket and a server socket created by the server; the determining closing unit is used for: and closing the local socket when the multimedia playing is determined to be finished.
In this way, based on the multimedia playing device 300, by establishing the target transmission control protocol link allowing to circularly request the media resource segments, time consumption in the link connection process is avoided, further, by circularly requesting the media resource segments, media analysis data meeting preset analysis conditions is constructed in the local buffer area, and multimedia playing is performed, so that resource underload can be reliably avoided, meanwhile, multimedia playing is efficiently performed, and further, the time consumption of the multimedia resource request is effectively reduced as a whole, meanwhile, resource underload is reliably avoided, playing jamming is effectively avoided, multimedia playing effect is improved, and user experience is improved.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, the embodiment of the application further provides an electronic device, which may be a terminal or a server, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the application, specifically:
the electronic device may include one or more processing cores 'processors 401, one or more computer-readable storage media's memory 402, power supply 403, and input unit 404, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user page, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 404, which input unit 404 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions, for example, the processor 401 may perform the following steps:
sending a target connection request to a server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments; circularly sending an acquisition request of the media resource segment to the server through the target transmission control protocol link; based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and closing the target transmission control protocol link when the multimedia is played to a preset state.
In one embodiment, the processor 401 may execute, when sending a target connection request to a server, where the target connection request is used to instruct the server to establish a target transmission control protocol link that allows a loop to request a media resource segment: creating a local socket; establishing a transmission control protocol link between the local socket and a server socket created by the server; and based on the local socket, sending the target connection request to the server socket through the transmission control protocol link so as to instruct the server to adjust the transmission control protocol link to be a target transmission control protocol link allowing cyclic request of media resource fragments.
In one embodiment, a media asset segment includes a plurality of; the circularly sending, by the target tcp link, an acquisition request for a media resource segment to the server, and when media analysis data meeting a preset analysis condition is constructed in a local buffer based on the media resource segment requested by the acquisition request, the processor 401 may execute: sending a first acquisition request to the server through the target transmission control protocol link so as to receive a first media resource segment returned by the server; according to the first media resource segment, a second acquisition request is sent to the server through the target transmission control protocol link so as to receive a second media resource segment returned by the server; constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the first media resource segment and the second media resource segment; circularly sending a subsequent acquisition request to the server through the target transmission control protocol link so as to receive a subsequent media resource segment circularly returned by the server; and continuously constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the returned subsequent media resource fragments.
In one embodiment, when the second acquisition request is sent to the server through the target transmission control protocol link according to the first media resource segment, the processor 401 may execute: analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; and sending the second acquisition request to the server through the target transmission control protocol link.
In one embodiment, when media parsing data meeting a preset parsing condition is built in a local buffer based on the first media resource segment and the second media resource segment, the processor 401 may execute: analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate media analysis data meeting preset analysis conditions in the local buffer area.
In one embodiment, when the target tcp link is closed when the multimedia is played to a predetermined play state, the processor 401 may execute: acquiring an analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished according to the analysis state; and closing the target transmission control protocol link when the multimedia playing is determined to be finished.
In one embodiment, a target transmission control protocol link is established between the local socket and a server socket created by the server; the processor 401 may execute, when determining that the multimedia play is finished, closing the target transmission control protocol link: and closing the local socket when the multimedia playing is determined to be finished.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present embodiments also provide a storage medium having stored therein a computer program that can be loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Since the computer program stored in the storage medium may perform any of the steps in the method provided in the embodiment of the present application, the beneficial effects that can be achieved by the method provided in the embodiment of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It will be understood that the present application is not limited to the embodiments that have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

Claims (7)

1. A method of multimedia playing, comprising:
sending a target connection request to a server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments;
circularly sending an acquisition request of the media resource segment to the server through the target transmission control protocol link;
based on the media resource fragments requested by the acquisition request, constructing media analysis data meeting preset analysis conditions in a local buffer area, wherein the preset analysis conditions are that a player analyzes one frame of multimedia compression data, and the media resource fragments comprise a plurality of media resource fragments;
Circularly acquiring the media analysis data meeting preset analysis conditions from the local buffer zone, and analyzing to obtain media compression data based on the media analysis data to play multimedia;
when the multimedia is played to a preset state, closing the target transmission control protocol link;
the circularly sending, by the target tcp link, an acquisition request of a media resource segment to the server, and constructing, in a local buffer, media parsing data meeting a preset parsing condition based on the media resource segment requested by the acquisition request, including:
sending a first acquisition request to the server through the target transmission control protocol link so as to receive a first media resource segment returned by the server; according to the first media resource segment, a second acquisition request is sent to the server through the target transmission control protocol link so as to receive a second media resource segment returned by the server; constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the first media resource segment and the second media resource segment; circularly sending a subsequent acquisition request to the server through the target transmission control protocol link so as to receive a subsequent media resource segment circularly returned by the server; continuously constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the returned subsequent media resource fragments;
The sending, according to the first media resource segment, a second acquisition request to the server through the target transmission control protocol link, including: analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; transmitting the second acquisition request to the server through the target transmission control protocol link;
the constructing media analysis data meeting a preset analysis condition in a local buffer area based on the first media resource segment and the second media resource segment comprises: analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate media analysis data meeting preset analysis conditions in the local buffer area.
2. The method of claim 1, wherein the sending a target connection request to a server, the target connection request being for instructing the server to establish a target transmission control protocol link that allows for looping request media resource segments, comprises:
Creating a local socket;
establishing a transmission control protocol link between the local socket and a server socket created by the server;
and based on the local socket, sending the target connection request to the server socket through the transmission control protocol link so as to instruct the server to adjust the transmission control protocol link to be a target transmission control protocol link allowing cyclic request of media resource fragments.
3. The method of claim 1, wherein closing the target tcp link when the multimedia is played to a predetermined play state comprises:
acquiring an analysis state of media analysis data in a local buffer area;
determining whether the multimedia playing is finished according to the analysis state;
and closing the target transmission control protocol link when the multimedia playing is determined to be finished.
4. The method of claim 3, wherein the target transmission control protocol link is established between a local socket and a server socket created by the server;
and closing the target transmission control protocol link when the multimedia playing is determined to be finished, wherein the method comprises the following steps:
And closing the local socket when the multimedia playing is determined to be finished.
5. A multimedia playing device, comprising:
the system comprises an establishing module, a request processing module and a request processing module, wherein the establishing module is used for sending a target connection request to a server, and the target connection request is used for indicating the server to establish a target transmission control protocol link allowing cyclic request of media resource fragments;
a request module, configured to send, through the target transmission control protocol link, a request for acquiring a media resource segment to the server in a cyclic manner;
the construction module is used for constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the media resource fragments requested by the acquisition request, wherein the preset analysis conditions are that a player analyzes one frame of multimedia compression data, and the media resource fragments comprise a plurality of media resource fragments;
the playing module is used for circularly acquiring the media analysis data meeting the preset analysis conditions from the local buffer zone and playing the multimedia compressed data obtained by analyzing the media analysis data based on the media analysis data;
the closing module is used for closing the target transmission control protocol link when the multimedia is played to a preset state;
The request module comprises: a first request unit, configured to send a first acquisition request to the server through the target transmission control protocol link, so as to receive a first media resource segment returned by the server; a second request unit, configured to send a second acquisition request to the server through the target transmission control protocol link according to the first media resource segment, so as to receive a second media resource segment returned by the server; the construction module comprises: the first construction unit is used for constructing media analysis data meeting preset analysis conditions in a local buffer zone based on the first media resource segment and the second media resource segment; the request module further comprises: a continuous request unit, configured to send a subsequent acquisition request to the server in a circulating manner through the target transmission control protocol link, so as to receive a subsequent media resource segment returned by the server in a circulating manner; the building block further comprises: the continuous construction unit is used for continuously constructing media analysis data meeting preset analysis conditions in the local buffer zone based on the returned subsequent media resource fragments;
the second request unit is configured to: analyzing the first media resource segment to obtain the length information of the first media resource segment; generating a second acquisition request according to the length information and a length threshold value meeting a preset analysis condition; transmitting the second acquisition request to the server through the target transmission control protocol link;
The first construction unit is used for: analyzing the first media resource segment to obtain first media analysis data; analyzing the second media resource segment to obtain second media analysis data; and merging and storing the first media analysis data and the second media analysis data into a local buffer area to generate media analysis data meeting preset analysis conditions in the local buffer area.
6. A storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the method of any of claims 1 to 4.
7. An electronic device, comprising: a memory storing computer readable instructions; a processor reading computer readable instructions stored in a memory to perform the method of any one of claims 1 to 4.
CN202110892252.XA 2021-08-04 2021-08-04 Multimedia playing method and device, storage medium and electronic equipment Active CN113765886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110892252.XA CN113765886B (en) 2021-08-04 2021-08-04 Multimedia playing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110892252.XA CN113765886B (en) 2021-08-04 2021-08-04 Multimedia playing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113765886A CN113765886A (en) 2021-12-07
CN113765886B true CN113765886B (en) 2023-07-25

Family

ID=78788579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110892252.XA Active CN113765886B (en) 2021-08-04 2021-08-04 Multimedia playing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113765886B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035880A (en) * 2010-11-02 2011-04-27 中兴通讯股份有限公司 Method and device for maintaining connection
CN102231749A (en) * 2011-08-12 2011-11-02 乐视网信息技术(北京)股份有限公司 System and method for transmitting live stream by utilizing content delivery network (CDN)
CN110858919A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Data processing method and device in media file playing process and storage medium
WO2020108544A1 (en) * 2018-11-27 2020-06-04 杭州海康威视数字技术股份有限公司 Method, apparatus and system for synchronously caching data

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014179508A1 (en) * 2013-04-30 2014-11-06 Seven Networks, Inc. Detection and reporting of keepalive messages for optimization of keepalive traffic in a mobile network
CN104427400A (en) * 2013-08-22 2015-03-18 中国电信股份有限公司 Streaming media transmission method and system, and streaming media server
CN106302571B (en) * 2015-05-14 2020-07-28 微软技术许可有限责任公司 System and method for maintaining and caching server connections
KR102515269B1 (en) * 2016-03-05 2023-03-30 삼성전자주식회사 Apparatus and method for streaming video in an electronic device
CN105847944A (en) * 2016-04-21 2016-08-10 乐视控股(北京)有限公司 Providing method and providing device for multimedia content based on HTTP real-time streaming
CN109525887B (en) * 2018-12-27 2021-06-18 长沙理工大学 Self-adjusting playing method, system and device of online video
CN110381330A (en) * 2019-07-16 2019-10-25 北京达佳互联信息技术有限公司 Network data processing method, device, terminal, server and storage medium
CN111629452A (en) * 2020-04-02 2020-09-04 北京大米科技有限公司 Data transmission control method and device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035880A (en) * 2010-11-02 2011-04-27 中兴通讯股份有限公司 Method and device for maintaining connection
CN102231749A (en) * 2011-08-12 2011-11-02 乐视网信息技术(北京)股份有限公司 System and method for transmitting live stream by utilizing content delivery network (CDN)
CN110858919A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Data processing method and device in media file playing process and storage medium
WO2020108544A1 (en) * 2018-11-27 2020-06-04 杭州海康威视数字技术股份有限公司 Method, apparatus and system for synchronously caching data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Research and Design of a Real-Time Interactive Application Development Model Based on the Android Platform;Zhilong Yang;2013 Sixth International Symposium on Computational Intelligence and Design;全文 *
一种基于 HTTP 长连接的自适应流媒体传输***;林 锐等;电视技术;全文 *

Also Published As

Publication number Publication date
CN113765886A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN111240837B (en) Resource allocation method, device, terminal and storage medium
CN107659828B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN107613315B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN110166791B (en) Connection establishing method, device, equipment and storage medium
US10652348B2 (en) Device mode settings to provide an enhanced user experience
CN111093094A (en) Video transcoding method, device and system, electronic equipment and readable storage medium
CN107734356B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN107846624B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN113765886B (en) Multimedia playing method and device, storage medium and electronic equipment
KR102445154B1 (en) data transfer
CN113867831B (en) Intelligent device control method, intelligent device, storage medium and electronic device
CN114338830A (en) Data transmission method and device, computer readable storage medium and computer equipment
CN114025170A (en) Video playing method and device, computer equipment and computer readable storage medium
CN113747100B (en) Audio and video call method and device, storage medium and electronic equipment
CN113996058B (en) Information processing method, apparatus, electronic device, and computer-readable storage medium
CN117412103A (en) Program playing regulation and control method and device, storage medium and electronic equipment
CN113014945B (en) Data processing method and device, storage medium and computer equipment
CN114125509B (en) Video playing method and device, electronic equipment and storage medium
CN114339268B (en) Live broadcast data processing method and device and computer readable storage medium
CN114007090B (en) Video live broadcast establishing method and device, storage medium and electronic equipment
US20230421779A1 (en) Decoding processing method and apparatus, computer device, and storage medium
CN116939256A (en) Resource transmission method and device, intelligent equipment and storage medium
CN118301425A (en) Media resource playing method and device, electronic equipment and computer storage medium
CN117729341A (en) Live-broadcast picture display method, device and computer readable storage medium
CN117714777A (en) Signal processing method, device, display equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant