Video data access method and device

By distinguishing and obtaining only the required access information in video creation, the network overhead problem caused by the mixed arrangement of multiple videos and multiple pictures is solved, and more efficient video data access is achieved.

CN119835464AActive Publication Date: 2025-04-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311329601.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-04-15
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

In the scenario where video creation supports mixed arrangement of multiple videos and multiple pictures, the network overhead between the server and downstream services will inflate, resulting in reduced performance and inefficiency.

Method used

By receiving a video request from the client device, the clip information of the target video is obtained, and the access information of all clips is determined based on the clip information. Only access information of the first type of fragments that do not need to be obtained through downstream services and the second type of fragments that need to be obtained through downstream services are obtained, reducing network overhead.

Benefits of technology

Effectively reduce network overhead between server and downstream services, and improve the efficiency and performance of video data access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835464A_ABST
    Figure CN119835464A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video data access method and device, and relates to the technical field of video transmission. The method comprises the following steps: receiving a first video request sent by client equipment; fragment information of the target video is obtained, the fragment information of the target video comprises labels of all fragments of the target video, and the label of any fragment is used for indicating whether access information of the fragment needs to be obtained through downstream service or not; determining whether to send access information of all segments of the target video to the client device according to the segment information of the target video; if not, access information of all the first-class fragments and access information of all the second-class fragments in the target fragment interval are obtained; the first class of fragments and the second class of fragments are fragments of which access information does not need to be obtained through downstream service and needs to be obtained through downstream service respectively; and sending the access information of each first type of fragment and the access information of each second type of fragment in the target fragment interval to the client device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video transmission technology, and in particular to a method and device for accessing video data. Background Art

[0002] In order to improve the user's video creation experience, relevant technologies can support the creation of videos with multiple videos and multiple pictures mixed together. That is, a video can include multiple native videos and multiple pictures at the same time. The video content corresponding to each video or each picture is called a video clip, and when playing a video including multiple native videos and multiple pictures, the multiple clips are played in sequence from front to back. However, video creation that supports multiple videos and multiple pictures mixed together will cause the network overhead between the server and downstream services to swell to a very large level. Summary of the invention

[0003] In view of this, an embodiment of the present application provides a video transmission and device for reducing network overhead between a server and downstream services.

[0004] In order to achieve the above purpose, the embodiments of the present application provide the following technical solutions:

[0005] In a first aspect, an embodiment of the present application provides a method for accessing video data, including:

[0006] Receiving a first video request sent by a client device;

[0007] In response to the first video request, obtaining segment information of a target video, the target video being any video for which access information is to be sent to the client device, the segment information of the target video including tags of each segment of the target video, the tag of any segment being used to indicate whether access information of the segment needs to be obtained through a downstream service;

[0008] Determining whether to send access information of all segments of the target video to the client device according to the segment information;

[0009] Determine not to send access information of all the segments of the target video to the client device, obtain access information of each first-category segment and access information of each second-category segment within the target segment interval, and send access information of each first-category segment and access information of each second-category segment within the target segment interval to the client device; the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service.

[0010] As an optional implementation of the embodiment of the present application, the determining, according to the segment information of the target video, whether to send access information of all segments of the target video to the client device includes:

[0011] Acquire the total number of segments of the target video according to the segment information of the target video;

[0012] Determine whether the total number of segments of the target video is greater than a preset number of segments;

[0013] If not, determine to send access information of all the segments of the target video to the client device; if so, determine whether the remaining segments excluding the segments in the target segment interval include the second category of segments; if the remaining segments do not include the second category of segments, determine to send access information of all the segments of the target video to the client device; if the remaining segments include the second category of segments, determine not to send access information of all the segments of the target video to the client device.

[0014] As an optional implementation of the embodiment of the present application, before obtaining the access information of each first-category segment and the access information of each second-category segment in the target segment interval, the method further includes:

[0015] Determining the paging direction of the target video;

[0016] The target segment interval is determined according to the paging direction of the target video and a preset interval length.

[0017] As an optional implementation of the embodiment of the present application, determining the paging direction of the target video includes:

[0018] Determining whether the first video request carries direction indication information;

[0019] If not, determining the paging direction order direction of the target video;

[0020] If so, determine the paging direction of the target video in reverse order.

[0021] As an optional implementation of the embodiment of the present application, before obtaining the segment information of the target video in response to the first video request, the method further includes:

[0022] Determining the content of each segment of the target video;

[0023] If the content of the first segment of the target video is a picture, determining that access information of the first segment does not need to be obtained through a downstream service;

[0024] If the content of the second segment of the target video is a picture or video with stickers or a video with stickers, determining that access information of the second segment needs to be obtained through a downstream service;

[0025] According to whether the access information of each segment of the target video needs to be obtained through a downstream service, the segment information of the target video is generated and saved.

[0026] As an optional implementation of the embodiment of the present application, the generating and saving the segment information of the target video according to whether the access information of each segment of the target video needs to be obtained through a downstream service includes:

