A video scheduling method, device, apparatus and readable storage medium

By logically dividing video files into blocks and generating a mapping table, the problems of resource node unavailability and massive requests in video scheduling are solved, thus improving video scheduling efficiency.

CN116541553BActive Publication Date: 2026-05-05HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Filing Date
2023-05-31
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In the current video scheduling process, overly coarse or overly fine scheduling dimensions can cause resource nodes to become unavailable or generate massive scheduling requests, resulting in low video scheduling efficiency.

Method used

By logically dividing video files into blocks and generating a logical block mapping table, the storage capacity of resource nodes can be adapted to avoid massive scheduling requests and improve video scheduling efficiency.

Benefits of technology

It enables the adaptation of resource node storage capabilities when storing video files, avoiding massive scheduling requests and improving the efficiency of video scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541553B_ABST
    Figure CN116541553B_ABST
Patent Text Reader

Abstract

This application discloses a video scheduling method, apparatus, device, and readable storage medium, comprising: acquiring multiple segments of a video file to be stored; storing the multiple segments in a resource node cluster and recording the storage addresses of the multiple segments; determining a logical block partitioning strategy for the video file to be stored; generating a logical block mapping table corresponding to the video file to be stored based on the logical block partitioning strategy, the multiple segments, and the storage addresses of the multiple segments; and storing the logical block mapping table corresponding to the video file to be stored. As can be seen, this application, by logically partitioning the video file and generating a logical block mapping table, enables scheduling of the video file at the logical block level. This allows for adaptation to the storage capacity of resource nodes when storing the video file and avoids generating massive scheduling requests, thereby improving the efficiency of video scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video data processing, and more specifically, to a video scheduling method, apparatus, device, and readable storage medium. Background Technology

[0002] Video scheduling refers to various technologies that capture, record, process, store, transmit, and reproduce a series of still images using electrical signals. In existing video scheduling processes, the problem of scheduling dimensions being too coarse or too fine is frequently encountered. Specifically, if scheduling is performed based on the entire video, resource nodes need to store the full amount of video data; if a segment is corrupted or a disk fails, the node becomes unusable. If scheduling is performed based on individual slices, each access to a slice requires requesting the next slice's access address from the scheduler, resulting in massive scheduling requests. This not only increases access latency but also puts enormous pressure on resource nodes, significantly reducing their task processing efficiency and ultimately leading to inefficient overall video scheduling. Summary of the Invention

[0003] This application provides a video scheduling method, apparatus, device, and readable storage medium that can adapt to the storage capacity of resource nodes when storing video files and can avoid generating massive scheduling requests during scheduling, thereby improving the efficiency of video scheduling.

[0004] In view of this, embodiments of this application provide a video scheduling method, including:

[0005] Retrieve multiple segments of the video file to be stored;

[0006] The multiple sharded data are stored in a resource node cluster, and the storage addresses of the multiple sharded data are recorded;

[0007] Determine the logical block segmentation strategy for the video file to be stored;

[0008] Based on the logical block partitioning strategy, the multiple fragment data, and the storage addresses of the multiple fragment data, a logical block mapping table corresponding to the video file to be stored is generated. The logical block mapping table includes the correspondence between multiple logical blocks and the multiple fragment data, as well as the storage addresses of the multiple fragment data. Each logical block corresponds to at least one fragment data.

[0009] Store the logical block mapping table corresponding to the video file to be stored.

[0010] Optionally, determining the logical block mapping table corresponding to the video file to be stored based on the logical block strategy, the multiple fragment data, and the storage addresses of the multiple fragment data includes:

[0011] The video file to be stored is divided into blocks according to the logical block division strategy to obtain multiple logical blocks of the video file to be stored.

[0012] Determine the data fragments corresponding to each logical block;

[0013] The logical block mapping table is generated based on each logical block, the correspondence between each logical block and the fragment data, and the storage address of the fragment data.

[0014] Optionally, the table storing the logical block mapping relationship corresponding to the video file to be stored includes:

[0015] Generate the identification information of the video file to be stored and the strategy number of the logical block division strategy;

[0016] Generate the correspondence between the logical block mapping table and the identification information and the strategy number;

[0017] The logical block mapping table and the correspondence between the logical block mapping table, the identification information, and the strategy number are stored in memory.

