Video reading method and device
By reading and stored multiple time period data of the target video in advance, the problem of the video playback stuck when the user retreats to the target time point, and achieves a smoother video playback experience.
Patent Information
- Application Number
- CN202311554120.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-24
- Filing Date
- 2023-11-17
- Publication Date
- 2025-01-24
AI Technical Summary
During the video playback, after the user reaches the target time point through fast forward or backward operations, he needs to request the video data again, resulting in stuttering in video playback.
At the server of the file storage system, read the video data set of the target video in advance, including the video data of the target time point, the video data of the first time before the target time point, and the second time after the target time point Video data and store it in the internal memory of the client.
When the user retreats to the target time point, the corresponding video data is read directly from the client's internal memory, avoiding the time delay in requesting data from the server, easing the problem of video playback lag, and improving the user experience.
Smart Images

Figure CN119364045A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on July 24, 2023, with application number 202310911735.9 and application name “A method, device and other equipment for data processing”, all contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of storage technology, and in particular to a video reading method and device. Background Art
[0003] When a user plays a video file using a client of a file storage system, the user can fast forward or rewind to play the content of the target time point of the video file. When the user performs a fast forward or rewind operation, if the dragged time point is after the target time point, the user needs to perform a rewind operation again so that the rewinded time point coincides with the target time point, and the content data of the target time point of the video file is played.
[0004] After the dragged time point is at the target time point, if the rewind operation is performed again so that the rewinded time point coincides with the target time point, the client needs to re-request the content data of the target time point from the server of the file storage system. The client sends a request to obtain the content data of the target time point to the server. After receiving the request, the server reads the content data of the target time point from the disk to the server's memory, and the server sends the content data to the client. The server has a long delay in reading the content data from the disk to the internal memory, which causes the video file to be played lag. Summary of the invention
[0005] The present application provides a video reading method and device for solving the problem of video playback freeze when a user drags the video forward to any time point and then rewinds to a target time point.
[0006] In a first aspect, the present application provides a video reading method. The method is applied to a server of a file storage system, and the file storage system also includes a client. The server is used to access at least one storage device of the file storage system. At least one storage device is located in multiple data centers in different regions, and each data center includes multiple servers. The method includes: the server receives a video reading request from the client. The video reading request carries an identifier of a target video and a target time point of the target video. In response to the video reading request, the server reads a video data set of the target video from at least one storage device. The video data set includes video data of the target video at the target time point, video data of the target video in a first time period before the target time point, and video data of the target video in a second time period after the target time point. The video data set is distributed and stored in at least one storage device. The server sends the video data set to the client.
[0007] In the present application, the client receives a video playback operation for a target time point, sends a video read request to the server, receives a video data set sent by the server, and stores the video data set in the client's internal memory. The video data set includes video data at the target time point, video data of a first time period before the target time point, and video data of a second time period after the target time point. When the client receives a rewind operation for the target time point, and the video data of the rewind time point after the rewind operation needs to be played, the client directly reads the video data of the first time period from the client's internal memory and plays it. This saves the time for the client to send a request to the server to obtain the video data of the rewind time point, the time for the server to read the video data of the rewind time point from at least one storage device and store it in the server's internal memory, and the time for the server to take out the video data of the rewind time point from the server's internal memory and transmit it to the client. This alleviates the problem of screen freeze caused by the client performing rewind during the video playback process, and improves the user experience.
[0008] In a possible implementation, at least one storage device stores videos in the time sequence of video playback. The server determines the first storage location of the target video in at least one storage device based on the identifier of the target video. The server reads the video data of the target video at the target time point. The server determines the second storage location of the video data of the first time period in at least one storage device and the third storage location of the video data of the second time period in at least one storage device based on the time sequence of video playback. The server reads the video data of the target video in the first time period and the video data of the target video in the second time period. In this way, the server reads the video data of the target time point, the video data of the previous time point of the target time point (i.e., the first time period), and the video data of the subsequent time point of the target time point (i.e., the second time period). When the client receives a rewind operation for the target time point, the video data of the previous time point of the target time point (i.e., the first time period) can be directly obtained, saving the time of obtaining the video data of the first time period.
[0009] In another possible implementation, the server receives a pre-reading start request from the client. The pre-reading start request is used to indicate that the server reads the video data of the first time period upon receiving the video read request and sends it to the client. In this way, the user can set whether to enable pre-reading as needed, thereby improving the user experience.
[0010] In another possible implementation, the server receives a pre-read configuration request from the client. The pre-read configuration request is used to indicate: the amount of data read when the server reads the video data of the first time period or the length of the first time period. In this way, the user can set whether to cache the video data at the previous time point and the amount of cached video data as needed, thereby avoiding the problem of video playback freeze caused by the client receiving a rewind operation for the target time point, thereby improving the user experience.
[0011] In another possible implementation, the server reads a video data set from at least one storage device in response to the video read request, and stores the video data set in the internal memory of the server. And the server reads the video data set from the internal memory of the server. In this way, when the server receives a request from the client to obtain video data of the first time period, the server can directly read the data from the internal memory of the server, saving the time of the server reading the video data of the first time period from the storage device.
[0012] In the second aspect, the present application provides a video reading method. The method is applied to a client of a file storage system, and the file storage system also includes a server. The client receives a video playback operation for a target time point, and in response to the video playback operation, sends a video reading request to the server. The video reading request is used to obtain: video data at the target time point, and the video reading request carries an identifier of the video data at the target time point. The client receives a video data set sent by the server. Among them, the video data set includes the video data at the target time point, the video data of a first time period before the target time point, and the video data of a second time period after the target time point. The client stores the video data set in the internal memory of the client. The client receives a video rewind operation for the target time point, and in response to the video rewind operation, reads the video data of the first time period before the target time point from the internal memory and plays it.
[0013] In a possible implementation, the client provides a configuration interface, which is used to receive a video configuration instruction from a user.
[0014] In another possible implementation, the client receives a pre-reading start instruction from the user through a configuration interface, where the pre-reading start instruction is used to instruct to store video data of a first time period before a target time point into an internal memory of the client.
[0015] In another possible implementation, the client receives a pre-read configuration instruction from a user through a configuration interface, where the pre-read configuration instruction is used to indicate a data volume to be read for video data in a first time period.
[0016] In a third aspect, the present application provides a video playback method. The method is applied to a file storage system, and the file storage system includes a client and a server. The server is used to access at least one storage device of the file storage system. At least one storage device is located in multiple data centers in different regions, and each data center includes multiple servers. The client receives a video playback operation for a target time point. In response to the video playback operation, the client sends a video read request to the server. The video read request is used to obtain video data at the target time point, and the video read request carries an identifier of the video data at the target time point. The server receives the video read request from the client, and in response to the video read request, reads a video data set of the target video from at least one storage device. The video data set includes video data of the target video at the target time point, video data of the target video in a first time period before the target time point, and video data of the target video in a second time period after the target time point, and the video data set is distributed and stored in at least one storage device. The server sends the video data set to the client. The client receives the video data set sent by the server. The client stores the video data set in the internal memory of the client. The client receives a video rewind operation for a target time point, and in response to the video rewind operation, reads video data of a first time period before the target time point from an internal memory and plays the video data.
[0017] In a possible implementation, at least one storage device stores videos in the time sequence of video playback. The server determines the first storage location of the target video in at least one storage device based on the identifier of the target video. The server reads the video data of the target video at the target time point. The server determines the second storage location of the video data of the first time period in at least one storage device and the third storage location of the video data of the second time period in at least one storage device based on the time sequence of video playback. The server reads the video data of the target video in the first time period and the video data of the target video in the second time period. In this way, the server reads the video data of the target time point, the video data of the previous time point of the target time point (i.e., the first time period), and the video data of the subsequent time point of the target time point (i.e., the second time period). When the client receives a rewind operation for the target time point, the video data of the previous time point of the target time point (i.e., the first time period) can be directly obtained, saving the time of obtaining the video data of the first time period.
[0018] In another possible implementation, the server receives a pre-reading start request from the client. The pre-reading start request is used to indicate that the server reads the video data of the first time period upon receiving the video read request and sends it to the client. In this way, the user can set whether to enable pre-reading as needed, thereby improving the user experience.
[0019] In another possible implementation, the server receives a pre-read configuration request from the client. The pre-read configuration request is used to indicate: the amount of data read when the server reads the video data of the first time period or the length of the first time period. In this way, the user can set whether to cache the video data at the previous time point and the amount of cached video data as needed, thereby avoiding the problem of video playback freeze caused by the client receiving a rewind operation for the target time point, thereby improving the user experience.
[0020] In another possible implementation, the server reads a video data set from at least one storage device in response to the video read request, and stores the video data set in the internal memory of the server. And the server reads the video data set from the internal memory of the server. In this way, when the server receives a request from the client to obtain video data of the first time period, the server can directly read the data from the internal memory of the server, saving the time of the server reading the video data of the first time period from the storage device.
[0021] In a possible implementation, the client provides a configuration interface, which is used to receive a video configuration instruction from a user.
[0022] In another possible implementation, the client receives a pre-reading start instruction from the user through a configuration interface, where the pre-reading start instruction is used to instruct to store video data of a first time period before a target time point into an internal memory of the client.
[0023] In another possible implementation, the client receives a pre-read configuration instruction from a user through a configuration interface, where the pre-read configuration instruction is used to indicate a data volume to be read for video data in a first time period.
[0024] In a fourth aspect, the present application provides a video reading device. The video reading device is used to access at least one storage device of a file storage system. At least one storage device is located in multiple data centers in different regions, and each data center includes multiple servers. The device includes: a transceiver module, used to: receive a video reading request from a client. Wherein, the video reading request carries an identifier of a target video and a target time point of the target video. A processing module, used to: read a video data set of a target video from at least one storage device in response to a video reading request. Wherein, the video data set includes video data of the target video at a target time point, video data of the target video in a first time period before the target time point, and video data of the target video in a second time period after the target time point. The video data set is distributed and stored in at least one storage device. The transceiver module is also used to: send the video data set to the client.
[0025] In a fifth aspect, the present application provides a video playback device. The video playback device includes: a transceiver module, which is used to: receive a video playback operation for a target time point. A processing module, which is used to: send a video read request to a server in response to the video playback operation. The video read request is used to obtain the video data at the target time point, and the video read request carries an identifier of the video data at the target time point. The transceiver module is also used to: receive a video data set sent by the server, and the video data set includes the video data at the target time point, the video data of a first time period before the target time point, and the video data of a second time period after the target time point. The processing module is also used to: store the video data set to the internal memory of the device. The transceiver module is also used to: receive a video rewind operation for the target time point. The video playback module is used to: read the video data of the first time period before the target time point from the internal memory in response to the video rewind operation, and play it.
[0026] In a sixth aspect, the present application provides a video playback system, which includes: the video reading device in the fourth aspect and the video playback device in the fifth aspect.
[0027] In a seventh aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, each computing device including a processor and a memory. The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the operation steps of the method in the first aspect or any possible implementation of the first aspect, or the computing device cluster performs the operation steps of the method in the second aspect or any possible implementation of the second aspect.
[0028] In an eighth aspect, the present application provides a computer-readable storage medium, including: computer software instructions; when the computer software instructions are executed in a computing device, the computing device is caused to execute the operation steps of the method in the first aspect or any possible implementation of the first aspect, or the computing device is caused to execute the operation steps of the method in the second aspect or any possible implementation of the second aspect, or the computing device is caused to execute the operation steps of the method in the third aspect or any possible implementation of the third aspect.
[0029] In a ninth aspect, the present application provides a computer program product. When the computer program product is run on a computer, the computing device is caused to perform the operation steps of the method in the first aspect or any possible implementation of the first aspect, or the computing device is caused to perform the operation steps of the method in the second aspect or any possible implementation of the second aspect, or the computing device is caused to perform the operation steps of the method in the third aspect or any possible implementation of the third aspect.
[0030] The beneficial effects of the third to ninth aspects above can be referred to the description of any implementation in the first or second aspect, and will not be repeated here. Based on the implementation provided by the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the structure of a file storage system provided for this application;
[0032] Figure 2 A schematic diagram of a video storage process provided for this application;
[0033] Figure 3 A first video reading schematic diagram provided for this application;
[0034] Figure 4 A second video reading schematic diagram provided for this application;
[0035] Figure 5 A flowchart of a video playback method provided by this application;
[0036] Figure 6 A schematic diagram of the first pre-reading start interface provided by this application;
[0037] Figure 7 A schematic diagram of the first pre-reading configuration provided for this application;
[0038] Figure 8 A schematic diagram of a second pre-reading configuration provided for this application;
[0039] Fig. 9 A schematic diagram of the third pre-reading configuration provided for this application;
[0040] Fig.10 A schematic diagram of the second pre-reading start interface provided by this application;
[0041] Fig.11 A schematic diagram of a fourth pre-reading configuration provided for this application;
[0042] Fig.12 A flowchart of the first method of obtaining video data provided by this application;
[0043] Fig.13 A second flowchart for obtaining video data provided by this application;
[0044] Fig.14 A schematic diagram of a client reading data provided by this application;
[0045] Fig.15 A schematic diagram of the structure of a video reading device provided by the present application;
[0046] Fig.16 A schematic diagram of the structure of a video playback device provided in this application;
[0047] Fig.17 A schematic diagram of the structure of a computing device provided for this application;
[0048] Fig.18 A schematic diagram of the structure of a computing cluster provided for this application;
[0049] Fig.19 A connection diagram of a computing device provided for this application. DETAILED DESCRIPTION
[0050] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given.
[0051] Figure 1 A schematic diagram of the structure of a file storage system provided for this application, such as Figure 1 As shown, the video playback system 100 includes a client 110, a server 120 and at least one storage device. The client 110 and the server 120, and the server 120 and the storage device can be connected through a network, and the network can include one or more network devices. The network device can be a device with data forwarding function such as a router or a switch.
[0052] The client 110 may be an electronic device installed with video playback software, applications (applications, apps), video editing software, etc. The electronic device may include, but is not limited to: the following types of devices: mobile phones (such as Figure 1 Client 111 shown), tablet computer, handheld computer, personal computer (PC) (such as Figure 1 Client 112 shown), cellular phone, personal digital assistant (PDA) (such as Figure 1 Client 113 shown), desktop computer (such as Figure 1 The client 114 shown in the figure, wearable devices (such as smart watches), smart home devices (such as TVs), car computers, game consoles, and augmented reality (AR) and virtual reality (VR) devices, etc. This embodiment does not impose any special restrictions on the specific device form of the client 110. For example, the user can choose to play the video on a PC as needed; or the user can choose to play the video on a mobile phone as needed. For details about the internal structure of the client 110, please refer to the following Fig.17 The description is not repeated here.
[0053] The client 110 may be public, such as an electronic device installed with video playback software or video editing software available to the public. The client 110 may also be private, such as an electronic device installed with video playback software or video editing software not available to the public. The present application does not limit the type of the client 110.
[0054] The server 120 is used to manage or access the storage device, such as the server 120 accesses the storage device and obtains the video data stored in the storage device. The server can be a server 121, a computer 122, etc.
[0055] At least one storage device included in the file system 100 can be deployed in multiple data centers. The multiple data centers can be located in the same area or in different areas, which is not limited in this application. Each data center can include one or more physical devices with storage functions, such as servers, mobile phones, tablet computers, read-only memory (ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD), etc. This application is for physical devices with storage functions.
[0056] The above are only examples of application scenarios or video playback systems provided by this embodiment and should not be construed as limiting the present application. The video playback system is described above in conjunction with the accompanying drawings. At least one storage device of the file storage system can store videos in a variety of ways. A possible example is given below.
[0057] Figure 2 A schematic diagram of a video storage process provided for this application, such as Figure 2 As shown, the process of the server of the file storage system storing the video to at least one storage device of the file storage system may include the following steps ① to ③.
[0058] In step ①, the server of the file storage system divides the video into multiple video segments according to preset rules, and generates an identifier corresponding to each video segment.
[0059] Each of the segmented video segments can be played independently. The server can segment the video in a variety of ways to obtain multiple independently playable video segments. Two possible examples are given below.
[0060] Example A, the server can divide the video according to the length of the playback time to obtain multiple video segments that can be played independently. Each video segment can include one or more frames of images. For example, if the total duration of video 1 is 10 minutes (minutes, min), and each video segment obtained by dividing video 1 according to a duration of 2 min can be played independently. In this case, the server divides video 1 according to a duration of 2 min to obtain 5 video segments. According to the needs of actual applications, the server can use a longer or shorter time to divide the video to obtain one or more video segments containing one or more frames of images.
[0061] Example B: The server divides the video into multiple video segments according to the data volume.
[0062] The data volume of each video segment can be equal or unequal, and this application does not limit this. For example, the data volume of video 1 is 400 megabytes (MB), and each video segment of 40MB of data can be played independently. In this case, the server divides video 1 into 10 video segments of 40MB of data volume according to the data volume of 40MB.
[0063] The above gives an example of a server dividing a video into multiple independently playable video segments according to duration and data volume. In some possible examples, the server may also divide the video into multiple independently playable video segments in other ways, which is not limited in this application.
[0064] The identification number generated by the server for each video segment may include: the identification number of the video and the identification numbers of each video segment obtained by dividing the video. The identification number of the video (also called the video identifier) is used to identify the video, and the identification number of the video segment (also called the video segment identifier) is used to identify the video segment. The server can determine the target video from multiple videos stored in the storage device according to the identifier of the target video, and determine the target video segment from multiple video segments stored in the storage device according to the identifier of the video segment.
[0065] The server may generate the video segment identifier according to the playback order of each video segment in the video. For example, the server generates the video segment identifier for each video segment according to the video identifier and the start time of each video segment in the video. For another example, the server generates the video segment identifier for each video segment according to the video identifier and the end time of each video segment in the video.
[0066] For example, the total duration of video 1 is 10 minutes, and the server divides video 1 into 2 minutes, obtaining video segments 1 to 5. The starting times of video segments 1 to 5 are the 1st minute, the 3rd minute, the 5th minute, the 7th minute, and the 9th minute, respectively. In this case, the server generates identifiers 1 to 5 for video segments 1 to 5 according to the corresponding starting times of video segments 1 to 5, as shown in Table 1.
[0067] Table 1
[0068] Serial number Video clips Start time Video clip identification 1 Video Clip 1 Minute 1 Logo 1 2 Video Clip 2 Minute 3 Logo 2 3 Video clip 3 Minute 5 Logo 3 4 Video clip 4 Minute 7 Logo 4 5 Video Clip 5 Minute 9 Logo 5
[0069] In a possible scenario, the server may also store the start time and end time of each video segment in at least one storage device included in the file storage system, such as the time information in the third column of Table 2 below.
[0070] Optionally, the server can also store the data volume of each video clip in at least one storage device included in the file storage system. The data volume of a video clip may vary due to the complexity of each frame of the image contained in the video clip. The complexity of an image can be determined by the pixels that change between two adjacent frames of images. For the content of this part, please refer to the description of the relevant technology, which will not be repeated here. For example, if the total length of video 1 is 10 minutes, the data volume of video 1 is 400MB. The server divides video 1 into 2 minutes in length and obtains video clips 1 to 5 with different data volumes. Please refer to Table 2.
[0071] Table 2
[0072] Serial number Video clips Time information (start time - end time) Video clip identification Data volume (MB) 1 Video Clip 1 1st to 2nd minute Logo 1 80 2 Video Clip 2 3rd to 4th minute Logo 2 120 3 Video clip 3 5th to 6th minute Logo 3 60 4 Video clip 4 7th to 8th minute Logo 4 60 5 Video Clip 5 9th to 10th minute Logo 5 90
[0073] In step ②, the server of the file storage system generates a relationship table according to the playback order of each video clip.
[0074] The relationship table indicates the playback order of each video segment.
[0075] In a possible scenario, the server may determine the playback order of the video segments according to the start time and the end time of the playback of the video segments in the video, and generate a relationship table based on the playback order.
[0076] Please refer to Table 2 above, where video segment 3 is the current video segment. The server determines that video segment 2 is the preceding adjacent video segment of video segment 3 and video segment 4 is the following adjacent video segment of video segment 3 according to the start time (i.e., the 5th minute) and end time (i.e., the 6th minute) of the video segment 3 played in video 1. The server generates a relationship table as shown in Table 3 according to this method.
[0077] Table 3
[0078]
[0079]
[0080] The above text uses the example of taking the previous video segment adjacent to the current video segment as the previous video segment and the next video segment adjacent to the current video segment as the next video segment as an example for explanation. In practical applications, multiple previous video segments adjacent to the current video segment can also be used as the previous video segment and multiple next video segments adjacent to the current video segment can be used as the next video segment as needed. For example, two previous video segments adjacent to the current video segment are used as the previous video segment of the current video segment and two next video segments adjacent to the current video segment are used as the next video segment of the current video. In some possible situations, the number of previous video segments and the number of next video segments can be different, such as taking a previous video segment adjacent to the current video segment as the previous video segment of the current video segment and taking two next video segments adjacent to the current video segment as the next video segment of the current video. The present application does not limit the number of video segments contained in the previous video segment and the next video segment.
[0081] In step ③, the server of the file storage system accesses at least one storage device included in the file storage system, stores each video clip in one or more storage devices in the at least one storage device, and generates a location table for storing each video clip.
[0082] The location table records the storage address of each video clip in one or more storage devices in the file storage system. In this application, the storage address may also be referred to as the storage location. Each video clip may be stored in different storage locations of a storage device, such as video clip 1 and video clip 2 in Table 4, or may be stored in different locations of different storage devices, such as video clips 3 to 5 in Table 4.
[0083] Table 4
[0084] Serial number Video clips Video clip identification Storage address 1 Video Clip 1 Logo 1 Storage device 1, storage location 1 2 Video Clip 2 Logo 2 Storage device 1 storage location 2 3 Video clip 3 Logo 3 Storage location 3 of storage device 2 4 Video Clip 4 Logo 4 Storage location 4 of storage device 3 4 Video Clip 5 Logo 5 Storage location 5 of storage device 6
[0085] Users can use the client to play videos. In some possible situations, such as the monitoring query process or the editing process after the program is recorded, users often need to watch the content of the video at a time point before or after the current time point. In this case, the user can use the client to fast forward or rewind operations to play the content of the target time point of the video. When the user performs a fast forward operation or a rewind operation, if the time point after the operation is after the target time point, the rewind operation needs to be performed again so that the time point after the rewind operation coincides with the target time point to play the content of the target time point of the video. For example, if you need to watch the content of the 15th minute of the video, the user performs a fast forward operation to the 20th minute of the video. At this time, you need to perform a rewind operation to the 15th minute of the video.
[0086] Figure 3 The first video reading schematic diagram provided for this application is as follows: Figure 3 As shown, the time point t0 dragged by the user is before the target time point t. In order to watch the content at the target time point t, a forward operation needs to be performed so that the time point t1 after the forward operation is performed coincides with the target time point t. Since the target time point t is after the time point t0 dragged by the user, when the client is set to cache the video data of the subsequent time point of the current time point, the video data t of the target time point is cached. Figure 4 The second video reading schematic diagram provided for this application is as follows: Figure 4 As shown, when the time point t0 dragged by the user is after the target time point t, a back operation needs to be performed so that the time point t2 after the back operation is performed coincides with the target time point t. Since the target time point t is before the time point t0 dragged by the user, the video data of the target time point t is not cached. In this case, the client sends a request to the server to obtain the video data of the target time point t. After the server receives the request, the server accesses at least one storage device of the file storage system, and obtains the video data of the target time point t from the at least one storage device to the internal memory of the server, and the server sends the video data to the client. The server accesses at least one storage device of the file storage system, and the delay in reading the video data from the at least one storage device to the internal memory of the server is long, which can easily cause the video playback to be stuck.
[0087] To this end, the present application provides a video playback method, which can be executed by the file storage system 100 described above. Figure 5 A flowchart of a video playback method provided by this application is shown in FIG. Figure 5 As shown, the method may include the following steps S510 to S590.
[0088] Step S510: The client receives a video playback operation for a target time point.
[0089] The user can use the client's forward operation, backward operation, play at a specified time point, etc. to play the video at the target time point. There are many different ways to implement the forward operation, backward operation, and play at a specified time point. Several possible examples are given below.
[0090] Example 11: A user drags the time bar of a video played in a client so that the playing time coincides with a target time point.
[0091] Example 12: The user draws a preset pattern on the client of the video being played so that the playing time coincides with the target time point. For example, the user draws "—" from front to back on the client of the video being played so that the client performs a forward operation. The preset pattern can be set according to actual needs, and this application does not limit this.
[0092] Example 13: The user performs a preset action on the client of the video being played, so that the playing time coincides with the target time point, such as the user double-clicks the client of the video being played, so that the client performs a rewind operation.
[0093] Example 14: The user slides any position of the video screen played on the client so that the playback time coincides with the target time point.
[0094] Example 15: When the client has a camera function, the user can also use gestures to perform forward and backward operations on the video played in the client so that the playback time coincides with the target time point. For example, when the client detects that the user has raised his hand, the video played in the client is forwarded.
[0095] In one possible scenario, the client may also provide a configuration interface. The configuration interface is used to receive: The configuration interface is used to receive the user's video configuration instructions. The client may receive various instructions from the user through the configuration interface. Two possible scenarios are given below.
[0096] Scenario A: The client can receive, through the configuration interface, a user's pre-reading start instruction.
[0097] The pre-reading start instruction is used to instruct to store the video data of the first time period before the target time point in the internal memory of the client. The client can receive the pre-reading start instruction of the user in various ways. For example, by using the start button, Figure 6 This is a schematic diagram of the first pre-reading start interface provided by this application, such as Figure 6 As shown, the client may provide a button, and the user can turn on or off the pre-reading instruction by clicking the button.
[0098] Scenario B: The client may receive, through the configuration interface, the user's pre-read configuration instructions.
[0099] The pre-read configuration instruction is used to indicate the amount of video data to be read in the first time period. The client can receive the pre-read configuration instruction of the user in a variety of ways, and three possible examples are shown below.
[0100] Example A: The client prompts the user to input the amount of data to be pre-read by inputting the pre-reading time.
[0101] Figure 7 A schematic diagram of the first pre-reading configuration provided for this application, such as Figure 7 As shown, the user enters the required pre-reading duration in the text box provided by the client. Since the video is divided into multiple independently playable video segments and stored in at least one storage device, in order to ensure that the data obtained by time can be played independently. The client can give the rules of the time input by the user in the provided configuration interface, such as the input time is a multiple of 2.
[0102] Example B: The client prompts the user to input the amount of data to be pre-read directly.
[0103] Figure 8 A schematic diagram of the second pre-reading configuration provided for this application, such as Figure 8 As shown, the user enters the amount of data to be pre-read in the text box provided by the client. For example, the user enters 20 megabytes (MB) of data to be cached in the text box. In this case, if the amount of data to be cached entered by the user is greater than the amount of data in the time period before the target time point, the client caches the amount of data of the video clip before the target time point. For example, if the size of the video is 400MB, the user enters 80MB in the text box. The amount of data in the time period before the target time point is 20MB, in this case, the client caches 20MB of data.
[0104] Example C: The client prompts the user to enter the amount of data to be pre-read in percentage.
[0105] Fig. 9 A schematic diagram of the third pre-reading configuration provided for this application, such as Fig. 9As shown, the user enters the percentage of pre-reading required in the text box provided by the client, and the percentage is used to indicate the ratio of the amount of data that needs to be cached to the amount of video data. For example, the data size of the video is 400MB. The user enters 20% in the text box, indicating that 80MB of data needs to be cached. In this case, when the amount of data that the user needs to cache is greater than the data size of the video clip before the target time point, the client caches the data size of the video clip before the target time point. If the size of the video is 400MB, the user enters 20% in the text box, indicating that 80MB of data needs to be cached. The data size of the time period before the target time point is 20MB. In this case, the client caches 20MB of data.
[0106] According to the needs of actual applications, the client may also use other methods to receive the user's pre-reading enable instruction and pre-reading configuration instruction, which is not limited in this application.
[0107] Optionally, the pre-reading start instruction may also instruct to store the video data of the second time period after the target time point in the internal memory of the client. Similar to the case described above where the pre-reading start instruction instructs to store the video data of the first time period before the target time point in the internal memory of the client, the client may receive the pre-reading second time period instruction input by the user by means of a button or the like. Fig.10 A schematic diagram of the second pre-reading start interface provided by this application, such as Fig.10 As shown, the user can open or close the pre-reading instruction by clicking a button. The client can also enter the amount of video data of the second time period to be cached in the text box provided by the client. The client can receive the amount of data of the second time period to be cached input by the user in the manner given in Examples A to C above. Fig.11 As shown, Fig.11 This is a schematic diagram of the fourth pre-reading configuration provided in the present application, where the user directly inputs the amount of video data of the second time period that needs to be cached in a text box provided by the client.
[0108] Step S520: In response to the video playback operation, the client sends a video read request to the server.
[0109] The video read request is used to obtain the video data at a target time point, and the video read request carries an identifier of the video data at the target time point.
[0110] In one possible scenario, the video read request may be sent from the client to the server in the form of an IO stream. An IO stream refers to a set of IO requests generated by an application, which includes multiple IO requests. For example, if the IO request is a write request, each write request may carry a piece of data and the address information of the data. For another example, if the IO request is a read request, each read request may carry the storage address of the requested data, etc.
[0111] In one possible scenario, the IO stream may use fixed bytes to carry an identifier for identifying the video data of the video at the target time point. Taking the IO stream including 8 bytes as an example, the IO stream may use the first and second bytes to carry an identifier for identifying the video data of the video at the target time point. According to the needs of the actual application, the IO stream may also include other numbers of bytes, and use other numbers of bytes and bytes in other positions to carry an identifier for identifying the video data of the video at the target time point. For example, the IO stream includes 16 bytes, and uses the first to fourth bytes to carry an identifier for identifying the video data of the video at the target time point. The present application does not limit the number of bytes and byte positions of the identifier carried by the IO stream to identify the video data of the video at the target time point.
[0112] Corresponding to step S520, the server executes step S530, and step S530 is specifically as follows: the server receives a video reading request from the client.
[0113] Step S540: The server reads a video data set of a target video from at least one storage device in response to the video read request.
[0114] The video data set includes video data of the target video at the target time point, video data of the target video in a first time period before the target time point, and video data of the target video in a second time period after the target time point, and the video data set is distributed and stored in at least one storage device.
[0115] The video data at the target time point may refer to a frame of image corresponding to the target time point, or may refer to multiple frames of image including the frame of image corresponding to the target time point. For example, a video clip including the target time point, or multiple video clips including the target time point. For example, if the total duration of video 1 is 10 minutes, the server divides video 1 into video clips 1 to video clip 5 according to 2 minutes. For information about each video clip, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds. In this case, the video data at the target time point may refer to a frame of image corresponding to 3 minutes and 50 seconds, or may refer to video clip 2, or may refer to multiple video clips including video clip 2, such as video clip 1 and video clip 2.
[0116] In one possible scenario, the server receives a pre-reading enable request from the client. The pre-reading enable request can be used to indicate that the server reads the video data of the first time period and sends it to the client when receiving the video read request. The pre-reading enable request can also be used to indicate that the server reads the video data of the second time period and sends it to the client when receiving the video read request. The pre-reading enable request can also be used to indicate that the server reads the video data of the first time period and the video data of the second time period and sends them to the client when receiving the video read request. In some possible scenarios, the server can also preset to enable pre-reading, which is not limited in this application. In this way, the user can set whether to enable pre-reading according to needs, thereby improving the user experience.
[0117] In one possible scenario, the server receives a pre-read configuration request from the client. The pre-read configuration request can be used to indicate: the amount of data read when the server reads the video data of the first time period or the duration of the first time period. The pre-read configuration request can also be used to indicate: the amount of data read when the server reads the video data of the second time period or the duration of the second time period. The pre-read configuration request can also be used to indicate: the amount of data read when the server reads the video data of the first time period or the duration of the first time period and the amount of data read when the server reads the video data of the second time period or the duration of the second time period. In some possible scenarios, the server can also preset at least one of the duration of the first time period, the duration of the second time period, and the amount of data read, which is not limited in this application. In this way, the user can set whether to cache the video data at the previous time point and the amount of cached video data as needed, avoiding the problem of video playback jamming when the client receives the back operation for the target time point, thereby improving the user experience.
[0118] In one possible scenario, the server responds to the video read request, reads the video data set from at least one storage device, stores the video data set in the internal memory of the server, and reads the video data set from the internal memory of the server. In this way, when the server receives the video data of the first time period initiated by the client, it can directly read the data from the internal memory of the server, saving the time of the server reading the video data of the first time period from the storage device.
[0119] The following uses the video data at the target time point as an example of a video clip including the target time point to illustrate the process of the server obtaining the video data. Fig.12 The first flow chart for obtaining video data provided by this application is as follows: Fig.12 As shown, the process includes the following steps ① to ⑤.
[0120] In step ①, the server determines a first storage location of the target video in at least one storage device according to an identifier of the target video.
[0121] Taking the target video as video 1 given above as an example, the server determines storage device 1, storage device 2, storage device 3 and storage device 6 storing video 1 from at least one storage device included in the file storage system according to the identifier of video 1.
[0122] Step ②: The server reads the video data of the target video at the target time point.
[0123] The server determines the target video segment including the target time point and the identifier of the target video segment according to the target time point and the relationship table. The server determines the target storage location of the target video segment in at least one storage device included in the file storage system according to the location table and the identifier of the target video segment. The server reads the video data of the target video at the target time point from the target storage location.
[0124] Exemplarily, the target video is video 1, and the server divides video 1 into video segments 1 to video segments 5 according to 2 minutes, and stores video segments 1 to video segments 5 according to the information in Table 4. Taking the target time point as 3 minutes and 50 seconds as an example, in this case, the server determines that the target video segment containing the target time point is video segment 2 and identifier 2 of video segment 2 according to the relationship table. The server determines that video segment 2 is stored in storage location 2 of storage device 1 according to the location table, and the server reads video segment 2 from storage location 2 of storage device 1 to obtain video data at the target time point.
[0125] In step ③, the server determines the second storage location of the video data of the first time period in at least one storage device and the third storage location of the video data of the second time period in at least one storage device according to the time sequence of the video playback.
[0126] The server reads the video data of the target time point, the video data of the previous time point (i.e., the first time period), and the video data of the subsequent time point (i.e., the second time period). When the client receives a rewind operation for the target time point, the video data of the previous time point (i.e., the first time period) can be directly obtained, which saves the time of obtaining the video data of the first time period.
[0127] Fig.13 The second flow chart for obtaining video data provided by this application is as follows: Fig.13 As shown, the server may use steps S31 to S33 to determine a second storage location of the video data of the first time period in at least one storage device.
[0128] Step S31: the server determines a first time period.
[0129] In a possible scenario, the first time period is used to indicate a period of time before the target time point. The server can determine the first time period according to the pre-reading configuration instruction input by the user using the configuration interface provided by the client. Depending on the different ways in which the user inputs the amount of data to be pre-read, the server determines the first time period in different ways, which are explained below.
[0130] Case a: the method of inputting the amount of data that needs to be pre-read as described in Example 1 of Case B.
[0131] In this method, the user directly inputs the required pre-reading time using the configuration interface provided by the client. In this case, the server directly uses the required pre-reading time input by the user as the first time period.
[0132] Case b: the method of determining the amount of input data that needs to be pre-read as described in Example 2 of Case B.
[0133] In this method, the user uses the configuration interface provided by the client to input the amount of data that needs to be pre-read. In this case, the server obtains the duration required for pre-reading based on the relationship between the amount of data and the target time point, and uses the duration as the first time period. Exemplarily, the total duration of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information on each video segment, please refer to Table 2 above. The current video is played to the 5th minute and 30 seconds, and the amount of data that needs to be pre-read entered by the user in the configuration interface is 70MB. In this case, the server obtains that the first time period is 2 minutes and 30 seconds based on the correspondence between the time information and data volume of each video segment shown in Table 2.
[0134] Case c: the method of determining the amount of input data that needs to be pre-read as described in Example 3 of Case B.
[0135] In this method, the user uses the configuration interface provided by the client to input the percentage of data to be pre-read. In this case, the server calculates the amount of data to be pre-read based on the percentage. After determining the amount of data to be pre-read, the server can determine the first time period in the manner described in situation b. For details about this part, please refer to the relevant description above and will not be repeated here.
[0136] The above gives an example of the server determining the first time period according to the amount of data to be pre-read input by the user using the configuration interface provided by the client. In some possible situations, the user only inputs the video data of the previous time point that needs to be pre-read through the configuration interface, but does not input the amount of data to be cached. In this case, the server determines the preset duration as the first time period, and pre-reads the video data corresponding to the preset duration. The preset duration can be pre-stored on the server, and when the user does not specify the first time period, the preset duration is stored.
[0137] Optionally, when the configuration interface receives information input by the user about video data of a pre-read video at a later time point (i.e., a second time period) at a target time point, the server may determine the second time period using the method for determining the first time period. For related content, please refer to the above description and will not be repeated here.
[0138] Step S32: the server determines a video segment and a video segment identifier that include video data of the first time period.
[0139] The server determines the pre-read video segment and the identifier of the video segment according to the target time point, the first time period and the relationship table.
[0140] For example, the total length of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds, and the first time period is 2 minutes. The video data that needs to be cached determined by the server is from 1 minute and 50 seconds to 3 minutes and 50 seconds. The server determines that the video segment to be cached is video segment 1 and identification 1 according to the relationship table.
[0141] The above description uses the example that the video data of the first time period is located in one video segment. In some possible situations, the video data of the first time period may be located in multiple video segments, which is not limited in the present application.
[0142] Step S33: The server determines a second storage location of the video data of the first time period in at least one storage device according to the video segment identifier.
[0143] The server determines the storage location of the video segment according to the identifier of the video segment containing the video data of the first time period and the location table.
[0144] Exemplarily, the identifier of the video segment containing the video data of the first time period is identifier 1. The server determines the storage location of the video segment 1 containing the video data of the first time period as storage location 1 of storage device 1 according to identifier 1 and the location table.
[0145] The above description uses the example that the video data of the first time period is located in a video segment. In some possible situations, when the video data of the first time period is located in multiple video segments, the server determines the storage location of each video segment based on the identifier of each video segment.
[0146] The method for the server to obtain the video data of the second time period is the same as the method for obtaining the video data of the first time period. Based on the above description of the process of the server obtaining the video data of the first time period using steps S31 to S33, the process of the server obtaining the video data of the second time period will not be described in detail. For related processes, please refer to the description of steps S31 to S33 above, which will not be repeated here.
[0147] In step ④, the server reads the video data of the target video in the first time period and the video data of the target video in the second time period.
[0148] The server reads a video segment containing video data of a first time period and a video segment containing video data of a second time period from a storage location of a storage device. Exemplarily, the video segment containing video data of the first time period is stored in storage location 1 of storage device 1, and the video segment containing video data of the second time period is stored in storage location 3 of storage device 2. The server reads video segment 3 from storage location 3 of storage device 2 to obtain video data of the target video in the second time period.
[0149] Step 5: The server stores the video data set in the internal memory of the server and reads the video data set from the internal memory of the server.
[0150] The server can read the video data set in a variety of ways. Three possible examples are given below.
[0151] Example 1: The server uses a sequential data reading method to obtain video data at a target time point, video data in a first time period, and video data in a second time period.
[0152] Step S1, the server first reads a video segment containing video data at a target time point.
[0153] Step S2: the server then reads a video segment containing video data of the first time period.
[0154] Step S3: the server finally reads the video segment containing the video data of the second time period.
[0155] For example, the total duration of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds, the first time period is 2 minutes, and the second time period is 2 minutes. The server obtains video segment 2 from storage location 2 of storage device 1, the server obtains video segment 1 from storage location 1 of storage device 1, and the server obtains video segment 3 from storage location 3 of storage device 2.
[0156] Example 2: The server reads data in a time slice manner to obtain video data at a target time point, video data in a first time period, and video data in a second time period.
[0157] Step S1: The server reads a video segment containing video data at a target time point within a first time slice.
[0158] Step S2: the server reads a video segment containing video data of the first time period within a second time period.
[0159] Step S3: the server reads a video segment including video data of the second time period within a third time slice.
[0160] The server cyclically executes the above steps S1, S2, and S3 until the video data of the target time point, the video data of the first time period, and the video data of the second time period are completely acquired from at least one storage device included in the file storage system. The time lengths included in the first time slice, the second time slice, and the third time slice may be the same or different, and this is not limited in the present application. The following is an example in which the first time slice, the second time slice, and the third time slice are the same.
[0161] For example, the total duration of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds, the first time period is 2 minutes, and the second time period is 2 minutes. The server reads the video data of the target time point from storage location 2 of storage device 1 within 1 millisecond (ms), the server reads the video data of the first time period from storage location 1 of storage device 1 within 1ms, and the server reads the video data of the second time period from storage location 3 of storage device 2 within 1ms.
[0162] Example 3: The server uses a data volume percentage method to obtain video data at a target time point, video data in a first time period, and video data in a second time period.
[0163] Step S1 : The server first reads a first percentage of video data of a video segment including video data at a target time point.
[0164] Step S2: the server again reads the second percentage of video data of the video segment including the video data of the first time period.
[0165] Step S3: the server finally reads the third percentage of video data of the video segment including the video data of the second time period.
[0166] The server cyclically executes the above steps S1, S2, and S3 until the video data of the target time point, the video data of the first time period, and the video data of the second time period are completely acquired from at least one storage device included in the file storage system. The first percentage, the second percentage, and the third percentage may be the same or different, and this is not limited in the present application. The following is an example in which the first percentage, the second percentage, and the third percentage are the same.
[0167] Exemplarily, the total length of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds, the first time period is 2 minutes, and the second time period is 2 minutes. The server reads 5 percent (i.e., 6 MB) of the data volume of video segment 2 (i.e., 120 MB) from storage location 2 of storage device 1, the server reads 5 percent (i.e., 4 MB) of the data volume of video segment 1 (i.e., 80 MB) from storage location 1 of storage device 1, and the server reads 5 percent (i.e., 3 MB) of the data volume of video segment 3 (i.e., 60 MB) from storage location 3 of storage device 2. The server repeatedly acquires data using the above method until the video data of video segment 2 including the target time point, the video data of video segment 1 including the first time period, and the video data of video segment 3 including the second time period are completely acquired.
[0168] The above provides several possible examples of the server acquiring the video data at the target time point, the video data of the first time period, and the video data of the second time period. In some possible examples, the server may also acquire the video data at the target time point, the video data of the first time period, and the video data of the second time period in other orders according to actual needs, and this application is not limited to this.
[0169] In a possible scenario, at least one storage device stores the target video in the time sequence of video playback. The server determines the first storage location of the target video in the at least one storage device according to the identifier of the target video. The server reads the video data of the target video at the target time point. The server determines the second storage location of the video data of the first time period in the at least one storage device and the third storage location of the video data of the second time period in the at least one storage device according to the time sequence of video playback. The server reads the video data of the target video in the first time period and the video data of the target video in the second time period.
[0170] Step S550: The server sends the video data set to the client.
[0171] For example, the total length of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The video data at the target time point is located in video segment 2, the video data of the first time period is located in video segment 1, and the video data of the second time period is located in video segment 3. The server sends video segment 1, video segment 2, and video segment 3 to the client.
[0172] Corresponding to step S550, the client executes step S560, which specifically includes: the client receives a video data set sent by the server.
[0173] Step S570: The client stores the video data set in the internal memory of the client.
[0174] The client may store the video data set in the client's internal memory in different ways. For example, after receiving the data sent by the server, the client directly stores the data in the client's internal memory. Another example is that after receiving the data sent by the server, the client temporarily stores the data in other storage locations, and after the data temporarily stored in other storage locations reaches a data volume threshold, the data reaching the data volume threshold is transferred to the client's internal memory for storage.
[0175] Step S580: The client receives a video rewind operation for a target time point.
[0176] The client receives a video rewind operation for a target time point completed by the user in a variety of ways, and the various ways may include, but are not limited to, the ways given in Examples 11 to 15 above.
[0177] Step S590: In response to the video rewind operation, the client reads video data of a first time period before the target time point from the internal memory and plays the video data.
[0178] The client determines the time point to be played in response to the video rewind operation. If the video data at the time point to be played is within the video data of the first time period, the video data of the first time period before the target time point is read from the internal memory and played.
[0179] For example, the total duration of video 1 is 10 minutes, and the server divides video 1 into video segments 1 to 5 according to 2 minutes. For information about each video segment, please refer to Table 2 above. The target time point is 3 minutes and 50 seconds. In response to the operation of rewinding 2 minutes from the target time point, the client needs to play the video data at the time point of 1 minute and 50 seconds. In this case, the client reads the video data containing the 1st minute and 50 seconds (i.e., video segment 1) from the client's internal memory and plays it.
[0180] In the present application, the client receives a video playback operation for a target time point, sends a video read request to the server, receives a video data set sent by the server, and stores the video data set in the client's internal memory. The video data set includes video data at the target time point, video data in a first time period before the target time point, and video data in a second time period after the target time point. Fig.14 A schematic diagram of a client reading data provided for this application, such as Fig.14 As shown, when the client receives a rewind operation for a target time point, and needs to play the video data of the rewind time point after the rewind operation is performed, the client directly reads the video data of the first time period from the client's internal memory and plays it. This saves the time for the client to send a request to the server to obtain the video data of the rewind time point, the time for the server to read the video data of the rewind time point from at least one storage device and store it in the server's internal memory, and the time for the server to retrieve the video data of the rewind time point from the server's internal memory and transmit it to the client. This alleviates the problem of screen freeze caused by the client performing a rewind operation during the video playback process, and improves the user experience.
[0181] Combination of the above Figures 2 to 14 The video playback method provided by the present application is described below. Fig.15 A video reading device provided by the present application is described.
[0182] Fig.15 A schematic diagram of the structure of a video reading device provided in this application, such as Fig.15 The video reading device 1500 comprises: a transceiver module 1510, a processing module 1520, a storage module 1530 and a configuration module 1540. The video reading device 1500 is used to implement the function of the server.
[0183] The transceiver module 1510 is used to: receive a video read request from a client for a target time point; wherein the video read request carries an identifier of the video data at the target time point. The processing module 1520 is used to: read a video data set from a storage device in response to the video read request. wherein the video data set includes: video data at the target time point, video data of a first time period before the target time point, and video data of a second time period after the target time point. The processing module 1520 is also used to: store the video data set in the storage module 1530. The transceiver module 1510 is also used to: send the video data set to the client, so that when the client performs a video rewind operation for the target time point, the video data in the first time period before the target time point is played.
[0184] In one possible scenario, at least one storage device stores videos in the time sequence of video playback. Processing module 1520 is specifically used to: determine the first storage location of the target video in at least one storage device according to the identifier of the target video. Processing module 1520 is also specifically used to: read the video data of the target video at the target time point. Processing module 1520 is also specifically used to: determine the second storage location of the video data of the first time period in at least one storage device and the third storage location of the video data of the second time period in at least one storage device according to the time sequence of video playback. Processing module 1520 is also specifically used to: read the video data of the target video in the first time period and the video data of the target video in the second time period.
[0185] In a possible scenario, the configuration module 1540 is configured to: receive a pre-reading start request from the client. The pre-reading start request is used to instruct the server to read the video data of the first time period upon receiving the video reading request, and send it to the client.
[0186] In a possible scenario, the configuration module 1540 is further specifically configured to: receive a pre-read configuration request from the client. The pre-read configuration request is used to indicate the server to read the data volume when reading the video data in the first time period or the duration of the first time period.
[0187] In one possible scenario, the processing module 1520 is specifically configured to: read a video data set from at least one storage device in response to a video read request. The processing module 1520 is also specifically configured to: store the video data set in an internal memory of the server, and read the video data set from the internal memory of the server.
[0188] A more detailed description of the above-mentioned transceiver module 1510, processing module 1520, storage module 1530 and configuration module 1540 can be directly obtained by referring to the relevant description in the method embodiment shown in the aforementioned drawings, and will not be repeated here.
[0189] Among them, the transceiver module 1510, the processing module 1520, the storage module 1530 and the configuration module 1540 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the transceiver module 1510 is introduced below by taking the transceiver module 1510 as an example. Similarly, the implementation of the processing module 1520, the storage module 1530 and the configuration module 1540 can refer to the implementation of the transceiver module 1510.
[0190] As an example of a software functional unit, the transceiver module 1510 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the transceiver module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0191] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0192] As an example of a hardware functional unit, the transceiver module 1510 may include at least one computing device, such as a server, etc. Alternatively, the transceiver module 1510 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0193] The multiple computing devices included in the transceiver module 1510 can be distributed in the same region or in different regions. The multiple computing devices included in the transceiver module 1510 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the transceiver module 1510 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0194] It should be noted that, in other embodiments, the transceiver module 1510 can be used to execute any step in the video reading method, the processing module 1520 can be used to execute any step in the video reading method, the storage module 1530 can be used to execute any step in the video reading method, and the configuration module 1540 can be used to execute any step in the video reading method. The steps that the transceiver module 1510, the processing module 1520, the storage module 1530 and the configuration module 1540 are responsible for implementing can be specified as needed. The full functions of the video reading device are realized by respectively implementing different steps in the video reading method through the transceiver module 1510, the processing module 1520, the storage module 1530 and the configuration module 1540.
[0195] The above describes the video reading device provided by the present application in conjunction with the accompanying drawings. Fig.16 The present invention describes a video playback device provided by the present application. Fig.16 A schematic diagram of the structure of a video playback device provided in this application, such as Fig.16 As shown, the video playback device 1600 includes: a transceiver module 1610, a processing module 1620, a storage module 1630, a playback module 1640 and a configuration module 1650. The video playback device 1600 is used to implement the functions of the client in the above embodiment.
[0196] The transceiver module 1610 is used to receive a video playback request for a target time point. The transceiver module 1610 is also used to send a video read request to the server in response to the video playback request. The video read request is used to obtain the video data at the target time point, and the video read request carries the identifier of the video data at the target time point. The transceiver module 1610 is also used to receive a video data set sent by the server. The video data set includes: the video data at the target time point, the video data of the first time period before the target time point, and the video data of the second time period after the target time point. The processing module 1620 is used to store the video data set in the storage module 1630. The transceiver module 1610 is also used to receive a video rewind request for the target time point. The playback module 1640 is used to read the video data of the first time period before the target time point from the storage module 1630 in response to the video rewind request, and play it.
[0197] In a possible scenario, the configuration module 1650 is used to provide a configuration interface, wherein the configuration interface is used to receive a user's video configuration instruction.
[0198] In a possible scenario, the configuration module 1650 is specifically configured to: receive a user's pre-reading start instruction; wherein the pre-reading start instruction is used to instruct: storing video data of a first time period before a target time point in the storage module 1630 .
[0199] In a possible scenario, the configuration module 1650 is specifically used to: receive a pre-read configuration instruction from a user; wherein the pre-read configuration instruction is used to indicate: the data volume of the video data in the first time period.
[0200] A more detailed description of the above-mentioned transceiver module 1610, processing module 1620, storage module 1630, playback module 1640 and configuration module 1650 can be directly obtained by referring to the relevant description in the method embodiment shown in the aforementioned drawings, and will not be repeated here.
[0201] Among them, the transceiver module 1610, the processing module 1620, the storage module 1630, the playback module 1640 and the configuration module 1650 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the transceiver module 1610 is introduced below by taking the transceiver module 1610 as an example. Similarly, the implementation of the processing module 1620, the storage module 1630, the playback module 1640 and the configuration module 1650 can refer to the implementation of the transceiver module 1610.
[0202] As an example of a software functional unit, the transceiver module 1610 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the transceiver module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0203] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0204] As an example of a hardware functional unit, the transceiver module 1610 may include at least one computing device, such as a server, etc. Alternatively, the transceiver module 1610 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0205] The multiple computing devices included in the transceiver module 1610 can be distributed in the same region or in different regions. The multiple computing devices included in the transceiver module 1610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the transceiver module 1610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0206] It should be noted that, in other embodiments, the transceiver module 1610 can be used to execute any step in the video playback method, the processing module 1620 can be used to execute any step in the video playback method, the storage module 1630 can be used to execute any step in the video playback method, the playback module 1640 can be used to execute any step in the video playback method, and the configuration module 1650 can be used to execute any step in the video playback method. The steps that the transceiver module 1610, the processing module 1620, the storage module 1630, the playback module 1640 and the configuration module 1650 are responsible for implementing can be specified as needed. The full functions of the video playback device are realized by respectively implementing different steps in the video playback method through the transceiver module 1610, the processing module 1620, the storage module 1630, the playback module 1640 and the configuration module 1650.
[0207] When the video reading device and the video playing device implement the method shown in any of the aforementioned figures through hardware, the functions of the video reading device and the video playing device can be implemented by a computing device. Fig.17 A schematic diagram of a computing device provided in this application, such as Fig.17 As shown, computing device 1700 includes: bus 1702, processor 1704, memory 1706 and communication interface 1708. Processor 1704, memory 1706 and communication interface 1708 communicate through bus 1702. Computing device 1700 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1700.
[0208] The bus 1702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.17The bus 1704 may include a path for transmitting information between various components of the computing device 1700 (eg, the memory 1706, the processor 1704, and the communication interface 1708).
[0209] The processor 1704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0210] The memory 1706 may include a volatile memory, such as a random access memory (RAM). The processor 1704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0211] The memory 1706 stores executable program codes, and the processor 1704 executes the executable program codes to respectively implement the functions of the aforementioned transceiver module, processing module, and configuration module, thereby implementing the video reading method. That is, the memory 1706 stores instructions for executing the video reading method.
[0212] Alternatively, the memory 1706 stores executable codes, and the processor 1704 executes the executable codes to respectively implement the aforementioned video reading devices, thereby implementing the video reading method. That is, the memory 1706 stores instructions for executing the video reading method.
[0213] The communication interface 1703 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1700 and other devices or communication networks.
[0214] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0215] Fig.18 A schematic diagram of the structure of a computing cluster provided for this application, such as Fig.18 As shown, the computing device cluster includes at least one computing device 1700. The memory 1706 in one or more computing devices 1700 in the computing device cluster may store the same instructions for executing the video reading method.
[0216] In some possible implementations, the memory 1706 of one or more computing devices 1700 in the computing device cluster may also store partial instructions for executing the video reading method. In other words, the combination of one or more computing devices 1700 may jointly execute instructions for executing the video reading method.
[0217] It should be noted that the memory 1706 in different computing devices 1700 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the video reading device. That is, the instructions stored in the memory 1706 in different computing devices 1700 can implement the functions of one or more modules among the transceiver module, the processing module and the configuration module.
[0218] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.19 A possible implementation is shown. Fig.19 A connection diagram of a computing device provided in this application, such as Fig.19 As shown, two computing devices 1700A and 1700B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1706 in the computing device 1700A stores instructions for executing the functions of the transceiver module. At the same time, the memory 1706 in the computing device 1700B stores instructions for executing the functions of the processing module and the configuration module.
[0219] Fig.19 The connection method between the computing device clusters shown may be that considering that the video reading method provided in the present application requires a large amount of video data to be sent and received, it is considered that the functions implemented by the transceiver module are handed over to the computing device 1700A for execution.
[0220] It should be understood that Fig.19 The functionality of the computing device 1700A shown in FIG. 1700A may also be implemented by multiple computing devices 1700. Similarly, the functionality of the computing device 1700B may also be implemented by multiple computing devices 1700.
[0221] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.18 and Fig.19 The connection mode of the computing device cluster is different in that the memory 1706 in one or more computing devices 1700 in the computing device cluster may store the same instructions for executing the video reading method.
[0222] In some possible implementations, the memory 1706 of one or more computing devices 1700 in the computing device cluster may also store partial instructions for executing the video reading method. In other words, the combination of one or more computing devices 1700 may jointly execute instructions for executing the video reading method.
[0223] It should be noted that the memory 1706 in different computing devices 1700 in the computing device cluster can store different instructions for executing part of the functions of the video playback system. That is, the instructions stored in the memory 1706 in different computing devices 1700 can implement the functions of one or more of the video playback device and the video reading device.
[0224] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes a video reading method or a video playing method.
[0225] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute a video reading method or instruct the computing device to execute a video playing method.
[0226] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A video reading method, characterized in that: The method is applied to a server of a file storage system, the file storage system further comprising a client, the server being used to access at least one storage device of the file storage system, the at least one storage device being located in a plurality of data centers in different regions, each data center comprising a plurality of servers, the method comprising: Receive a video read request from the client, where the video read request carries an identifier of a target video and a target time point of the target video; In response to the video read request, read the video data set of the target video from the at least one storage device; wherein the video data set includes the video data of the target video at the target time point, the video data of the target video in a first time period before the target time point, and the video data of the target video in a second time period after the target time point, and the video data set is distributed and stored in the at least one storage device; The video data set is sent to the client.
2. The method according to claim 1, characterized in that The at least one storage device stores the videos in the order of their playback time. The step of reading the video data set from the at least one storage device in response to the video read request comprises: Determining, according to the identifier of the target video, a first storage location of the target video in the at least one storage device; Read the video data of the target video at the target time point; Determine, according to the time sequence of video playback, a second storage location of the video data of the first time period in the at least one storage device and a third storage location of the video data of the second time period in the at least one storage device; The video data of the target video in the first time period and the video data of the target video in the second time period are read.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: A pre-reading start request is received from the client, where the pre-reading start request is used to instruct the server to read the video data of the first time period upon receiving the video reading request, and send the video data to the client.
4. The method according to claim 1 or 2, characterized in that: The method further comprises: A pre-reading configuration request is received from the client, where the pre-reading configuration request is used to indicate the server an amount of data to be read when reading video data in the first time period or a duration of the first time period.
5. The method according to claim 1, characterized in that The step of reading the video data set of the target video in response to the video read request includes: In response to the video read request, reading the video data set from the at least one storage device; Storing the video data set in the internal memory of the server; The video data set is read from the internal memory of the server.
6. A video playback method, characterized in that: The method is applied to a client of a file storage system, the file storage system also includes a server, and the method includes: Receive a video playback operation for a target time point; In response to the video playback operation, sending a video read request to the server, wherein the video read request is used to obtain the video data at the target time point, and the video read request carries an identifier of the video data at the target time point; Receive a video data set sent by the server, the video data set including video data at the target time point, video data in a first time period before the target time point, and video data in a second time period after the target time point; Storing the video data set in the internal memory of the client; Receiving a video rewind operation for the target time point; In response to the video rewind operation, video data of a first time period before the target time point is read from the internal memory and played.
7. The method according to claim 6, characterized in that The method further comprises: A configuration interface is provided, wherein the configuration interface is used to receive a user's video configuration instruction.
8. The method according to claim 7, characterized in that The configuration interface is used to receive a user's video configuration instruction, including: A pre-reading start instruction of the user is received through the configuration interface, wherein the pre-reading start instruction is used to instruct to store video data of a first time period before the target time point into the internal memory of the client.
9. The method according to claim 7, characterized in that: The configuration interface is used to receive a user's video configuration instruction, including: A pre-read configuration instruction of the user is received through the configuration interface, where the pre-read configuration instruction is used to indicate the amount of video data to be read in the first time period.
10. A video reading device, characterized in that: The apparatus is used to access at least one storage device of a file storage system, wherein the at least one storage device is located in a plurality of data centers in different regions, each data center including a plurality of servers, and the apparatus comprises: A transceiver module, configured to receive a video read request from a client, wherein the video read request carries an identifier of a target video and a target time point of the target video; a processing module, configured to read, in response to the video read request, a video data set of the target video from the at least one storage device, the video data set comprising video data of the target video at the target time point, video data of the target video in a first time period before the target time point, and video data of the target video in a second time period after the target time point, the video data set being distributed and stored in the at least one storage device; The transceiver module is also used to send the video data set to the client.
11. The device according to claim 10, characterized in that The at least one storage device stores the videos in a time sequence of video playback, and the processing module is specifically configured to determine a first storage position of the target video in the at least one storage device according to an identifier of the target video; Read the video data of the target video at the target time point; Determine, according to the time sequence of video playback, a second storage location of the video data of the first time period in the at least one storage device and a third storage location of the video data of the second time period in the at least one storage device; The video data of the target video in the first time period and the video data of the target video in the second time period are read.
12. The device according to claim 10 or 11, characterized in that The transceiver module is also used for: A pre-reading start request is received from the client, where the pre-reading start request is used to instruct the device to read the video data of the first time period when receiving the video reading request, and send the video data to the client.
13. The device according to claim 10 or 11, characterized in that The transceiver module is also used for: A pre-reading configuration request is received from the client, where the pre-reading configuration request is used to indicate the amount of data to be read when the device reads the video data in the first time period or the duration of the first time period.
14. The device according to claim 10, characterized in that The processing module is specifically used for: In response to the video read request, reading the video data set from the at least one storage device; storing the video data set in an internal memory of the device; The set of video data is read from an internal memory of the device.
15. A video playback device, characterized in that: The device comprises: A transceiver module, used for receiving a video playback operation for a target time point; A processing module, configured to send a video read request to a server in response to the video playback operation, wherein the video read request is used to obtain the video data at the target time point, and the video read request carries an identifier of the video data at the target time point; The transceiver module is further used to: receive a video data set sent by the server, the video data set including video data at the target time point, video data in a first time period before the target time point, and video data in a second time period after the target time point; The processing module is further configured to store the video data set into an internal memory of the device; The transceiver module is further used to receive a video rewind operation for the target time point; The video playing module is used to read the video data of the first time period before the target time point from the internal memory in response to the video rewind operation, and play the video data.
16. The device according to claim 15, characterized in that The device also includes: The configuration module is used to provide a configuration interface, and the configuration interface is used to receive a user's video configuration instruction.
17. The device according to claim 16, characterized in that The configuration module is specifically used for: A pre-reading start instruction from the user is received, where the pre-reading start instruction is used to instruct to store video data of a first time period before the target time point into an internal memory of the device.
18. The device according to claim 16, characterized in that The configuration module is specifically used for: A pre-reading configuration instruction of the user is received, where the pre-reading configuration instruction is used to indicate a data amount to be read of the video data in the first time period.
19. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 5.
20. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 6 to 9.
21. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 5.
22. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 6 to 9.
23. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 5.
24. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 6 to 9.