[0027] Traversing each segment of the target video, if the access information of the current segment does not need to be obtained through the downstream service, setting the tag corresponding to the current segment to the first preset value; if the access information of the current segment needs to be obtained through the downstream service, setting the tag corresponding to the segment to the second preset value, so as to obtain the tag sequence of the target video;

[0028] Acquire segment information of the target video according to the tag sequence;

[0029] The segment information of the target video is saved in a preset storage space.

[0030] As an optional implementation of the embodiment of the present application, the method further includes:

[0031] Generate paging information of the target video, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0032] The paging information of the target video is sent to the client device.

[0033] As an optional implementation of the embodiment of the present application, the method further includes:

[0034] receiving a second video request sent by the client device, where the second video request carries paging information of the target video;

[0035] In response to the second video request, access information of each remaining second-category segment is acquired; the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0036] The access information of each remaining second-category fragment is sent to the client device.

[0037] In a second aspect, an embodiment of the present application provides a method for accessing video data, including:

[0038] Sending a first video request to the server;

[0039] Receive access information of each first-category segment of the target video and access information of each second-category segment within the target segment interval sent by the server, wherein the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service;

[0040] According to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval, the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval are obtained.

[0041] As an optional implementation of the embodiment of the present application, the method further includes:

[0042] Receive paging information of the target video sent by a server, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0043] During the process of playing the target video, determining in real time whether the cached playback time of the target video is less than a threshold time;

[0044] When the cache playback duration is less than the threshold duration, sending a second video request to the server, where the second video request carries paging information of the target video;

[0045] receiving access information of each remaining second-category segment of the target video sent by the server, wherein the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0046] According to the access information of each remaining second-category segment of the target video, the playback data of each remaining second-category segment of the target video is obtained.

[0047] In a third aspect, an embodiment of the present application provides a server, including:

[0048] A receiving unit, configured to receive a first video request sent by a client device;

[0049] an acquisition unit, configured to acquire segment information of a target video in response to the first video request, wherein the target video is any video for which access information is to be sent to the client device, and the segment information of the target video includes tags of each segment of the target video, wherein the tag of any segment is used to indicate whether access information of the segment needs to be acquired through a downstream service;

[0050] a processing unit, configured to determine whether to send access information of all segments of the target video to the client device according to the segment information of the target video, and, if it is determined not to send access information of all segments of the target video to the client device, obtain access information of each first-category segment and access information of each second-category segment in the target segment interval; the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service;

[0051] The sending unit is used to send the access information of each first-category segment and the access information of each second-category segment in the target segment interval to the client device.

[0052] As an optional implementation manner of the embodiment of the present application, the processing unit is specifically used to obtain the total number of segments of the target video according to the segment information of the target video; determine whether the total number of segments of the target video is greater than the preset number of segments; if not, determine to send access information of all segments of the target video to the client device; if so, determine whether the remaining segments other than the segments in the target segment interval include the second category of segments; if the remaining segments do not include the second category of segments, determine to send access information of all segments of the target video to the client device; if the remaining segments include the second category of segments, determine not to send access information of all segments of the target video to the client device.

[0053] As an optional implementation of the embodiment of the present application, the processing unit is also used to determine the paging direction of the target video before obtaining the access information of each first-category fragment and the access information of each second-category fragment in the target fragment interval; determine the target fragment interval according to the paging direction of the target video and the preset interval length.

[0054] As an optional implementation of the embodiment of the present application, the processing unit is specifically used to determine whether the first video request carries direction indication information; if not, determine the paging direction sequence direction of the target video; if so, determine the paging direction reverse direction of the target video.

[0055] As an optional implementation of the embodiment of the present application, the processing unit is also used to determine the content of each segment of the target video before obtaining the segment information of the target video in response to the first video request; if the content of the first segment of the target video is a picture, it is determined that the access information of the first segment does not need to be obtained through a downstream service; if the content of the second segment of the target video is a picture or video with stickers or a video with stickers, it is determined that the access information of the second segment needs to be obtained through a downstream service; based on whether the access information of each segment of the target video needs to be obtained through a downstream service, the segment information of the target video is generated and saved.

[0056] As an optional implementation of the embodiment of the present application, the processing unit is specifically used to traverse each segment of the target video. If the access information of the current segment does not need to be obtained through the downstream service, the tag corresponding to the current segment is set to a first preset value; if the access information of the current segment needs to be obtained through the downstream service, the tag corresponding to the segment is set to a second preset value to obtain a tag sequence of the target video; obtain the segment information of the target video according to the tag sequence; and save the segment information of the target video to a preset storage space.

[0057] As an optional implementation of the embodiment of the present application, the processing unit is further used to generate paging information of the target video, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0058] The sending unit is further used to send the paging information of the target video to the client device.

[0059] As an optional implementation of the embodiment of the present application,

[0060] The receiving unit is further configured to receive a second video request sent by the client device, wherein the second video request carries paging information of the target video;

[0061] The processing unit is further configured to obtain access information of each remaining second-category segment in response to the second video request; the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0062] The sending unit is further configured to send access information of each remaining second-category fragment to the client device.