[0018] Optionally, after storing the logical block mapping table corresponding to the video file to be stored, the method further includes:

[0019] The number of lookups in the stored logical block mapping table is retrieved every preset period.

[0020] The logical block mapping table corresponding to the number of lookups below a preset threshold is transferred from memory to local storage.

[0021] Optionally, the method further includes:

[0022] Receive a video scheduling request sent by a terminal device, wherein the video scheduling request includes the identification information of the target video file;

[0023] The logical relationship mapping table corresponding to the target video file is searched based on the identification information of the target video file.

[0024] The storage address of the target video file corresponding to the target video file is obtained according to the logical relationship mapping table corresponding to the target video file.

[0025] The target shard data is obtained from the resource node cluster according to the storage address of the target shard data;

[0026] The target fragment data is sent to the terminal device.

[0027] Optionally, the video scheduling request may further include a strategy number;

[0028] The step of searching the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file includes:

[0029] The logical relationship mapping table corresponding to the target video file is searched based on the identification information of the target video file and the strategy number.

[0030] This application embodiment also provides a video scheduling device, the device comprising:

[0031] The acquisition unit is used to acquire multiple segments of data from the video file to be stored.

[0032] A storage unit is used to store the multiple sharded data in a resource node cluster and record the storage addresses of the multiple sharded data.

[0033] A determining unit is used to determine the logical block segmentation strategy of the video file to be stored;

[0034] The generation unit is used to generate a logical block mapping table corresponding to the video file to be stored according to the logical block strategy, the multiple fragment data and the storage address of the multiple fragment data. The logical block mapping table includes the correspondence between multiple logical blocks and the multiple fragment data and the storage address of the multiple fragment data. Each logical block corresponds to at least one fragment data.

[0035] The storage unit is also used to store the logical block mapping table corresponding to the video file to be stored.

[0036] Optionally, the device further includes:

[0037] The receiving unit is used to receive a video scheduling request sent by the terminal device, wherein the video scheduling request includes the identification information of the target video file;

[0038] The lookup unit is used to look up the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file;

[0039] The acquisition unit is further configured to obtain the storage address of the target segment data corresponding to the target video file according to the logical relationship mapping table corresponding to the target video file;

[0040] The acquisition unit is further configured to acquire the target shard data from the resource node cluster according to the storage address of the target shard data;

[0041] The sending unit is used to send the target fragment data to the terminal device.

[0042] This application also provides a computer device, including: a memory, a processor, and a bus system;

[0043] The memory is used to store programs;

[0044] The processor is used to execute the program in the memory to implement any of the video scheduling methods described above;

[0045] The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.

[0046] This application also provides a computer-readable storage medium storing instructions that, when run on a computer, cause the computer to execute any of the video scheduling methods described above.

[0047] This application provides a video scheduling method, including: acquiring multiple segments of a video file to be stored; storing the multiple segments in a resource node cluster and recording the storage addresses of the multiple segments; determining a logical block strategy for the video file to be stored; generating a logical block mapping table corresponding to the video file to be stored based on the logical block strategy, the multiple segments, and the storage addresses of the multiple segments, wherein the logical block mapping table includes the correspondence between multiple logical blocks and the multiple segments, and the storage addresses of the multiple segments, with each logical block corresponding to at least one segment; and storing the logical block mapping table corresponding to the video file to be stored. As can be seen, this application, by logically dividing the video file and generating a logical block mapping table, enables scheduling of the video file at the logical block level, thereby adapting the storage capacity of resource nodes when storing the video file and avoiding the generation of massive scheduling requests, thus improving the efficiency of video scheduling. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0049] Figure 1 A flowchart illustrating a video scheduling method provided in an embodiment of this application;

[0050] Figure 2 A schematic diagram of the structure of a logical block mapping relationship table provided in an embodiment of this application;

[0051] Figure 3 A schematic diagram of the hierarchical structure of a video scheduling method provided in an embodiment of this application;

[0052] Figure 4 A flowchart illustrating another video scheduling method provided in an embodiment of this application;

[0053] Figure 5 This is a schematic diagram of the structure of a video scheduling device provided in an embodiment of this application. Detailed Implementation

