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

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

Info

Publication number
CN113765886A
CN113765886A CN202110892252.XA CN202110892252A CN113765886A CN 113765886 A CN113765886 A CN 113765886A CN 202110892252 A CN202110892252 A CN 202110892252A CN 113765886 A CN113765886 A CN 113765886A
Authority
CN
China
Prior art keywords
server
media
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.)
Granted
Application number
CN202110892252.XA
Other languages
Chinese (zh)
Other versions
CN113765886B (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

Images

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 multimedia playing device, a storage medium and electronic equipment, which relate to the technical field of Internet, and 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 a cyclic request media resource segment; circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link; constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and when the multimedia is played to a preset state, closing the target transmission control protocol link. The multimedia playing effect is effectively improved.

Description

Multimedia playing method, device, storage medium and electronic equipment
Technical Field
The present application relates to the field of internet technologies, and in particular, to a multimedia playing method and apparatus, a storage medium, and an electronic device.
Background
With the popularization of the internet, users often have a demand for acquiring multimedia resources from the network to play multimedia, and the playing effect of the multimedia resources is closely related to the network transmission process, the size of a local buffer area of a playing terminal and the like.
At present, during multimedia playing, due to the instability of a network transmission process, a small local buffer area of a playing terminal and the like, a multimedia resource request needs to consume a lot of time in the multimedia playing process, resource underrun is easily caused, playing is blocked, and user experience is affected.
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 above technical problem, an embodiment of the present application provides the following technical solutions:
according to an 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 a cyclic request media resource segment; circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link; constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and when the multimedia is played to a preset state, closing the target transmission control protocol link.
In some embodiments of the present application, the sending a target connection request to a server, the target connection request instructing the server to establish a target transmission control protocol link allowing cyclic requesting of media resource segments, includes: creating a local socket; establishing a transmission control protocol link between the local socket and a server socket established by the server; based on the local socket, sending the target connection request to the server socket through the transmission control protocol link to instruct the server to adjust the transmission control protocol link to a target transmission control protocol link allowing cyclic request of media resource segments.
In some embodiments of the present application, the media asset segment comprises a plurality; the circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link, and constructing media analysis data meeting preset analysis conditions in a local buffer area based on the media resource segments 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, sending a second acquisition request 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 which accords with preset analysis conditions in a local buffer area 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 subsequent media resource segments circularly returned by the server; and continuously constructing media analysis data which accord with preset analysis conditions in the local buffer area based on the returned subsequent media resource segments.
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 to a local buffer area so as 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 playing state includes: acquiring the analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished or not according to the analysis state; and when the multimedia playing is determined to be finished, closing the target transmission control protocol link.
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; when the multimedia playing is determined to be finished, closing the target transmission control protocol link, including: and when the multimedia playing is determined to be finished, closing the local socket.
According to an embodiment of the present application, a multimedia playback apparatus includes: the system comprises an establishing module, a sending module and a sending 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 a cyclic request media resource segment; a request module, configured to send a request for acquiring media resource segments to the server in a cycle through the target tcp link; the construction module is used for constructing media analysis data which accord with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; the playing module is used for acquiring the media analysis data from the local buffer area 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 of 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 methods of the embodiments.
In the embodiment of the application, a target connection request is sent to a server, and the target connection request is used for indicating the server to establish a target transmission control protocol link allowing a cyclic request media resource segment; circularly sending an acquisition request of the media resource segments to the server through a target transmission control protocol link; constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; acquiring media analysis data from a local buffer area, and performing multimedia playing on the media analysis data; and when the multimedia is played to a preset state, closing the target transmission control protocol link.
In this way, by establishing a target transmission control protocol link allowing cyclic request of media resource segments, time consumption in the link connection process is avoided, further, by cyclically requesting the media resource segments, media analysis data meeting preset analysis conditions are constructed in a local buffer area, multimedia playing is performed, resource underload can be reliably avoided, multimedia playing can be efficiently performed, time consumed by multimedia resource requests is effectively reduced on the whole, resource underload is reliably avoided, playing jam is effectively avoided, the multimedia playing effect is improved, and user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 shows a schematic diagram of a system to which embodiments of the present application may be applied.
Fig. 2 shows a flow chart of a multimedia playback method according to an embodiment of the application.
Fig. 3 shows a block diagram of a multimedia playback device according to an embodiment of the present application.
FIG. 4 shows a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may 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 devices, such as a television, a computer, a mobile phone, a smart watch, a home appliance, and the like. 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 connections.
In one embodiment of the present 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 tcp link allowing cyclic request of media resource segments; circularly sending an acquisition request of the media resource segments to the server through a target transmission control protocol link; constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; acquiring media analysis data from a local buffer area, and performing multimedia playing on the media analysis data; and when the multimedia is played to a preset state, closing the target transmission control protocol link.
Fig. 2 schematically shows a flow chart of a multimedia playback method according to an embodiment of the present application. The execution subject 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, sending a target connection request to the server, wherein the target connection request is used for indicating the server to establish a target transmission control protocol link allowing the cyclic request of the media resource segments;
step S220, circularly sending a request for acquiring media resource segments to a server through a target transmission control protocol link;
step S230, constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request;
step S240, obtaining media analysis data from the local buffer area, and performing multimedia playing on the media analysis data;
step S250, when the multimedia is played to a predetermined state, the target tcp link is closed.
The following describes specific procedures of each step performed when multimedia playback is performed.
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 allowing cyclic request of media resource segments.
In the embodiment of this example, 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 receiving the target connection request, the server may establish a target transmission control protocol link that allows a cyclic request of the media resource segment between the server and the terminal according to the predetermined instruction field if the target connection request includes the predetermined instruction field.
The predetermined instruction field may be a long link-alive field (keep-alive field) that may instruct the server to set the tcp link established between the terminal and the server to remain uninterrupted, so as to establish a target tcp link that allows the cyclic request of the media resource segment.
The Transmission Control Protocol link is a communication link based on a Transmission Control Protocol, and the Transmission Control Protocol (TCP) is a connection-oriented, reliable transport layer communication Protocol based on a byte stream. The target transmission control protocol link is a transmission control protocol link that allows cyclic request of media resource segments, i.e. allows cyclic sending 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, one request can request a part of media resource segment files from a server, the transmission control protocol link needs to be disconnected after each request is completed, the media resource segment is not allowed to be requested circularly, if multiple requests are carried out, the transmission control protocol link needs to be established for multiple times, and the transmission control protocol link is disconnected for multiple times through multiple requests, so that the establishment of the transmission control protocol link is based on 3 times of network data packet interaction connected by the transmission control protocol, the disconnection of the transmission control protocol link is based on 4 times of network data packet interaction disconnected by the transmission control protocol, the multiple disconnection consumes more time, and the influence on a local multimedia playing process is larger. In one approach, if all media resource segments of the multimedia to be played are obtained directly from the client by one request, the local buffer is subjected to very high pressure, which also affects the playing effect.
And then, a target connection request is sent to the server to indicate the server to establish a target transmission control protocol link allowing the cyclic request of the media resource segments, so that the efficient segmented request of the media resource segments 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 tcp link allowing cyclic requesting of media resource segments, includes:
creating a local socket; establishing a transmission control protocol link between a local socket and a server-side socket established 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 cyclic requests for media resource segments.
A local Socket is a Socket at the terminal side, and is a Socket, and the local Socket is a Socket describing a terminal address and a port of the terminal; a server socket is a socket on the server side, and a server socket is a socket describing the address and port of a server in the server.
The method comprises the steps of establishing a transmission control protocol link between a local socket and a server-side socket created by a server, efficiently and high-performance transmitting byte-level data based on the local socket, adjusting the transmission control protocol link to a target transmission control protocol link allowing cyclic request of media resource fragments by the server, and efficiently and reliably requesting a media field fragment file through the target transmission control protocol link based on the local socket and the server-side socket in subsequent steps.
In step S220, a request for acquiring a media resource segment is sent to the server cyclically through the target tcp link.
In this exemplary embodiment, the manner of sending the obtaining request in a loop may be sending the obtaining request to the server at a certain time interval until the obtaining of the media resource segment file of the multimedia to be played is completed or stopping sending the obtaining request under a specific ending condition (for example, the user clicks an end play button). Wherein, the acquisition request of the media resource segment can be sent to the server circularly through the local socket.
In step S230, media parsing data meeting the preset parsing condition is constructed in the local buffer based on the media resource segment requested by the acquisition request.
In this example, the preset parsing condition means that a player in the terminal can parse data meeting a playing standard, and in one example, the preset parsing condition is that the player can parse a frame of compressed audio or video data. The media analysis data corresponding to the media resource segment can be obtained by analyzing the requested media resource segment, and then the media analysis data corresponding to the media resource segment are combined to construct media analysis data meeting a preset analysis condition in a local buffer, where the local buffer may be a memory (e.g., a DDR memory) in the terminal.
And constructing media analysis data meeting the preset analysis condition in the local buffer area based on the media resource segment requested by the acquisition request, and circularly acquiring the media analysis data meeting the preset analysis condition from the local buffer area by the player for playing under the condition that the local buffer area is smaller and the media resource segment is circularly requested.
In one embodiment, a media asset segment comprises a plurality; the circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link, and constructing media analysis data meeting preset analysis conditions in a local buffer area based on the media resource segments 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 segment returned by the server; according to the first media resource segment, sending a second acquisition request 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 which accords with preset analysis conditions in a local buffer area 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 subsequent media resource segments circularly returned by the server; and continuously constructing media analysis data which accord with preset analysis conditions in the local buffer area based on the returned subsequent media resource segments.
The multimedia resource corresponding to the multimedia to be played (for example, audio, video, or audio and 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 responds to the first acquisition request and may return the first media resource segment, the server may analyze the first media resource segment to obtain audio and video text data (i.e., first media analysis data) in the first media resource segment, length information of the first media resource segment, and the like, and may cache the first media analysis data in 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 parsing condition to acquire a second media resource segment that may construct media parsing data meeting the preset parsing condition, then parse audio/video text data (i.e., second media parsing data) in the second media resource segment, merge and cache the second media parsing data and the first media parsing data to the local buffer, and further construct the media parsing data meeting the preset parsing condition in the local buffer.
Then, the player can acquire the media analysis data meeting the preset analysis condition from the local buffer zone to play multimedia, meanwhile, the terminal can circularly generate a subsequent acquisition request according to the length information of the residual 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 segment circularly returned by the server, and continuously construct the media analysis data meeting the preset analysis condition in the local buffer zone for the player to acquire and play based on the returned subsequent media analysis data of the subsequent media resource segment.
In one embodiment, sending a second acquisition request to a server through the target transmission 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 by the player when playing multimedia (for example, a length threshold of media parsing data of a frame of audio or video compressed data may be parsed), a difference is obtained by subtracting a length value in length information of the first media resource segment from the length threshold, the difference may generate a second acquisition request, for example, when the difference is a positive value, a second acquisition request carrying a request value greater than or equal to the difference may be generated, and the server may return a response to the second media resource segment according to the request value, so that it may be ensured that media parsing data meeting the preset parsing condition is constructed in the body buffer.
Similarly, the subsequent acquisition request may be generated according to the length threshold and length information of the media parsing data remaining after the local buffer is played.
In one embodiment, constructing media parsing data in a local buffer according to a preset parsing condition based on a first media resource segment and a 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 to a local buffer area so as to generate media analysis data which accords with preset analysis conditions in the local buffer area.
The media resource segment is a resource segment including text data, i.e. data such as length information, transmitted in a byte stream form, and after receiving 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 multimedia text data, e.g. text data of audio and video, i.e. the first media analysis data and the second media analysis data. And then merging and storing the first media analysis data and the second media analysis data into a local buffer area, generating media analysis data meeting preset analysis conditions in the local buffer area, and after merging the first media analysis data and the second media analysis data, the player only needs to acquire part of the media analysis data corresponding to the length threshold required when playing the multimedia from the local buffer area for playing.
In step S240, media parsing data is obtained from the local buffer, and multimedia playing is performed on the media parsing data.
In the embodiment of this example, the player only needs to obtain a part of media parsing data corresponding to a length threshold required for playing multimedia from the local buffer, and then may parse the part of media parsing data according to a playing format to obtain multimedia compressed data (for example, a frame of complete audio compressed data or video compressed data), and then may send the multimedia compressed data to respective corresponding decoders, and wait for output data output by the decoders, where video output data corresponding to video compressed data output by the decoders may be a frame of YUV data, audio output data corresponding to audio compressed data may be a frame of PCM data, the video output data may be sent to an image renderer for display and play, and the audio output data may be sent to an audio system for further post-processing.
In step S250, when the multimedia is played to a predetermined state, the target tcp link is closed.
In the embodiment of the present example, the multimedia to be played may be played to a predetermined state after the multimedia is played or under a specific ending condition (for example, the user clicks an ending play button). Then, the multimedia playing can be finished by disconnecting the target transmission control protocol link, the whole playing process is smooth, and the playing effect is effectively improved.
In one embodiment, the closing the target tcp link when the multimedia is played to the predetermined playing state comprises:
acquiring the analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished or not according to the analysis state; and when the multimedia playing is determined to be finished, closing the target transmission control protocol link.
The analysis state is a state of analyzing the multimedia compressed data based on the media analysis data, and when no media analysis data is used for analyzing the multimedia compressed data in the local buffer within a predetermined time period, the multimedia playing can be judged to be finished. Therefore, the closing control of the target transmission control protocol link can be carried out according to the analysis state in the local buffer area, and the overall reliability of the cyclic request and the constructed media analysis data is further ensured.
In one embodiment, the target tcp link is established between a local socket and a server socket created by the server; when the multimedia playing is determined to be finished, closing the target transmission control protocol link, wherein the step comprises the following steps: when the multimedia playing is determined to be finished, the local socket is closed.
In this way, based on steps S210 to S250, time consumption in the link connection process is avoided by establishing a target tcp link that allows a cyclic request of the media resource segment, and further, media parsing data meeting a preset parsing condition is constructed in a local buffer by the cyclic request of the media resource segment to perform multimedia playing, so that resource underload can be reliably avoided while multimedia playing is efficiently performed, time consumed by the multimedia resource request is effectively reduced as a whole, resource underload is reliably avoided, playing jamming is effectively avoided, multimedia playing effect is improved, and user experience is improved.
In order to better implement the multimedia playing method provided by the embodiment of the present application, the embodiment of the present application further provides a multimedia playing device based on the multimedia playing method. The meaning of the noun is the same as that in the above multimedia playing method, and the specific implementation details can refer to the description in the method embodiment. Fig. 3 shows a block diagram of a multimedia playback device according to an embodiment of the present application.
As shown in fig. 3, the multimedia playing apparatus 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 used to instruct the server to establish a target tcp link that allows a cyclic request of media resource segments; the request module 320 may be configured to send a request for obtaining media resource segments to the server cyclically through the target tcp link; the constructing module 330 may be configured to construct media parsing data meeting a preset parsing condition in a local buffer based on the media resource segment requested by the obtaining 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; a link adjusting unit, configured to send the target connection request to the server socket through the tcp link based on the local socket, so as to instruct the server to adjust the tcp link to a target tcp link that allows a cyclic request of media resource segments.
In one embodiment, the media asset segment comprises a plurality; the request module 320 includes: a first request unit, configured to send a first acquisition request to the server through the target tcp 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 tcp 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 which accord with preset analysis conditions in a local buffer area 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 cyclically through the target tcp link, so as to receive a subsequent media resource segment returned by the server cyclically; the building block 330 further comprises: and the continuous construction unit is used for continuously constructing the media analysis data which accords with the preset analysis condition in the local buffer area based on the returned subsequent media resource segments.
In one 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 one embodiment, the first building 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 to a local buffer area so as 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; an end determining unit, configured to determine whether multimedia playing is ended according to the parsing state; and the determining and 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 tcp link is established between the local socket and a server socket created by the server; the determining and closing unit is used for: and when the multimedia playing is determined to be finished, closing the local socket.
In this way, based on the multimedia playing apparatus 300, by establishing the target tcp link allowing the cyclic request of the media resource segment, time consumption in the link connection process is avoided, further, by cyclically requesting the media resource segment, media parsing data meeting the preset parsing condition is constructed in the local buffer for multimedia playing, resource underload can be reliably avoided, and multimedia playing can be efficiently performed, so that overall time consumption of the multimedia resource request is effectively reduced, 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 the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, an embodiment of the present application further provides an electronic device, where the electronic device 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 present application, and specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of 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 operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring 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 handles operating systems, user pages, application programs, and the like, and the modem processor mainly handles wireless communications. 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 operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the 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 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, so as to implement various functions, for example, the processor 401 may execute 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 a cyclic request media resource segment; circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link; constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request; acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data; and when the multimedia is played to a preset state, closing the target transmission control protocol link.
In one embodiment, when a target connection request is sent to a server, and the target connection request is used to instruct the server to establish a target transmission control protocol link allowing cyclic request of media resource segments, the processor 401 may perform: creating a local socket; establishing a transmission control protocol link between the local socket and a server socket established by the server; based on the local socket, sending the target connection request to the server socket through the transmission control protocol link to instruct the server to adjust the transmission control protocol link to a target transmission control protocol link allowing cyclic request of media resource segments.
In one embodiment, a media asset segment comprises a plurality; the processor 401 may execute the following steps when the request for acquiring the media resource segment is sent to the server in a loop through the target tcp link, and based on the media resource segment requested by the request for acquiring, media parsing data meeting a preset parsing condition is constructed in a local buffer: 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, sending a second acquisition request 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 which accords with preset analysis conditions in a local buffer area 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 subsequent media resource segments circularly returned by the server; and continuously constructing media analysis data which accord with preset analysis conditions in the local buffer area based on the returned subsequent media resource segments.
In one embodiment, when sending the second acquisition request to the server through the target transmission control protocol link according to the first media resource segment, the processor 401 may perform: 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 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, the processor 401 may perform: 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 to a local buffer area so as 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 the predetermined playing state, the processor 401 may perform: acquiring the analysis state of media analysis data in a local buffer area; determining whether the multimedia playing is finished or not according to the analysis state; and when the multimedia playing is determined to be finished, closing the target transmission control protocol link.
In one embodiment, a target tcp link is established between the local socket and a server socket created by the server; when the target tcp link is closed when it is determined that the multimedia playing is finished, the processor 401 may perform: and when the multimedia playing is determined to be finished, closing the local socket.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the computer program.
To this end, the present application further provides a storage medium, in which a computer program is stored, where the computer program can be loaded by a processor to execute the steps in any one of the methods provided in the present application.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the methods provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
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 invention 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 invention 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 (10)

1. A multimedia playing method, 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 a cyclic request media resource segment;
circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link;
constructing media analysis data which accords with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request;
acquiring the media analysis data from the local buffer area, and performing multimedia playing on the media analysis data;
and when the multimedia is played to a preset state, closing the target transmission control protocol link.
2. The method of claim 1, wherein sending a target connection request to a server, the target connection request instructing the server to establish a target transmission control protocol link allowing cyclic requesting of media resource segments comprises:
creating a local socket;
establishing a transmission control protocol link between the local socket and a server socket established by the server;
based on the local socket, sending the target connection request to the server socket through the transmission control protocol link to instruct the server to adjust the transmission control protocol link to a target transmission control protocol link allowing cyclic request of media resource segments.
3. The method of claim 1, wherein the media asset segment comprises a plurality; the circularly sending an acquisition request of media resource segments to the server through the target transmission control protocol link, and constructing media analysis data meeting preset analysis conditions in a local buffer area based on the media resource segments 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, sending a second acquisition request 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 which accords with preset analysis conditions in a local buffer area 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 subsequent media resource segments circularly returned by the server;
and continuously constructing media analysis data which accord with preset analysis conditions in the local buffer area based on the returned subsequent media resource segments.
4. The method of claim 3, wherein sending a second acquisition request to the server over the target transmission control protocol link according to the first media resource segment comprises:
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.
5. The method of claim 3, wherein constructing media parsing data in a local buffer according to a preset parsing condition 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 to a local buffer area so as to generate media analysis data meeting preset analysis conditions in the local buffer area.
6. The method of claim 1, wherein closing the target tcp link when the multimedia is played to a predetermined playing state comprises:
acquiring the analysis state of media analysis data in a local buffer area;
determining whether the multimedia playing is finished or not according to the analysis state;
and when the multimedia playing is determined to be finished, closing the target transmission control protocol link.
7. The method of claim 6, wherein the target tcp link is established between a local socket and a server-side socket created by the server;
when the multimedia playing is determined to be finished, closing the target transmission control protocol link, including:
and when the multimedia playing is determined to be finished, closing the local socket.
8. A multimedia playback apparatus, comprising:
the system comprises an establishing module, a sending module and a sending 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 a cyclic request media resource segment;
a request module, configured to send a request for acquiring media resource segments to the server in a cycle through the target tcp link;
the construction module is used for constructing media analysis data which accord with preset analysis conditions in a local buffer area based on the media resource segment requested by the acquisition request;
the playing module is used for acquiring the media analysis data from the local buffer area 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.
9. 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 7.
10. An electronic device, comprising: a memory storing computer readable instructions; a processor reading computer readable instructions stored by the memory to perform the method of any of claims 1 to 7.
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 true CN113765886A (en) 2021-12-07
CN113765886B 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 (12)

* 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)
US20140321448A1 (en) * 2013-04-30 2014-10-30 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
CN105847944A (en) * 2016-04-21 2016-08-10 乐视控股(北京)有限公司 Providing method and providing device for multimedia content based on HTTP real-time streaming
US20160337466A1 (en) * 2015-05-14 2016-11-17 Microsoft Technology Licensing, Llc Maintaining and caching server connections
CN109525887A (en) * 2018-12-27 2019-03-26 长沙理工大学 A kind of self-regulation playback method, system and the device of Online Video
US20190098367A1 (en) * 2016-03-05 2019-03-28 Samsung Electronics Co., Ltd Video streaming apparatus and method in electronic device
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
CN111629452A (en) * 2020-04-02 2020-09-04 北京大米科技有限公司 Data transmission control method and device, storage medium and electronic equipment
US20210021663A1 (en) * 2019-07-16 2021-01-21 Beijing Dajia Internet Information Technology Co, Ltd. Method for processing network data, and terminal, server and storage medium thereof

Patent Citations (12)

* 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)
US20140321448A1 (en) * 2013-04-30 2014-10-30 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
US20160337466A1 (en) * 2015-05-14 2016-11-17 Microsoft Technology Licensing, Llc Maintaining and caching server connections
US20190098367A1 (en) * 2016-03-05 2019-03-28 Samsung Electronics Co., Ltd Video streaming apparatus and method in electronic device
CN105847944A (en) * 2016-04-21 2016-08-10 乐视控股(北京)有限公司 Providing method and providing device for multimedia content based on HTTP real-time streaming
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
CN109525887A (en) * 2018-12-27 2019-03-26 长沙理工大学 A kind of self-regulation playback method, system and the device of Online Video
US20210021663A1 (en) * 2019-07-16 2021-01-21 Beijing Dajia Internet Information Technology Co, Ltd. Method for processing network data, and terminal, server and storage medium thereof
CN111629452A (en) * 2020-04-02 2020-09-04 北京大米科技有限公司 Data transmission control method and device, storage medium and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHILONG YANG: "Research and Design of a Real-Time Interactive Application Development Model Based on the Android Platform", 2013 SIXTH INTERNATIONAL SYMPOSIUM ON COMPUTATIONAL INTELLIGENCE AND DESIGN *
林 锐等: "一种基于 HTTP 长连接的自适应流媒体传输系统", 电视技术 *