[0063] In a fourth aspect, an embodiment of the present application provides a client device, including:

[0064] A sending unit, configured to send a first video request to a server;

[0065] A receiving unit, configured to receive access information of each first-category segment of a target video and access information of each second-category segment within a target segment interval sent by a server, wherein the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service;

[0066] An access unit is used to obtain the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval according to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval.

[0067] As an optional embodiment of the present application,

[0068] The sending unit is further used to receive paging information of the target video sent by the server, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0069] The sending unit is further used to determine in real time whether the cached playback time of the target video is less than a threshold time during the process of playing the target video; and when the cached playback time is less than the threshold time, send a second video request to the server, wherein the second video request carries the paging information of the target video;

[0070] The receiving unit is further configured to receive access information of each remaining second-category segment of the target video sent by the server, wherein the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0071] The access unit is further used to obtain the playback data of each remaining second-category segment of the target video according to the access information of each remaining second-category segment of the target video.

[0072] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store a computer program and the processor is used to enable the electronic device to implement the video data access method described in any of the above embodiments when executing the computer program.

[0073] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when the computer program is executed by a computing device, enables the computing device to implement any of the above-mentioned video data access methods.

[0074] In a seventh aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to implement any of the above-mentioned methods for accessing video data.

[0075] The video data access method provided by the embodiment of the present application, upon receiving a first video request sent by a client device, first obtains the segment information of the target video in response to the first video request, then determines whether to send the access information of all the segments of the target video to the client device according to the segment information of the target video, and, if it is determined that the access information of all the segments of the target video is not to be sent to the client device, obtains the access information of each first-category segment and the access information of each second-category segment in the target segment interval, and sends the access information of each first-category segment and the access information of each second-category segment in the target segment interval to the client device. Since the embodiment of the present application, when it is determined that the access information of all the segments of the target video is not to be sent to the client device, only needs to obtain the access information of the first-category segment whose access information does not need to be obtained through the downstream service and the access information of the second-category segment whose access information in the target segment interval needs to be obtained through the downstream service, therefore, compared with obtaining the access information of all the segments in the target video, the embodiment of the present application can reduce the network overhead between the server and the downstream service. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0078] Figure 1 A roadmap of the steps for a client to access video data in a paging data interaction system provided in an embodiment of the present application;

[0079] Figure 2 One of the interactive flow charts of the method for accessing video data provided in the embodiment of the present application;

[0080] Figure 3The second interactive flow chart of the method for accessing video data provided in the embodiment of the present application;

[0081] Figure 4 The third interactive flow chart of the method for accessing video data provided in the embodiment of the present application;

[0082] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0083] Figure 6 A schematic diagram of the structure of a client device provided in an embodiment of the present application;

[0084] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0085] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0086] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0087] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In addition, in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more.

[0088] In the video consumption scenario, the core interface is generally designed to interact with data in a paging mode. Each time the client initiates a request, the server obtains the full access information of the specified number of videos and returns it to the client. In this way, the client can obtain the full playback data of these videos in advance. When the user switches videos, the switched video can be played immediately without additional network requests. Figure 1As shown, under the paging data interaction system, the process of the client accessing video data includes: 1. The client device sends a request to the server. 2. The server determines at least one video to be accessed according to the video recommendation algorithm, the video aggregation algorithm, etc. 3. The server obtains the access information of each video to be accessed. Among them, the access information of the video to be accessed includes: the access address of the native video segment in the video to be accessed, the access address of the picture in the video to be accessed, and the access address of the metadata of the sticker in the video to be accessed. Obtaining the access address of the native video segment in the video to be accessed needs to rely on the downstream service of the server, specifically: sending the ID of the native video segment to the microservice of the video architecture, and receiving the access address of the native video segment returned by the microservice of the video architecture. Obtaining the access address of the picture in the video to be accessed does not need to rely on the downstream service of the server, and can be directly read through the core storage service. Obtaining the access address of the metadata of the sticker in the video to be accessed also needs to rely on the downstream service of the server. 4. The server sends the access information of each video to be accessed to the client device. 5. The client device obtains the playback data of each video to be accessed according to the access information of each video to be accessed. Since the server needs to interact with downstream services in the process of obtaining access information such as the access address of the native video in the video to be accessed and the access address of the sticker metadata, network overhead will be generated between the server and the downstream services in the process of obtaining the access information of the video to be accessed.

[0089] In the business scenario where video creation only supports one video or multiple images, when obtaining the access information of a video, it is only necessary to obtain the access address of one native video at most. Therefore, the network overhead between the server and the downstream service in the process of obtaining the access information of the video to be accessed is still within the acceptable range. However, after video creation supports multiple videos and multiple images mixed, the paging mode of sending full access information is still used to design data interaction. After receiving the request from the client, the server needs to obtain the access information of each segment in each video, and obtaining the access information of a video may require obtaining the access addresses of multiple native videos. Therefore, the network overhead between the server and the downstream service will swell to a very large level. For example: each time the server receives a request from a client device, it determines 10 videos to be accessed. Each video to be accessed includes 100 native video clips. For one request sent by the client device, the server needs to obtain the access addresses of 10*100 native video clips through the downstream service. Even if a single call to the downstream service can obtain the access addresses of 20 native video clips, 50 calls to the downstream service are required. Compared with the business scenario where video creation only supports one video or multiple pictures, the network overhead between the server and the downstream service has expanded 50 times.