[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] Video scheduling refers to various technologies that capture, record, process, store, transmit, and reproduce a series of still images using electrical signals. In existing video scheduling processes, the problem of scheduling dimensions being too coarse or too fine is frequently encountered. Specifically, if scheduling is performed based on the entire video, resource nodes need to store the full amount of video data; if a segment is corrupted or a disk fails, the node becomes unusable. If scheduling is performed based on individual slices, each access to a slice requires requesting the next slice's access address from the scheduler, resulting in massive scheduling requests. This not only increases access latency but also puts enormous pressure on resource nodes, significantly reducing their task processing efficiency and ultimately leading to inefficient overall video scheduling.

[0057] Therefore, to address the above-mentioned problems, this application provides a video scheduling method, apparatus, device, and readable storage medium that can adapt to the storage capacity of resource nodes when storing video files and can avoid generating a massive number of scheduling requests during scheduling, thereby improving the efficiency of video scheduling.

[0058] Please see Figure 1 The video scheduling method provided in this application includes the following steps.

[0059] S101. Obtain multiple segments of the video file to be stored.

[0060] In this embodiment, the video file to be stored can be obtained from the video management system during off-peak network usage periods, or uploaded by technicians. Then, the video file is sliced ​​to obtain multiple segments. Specifically, the segmented data can be divided according to a fixed file size, for example, using a segmentation access protocol such as HLS or DASH to slice the video file and obtain multiple segments. Furthermore, after obtaining the segmented data, it can be named, and the size, duration, and sequence of each segment can be added to the filename to facilitate verification during subsequent video scheduling.

[0061] S102. Store the multiple sharded data in the resource node cluster and record the storage address of the multiple sharded data.

[0062] In this embodiment, after acquiring multiple segments of the video file to be stored, each segment can be stored in a resource node cluster, and the storage address of each segment can be recorded. It is understood that, based on the storage capacity of each resource node in the cluster, the multiple segments of the video file to be stored can be stored in resource nodes with sufficient storage space. Specifically, the free space of each resource node can be obtained first. If the size of the free space is greater than the size of the segment data, the segment data can be stored in that resource node. The resource node with the largest free space can be preferentially selected for storage, thereby maximizing the storage utilization of the resource nodes and adapting to their storage capabilities.

[0063] It should be noted that a resource node group can include multiple resource nodes, among which the resource nodes can be PCDN (P2PCDN) resource nodes.

[0064] S103. Determine the logical block division strategy for the video file to be stored.

[0065] In this embodiment, multiple logical segmentation strategies can be pre-set, and then the logical segmentation strategy for the video file to be stored can be determined from these strategies according to actual needs. Specifically, the logical segmentation strategy can segment the video file according to its duration or file size. For example, strategy 1: segment the video file into 30MB blocks; strategy 2: segment the video file into 10-second blocks; strategy 3: segment the video file into 20MB blocks. Each strategy has a unique strategy name, such as size30 for strategy 1, dur10 for strategy 2, and size20 for strategy 3.

[0066] S104. Generate a logical block mapping table corresponding to the video file to be stored based on the logical block strategy, the multiple block data, and the storage addresses of the multiple block data.

[0067] In this embodiment, after determining the logical segmentation strategy of the video file to be stored, a logical segmentation mapping table corresponding to the video file to be stored can be generated based on the logical segmentation strategy, multiple segments of the video file to be stored, and the storage addresses of these segments. It is understood that the logical segmentation mapping table can include the correspondence between multiple logical segments and multiple segments of data, as well as the storage addresses of these segments, with each logical segment corresponding to at least one segment of data. The logical segmentation mapping table can be as follows: Figure 2As shown, this illustrates the correspondence between some logical blocks and their corresponding storage addresses. The logical block mapping table can be implemented using a list hash, a combination of array and linked list. The array stores the block number, and the linked list stores the original sequence of fragment units. By constructing the logical block mapping table, when reading and scheduling the video file to be stored, the storage address of each fragment can be directly read from the logical block mapping table, and each fragment can be scheduled directly, without needing to access and schedule fragment data one by one, thus avoiding massive scheduling requests and improving the efficiency of video scheduling.