Also Published As

Publication number Publication date
CN113765886B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
JP6742465B2 (en) Method, device and bluetooth speaker for continuous wakeup delay reduction in bluetooth speaker
CN108055304B (en) Remote data synchronization method, device, server, equipment and storage medium
CN110807128A (en) Video preloading method, device, equipment and storage medium
CN113672748A (en) Multimedia information playing method and device
CN109788251B (en) Video processing method, device and storage medium
CN114143371A (en) Screen projection method and device, storage medium and electronic equipment
CN109951737B (en) Video processing method, video processing device, electronic equipment and computer-readable storage medium
CN111596864A (en) Method, device, server and storage medium for data delayed deletion
CN113765886B (en) Multimedia playing method and device, storage medium and electronic equipment
KR20200108348A (en) Data transfer
CN114338830A (en) Data transmission method and device, computer readable storage medium and computer equipment
CN115344644A (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN113867831A (en) Intelligent device control method, intelligent device, storage medium and electronic device
CN113747100B (en) Audio and video call method and device, storage medium and electronic equipment
CN111726658A (en) Multimedia data transmission method and device
CN113996058B (en) Information processing method, apparatus, electronic device, and computer-readable storage medium
CN112631692B (en) Application program operation control method, device and storage medium
CN114125509B (en) Video playing method and device, electronic equipment and storage medium
CN110457392B (en) Copy reading and writing method and device
CN109660610B (en) Data processing method, device, equipment and storage medium
CN113986238A (en) Application cooperation method and device, storage medium and electronic equipment
CN115987748A (en) Smart television control method and device, storage medium and electronic equipment
CN115981805A (en) Service control method, device, electronic equipment and medium based on scheduling system
CN117411932A (en) Message pushing method and device, electronic equipment and computer storage medium
CN117119134A (en) Video call method, device, storage medium and door lock

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