[0090] The user's video viewing behavior will cause some of the network overhead between the server and downstream services to be invalid. For example: the server obtains the access information of all the segments of a certain video and sends it to the client device. When watching the video, the user may only watch the first few segments of the video because he is not interested in the video, and then switch to watch other videos, which will cause the network overhead between the server and the downstream service caused by obtaining the access information of the unwatched segments to be invalid. Based on the above content, in order to reduce the network overhead between the server and the downstream services, the embodiment of the present application provides the following technical solution.

[0091] Reference Figure 2 As shown, the embodiment of the present application provides a method for accessing video data, referring to Figure 2 As shown, the method for accessing the video data includes the following steps:

[0092] S201. A client device sends a first video request to a server.

[0093] Correspondingly, the server receives the first video request sent by the client device.

[0094] In some embodiments, the first video request may be a video recommendation request. For example, the terminal device displays videos based on a waterfall view, and monitors in real time whether the number of cached videos is less than a threshold number when the user switches videos by sliding up and down, and triggers the client device to send a video recommendation request to the server when the number of cached videos is less than the threshold number.

[0095] In some embodiments, the first video request may also be a video search request. For example, when a user searches for a video based on a keyword, the client device sends a video search request carrying the keyword to the server. For example, in a daily aggregation scenario where videos posted within a preset time are aggregated into one video, the first video request may be to obtain videos posted by the current user within the preset time.

[0096] S202: The server obtains segment information of the target video in response to the first video request.

[0097] The target video is any video whose access information is to be sent to the client device, and the segment information of the target video includes tags of each segment of the target video. The tag of any segment is used to indicate whether the access information of the segment needs to be obtained through downstream services.

[0098] The target video may include multiple native videos and multiple pictures at the same time, and the video content corresponding to each video or each picture is called a segment of the target video.

[0099] In some embodiments, the implementation method for the server to obtain the segment information of the target video may include: obtaining the identification information of the target video, and reading the segment information of the target video from a preset storage space according to the identification information of the target video and the correspondence between the identification information and the segment information of the target video.

[0100] In some embodiments, the tag of the fragment can be 0 or 1. When the tag of the fragment is 0, it means that the access information of the fragment does not need to be obtained through the downstream service. When the tag of the fragment is 1, it means that the access information of the fragment needs to be obtained through the downstream service.

[0101] S203: The server determines whether to send access information of all segments of the target video to the client device according to the segment information of the target video.

[0102] That is, whether to paginate the target video is determined according to the segment information of the target video, and only the access information of a segment of the target video is sent to the client device.

[0103] In the above step S203, if it is determined to send the access information of all the segments of the target video to the client device, the access information of all the segments of the target video is obtained, and the access information of all the segments of the target video is sent to the client device; if it is determined not to send the access information of all the segments of the target video to the client device, the following step S204 is executed:

[0104] S204: The server obtains access information of each first-category segment and access information of each second-category segment in the target segment interval.

[0105] The first type of fragments are fragments whose access information does not need to be obtained through downstream services, and the second type of fragments are fragments whose access information needs to be obtained through downstream services.

[0106] In some embodiments, access information for obtaining pictures does not need to go through downstream services, while access information for obtaining videos and stickers needs to go through downstream services. Therefore, the first category of clips can be the video content corresponding to the pictures, and the second category of clips can be the video content corresponding to the pictures with stickers, the video content corresponding to the videos, and the video content corresponding to the videos with stickers.

[0107] Since the first category of fragments are fragments whose access information does not need to be obtained through downstream services, the server obtaining the access information of the first category of fragments will not cause network overhead between the server and the downstream service. For the second category of fragments whose access information needs to be obtained through downstream services, only the access information of a part of the second category of fragments (the second category of fragments within the target fragment interval) is obtained, and the access information of the remaining other fragments will be obtained only when needed, and the access information of the remaining other fragments will not be obtained when not needed. Therefore, the embodiment of the present application can reduce the network overhead between the server and the downstream service.

[0108] S205. The server sends access information of each first-category segment and access information of each second-category segment in the target segment interval to the client device.

[0109] Correspondingly, the client device receives the access information of each first-category segment and the access information of each second-category segment in the target segment interval sent by the server.

[0110] S206. The client device obtains the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval according to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval.