[0068] In one possible implementation, the video file to be stored can first be divided into blocks according to a logical block partitioning strategy, resulting in multiple logical blocks of the video file to be stored; the corresponding fragment data for each logical block can be determined; and a logical block mapping table can be generated based on each logical block, the correspondence between each logical block and its fragment data, and the storage address of the fragment data. It is understandable that, as... Figure 3 As shown, in this embodiment, there is a logical block hierarchy between the underlying storage layer and the video layer. After the video file to be stored is virtually divided into multiple logical blocks according to the logical block strategy, it is necessary to first determine which data segments each logical block corresponds to, then establish the correspondence between each logical block and the corresponding data segments, and then establish the correspondence between the storage addresses of each logical block and the corresponding data segments, finally forming a complete logical block mapping table.

[0069] S105. Store the logical block mapping table corresponding to the video file to be stored.

[0070] In this embodiment, after generating the logical block mapping table corresponding to the video file to be stored, the logical block mapping table can be stored. This allows for direct reading of the storage address of each data segment and scheduling of each data segment during subsequent scheduling of the video file, eliminating the need to access and schedule data segments one by one, thus avoiding massive scheduling requests and improving video scheduling efficiency. It is understood that a video file to be stored can have multiple corresponding logical block mapping tables; that is, the video file to be stored can be logically divided into blocks according to multiple logical strategies, and a logical block mapping table corresponding to each logical strategy can be generated and stored.

[0071] In one possible implementation, identification information and a policy number for the logical segmentation strategy of the video file to be stored can be generated; a logical segmentation mapping table can be generated to correspond with the identification information and the policy number; and the logical segmentation mapping table and the correspondence between the logical segmentation mapping table and the identification information and the policy number can be stored in memory. It can be understood that after generating the logical segmentation mapping table for the video file to be stored based on a certain logical segmentation strategy, the identification information and the policy number of the logical segmentation strategy of the video file to be stored can be generated, and the correspondence between the identification information, the policy number, and the logical segmentation mapping table can be established and stored so that the required logical segmentation mapping table can be accurately found during subsequent video scheduling.

[0072] In one possible implementation, the number of lookups in the stored logical block mapping table can be retrieved at preset intervals; logical block mapping tables with lookups below a preset threshold are then moved from memory to local storage. It's understandable that, since each video file corresponds to one or more logical block mapping tables, caching a massive number of these tables in memory would consume significant memory resources. Therefore, less frequently used logical mapping tables can be moved from memory to local storage, thus alleviating memory storage pressure.

[0073] In one possible implementation, a video scheduling request sent by a terminal device can be received. This request includes the identification information of a target video file. The process involves: finding the logical relationship mapping table corresponding to the target video file based on its identification information; obtaining the storage address of the target segment data corresponding to the target video file based on the logical relationship mapping table; retrieving the target segment data from the resource node cluster based on its storage address; and sending the target segment data to the terminal device. It is understood that upon receiving a video scheduling request from the terminal device, the logical relationship mapping table corresponding to the target video file can be obtained directly from the target video file's identification information. This allows for direct reading of the storage address of each target segment data from the logical block mapping table and scheduling of each target segment data. This eliminates the need to access and schedule segment data one by one, thus avoiding a massive number of scheduling requests and improving the efficiency of video scheduling.

[0074] In one possible implementation, the video scheduling request also includes a policy number; then, the logical relationship mapping table corresponding to the target video file can be looked up based on the target video file's identifier information and the policy number. It is understood that the terminal device can choose which logical segmentation strategy to use for scheduling the target video file, that is, it can select this by sending a video scheduling request including the policy number. After receiving the video scheduling request, the server can look up the logical segmentation mapping table corresponding to the target video file's identifier information and the policy number to schedule the target video file.

[0075] Furthermore, if the server cannot find the logical block mapping table corresponding to the identifier information of the target video file and the policy number, it can first obtain the logical block mapping table corresponding only to that identifier information, then obtain all target segment data corresponding to the target video file; find the target logical block strategy corresponding to the policy number, logically block the target segment data according to the target logical block strategy and generate a target logical block mapping table, store the target logical block mapping table, schedule the target segment data according to the target logical block mapping table, and finally return the target segment data to the terminal device. Since changes in the logical block strategy do not cause changes to the underlying segment data storage, but only change the corresponding logical block mapping table, the required logical block mapping table can be reconstructed based on the underlying stored segment data. That is, the loss of the critical logical block mapping table will not cause a cascading failure of nodes and servers, and access services can be restored in a short time.

