Video playback data processing method, device and electronic device
By adopting the connection pool mechanism in online video playback, the network connection that has paused data reading but is not disconnected is reused, which solves the problem of video playback lag caused by frequent disconnections and new network connections, and improves the response speed of video playback.
Patent Information
- Application Number
- CN202011504258.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-12-17
AI Technical Summary
During online video playback, due to the reading position jump caused by the video file format, the existing technology requires frequent disconnection and new network connections, resulting in a long start time and a stuttering during playback.
The connection pool mechanism is used to save the network connections that have suspended data reading but are not disconnected. When the data reading position jumps, the network connections in the connection pool are reused to reduce the number of disconnections and new creations of network connections.
By reusing the network connections in the connection pool, video playback lag is reduced and the response speed of video playback is improved.
Smart Images

Figure CN114650438B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a method, device and electronic equipment for processing video playback data, and belongs to the field of computer technology. Background Art
[0002] In the scenario of online video playback, the client needs to continuously obtain video playback data from the server and then play it through the local player. In some cases, due to the format of the video file, such as the large interleaving spacing of audio and video data, the post-positioning of video metadata, etc., the reading position of the video playback data jumps. In view of this situation, the prior art needs to disconnect and re-establish the network connection with the server many times. However, due to the time-consuming disconnection and re-establishment of the network connection, such frequent switching will result in a long start time and freezes during playback. Summary of the invention
[0003] The embodiments of the present invention provide a method, device and electronic device for processing video playback data to improve the response speed of online video playback.
[0004] In order to achieve the above object, an embodiment of the present invention provides a method for processing video playback data, including:
[0005] In response to a data read request for a data position to be read other than a currently read data position, searching a connection pool for a network connection corresponding to the data position to be read, wherein the network connection in the connection pool is in a state of suspending data reading but not disconnecting;
[0006] If there is a network connection corresponding to the location of the data to be read, the network connection is used to obtain the video playback data at the location of the data to be read.
[0007] The embodiment of the present invention further provides a device for processing video playback data, including:
[0008] A network connection search module, configured to respond to a data read request for a data position to be read other than a currently read data position, and to search a connection pool for a network connection corresponding to the data position to be read, wherein the network connection in the connection pool is in a state where data reading is suspended but not disconnected;
[0009] The network connection multiplexing module is used to obtain the video playback data of the data location to be read by using the network connection corresponding to the data location to be read when there is a network connection corresponding to the data location to be read in the connection pool.
[0010] An embodiment of the present invention further provides an electronic device, including:
[0011] Memory, used to store programs;
[0012] The processor is used to run the program stored in the memory to execute the aforementioned video playback data processing method.
[0013] The video playback data processing method, device and electronic device of the embodiments of the present invention, through a connection pool mechanism, reuse the network connection that was previously saved in the connection pool and has paused data reading but not disconnected when a jump occurs in the data reading position, thereby reducing the video playback jamming phenomenon caused by frequent disconnection and new network connection, and improving the response speed of video playback.
[0014] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of an application scenario of the method for processing video playback data according to an embodiment of the present invention;
[0016] Figure 2 Schematic diagram of an application scenario of a moov data post-positioning situation in an embodiment of the present invention;
[0017] Figure 3 A schematic diagram of an application scenario of audio and video interleaving according to an embodiment of the present invention;
[0018] Figure 4 A schematic diagram of a process flow of a method for processing video playback data according to an embodiment of the present invention;
[0019] Figure 5 A schematic diagram of the structure of a device for processing video playback data according to an embodiment of the present invention;
[0020] Figure 6 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0022] The embodiment of the present invention provides a method for processing video playback data, which is used to reduce the freezing phenomenon caused by frequent disconnection from the server and establishment of new network connection during online video playback. Figure 1As shown, it is a schematic diagram of an application scenario of the method for processing video playback data according to an embodiment of the present invention. As shown in the figure, during the online video playback process, based on the playback requirements of the player on the client, it is necessary to continuously request video playback data from the server. Generally, the order in which the player requests video playback data is consistent with the storage order of the video playback data in the video file on the server. In this case, only one network connection is needed, and the client continuously obtains the video playback data from the server in order and plays it through the player.
[0023] However, due to the data format of the video file, there will be a situation where the data reading position jumps, and sometimes there will be a situation where the video playback data behind is read and then jumps back to the previous data reading position. In the prior art, for this situation of position jumping, the current network connection will be disconnected, and then the network connection corresponding to the data position to be read will be re-established, and then the data will be read. Since the disconnection and establishment of the network connection both require communication with the server, for example, in order to establish an HTTP network connection, it is necessary to perform three TCP handshakes and SSL handshakes and HTTP header request message interaction processes. When the network connection is disconnected, it is also necessary to send a message to the server to inform the disconnection and delete the local socket file. If this position jump occurs more frequently, the establishment and disconnection process of the network connection will be very time-consuming, which will cause the video playback to freeze.
[0024] The embodiment of the present invention adopts a connection pool mechanism, which is used to save network connections that are paused in data reading but not disconnected. When a jump occurs in the data reading position, for the data position to be read, the connection pool will be searched first to see if there is a network connection corresponding to the data position to be read. If so, the existing network connection will be reused to continue reading the data. Since the existing network connection is in an undisconnected state, data reading processing can be performed directly with the server. The network connection corresponding to the current data reading position can be kept connected without disconnecting the network connection corresponding to the current data reading position. Instead, the data transmission with the server is suspended at the application layer, that is, data reading is suspended, and the connection is placed in the connection pool for storage for possible subsequent data reading. In addition, for the network connection corresponding to the current data reading position, it is also possible to decide whether it needs to be placed in the connection pool based on the possibility of its subsequent reuse. If it is determined that the possibility of reuse is low, the network connection can be directly disconnected. Figure 1As shown in , the connection pool stores the undisconnected network connections ① to ④. The dotted line in the figure represents the state that is not disconnected but not in use. The currently used network connection is network connection ⑤. When a position jump occurs, the network connection ⑤ corresponding to the current data reading position is put into the connection pool, and the network connection ③ corresponding to the data position to be read is taken out from the connection pool, and the network connection ③ is used to perform data reading processing with the server. In addition, if the network connection corresponding to the data position to be read does not exist in the connection pool, a new network connection is created, and the new network connection is used to read data.
[0025] The jump in the data reading position may be caused by the video file format, such as too large an interleaving spacing between audio and video data, post-positioning of video metadata, etc. It may also be caused by the user's dragging (seek) behavior. These situations may reuse the network connection in the connection pool.
[0026] like Figure 2 As shown, it is a schematic diagram of an application scenario of the moov data (a kind of metadata in MP4 format) post-positioned in an embodiment of the present invention. In an embodiment of the present invention, video playback data refers to data stored in a video file, including not only video content data but also information data in the video file for playing video content data, such as metadata, format fields, etc. Among them, moov data stores metadata required for media playback, such as video duration, frame rate, index of video data, etc. For video playback scenarios, it is necessary to read the moov data before playback can begin. Generally speaking, for video resources of some private domain players, such as platforms that provide online film and television services, they generally have a better video encapsulation format, and the overall order of data in the video file is type field—moov data—video data. Therefore, it can be read in the data order of the video file and played normally. However, for some public domain players, the format of the encapsulated video file may post-position the moov data (such as Figure 2 ), such as some short video files or video files made by users themselves.
[0027] like Figure 2For the video file shown, after reading the type field, it is necessary to jump to the position corresponding to the moov data at the end of the video file to read the data. After reading the moov data, it returns to the position after the type field, that is, the starting position of the video content data, and starts reading the video content data. For such a situation, after reading the type field, the network connection 1 corresponding to the current data reading position is placed in the connection pool, and then jumps to the data position to be read. Since there is no network connection corresponding to the data position to be read in the connection pool at this time, it is necessary to create network connection 2 to read the moov data. After the moov data is read, it is necessary to jump to the position after the type field ( Figure 2 The video content data is read from the location of the data to be read in the view below). Since the moov data is stored on the client after reading, it generally does not need to be read again. Therefore, the possibility of network connection 2 being reused is extremely low, and the network connection 2 can be directly disconnected to release the network resources.
[0028] pass Figure 2 It can be seen from the application scenario shown that, in the case of jumping the reading position of the moov data, at least one process of disconnecting and reestablishing the network connection 1 is reduced, thereby increasing the speed of starting to play the video.
[0029] like Figure 3 As shown, it is a schematic diagram of an application scenario of the audio and video interleaving situation of an embodiment of the present invention. Video content data includes video data and audio data. In the video encapsulation process, the encoded and compressed video data and audio data are stored in a video file in an interleaved manner according to a certain format. For example, 5 seconds of video data a—5 seconds of audio data a—5 seconds of video data b—5 seconds of audio data b are interleaved and stored in this way, where the labels a and b represent the corresponding relationship between the video and the audio. Under normal circumstances, the client will obtain a piece of video data (such as video data a) and the corresponding audio data (such as audio data a) from the server at a faster speed, so as to play the video. However, there are still some situations where the video data and audio data are not well interleaved. For example, the interleaving time span is too large, 15 seconds of video data c—15 seconds of audio data c—15 seconds of video data d—15 seconds of audio data d. For the client, it is impossible to obtain the corresponding audio data c when the player plays the video data c. In this case, it may be necessary to change the reading strategy of the video data and audio data, that is, first read 5 seconds of video data c, then jump to the position of audio data c to read 5 seconds of audio data c, and then jump back to the part of video data c to continue reading 5 seconds of video data c, and repeat the jump reading. In the prior art, the network connection will be disconnected and a new network connection will be established each time a jump occurs. Therefore, in the process of playing a complete video, dozens or even hundreds of network connection disconnections and establishment processes may be generated, resulting in video freezes.
[0030] In the embodiment of the present invention, a connection pool is used to solve the problem of improper audio and video interleaving. Figure 3 As shown in the figure, each box represents a data block of audio data or video data (each data block corresponds to a preset duration). The interleaving method shown in the figure is that every four video data blocks and every four audio data blocks are interleaved and stored. The data blocks that have been read are represented by a pattern filled with slashes. In terms of data reading, after reading each video data block, jump to the corresponding interleaved part, read an audio data block, and then come back to read the next video data block, and so on. Figure 3 In the process shown in the top view, the current data reading position is at the first video data block reading completion, the network connection 3 at this time is put into the connection pool, and then jumps to the beginning of the first audio data block, that is, the data position to be read. At this time, the connection pool does not have an existing network connection corresponding to this position, so a network connection 4 is created to start reading the audio data block. Then, as Figure 3 As shown in the middle view, after reading the first audio data block, it is necessary to jump back to read the second video data block. At this time, network connection 4 is put into the connection pool, and network connection 3 is taken out to continue reading the video data block. Then, as Figure 3 As shown in the lower view, after reading the second video data block, it is necessary to jump to the starting position of the second audio data block. At this time, network connection 3 is put into the connection pool, network connection 4 is taken out, and the second audio data is continued to be read from the data position to be read in the figure. Figure 3 As shown, the entire video file can be read only by alternately using network connection 3 and network connection 4, thereby reducing the number of disconnections and new network connections, and effectively reducing video freezes.
[0031] In addition, the user's dragging (seek) behavior is also the reason for the jump of the read data position. For the user's dragging behavior, when the user drags each time, it can be found from the connection pool whether there is a network connection corresponding to the data position to be read after dragging. If it exists, it can be continued to read based on the network connection. If it does not exist, a new network connection is created to read data. For the network connection corresponding to the read data position before dragging, it can be put into the connection pool for reuse if the user drags it back later. Of course, the user's dragging behavior can also be judged according to the user's video playing habits to determine whether it is necessary to put the network connection corresponding to the read data position before dragging, that is, the network connection corresponding to the current read data position, into the connection pool. For example, some users like to jump back and forth frequently when watching videos. For such users, the network connection before the jump can be put into the connection pool for later use. On the contrary, for some users, they are used to dragging backwards, such as fast forward 10 seconds or jumping from the 5-minute position of the video to the 20-minute position. These users generally do not jump back to watch the previous video. Therefore, for such users, the network connection before the jump can be disconnected to release network resources.
[0032] The above uses moov data post-position, audio and video interleaving, and user dragging as examples to illustrate the processing mechanism of an embodiment of the present invention. In addition, for situations where the data reading position jumps, the jump amplitude can be judged first. For some small jumps, the current network connection can continue to be used for data reading, that is, there is essentially no position jump, thereby reducing the number of network connection switching or new creation. For example, if the user drags from the 2 minute 30 second position to the 2 minute 33 second position, the 3-second video content may be read instantly, so there is no need to switch or create a network connection. Specifically, the jump amplitude threshold used for judging the size of the jump amplitude can be determined according to the current network speed, that is, in the case of high network speed, a larger jump amplitude threshold can be corresponding, and in the case of low network speed, a smaller jump amplitude threshold can be corresponding.
[0033] In addition, when selecting a network connection corresponding to the position of the data to be read from the connection pool, it is not necessary to select a network connection that completely matches the data position. It is also OK to select a network connection that is relatively close to the data reading position. For example, if the user drags from the 1 minute 30 second position (the network connection corresponding to this position is put into the connection pool) to the 6 minute 10 second position, and then drags to the 1 minute 35 second position, the network connection corresponding to the 1 minute 30 second position can be directly used. Since the data from 1 minute 30 seconds to 1 minute 35 seconds will be read quickly, it will not affect the playback process.
[0034] In addition, in order to more effectively utilize network connection resources, the time that the network connection saved in the connection pool is in a non-reuse state can be recorded. If the time in the non-reuse state is greater than a preset time threshold, the network connection is disconnected to release network resources.
[0035] The video playback data processing method of the embodiment of the present invention, through the connection pool mechanism, reuses the network connection that was previously saved in the connection pool and has paused data reading but not disconnected when a jump occurs in the data reading position, thereby reducing the video playback jamming phenomenon caused by frequent disconnection and new network connection, and improving the response speed of video playback.
[0036] The technical solution of the present invention is further illustrated by some specific embodiments below.
[0037] Embodiment 1
[0038] like Figure 4 As shown, it is a flow chart of a method for processing video playback data according to an embodiment of the present invention. The method can be applied to a client to obtain video playback data from a server and play the video playback data. The method may include:
[0039] S101: In response to a data read request for a data location to be read other than a current data read location, a network connection corresponding to the data location to be read is searched in a connection pool. The connection pool is used to store network connections that are suspended from data reading but not disconnected, that is, a network connection put into the connection pool is equivalent to being suspended, pausing the data transmission function, but resources are not released between the server and the client, and can still be enabled at any time.
[0040] In the online video playback scenario, the player on the client will issue a data read request according to the video playback progress. The data read request contains the location of the video playback data requested to be read, that is, the data location to be read. The client needs to read the video playback data from the server through the network connection established with the server before, and then provide it to the player for playback. The process of establishing a new network connection requires multiple interactions between the client and the server. For example, in order to establish an HTTP network connection, the client and the server need to perform three TCP handshakes and SSL handshakes and HTTP header request messages. After the network connection is established, the video playback data will be transmitted between the server and the client through data packets. The video playback data transmitted by the data packets will be numbered in sequence according to the position of the video playback data in the video file. That is to say, for a certain network connection, during the data transmission process, the data will be read backward continuously from the data location requested to be read when the network connection is established according to the order of the video playback data in the video file. The server and the client will record information such as the data reading location and the number of the data packet. For example, in a communication model based on the TCP / IP protocol, the server and the client both establish a Socket object, and then transmit data through the Socket object, and record the data packet information and the data reading location.
[0041] S102: If there is a network connection corresponding to the position of the data to be read, the video playback data of the position of the data to be read is obtained using the network connection. As described above, since the network connection in the connection pool is in an undisconnected state, it can be enabled at any time without the need to perform the three-way TCP handshake creation process. In addition, the above-mentioned network connection corresponding to the position of the data to be read can be a network connection that is relatively close to the data reading position, for example, at a position two seconds before the position of the data to be read. In the case of a fast network speed, the above-mentioned data position to be read may be read instantly, and the user will not perceive it.
[0042] S103: If there is no network connection corresponding to the location of the data to be read, a new network connection is created, and the video playback data of the location of the data to be read is obtained using the new network connection. The above network connection may include an HTTP network connection, and the above video playback data is data stored in the video file, including not only video content data but also information data in the video file for playing the video content data. Specifically, the video playback data may include audio and video interleaved data and / or video playback metadata.
[0043] In addition, for the network connection corresponding to the current data read position, the network connection corresponding to the current data read position may not be disconnected first, but data transmission may be suspended and placed in a connection pool for storage for possible data reading. Furthermore, for the network connection corresponding to the current data read position, it may be determined whether the network connection corresponding to the current data read position may be reused based on the situation that triggers the above-mentioned data read request. If it may be reused, the network connection corresponding to the current data read position may be saved in the request connection pool, otherwise the network connection corresponding to the current data read position may be disconnected. Specifically, judgments may be made based on the aforementioned situations to determine whether to place the network connection in the connection pool:
[0044] 1) If the data reading request is triggered by the user's dragging behavior, then determine whether the network connection corresponding to the current data reading location is likely to be reused based on the user's usage habits. Since the user's dragging behavior is relatively random, it can generally be considered that the possibility of the user returning to the original location for playback after dragging is small, and it can be assumed that the current network connection will not be reused. However, for some users, there may be situations where they like to jump back and forth to watch. For these users, their usage habits can be identified through historical user behavior, and then the possibility of the current network connection being reused can be determined.
[0045] 2) If the data read request is triggered by the behavior of reading audio and video interleaved data, it is determined that the network connection corresponding to the current read data position may be reused. As in the application scenario mentioned above, when the read position jumps for audio and video interleaved data, jump reading is generally performed repeatedly.
[0046] 3) If the data read request is triggered by the behavior of reading video metadata, it is determined that the network connection corresponding to the current data read position may be reused. As in the application scenario mentioned above, after reading the moov data, it will return to the starting position of the video content data and start reading the video content data.
[0047] In addition, when a jump occurs in the read data position, that is, when a data read request occurs for a data position to be read other than the current read data position, the jump amplitude of the data position to be read relative to the current read data position can be judged. If the jump amplitude is greater than the jump amplitude threshold, the network connection corresponding to the data position to be read is searched in the connection pool, that is, another network connection is needed to read the data. If the jump amplitude is less than or equal to the jump amplitude threshold, the current network connection is continued to be used to obtain the video playback data, because if the jump amplitude is small, the read data position may change from the read data position before the jump (that is, the aforementioned current read data position) to the data position to be read in a very short time. In this case, if the network connection is still switched for data reading, whether it is reused or a new network connection is created, computing resources will be wasted. Therefore, the current network connection can still be used for data reading. The jump amplitude threshold can be determined according to the current network speed, that is, in the case of high network speed, a larger jump amplitude threshold can be corresponding, and in the case of low network speed, a smaller jump amplitude threshold can be corresponding.
[0048] In addition, before searching the connection pool for the network connection corresponding to the position of the data to be read, the process may further include: detecting whether the video playback data corresponding to the position of the data to be read has been downloaded, and if so, reading the video playback data corresponding to the position of the data to be read from the downloaded data storage area. For example, during the dragging behavior of the user, the user may jump to the video playback data that has been read before. In this case, the data can be directly read locally on the client without having to be obtained from the server through the network connection.
[0049] In addition, in order to more effectively utilize network connection resources, the time that the network connection saved in the connection pool is in a non-reuse state can be recorded. If the time in the non-reuse state is greater than a preset time threshold, the network connection is disconnected to release network resources.
[0050] The video playback data processing method of the embodiment of the present invention, through the connection pool mechanism, reuses the network connection that was previously saved in the connection pool and has paused data reading but not disconnected when a jump occurs in the data reading position, thereby reducing the video playback jamming phenomenon caused by frequent disconnection and new network connection, and improving the response speed of video playback.
[0051] Embodiment 2
[0052] like Figure 5 As shown, it is a structural schematic diagram of a device for processing video playback data according to an embodiment of the present invention. The device can be applied to a client to obtain video playback data from a server and play the video playback data. The device may include:
[0053] The network connection search module 11 is used to respond to a data read request for a data position to be read other than the current data read position, and to search for a network connection corresponding to the data position to be read in the connection pool, wherein the network connection in the connection pool is in a state of suspending data reading but not disconnected. The connection pool is used to save the network connection that is suspended but not disconnected, that is, the network connection put into the connection pool is equivalent to being suspended, suspending the data transmission function, but the resources between the server and the client are not released, and it can still be enabled at any time.
[0054] When a jump occurs in the read data position, that is, when a data read request occurs for a data position to be read other than the current read data position, the jump amplitude of the data position to be read relative to the current read data position can be judged. If the jump amplitude is greater than the jump amplitude threshold, the network connection corresponding to the data position to be read is searched in the connection pool, that is, another network connection is needed to read the data. If the jump amplitude is less than or equal to the jump amplitude threshold, the current network connection is continued to be used to obtain the video playback data, because if the jump amplitude is small, the read data position may change from the read data position before the jump (that is, the aforementioned current read data position) to the data position to be read in a very short time. In this case, if the network connection is still switched for data reading, whether it is reused or a new network connection is created, computing resources will be wasted. Therefore, the current network connection can still be used for data reading. The jump amplitude threshold can be determined according to the current network speed, that is, in the case of high network speed, a larger jump amplitude threshold can be corresponding, and in the case of low network speed, a smaller jump amplitude threshold can be corresponding.
[0055] In addition, before searching the connection pool for the network connection corresponding to the position of the data to be read, the process may further include: detecting whether the video playback data corresponding to the position of the data to be read has been downloaded, and if so, reading the video playback data corresponding to the position of the data to be read from the downloaded data storage area. For example, during the dragging behavior of the user, the user may jump to the video playback data that has been read before. In this case, the data can be directly read locally on the client without having to be obtained from the server through the network connection.
[0056] The network connection multiplexing module 12 is used to obtain the video playback data of the data position to be read using the network connection when there is a network connection corresponding to the data position to be read in the connection pool. The network connection corresponding to the data position to be read may be a network connection that is relatively close to the data reading position, for example, two seconds before the data position to be read. In the case of a fast network speed, the data position to be read may be read instantly, and the user will not be aware of it.
[0057] The network connection creation module 13 is used to create a new network connection and use the newly created network connection to obtain the video playback data of the data location to be read when there is no network connection corresponding to the data location to be read in the connection pool. The above network connection may include an HTTP network connection, and the above video playback data is data stored in the video file, including not only video content data but also information data in the video file for playing the video content data. Specifically, the video playback data may include audio and video interleaved data and / or video playback metadata.
[0058] In addition, the device may also include:
[0059] The network connection saving module 14 is used to save the network connection corresponding to the current data read position into the request connection pool. Furthermore, for the network connection corresponding to the current data read position, it can be determined whether the network connection corresponding to the current data read position can be reused according to the situation that triggers the above-mentioned data read request. If it can be reused, the network connection corresponding to the current data read position is saved in the request connection pool, otherwise the network connection corresponding to the current data read position is disconnected. The specific situation judgment and corresponding processing can be performed with reference to the contents introduced in the first embodiment. In addition, in order to more effectively utilize the resources of the network connection, the network connection saving module 14 can also record the time when the network connection saved in the connection pool is in a non-reused state. If the time in the non-reused state is greater than the preset time threshold, the network connection is disconnected to release the network resources.
[0060] The specific description of the above-mentioned processing process, the detailed description of the technical principle and the detailed analysis of the technical effect have been described in detail in the previous embodiments and will not be repeated here.
[0061] The video playback data processing device of the embodiment of the present invention, through the connection pool mechanism, reuses the network connection that was previously saved in the connection pool and has paused data reading but not disconnected when a jump occurs in the data reading position, thereby reducing the video playback jamming phenomenon caused by frequent disconnection and new network connection establishment, and improving the response speed of video playback.
[0062] Embodiment 3
[0063] The above embodiments describe the process flow and device structure of the method for processing video playback data. The functions of the above method and device can be implemented by means of an electronic device, such as Figure 6 As shown, it is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, which specifically includes: a memory 110 and a processor 120.
[0064] The memory 110 is used to store programs.
[0065] In addition to the above-mentioned programs, the memory 110 may also be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc.
[0066] The memory 110 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0067] The processor 120 is coupled to the memory 110 and is used to execute the program in the memory 110 to perform the operation steps of the method for processing video playback data described in the above embodiments.
[0068] In addition, the processor 120 may also include various modules described in the above embodiments to perform processing of video playback data, and the memory 110 may be used, for example, to store data required for these modules to perform operations and / or output data.
[0069] The specific description of the above-mentioned processing process, the detailed description of the technical principle and the detailed analysis of the technical effect have been described in detail in the previous embodiments and will not be repeated here.
[0070] Furthermore, as shown in the figure, the electronic device may also include other components such as a communication component 130, a power component 140, an audio component 150, and a display 160. The figure only schematically shows some components, which does not mean that the electronic device only includes the components shown in the figure.
[0071] The communication component 130 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component 130 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 130 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0072] The power supply component 140 provides power to various components of the electronic device. The power supply component 140 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.
[0073] The audio component 150 is configured to output and / or input audio signals. For example, the audio component 150 includes a microphone (MIC), and when the electronic device is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 110 or sent via the communication component 130. In some embodiments, the audio component 150 also includes a speaker for outputting audio signals.
[0074] The display 160 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0075] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing video playback data, comprising: In response to a data read request for a data position to be read other than a current data read position, the network connection corresponding to the current data read position is saved in the request connection pool, and the network connection corresponding to the data position to be read is searched in the connection pool, wherein the network connection in the connection pool is in a state of suspending data reading but not disconnected; wherein the current data read position and the data position to be read are located in the same video; if there is a network connection corresponding to the data position to be read, the network connection is used to obtain the video playback data of the data position to be read.
2. The method according to claim 1, wherein: Also includes: If there is no network connection corresponding to the location of the data to be read, a new network connection is created, and the video playback data at the location of the data to be read is acquired using the new network connection.
3. The method according to claim 1, wherein: The step of saving the network connection corresponding to the current read data location to the request connection pool includes: Determining whether a network connection corresponding to a current data read location can be reused according to a situation triggering the data read request; If it is possible to be reused, the network connection corresponding to the current data reading position is saved in the request connection pool; otherwise, the network connection corresponding to the current data reading position is disconnected.
4. The method according to claim 3, wherein: According to the situation of triggering the data read request, determining whether the network connection corresponding to the current read data position may be reused includes: If the data reading request is triggered by the user's dragging behavior, determining whether the network connection corresponding to the current data reading position can be reused according to the user's usage habits; If the data read request is triggered by an action of reading audio and video interleaved data, determining that a network connection corresponding to a current data read position may be reused; If the data reading request is triggered by an action of reading video metadata, it is determined that the network connection corresponding to the current data reading position may be reused.
5. The method according to claim 1, wherein: In response to a data read request for a data position to be read other than a current data read position, searching a connection pool for a network connection corresponding to the data position to be read includes: In response to a data read request for a data position to be read other than a current data read position, obtaining a jump amplitude of the data position to be read relative to the current data read position; If the jump amplitude is less than or equal to the jump amplitude threshold, continue to use the current network connection to obtain video playback data; If the jump amplitude is greater than the jump amplitude threshold, searching the connection pool for a network connection corresponding to the location of the data to be read.
6. The method according to claim 5, wherein: The jump amplitude threshold is determined according to the current network speed.
7. The method according to claim 1, wherein: Before searching the connection pool for the network connection corresponding to the location of the data to be read, the method further includes: It is detected whether the video play data corresponding to the data position to be read has been downloaded. If it has been downloaded, the video play data corresponding to the data position to be read is read from the downloaded data storage area.
8. The method according to claim 1, wherein: Also includes: Record the time that the undisconnected network connections saved in the connection pool are not reused; If the time in the non-multiplexed state is greater than a preset time threshold, the network connection is disconnected.
9. The method according to claim 1, wherein: The video playback data includes: audio and video interleaved data and / or video playback metadata.
10. The method according to claim 1, wherein: The network connection includes an HTTP network connection.
11. A device for processing video playback data, comprising: A network connection search module is used to respond to a data read request for a data position to be read other than a current data read position, save the network connection corresponding to the current data read position into the request connection pool, and search the connection pool for the network connection corresponding to the data position to be read, wherein the network connection in the connection pool is in a state of suspending data reading but not disconnected; wherein the current data read position and the data position to be read are located in the same video; and a network connection multiplexing module is used to use the network connection to obtain the video playback data of the data position to be read when there is a network connection corresponding to the data position to be read in the connection pool.
12. The device according to claim 11, wherein Also includes: The network connection creation module is used to create a new network connection and use the newly created network connection to obtain the video playback data at the data location to be read when there is no network connection corresponding to the data location to be read in the connection pool.
13. The device according to claim 11, wherein: In response to a data read request for a data position to be read other than a current data read position, searching a connection pool for a network connection corresponding to the data position to be read includes: In response to a data read request for a data position to be read other than a current data read position, obtaining a jump amplitude of the data position to be read relative to the current data read position; If the jump amplitude is less than or equal to the jump amplitude threshold, continue to use the current network connection to obtain video playback data; If the jump amplitude is greater than the jump amplitude threshold, searching the connection pool for a network connection corresponding to the location of the data to be read.
14. An electronic device comprising: Memory, used to store programs; A processor, configured to run the program stored in the memory to execute the method for processing video playback data according to any one of claims 1 to 10.
Citation Information
Patent Citations
Internet audio and video playback method and device
CN107820100A
Network request method and device
CN109729176A
Long connection management method, device, equipment and computer readable storage medium
CN110430238A