[0111] The video data access method provided by the embodiment of the present application, upon receiving a first video request sent by a client device, first obtains the segment information of the target video in response to the first video request, then determines whether to send the access information of all the segments of the target video to the client device according to the segment information of the target video, and, if it is determined that the access information of all the segments of the target video is not to be sent to the client device, obtains the access information of each first-category segment and the access information of each second-category segment in the target segment interval, and sends the access information of each first-category segment and the access information of each second-category segment in the target segment interval to the client device. Since the embodiment of the present application, when it is determined that the access information of all the segments of the target video is not to be sent to the client device, only needs to obtain the access information of the first-category segment whose access information does not need to be obtained through the downstream service and the access information of the second-category segment whose access information in the target segment interval needs to be obtained through the downstream service, therefore, compared with obtaining the access information of all the segments in the target video, the embodiment of the present application can reduce the network overhead between the server and the downstream service.

[0112] As an extension and refinement of the above embodiment, the present application embodiment also provides another method for accessing video data, referring to Figure 3 As shown, the method for accessing the video data includes the following steps:

[0113] S301. A client device sends a first video request to a server.

[0114] Correspondingly, the server receives the first video request sent by the client device.

[0115] S302: The server obtains segment information of the target video in response to the first video request.

[0116] The target video is any video whose access information is to be sent to the client device, and the segment information of the target video includes tags of each segment of the target video. The tag of any segment is used to indicate whether the access information of the segment needs to be obtained through downstream services.

[0117] In some embodiments, the segment information of the target video is pre-generated by the server and stored in a preset storage space. When the segment information of the target video needs to be obtained, it can be directly read from the preset storage space.

[0118] In some embodiments, the implementation method for the server to generate and save the segment information of the target video may include the following steps: determining the content of each segment of the target video; if the content of the first segment of the target video is a picture, determining that the access information of the first segment does not need to be obtained through a downstream service; if the content of the second segment of the target video is a picture or video with stickers or a video with stickers, determining that the access information of the second segment needs to be obtained through a downstream service; based on whether the access information of each segment of the target video needs to be obtained through a downstream service, generating and saving the segment information of the target video.

[0119] In the embodiments of the present application, the bitmap concept can be used to record or save the labels of each segment of the target video (segment information of the target video) with one or more label sequences. In some embodiments, based on whether the access information of each segment of the target video needs to be obtained through a downstream service, the segment information of the target video is generated and saved, including: traversing each segment of the target video, if the access information of the current segment does not need to be obtained through a downstream service, the label corresponding to the current segment is set to a first preset value, if the access information of the current segment needs to be obtained through a downstream service, the label corresponding to the segment is set to a second preset value to obtain the label sequence of the target video; obtain the segment information of the target video according to the label sequence; save the segment information of the target video to a preset storage space.

[0120] Exemplarily, when the first preset value is 0, the second preset value is 1, the target video includes 30 segments, and the first, fourth, fifth, seventh, eleventh, fifteenth, seventeenth, eighteenth, twenty-fourth, twenty-sixth, and twenty-ninth segments of the target video are segments whose access information needs to be obtained through downstream services, and the remaining segments are segments that do not need to be obtained through downstream services, then the tag sequence of the target video can be as follows:

[0121] 100110100010001011000001010010.

[0122] Furthermore, when saving the target video segment information, the target video tag sequence can be directly saved as the target video segment information, and the target video tag sequence can be compressed to reduce the storage space occupied by the target video segment information. For example, the target video tag sequence can be first taken as a decimal number, and converted into a hexadecimal value, and the largest hexadecimal value can be saved as a string attribute.

[0123] It should be noted that, although the bitmap concept can be used to record or save the labels of each segment of the target video (segment information of the target video) in the embodiment of the present application, the storage form of the segment information of the target video is not limited in the embodiment of the present application, and the labels of each segment of the target video can be obtained according to the segment information of the target video. For example: the segment information of the target video can be saved in the form of a mapping relationship table between labels and segment indexes, and for another example: the segment information of the target video can also be saved in the form of a string composed of the label values ​​of each segment.

[0124] S303: The server obtains the total number of segments of the target video according to the segment information of the target video.

[0125] In some embodiments, the total number of segments of the target video may be determined based on tag data in the segment information of the target video.

[0126] S304: The server determines whether the total number of segments of the target video is greater than a preset number of segments.

[0127] In some embodiments, the preset number of segments may be the number of segments within the target segment interval.

[0128] In the above embodiment, if the total number of segments of the target video is less than or equal to the preset number of segments, the following step S305 is performed:

[0129] S305: The server determines to send access information of all segments of the target video to the client device.

[0130] For example, if the total number of segments of the target video is 15 and when paging the video, access information of the first 20 segments needs to be sent for the first time, then there is no need to paging the target video.

[0131] In the above step S304, if the total number of segments of the target video is greater than the preset number of segments, the following step S306 is performed:

[0132] S306: The server determines whether the remaining segments except the segments in the target segment interval include the second type of segments.

[0133] In the above step S306, if the remaining fragments do not include the second type of fragments, obtaining the access information of the remaining fragments will not bring network overhead between the server and the downstream service, so there is no need to paginate the target video, so return to the above step S305 to determine to send the access information of all the fragments of the target video to the client device.