[0076] Therefore, this application provides a video scheduling method that can logically divide video files into blocks and generate a logical block mapping table for video files. This allows scheduling of the video file to be performed at the level of logical blocks, thereby enabling the storage capacity of resource nodes to be adapted when storing video files and avoiding the generation of massive scheduling requests during scheduling, thus improving the efficiency of video scheduling.

[0077] The following section will introduce specific application scenarios. Please refer to [link / reference]. Figure 4 The video scheduling method provided in this application includes:

[0078] 1. The underlying segment data of video files is stored according to fixed file lengths or original segment files. For a single file, such as mp4, mp3, or flv video files, segments are divided according to fixed file lengths; for segment access protocols such as HLS and DASH, the original segments are organized and stored. Segment data naming requires adding the segment size, duration, and segment sequence to the segment file name. The advantage of this convention is that the logical block mapping table can be reconstructed by scanning the segment data files.

[0079] 2. A single video can be divided into multiple chunking strategies. For example, Strategy 1: chunks of 30MB each; Strategy 2: chunks of 10-second duration each; Strategy 3: chunks of 20MB each. A corresponding logical chunking mapping table is generated based on the video name and strategy number. For example, if there are strategies 1, 2, and 3, three logical chunking mapping tables will be generated respectively. Each strategy has a unique strategy name, such as Strategy 1: size30, Strategy 2: dur10, and Strategy 3: size20. A globally unique hexadecimal UUID is generated based on the video access URI. The UUID calculation can use common hash algorithms such as MD5 or SHA-1. Each logical chunking mapping table is cached in memory and then persisted to local storage as needed.

[0080] 3. First, based on step 2, calculate the UUID hexadecimal string corresponding to the video. Second, create a video directory, where the directory name is the UUID hexadecimal string; if special characters are present, they need to be escaped. Finally, the underlying segmentation data and the logical block mapping table are stored in the same video directory.

[0081] 4. Each video corresponds to one or more logical block mapping tables. Caching these massive amounts of logical block mapping tables in memory consumes significant memory resources. The LFU algorithm replaces the least frequently accessed logical block mapping tables with those in storage to reduce memory usage. One improvement to the LFU algorithm is that the most recently replaced logical block mapping tables in memory have a minimum retention time, defaulting to 3 seconds, to prevent frequently swapping in and out mapping tables that have just started to be accessed.

[0082] 5. The logical block mapping table is implemented using list hashing, which is a combination of array and linked list. The array stores the block number, and the linked list stores the original slice unit sequence.

[0083] 6. A mapping table between fragment unit sequence numbers and fragment unit filenames is cached in memory and persisted to local storage, stored in the video directory. This mapping table stores information for all video fragment units and is implemented using an array. Once generated, it does not need to be regenerated. The length of the array is also the number of fragment units.

[0084] 7. Resource nodes store all segment unit data of logical blocks according to the strategy, and also report the logical block relationship mapping table of all video segments to the server. The scheduling center in the server caches the logical block mapping table in the DB. If the segment unit data is already stored in the node, but the logical block relationship mapping table corresponding to the segmentation strategy is missing or not available, how can the node also provide segment unit data access service? The implementation process is as follows: 1) Based on the segmentation strategy name, segment number, and segment unit file name in the video scheduling request sent by the terminal device, the strategy name, logical segment number, and segment unit sequence number (the sequence number is stored in the file name naming rule) can be obtained. 2) If the node does not find the corresponding strategy name in the reported logical block mapping table, it searches in the existing logical block mapping table. If the original segment unit sequence number is found, the corresponding strategy number and logical block number are returned. 3) The corresponding strategy number and logical block number are returned to the player. 4) After reading the returned information, the player requests the node to provide data access with the new strategy name and logical block number. 5) In this way, as long as there is sharded unit data in the node, the node can still provide access services.

[0085] 8. The logical block mapping table reported to the server is represented using Columbus exponential encoding. The data structure is as follows: total number of logical blocks, number of shard units corresponding to logical block 1, number of shard units corresponding to logical block 2, and number of shard units corresponding to logical block k. Compared to JSON encoding, Columbus exponential encoding significantly reduces cache size and improves decoding efficiency.