[0134] In the above step S306, if the remaining fragments include the second type of fragments, obtaining access information of the remaining fragments will bring network overhead between the server and the downstream service, so the following step S307 is performed:

[0135] S307: The server determines not to send access information of all segments of the target video to the client device.

[0136] After determining not to send access information of all segments of the target video to the client device, the embodiment of the present application continues to perform the following steps:

[0137] S308: Determine the paging direction of the target video.

[0138] Generally, videos are watched sequentially starting from the first segment, but in some special scenarios, there may be a need to play the video in reverse order from the end. For example, in daily aggregation scenarios, when a user clicks to start playing a video, it will automatically jump to the earliest unread work. At this time, the user may need to play it in reverse order from the back to the front. Therefore, in an embodiment of the present application, the paging direction of the target video can be sequential or reverse.

[0139] S309: Determine the target segment interval according to the paging direction of the target video and a preset interval length.

[0140] In some embodiments, if the paging direction of the target video is sequential, the target segment interval includes a preset interval length of video segments at the head of the target video. For example, if the preset interval length is 20, the target segment interval includes the first 20 segments of the target video.

[0141] In some embodiments, if the target video is paginated in reverse order, the target segment interval includes a preset segment length of video segments at the end of the target video. For example, if the preset segment length is 15, the target segment interval includes the last 15 segments of the target video.

[0142] In some embodiments, determining the paging direction of the target video includes: determining whether the first video request carries direction indication information; if the first video request does not carry indication information, using the default sequential direction as the paging direction of the target video; and if the first video request carries indication information, determining the paging direction of the target video in reverse order.

[0143] S310. The server obtains access information of each first-category segment and access information of each second-category segment in a target segment interval.

[0144] S311. The server sends access information of each first-category segment and access information of each second-category segment in the target segment interval to the client device.

[0145] Correspondingly, the client device receives the access information of each first-category segment and the access information of each second-category segment in the target segment interval sent by the server.

[0146] S312. The client device obtains the playback data of each first-category segment of the target video and the playback data of each second-category segment in the target segment interval according to the access information of each first-category segment of the target video and the access information of each second-category segment in the target segment interval.

[0147] exist Figure 2 The embodiment shown or Figure 3 Based on the embodiment shown, refer to Figure 4 As shown, the method provided in the embodiment of the present application also includes the following steps:

[0148] S401: The server generates paging information of the target video.

[0149] Among them, the paging information includes: at least one of: first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video.

[0150] S402: The server sends paging information of the target video to the client device.

[0151] Correspondingly, the client device receives the paging information of the target video sent by the server.

[0152] It should be noted that the paging information of the target video can be sent to the client device independently, or can be sent to the client device together with the access information of each first-category segment and the access information of each second-category segment in the target segment interval.

[0153] S403: During the process of playing the target video, the client device determines in real time whether the cached playback duration of the target video is less than a threshold duration.

[0154] That is, during the process of playing the target video based on the playback data of each first-category segment of the target video and the playback data of each second-category segment within the target segment interval, the client device determines in real time whether the cached playback time of the target video is less than the threshold time.

[0155] In the above step S403, if the cached playback duration of the target video is less than the threshold duration, the following step S404 is executed:

[0156] S404: The client device sends a second video request to the server.

[0157] Correspondingly, the server receives the second video request sent by the client device.

[0158] The second video request carries the paging information of the target video.

[0159] S405: The server obtains access information of each remaining second-category segment in response to the second video request.

[0160] The remaining second-category segments are the second-category segments in the remaining segments except the target segment interval.

[0161] S406: The server sends access information of each remaining second-category segment to the client device.

[0162] Correspondingly, the client device receives access information of each remaining second-category segment of the target video sent by the server.

[0163] After sending the access information of each first-category fragment and the access information of each second-category fragment in the target fragment interval to the client device, only the access information of the remaining second-category fragments has not been sent to the client device. Therefore, after the server sends the access information of each remaining second-category fragment to the client device, the client device can obtain the full playback data of the target video, thereby supporting the complete playback of the target video.

[0164] S407: The client device obtains the playback data of each remaining second-category segment of the target video according to the access information of each remaining second-category segment of the target video.

[0165] Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application also provides a server and a client device, which corresponds to the above method embodiment. For ease of reading, this embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the server and client device in this embodiment can correspond to all the contents of the above method embodiment.

[0166] The embodiment of the present application provides a server, Figure 5 This is a schematic diagram of the server structure. Figure 5 As shown, the server 500 includes:

[0167] A receiving unit 51 is configured to receive a first video request sent by a client device;

[0168] an acquiring unit 52, configured to acquire, in response to the first video request, segment information of a target video, wherein the target video is any video for which access information is to be sent to the client device, and the segment information of the target video includes tags of each segment of the target video, wherein the tag of any segment is used to indicate whether access information of the segment needs to be acquired through a downstream service;

[0169] The processing unit 53 is used to determine whether to send the access information of all the segments of the target video to the client device according to the segment information of the target video, and obtain the access information of each first-category segment and the access information of each second-category segment in the target segment interval when it is determined not to send the access information of all the segments of the target video to the client device; the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service;

[0170] The sending unit 54 is configured to send access information of each first-category segment and access information of each second-category segment in the target segment interval to the client device.

[0171] As an optional implementation of the embodiment of the present application, the processing unit 53 is specifically used to obtain the total number of segments of the target video according to the segment information of the target video; determine whether the total number of segments of the target video is greater than the preset number of segments; if not, determine to send access information of all segments of the target video to the client device; if so, determine whether the remaining segments other than the segments in the target segment interval include the second category of segments; if the remaining segments do not include the second category of segments, determine to send access information of all segments of the target video to the client device; if the remaining segments include the second category of segments, determine not to send access information of all segments of the target video to the client device.

[0172] As an optional implementation of the embodiment of the present application, the processing unit 53 is also used to determine the paging direction of the target video before obtaining the access information of each first-category fragment and the access information of each second-category fragment in the target fragment interval; determine the target fragment interval according to the paging direction of the target video and the preset interval length.

[0173] As an optional implementation of the embodiment of the present application, the processing unit 53 is specifically used to determine whether the first video request carries direction indication information; if not, determine the paging direction sequence direction of the target video; if so, determine the paging direction reverse direction of the target video.

[0174] As an optional implementation of the embodiment of the present application, the processing unit 53 is also used to determine the content of each segment of the target video before obtaining the segment information of the target video in response to the first video request; if the content of the first segment of the target video is a picture, it is determined that the access information of the first segment does not need to be obtained through the downstream service; if the content of the second segment of the target video is a picture or video with stickers or a video with stickers, it is determined that the access information of the second segment needs to be obtained through the downstream service; based on whether the access information of each segment of the target video needs to be obtained through the downstream service, the segment information of the target video is generated and saved.

[0175] As an optional implementation of the embodiment of the present application, the processing unit 53 is specifically used to traverse each segment of the target video. If the access information of the current segment does not need to be obtained through the downstream service, the tag corresponding to the current segment is set to the first preset value; if the access information of the current segment needs to be obtained through the downstream service, the tag corresponding to the segment is set to the second preset value to obtain the tag sequence of the target video; obtain the segment information of the target video according to the tag sequence; and save the segment information of the target video to the preset storage space.

[0176] As an optional implementation of the embodiment of the present application, the processing unit 53 is further used to generate paging information of the target video, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0177] The sending unit 54 is further configured to send the paging information of the target video to the client device.

[0178] As an optional implementation of the embodiment of the present application,

[0179] The receiving unit 51 is further configured to receive a second video request sent by the client device, wherein the second video request carries paging information of the target video;

[0180] The processing unit 53 is further configured to obtain access information of each remaining second-category segment in response to the second video request; the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0181] The sending unit 54 is further configured to send access information of each remaining second-category segment to the client device.

[0182] The present application embodiment provides a client device, Figure 6 is a schematic diagram of the structure of the client device, such as Figure 6 As shown, the client device 600 includes:

[0183] A sending unit 61, configured to send a first video request to a server;

[0184] The receiving unit 62 is used to receive access information of each first-category segment of the target video and access information of each second-category segment in the target segment interval sent by the server, wherein the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service;

[0185] The access unit 63 is used to obtain the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval according to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval.

[0186] As an optional embodiment of the present application,

[0187] The sending unit 61 is further used to receive paging information of the target video sent by the server, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video;

[0188] The sending unit 61 is further configured to determine in real time whether the cached playback time of the target video is less than a threshold time during the playback of the target video; and when the cached playback time is less than the threshold time, send a second video request to the server, wherein the second video request carries the paging information of the target video;

[0189] The receiving unit 62 is further configured to receive access information of each remaining second-category segment of the target video sent by the server, wherein the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval;

[0190] The access unit 63 is further configured to obtain the playback data of each remaining second-category segment of the target video according to the access information of each remaining second-category segment of the target video.

[0191] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 7 As shown, the electronic device provided in this embodiment includes: a memory 701 and a processor 702, wherein the memory 701 is used to store a computer program, and the processor 702 is used to execute the video data access method provided in the above embodiment when executing the computer program.

[0192] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computing device implements the video data access method provided in the above embodiment.

[0193] Based on the same inventive concept, an embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computing device implements the video data access method provided in the above embodiment.

[0194] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.

[0195] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0196] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0197] Computer readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application 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 or all of the technical features therein, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for accessing video data, characterized in that: include: Receiving a first video request sent by a client device; In response to the first video request, obtaining segment information of a target video, the target video being any video for which access information is to be sent to the client device, the segment information of the target video including tags of each segment of the target video, the tag of any segment being used to indicate whether access information of the segment needs to be obtained through a downstream service; Determining whether to send access information of all segments of the target video to the client device according to the segment information of the target video; Determine not to send access information of all the segments of the target video to the client device, obtain access information of each first-category segment and access information of each second-category segment within the target segment interval, and send access information of each first-category segment and access information of each second-category segment within the target segment interval to the client device; the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service.