[0086] 9. To facilitate quick location of whether fragment data exists in a node, the resource node also reports the storage status of the fragment data in bitmap format. From left to right, each bit being 1 indicates that the fragment data with the corresponding fragment number exists, and 0 indicates that it does not exist. The scheduling service can quickly determine whether access is possible by looking up the corresponding video fragment data bitmap.

[0087] The preceding nine steps achieve efficient mapping from logical blocks to underlying fragmented data. Furthermore, a single video can correspond to multiple different block strategies, allowing for the selection of the most suitable strategy based on node storage capacity, thus improving node storage utilization. Simultaneously, as long as fragmented data exists on the node, the server can still provide access methods for different block strategies, ensuring continuous server availability. Access will not be unavailable due to the loss or anomaly of the logical block mapping table, thereby improving server access stability.

[0088] Please see Figure 5 This application also provides a video scheduling device, including:

[0089] Acquisition unit 501 is used to acquire multiple segments of data from the video file to be stored.

[0090] Storage unit 502 is used to store the multiple fragmented data in a resource node cluster and record the storage address of the multiple fragmented data;

[0091] The determining unit 503 is used to determine the logical block division strategy of the video file to be stored.

[0092] The generation unit 504 is used to generate a logical block mapping table corresponding to the video file to be stored according to the logical block strategy, the multiple fragment data and the storage address of the multiple fragment data. The logical block mapping table includes the correspondence between multiple logical blocks and the multiple fragment data and the storage address of the multiple fragment data. Each logical block corresponds to at least one fragment data.

[0093] Storage unit 502 is also used to store the logical block mapping relationship table corresponding to the video file to be stored.

[0094] Optionally, the generation unit 504 specifically includes:

[0095] The segmentation subunit is used to segment the video file to be stored into multiple logical segments of the video file to be stored according to the logical segmentation strategy.

[0096] The sub-unit is used to determine the data slices corresponding to each logical block;

[0097] The first generation subunit is used to generate the logical block mapping table based on each logical block, the correspondence between each logical block and the fragment data, and the storage address of the fragment data.

[0098] Optionally, the storage unit 502 specifically includes:

[0099] The second generation subunit is used to generate the identification information of the video file to be stored and the strategy number of the logical block division strategy;

[0100] The third generation subunit is used to generate the correspondence between the logical block mapping table and the identification information and the strategy number;

[0101] The storage subunit is used to store the logical block mapping table and the correspondence between the logical block mapping table, the identification information, and the strategy number in memory.

[0102] Optionally, the method further includes:

[0103] The acquisition unit 501 is also used to acquire the number of lookups in the stored logical block mapping relationship table every preset period.

[0104] The transfer unit is used to transfer the logical block mapping table corresponding to the number of lookups below a preset threshold from memory to local storage.

[0105] Optionally, the device further includes:

[0106] The receiving unit is used to receive a video scheduling request sent by the terminal device, wherein the video scheduling request includes the identification information of the target video file;

[0107] The lookup unit is used to look up the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file;

[0108] The acquisition unit is further configured to obtain the storage address of the target segment data corresponding to the target video file according to the logical relationship mapping table corresponding to the target video file;

[0109] The acquisition unit is further configured to acquire the target shard data from the resource node cluster according to the storage address of the target shard data;

[0110] The sending unit is used to send the target fragment data to the terminal device.

[0111] Optionally, the video scheduling request further includes a strategy number, and the search unit is specifically used to search the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file and the strategy number.

[0112] Therefore, this application provides a video scheduling device that can logically divide video files into blocks and generate a logical block mapping table for video files. This allows scheduling of the video file to be performed at the level of logical blocks, thereby enabling the storage capacity of resource nodes to be adapted when storing video files and avoiding the generation of massive scheduling requests during scheduling, thus improving the efficiency of video scheduling.

[0113] This application also provides a computer device, including: a memory, a processor, and a bus system;

[0114] The memory is used to store programs;

[0115] The processor is used to execute the program in the memory to implement any of the video scheduling methods described above;

[0116] The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.

[0117] This application also provides a computer-readable storage medium storing instructions that, when run on a computer, cause the computer to execute any of the video scheduling methods described above.