2. The method according to claim 1, characterized in that The determining, according to the segment information of the target video, whether to send access information of all segments of the target video to the client device comprises: Acquire the total number of segments of the target video according to the segment information of the target video; Determine whether the total number of segments of the target video is greater than a preset number of segments; If not, determine to send access information of all the segments of the target video to the client device; if so, determine whether the remaining segments excluding the segments in the target segment interval include the second category of segments; if the remaining segments do not include the second category of segments, determine to send access information of all the segments of the target video to the client device; if the remaining segments include the second category of segments, determine not to send access information of all the segments of the target video to the client device.

3. The method according to claim 1, characterized in that Before obtaining access information of each first-category segment and access information of each second-category segment in the target segment interval, the method further includes: Determining the paging direction of the target video; The target segment interval is determined according to the paging direction of the target video and a preset interval length.

4. The method according to claim 3, characterized in that Determining the paging direction of the target video includes: Determining whether the first video request carries direction indication information; If not, determining the paging direction order direction of the target video; If so, determine the paging direction of the target video in reverse order.

5. The method according to claim 1, characterized in that Before acquiring the segment information of the target video in response to the first video request, the method further includes: Determining the content of each segment of the target video; If the content of the first segment of the target video is a picture, determining that access information of the first segment does not need to be obtained through a downstream service; If the content of the second segment of the target video is a picture or video with stickers or a video with stickers, determining that access information of the second segment needs to be obtained through a downstream service; According to whether the access information of each segment of the target video needs to be obtained through a downstream service, the segment information of the target video is generated and saved.

6. The method according to claim 5, characterized in that The generating and saving the segment information of the target video according to whether the access information of each segment of the target video needs to be obtained through a downstream service includes: Traversing each segment of the target video, if the access information of the current segment does not need to be obtained through the downstream service, setting the tag corresponding to the current segment to the first preset value; if the access information of the current segment needs to be obtained through the downstream service, setting the tag corresponding to the segment to the second preset value, so as to obtain the tag sequence of the target video; Acquire segment information of the target video according to the tag sequence; The segment information of the target video is saved in a preset storage space.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Generate paging information of the target video, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video; The paging information of the target video is sent to the client device.

8. The method according to claim 7, characterized in that The method further comprises: receiving a second video request sent by the client device, where the second video request carries paging information of the target video; In response to the second video request, access information of each remaining second-category segment is acquired; the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval; The access information of each remaining second-category fragment is sent to the client device.

9. A method for accessing video data, characterized in that: include: Sending a first video request to the server; Receive access information of each first-category segment of the target video and access information of each second-category segment within the target segment interval sent by the server, wherein the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service; According to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval, the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval are obtained.

10. The method according to claim 9, characterized in that The method further comprises: Receive paging information of the target video sent by a server, the paging information including: at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate that the target video also includes remaining segments other than the target segment interval; the second indication information is used to indicate the starting position of the remaining segments, and the third indication information is used to indicate the paging direction of the target video; During the process of playing the target video, determining in real time whether the cached playback time of the target video is less than a threshold time; When the cache playback duration is less than the threshold duration, sending a second video request to the server, where the second video request carries paging information of the target video; receiving access information of each remaining second-category segment of the target video sent by the server, wherein the remaining second-category segments are the second-category segments in the remaining segments except the target segment interval; According to the access information of each remaining second-category segment of the target video, the playback data of each remaining second-category segment of the target video is obtained.

11. A server, characterized in that: include: A receiving unit, configured to receive a first video request sent by a client device; an acquisition unit, configured to acquire segment information of a target video in response to the first video request, wherein the target video is any video for which access information is to be sent to the client device, and the segment information of the target video includes tags of each segment of the target video, wherein the tag of any segment is used to indicate whether access information of the segment needs to be acquired through a downstream service; a processing unit, configured to determine whether to send access information of all segments of the target video to the client device according to the segment information of the target video, and, if it is determined not to send access information of all segments of the target video to the client device, obtain access information of each first-category segment and access information of each second-category segment in the target segment interval; the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service; The sending unit is used to send the access information of each first-category segment and the access information of each second-category segment in the target segment interval to the client device.

12. A client device, characterized in that: include: A sending unit, configured to send a first video request to a server; A receiving unit, configured to receive access information of each first-category segment of a target video and access information of each second-category segment within a target segment interval sent by a server, wherein the first-category segment is a segment whose access information does not need to be obtained through a downstream service, and the second-category segment is a segment whose access information needs to be obtained through a downstream service; An access unit is used to obtain the playback data of each first category segment of the target video and the playback data of each second category segment in the target segment interval according to the access information of each first category segment of the target video and the access information of each second category segment in the target segment interval.

13. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program and the processor is used to enable the electronic device to implement the video data access method according to any one of claims 1 to 10 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the method for accessing video data according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Video processing method and device

    CN108156528A

  • Video service processing method and device

    CN114374860A

  • Interactive video distribution system and video player utilizing a client server architecture

    US20190268650A1

  • Installation and scaling for vcores

    US20210360319A1