[0118] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0119] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A video scheduling method, characterized in that, The method includes: Retrieve multiple segments of the video file to be stored; The multiple sharded data are stored in a resource node cluster, and the storage addresses of the multiple sharded data are recorded; Determine the logical block segmentation strategy for the video file to be stored; The video file to be stored is virtually divided into blocks according to the logical block division strategy to obtain multiple logical blocks of the video file to be stored. Based on the logical block partitioning strategy, the multiple fragment data, and the storage addresses of the multiple fragment data, a logical block mapping table corresponding to the video file to be stored is generated. The logical block mapping table includes the correspondence between multiple logical blocks and the multiple fragment data, as well as the storage addresses of the multiple fragment data. Each logical block corresponds to at least one fragment data. Store the logical block mapping table corresponding to the video file to be stored.

2. The method according to claim 1, characterized in that, The step of determining the logical block mapping table corresponding to the video file to be stored based on the logical block strategy, the multiple fragment data, and the storage addresses of the multiple fragment data includes: Determine the data fragments corresponding to each logical block; The logical block mapping table is generated based on each logical block, the correspondence between each logical block and the fragment data, and the storage address of the fragment data.

3. The method according to claim 1, characterized in that, The logical block mapping table corresponding to the video file to be stored includes: Generate the identification information of the video file to be stored and the strategy number of the logical block division strategy; Generate the correspondence between the logical block mapping table and the identification information and the strategy number; The logical block mapping table and the correspondence between the logical block mapping table, the identification information, and the strategy number are stored in memory.

4. The method according to claim 3, characterized in that, After storing the logical block mapping table corresponding to the video file to be stored, the method further includes: The number of lookups in the stored logical block mapping table is retrieved every preset period. The logical block mapping table corresponding to the number of lookups below a preset threshold is transferred from memory to local storage.

5. The method according to claim 1, characterized in that, The method further includes: Receive a video scheduling request sent by a terminal device, wherein the video scheduling request includes the identification information of the target video file; The logical relationship mapping table corresponding to the target video file is searched based on the identification information of the target video file. The storage address of the target video file corresponding to the target video file is obtained according to the logical relationship mapping table corresponding to the target video file. The target shard data is obtained from the resource node cluster according to the storage address of the target shard data; The target fragment data is sent to the terminal device.

6. The method according to claim 5, characterized in that, The video scheduling request also includes a strategy number; The step of searching the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file includes: The logical relationship mapping table corresponding to the target video file is searched based on the identification information of the target video file and the strategy number.

7. A video scheduling device, characterized in that, The device includes: The acquisition unit is used to acquire multiple segments of data from the video file to be stored. A storage unit is used to store the multiple sharded data in a resource node cluster and record the storage addresses of the multiple sharded data. A determining unit is used to determine the logical block segmentation strategy of the video file to be stored; The generation unit is configured to virtually divide the video file to be stored into multiple logical blocks according to the logical block division strategy, thereby obtaining multiple logical blocks of the video file to be stored; and to generate a logical block mapping table corresponding to the video file to be stored according to the logical block division strategy, the multiple fragment data, and the storage addresses of the multiple fragment data. The logical block mapping table includes the correspondence between multiple logical blocks and the multiple fragment data, as well as the storage addresses of the multiple fragment data, wherein each logical block corresponds to at least one fragment data. The storage unit is also used to store the logical block mapping table corresponding to the video file to be stored.

8. The apparatus according to claim 7, characterized in that, The device further includes: The receiving unit is used to receive a video scheduling request sent by the terminal device, wherein the video scheduling request includes the identification information of the target video file; The lookup unit is used to look up the logical relationship mapping table corresponding to the target video file based on the identification information of the target video file; The acquisition unit is further configured to obtain the storage address of the target segment data corresponding to the target video file according to the logical relationship mapping table corresponding to the target video file; The acquisition unit is further configured to acquire the target shard data from the resource node cluster according to the storage address of the target shard data; The sending unit is used to send the target fragment data to the terminal device.

9. A computer device, characterized in that, include: Memory, processor, and bus system; The memory is used to store programs; The processor is used to execute the program in the memory to implement the method of any one of claims 1 to 6; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.

10. A computer-readable storage medium, characterized in that, The device stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Video resource storage allocation method and device

    CN113259688A

  • Data management method and apparatus, and computer device and storage medium

    WO2021169113A1