Video metadata recovery method and device, computer equipment and storage medium

By obtaining and splicing video metadata fragments in logical blocks, using block header information and chain association relationships, the problem of video metadata being unreadable when the storage device is faulty or damaged is solved, and efficient and reliable video metadata recovery is achieved.

CN119938977APending Publication Date: 2025-05-06INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202412000444.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Video metadata is unreadable when the storage device fails or is damaged, affecting the stability and user experience of video storage services, and an effective recovery method is needed.

Method used

By acquiring multiple logical blocks, determining the target logical block based on the block header information, using chain association relationships to splice video metadata fragments, recovering the complete video metadata, and restoring it to the preset storage space after the integrity is detected.

Benefits of technology

Ensure that the video metadata is spliced ​​in the correct order during the recovery process, improving the reliability and efficiency of the recovery process, especially when the video metadata is missing or damaged, the complete video metadata can be quickly reconstructed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938977A_ABST
    Figure CN119938977A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data recovery, and discloses a video metadata recovery method and device, and the method comprises the steps: obtaining a first set; determining a plurality of target logic blocks from the plurality of logic blocks according to the plurality of pieces of block header information; splicing the plurality of video metadata fragments of the plurality of target logic blocks based on the chain association relationship to obtain spliced target video metadata; and if it is detected that the spliced target video metadata is complete video metadata, recovering the spliced target video metadata to a preset storage space. Therefore, a wrong recovery result caused by data loss or damage in the recovery process is effectively prevented, and the reliability of the recovery process is improved. Therefore, the video metadata recovery efficiency is improved, and especially under the condition that the video metadata are missing or damaged, the complete video metadata can be quickly reconstructed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data recovery, and in particular to a method and device for recovering video metadata, a computer device, and a storage medium. Background Art

[0002] As video content consumption continues to increase, the integrity and availability of video metadata have become critical. However, in actual applications, problems such as storage device failure, metadata corruption or loss may cause video metadata to be unreadable, which will directly affect the stability of video storage services and user experience. When a user requests video playback, if the corresponding video data cannot be found through video metadata, the video will not play properly, affecting user satisfaction with the service. Therefore, how to recover video metadata is an urgent problem to be solved. Summary of the invention

[0003] In view of this, the present invention provides a method, an apparatus, a computer device, and a storage medium for recovering video metadata to solve the problem of how to recover video metadata.

[0004] In a first aspect, the present invention provides a method for recovering video metadata, the method comprising:

[0005] Acquire a first set, wherein the first set includes a plurality of logic blocks, each of the logic blocks includes block header information and block data information, the block header information indicates an association relationship between the plurality of logic blocks, and the block data information is a video metadata segment;

[0006] According to the plurality of block header information, a plurality of target logic blocks are determined from the plurality of logic blocks, wherein the relationship between the plurality of target logic blocks is a chain association relationship;

[0007] Based on the chain association relationship, multiple video metadata segments of multiple target logical blocks are spliced ​​together to obtain spliced ​​target video metadata;

[0008] If it is verified that the spliced ​​target video metadata is complete video metadata, the spliced ​​target video metadata is restored to the preset storage space.

[0009] The present invention provides a method for recovering video metadata. By acquiring multiple logical blocks and determining multiple target logical blocks according to the association relationship between the multiple logical blocks indicated by block header information, multiple video metadata fragments dispersed in the multiple target logical blocks can be effectively found, and then the target video metadata can be spliced ​​out according to the chain association relationship and the multiple video metadata fragments. It ensures that the metadata fragments can be spliced ​​in the correct order during the recovery process, avoiding damage or inconsistency of the video metadata due to sequence errors. When it is detected that the spliced ​​video metadata is complete video metadata, the spliced ​​target video metadata is restored to a preset storage space. After detecting that the spliced ​​video metadata is complete video metadata, it is restored to the preset storage space, which effectively prevents erroneous recovery results caused by data loss or damage during the recovery process, and improves the reliability of the recovery process. Thereby, the efficiency of video metadata recovery is improved, especially when the video metadata is missing or damaged, the complete video metadata can be quickly reconstructed.

[0010] In an optional implementation manner, the block header information includes: an offset and a status flag, the offset corresponding to a logical block;

[0011] Determining a plurality of target logic blocks from the plurality of logic blocks according to the plurality of block header information includes:

[0012] Searching for a first flag among a plurality of status flags, and determining that a logic block corresponding to the first flag is a first target logic block;

[0013] Starting from the first offset corresponding to the above-mentioned first target logic block, the target logic block corresponding to each offset is searched in turn until the last target logic block is found, and multiple of the above-mentioned target logic blocks and the above-mentioned chain association relationship are obtained, and the status flag of the above-mentioned last target logic block is the last flag.

[0014] The method provided in this embodiment determines the first target logical block corresponding to the first and last flags from multiple logical blocks through the first flag in the status flag, starts from the first offset, searches for the target logical block corresponding to each offset in turn, until the last target logical block is found, and obtains multiple target logical blocks and the chain association relationship between the target logical blocks. Through the offset and status flag in the block header information, the target logical block in multiple logical blocks can be accurately determined. The offset identifies the position of the corresponding logical block, and the status flag provides whether the target logical block is at the first and last positions. The combination of the two can effectively identify the target logical block in turn from multiple logical blocks, ensuring accurate positioning during the recovery process.

[0015] In an optional implementation, the above method further includes:

[0016] If the last target logical block does not exist in the first set, determining that the spliced ​​target video metadata is incomplete video metadata;

[0017] Acquire a second set, the second set including a plurality of logic blocks different from the logic blocks in the first set;

[0018] Determining an interrupt offset from the offsets of the logic blocks in the first set, the interrupt offset corresponding to a logic block in the second set;

[0019] Starting from the interruption offset, searching for the logic block corresponding to each offset in the second set in turn until the last target logic block is found and a complete chain association relationship is obtained;

[0020] Based on the complete chain association relationship, the video metadata fragment of the first target logical block is sequentially spliced ​​to the video metadata fragment of the last target logical block to obtain the complete target video metadata;

[0021] The complete target video metadata is restored to the preset storage space.

[0022] The method provided in this embodiment determines that the target video metadata is incomplete by determining that the last target logical block does not exist in the first set, then obtains the second set, and continues to search for the logical block corresponding to each offset in the second set based on the interruption offset until the last target logical block is found and a complete chain association relationship is obtained, then the video metadata fragments are spliced ​​in sequence, and the complete target video metadata obtained after splicing is restored to a preset storage space, and the complete video metadata is spliced ​​by continuing to search for the target logical block in the second set based on the interruption offset from the search, thereby enhancing the flexibility of data recovery. Even if the original data is missing or interrupted, the complete target video metadata can still be restored by re-associating the logical blocks in different sets.

[0023] In an optional implementation, the obtaining of the first set includes:

[0024] Obtain resource occupancy of a server, where the server is used to store the logic block;

[0025] Based on the resource occupancy rate and the first target threshold, a target number of logic blocks are selected to form the first set.

[0026] The method provided in this embodiment obtains the resource occupancy rate of the server storing the logical blocks, determines the target number of selected logical blocks based on the resource occupancy rate and the first target threshold, and forms the target number of logical blocks into a first set. By introducing a logical block selection strategy based on the resource occupancy rate and the first target threshold in the process of obtaining the first set, a more efficient and flexible video metadata recovery process is achieved. The utilization efficiency of system resources is improved, the adaptability and robustness of the system are enhanced, the recovery speed and overall stability are optimized, and a strong guarantee is provided for efficient and reliable video metadata recovery.

[0027] In an optional implementation manner, the target number of logic blocks are selected based on the resource occupancy rate and the first target threshold to form the first set, including:

[0028] Determine the target quantity based on the resource occupancy rate and the first target threshold;

[0029] Get the block header information of each logical block;

[0030] Based on the block header information, multiple associated logical blocks are selected;

[0031] When the number of the plurality of associated logic blocks is greater than the target number, selecting the target number of logic blocks from the plurality of associated logic blocks to form the first set;

[0032] Alternatively, when the number of the plurality of associated logic blocks is equal to the target number, the plurality of associated logic blocks are grouped into the first set;

[0033] Alternatively, when the number of the plurality of associated logic blocks is less than the target number, and the resource occupancy rate is less than or equal to a second target threshold, selecting a plurality of supplementary logic blocks;

[0034] Combining a plurality of the associated logic blocks and a plurality of the supplemented logic blocks into the first set;

[0035] Alternatively, when the number of the plurality of associated logic blocks is less than the target number, and the resource occupancy rate is greater than the second target threshold, the plurality of associated logic blocks are grouped into the first set.

[0036] The method provided in this embodiment determines the target number based on the resource occupancy rate and the first target threshold, and then selects the associated logical blocks based on the block header information of the logical blocks, and then forms the first set with different strategies according to the size relationship between the number of associated logical blocks and the target number, and flexibly selects logical blocks based on the resource occupancy rate and the target threshold. This embodiment realizes efficient, stable and intelligent resource management in the video metadata recovery process, thereby improving the recovery efficiency, enhancing the stability, adaptability and automation level of the system, optimizing resource usage, and reducing human intervention, providing a strong guarantee for reliable and efficient video metadata recovery.

[0037] In an optional implementation, the above method further includes:

[0038] Get video metadata;

[0039] Splitting the video metadata into multiple video metadata segments;

[0040] storing the plurality of video metadata segments as block data information in a plurality of logic blocks respectively;

[0041] Determining the association relationship between the plurality of the logic blocks based on the order of the plurality of the video metadata segments;

[0042] Based on the above association relationship, the block header information of each logical block is determined.

[0043] The method provided in this embodiment divides the acquired video metadata into multiple video metadata segments, and then stores the video source data segments as block data information in multiple logical blocks respectively, and determines the block header information of the logical blocks based on the association relationship determined by the order of the video metadata segments. This achieves the effect of storing the video metadata in the form of logical blocks. This further improves the storage and recovery efficiency of the video metadata, enhances the flexibility, reliability and automation level of the system, optimizes the utilization of storage resources and the accuracy of video metadata processing, and provides a more efficient solution for video metadata management and large-scale storage.

[0044] In an optional implementation, the block header information of the above-mentioned logic block and the above-mentioned target video metadata include: checksum information;

[0045] The above verification shows that the above spliced ​​target video metadata is complete video metadata, including:

[0046] When the checksum information of the plurality of target logical blocks matches the checksum information of the spliced ​​target video metadata, it is determined that the spliced ​​target video metadata is complete.

[0047] The method provided in this embodiment determines that the target video metadata to be spliced ​​is complete by matching the block header information of the logical block with the checksum information in the target video metadata, thereby avoiding inconsistencies caused by data damage or loss, and can ensure that there is no data loss or damage during the splicing process, thereby improving the reliability of the video metadata, and can significantly reduce the impact caused by errors in the transmission or splicing process, thereby ensuring the integrity of the final video metadata.

[0048] In an optional implementation manner, before selecting a target number of logic blocks based on the resource occupancy rate and the first target threshold to form the first set, the method further includes:

[0049] Obtaining maximum load values ​​of multiple resource types of the server, where one resource type corresponds to one maximum load value;

[0050] The smallest maximum load value is selected from the maximum load values ​​of the multiple different resource types as the first target threshold.

[0051] The method provided in this embodiment can effectively optimize resource utilization and improve system stability by first obtaining and selecting maximum load values ​​of multiple different resource types of the server before selecting a target number of logic blocks based on the server's resource occupancy rate and the first target threshold, and selecting the smallest maximum load value as the first target threshold.

[0052] In an optional implementation, the resource occupancy rate of the server includes resource occupancy rates of multiple different resource types;

[0053] The above-mentioned selecting a target number of logic blocks based on the above-mentioned resource occupancy rate and the first target threshold value to form the above-mentioned first set includes:

[0054] Determine the target resource type corresponding to the first target threshold value according to the corresponding relationship between the resource type and the maximum load value;

[0055] Selecting the resource occupancy rate of the target resource type from the resource occupancy rates of the multiple different resource types;

[0056] Based on the resource occupancy rate of the target resource type and the first target threshold, a target number of logic blocks are selected to form the first set.

[0057] The method provided in this embodiment can determine the most suitable resource type to adjust the target threshold according to the corresponding relationship between the resource occupancy rate and the maximum load value of different resource types. By selecting the most suitable target resource type from multiple resource types, excessive use of certain resources can be effectively avoided. By setting the target resource type corresponding to the maximum load value, the system can prevent a certain resource type from affecting the stability of the overall service due to overload. When dynamically selecting the target resource type and adjusting the load based on the resource occupancy rate of the type, it can better adapt to the changing load requirements and enhance the server's ability to cope with large-scale concurrent tasks.

[0058] In an optional implementation, after splicing multiple video metadata segments of multiple target logical blocks based on the chain association relationship to obtain spliced ​​target video metadata, the method further includes:

[0059] Acquire timestamp information of a plurality of video metadata segments from the block data information of the plurality of target logical blocks;

[0060] By comparing the timestamp information of the plurality of target video metadata segments with a preset time range, determining whether the timestamp information of the plurality of target video metadata segments is within the preset time range, and, based on the timestamp information of the plurality of video metadata segments and the chain association relationship, determining whether the order of the target video metadata complies with a preset video playback order rule;

[0061] If so, it is determined that the above-mentioned spliced ​​target video metadata is valid video metadata.

[0062] The method provided in this embodiment can ensure that the splicing order of each video metadata segment is reasonable and complies with the preset rules by verifying the timestamps of the target video metadata segments. During the splicing process, if the timestamps of multiple target video metadata segments meet the preset time range and chain association rules, the system can accurately determine that these data segments are valid and continuous, thereby ensuring the integrity of the video metadata after splicing and avoiding data loss or duplication.

[0063] In an optional implementation, it also includes:

[0064] According to the above preset time range, determine the maximum preset time and the minimum preset time;

[0065] If the timestamp information of the plurality of target video metadata segments is greater than the minimum preset time and less than the maximum preset time, it is determined that the timestamp information of the plurality of target video metadata segments is within the preset time range.

[0066] The method provided in this embodiment verifies the timestamp information of multiple video metadata segments to ensure that they are within a preset time range and are spliced ​​in a reasonable order, thereby avoiding video content errors caused by timestamp confusion or inconsistent order, and ensuring that the spliced ​​video data is accurate. Based on the timestamp information and the chain association relationship, it is possible to effectively determine whether the order of multiple video metadata segments complies with the rules for video playback.

[0067] In an optional implementation, it also includes:

[0068] Determining the order of the plurality of target video metadata segments according to the chain association relationship;

[0069] If the order of the target video metadata segments is the same as the order of the timestamp information of the target video metadata segments, it is determined that the order of the target video metadata complies with the preset video playback order rule.

[0070] The method provided in this embodiment determines the order of multiple target video metadata segments through a chain association relationship and compares it with the timestamp information, so as to ensure that the splicing order of the video metadata segments is correct. The method automatically determines whether the order of the video metadata segments conforms to the preset rules, reduces the possibility of manual intervention and human error, and improves the automation level of the splicing process.

[0071] In a second aspect, the present invention provides a video metadata recovery device, the device comprising:

[0072] An acquisition module, configured to acquire a first set, wherein the first set includes a plurality of logic blocks, each of the logic blocks includes block header information and block data information, the block header information indicates an association relationship between the plurality of logic blocks, and the block data information is a video metadata segment;

[0073] A determination module, used for determining a plurality of target logic blocks from the plurality of logic blocks according to the plurality of block header information, wherein the relationship between the plurality of target logic blocks is a chain association relationship;

[0074] A splicing module, used for splicing multiple video metadata segments of multiple target logical blocks based on the chain association relationship to obtain spliced ​​target video metadata;

[0075] The recovery module is used to restore the spliced ​​target video metadata to a preset storage space if it is verified that the spliced ​​target video metadata is complete video metadata.

[0076] The present invention provides a video metadata recovery device, which can effectively find multiple video metadata fragments scattered in multiple target logical blocks by acquiring multiple logical blocks and indicating the association relationship between the multiple logical blocks according to the block header information, and then splice the target video metadata according to the chain association relationship and the multiple video metadata fragments. It ensures that each metadata fragment can be spliced ​​in the correct order during the recovery process, avoiding the damage or inconsistency of the video metadata caused by the wrong order. When it is detected that the spliced ​​video metadata is complete video metadata, the spliced ​​target video metadata is restored to the preset storage space. After detecting that the spliced ​​video metadata is complete video metadata, it is restored to the preset storage space, which effectively prevents the erroneous recovery result caused by data loss or damage during the recovery process, and improves the reliability of the recovery process. Thereby, the efficiency of video metadata recovery is improved, especially when the video metadata is missing or damaged, the complete video metadata can be quickly reconstructed.

[0077] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the video metadata recovery method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0078] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the video metadata recovery method of the first aspect or any corresponding embodiment thereof.

[0079] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the method for recovering video metadata of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0081] Figure 1 is one of the flow charts of the method for recovering video metadata according to an embodiment of the present invention;

[0082] Figure 2 is a second flowchart of a method for recovering video metadata according to an embodiment of the present invention;

[0083] Figure 3 is a schematic diagram of the architecture of a method for recovering video metadata according to an embodiment of the present invention;

[0084] Figure 4 is a schematic diagram of a video metadata recovery device according to an embodiment of the present invention;

[0085] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0086] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0087] According to an embodiment of the present invention, an embodiment of a method for recovering video metadata is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0088] In this embodiment, a method for recovering video metadata is provided, which can be used in the above-mentioned server. Figure 1 FIG. 1 is a flowchart of a method for recovering video metadata according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0089] Step S101, obtaining a first set.

[0090] The first set includes multiple logical blocks, each of which includes block header information and block data information, the block header information indicates the association relationship between the multiple logical blocks, and the block data information is a video metadata fragment. The first set may be pre-divided. The block header information may be used to describe the characteristics, position, size of the logical block and its relationship with other logical blocks, and the association relationship between the multiple logical blocks indicated by it may be a sequence, a dependency, etc. The block data information may be a video metadata fragment stored in the logical block, such as relevant information of the video frame, decoding information, etc.

[0091] One way to obtain the first set is to collect and pre-process video metadata from multiple data sources, perform segmentation, storage, labeling and indexing, and finally generate the first set.

[0092] Step S102: determining a plurality of target logical blocks from a plurality of logical blocks according to a plurality of block header information.

[0093] The relationship between multiple target logical blocks is a chain-like association relationship. Since the block header information indicates the association relationship between multiple logical blocks, multiple sequentially associated target logical blocks can be found according to the block header information of the target logical block. The target logical block is the logical block corresponding to the video metadata to be restored. The block header information of each logical block indicates the logical block associated with the logical block, so the multiple target logical blocks are chain-like associations.

[0094] A method for determining multiple target logic blocks is: according to each block header information, multiple chain association relationships are determined from a first set, each chain association relationship corresponds to multiple sequentially associated logic blocks, and a chain association relationship is selected from the multiple chain association relationships, and the chain association relationship corresponds to the above-mentioned multiple target logic blocks, thereby determining multiple target logic blocks.

[0095] Step S103 , based on the chain association relationship, multiple video metadata segments of multiple target logical blocks are spliced ​​together to obtain spliced ​​target video metadata.

[0096] The target video metadata is the video metadata that needs to be restored.

[0097] A method for splicing multiple video metadata fragments is: according to the chain association relationship, the association order of multiple target logic blocks is determined, and according to the association order, the video metadata fragments in the multiple target logic blocks are connected end to end in sequence for splicing to obtain the spliced ​​target video metadata.

[0098] Step S104: if it is verified that the spliced ​​target video metadata is complete video metadata, the spliced ​​target video metadata is restored to a preset storage space.

[0099] The complete video source data may be video metadata that conforms to an expected format or length, and the preset storage space may be a preset storage space corresponding to the target video metadata.

[0100] A method for verifying the integrity of the spliced ​​target video metadata is: verifying whether the spliced ​​target video metadata conforms to the expected format or length, checking whether the target video metadata has the actual video metadata fragment, and after confirming that the spliced ​​target video metadata is complete video metadata, storing the complete video metadata to a specified address of a preset storage space.

[0101] The present invention provides a video metadata recovery method, which can effectively find multiple video metadata fragments dispersed in multiple target logical blocks by obtaining multiple logical blocks and determining multiple target logical blocks according to the association relationship between the multiple logical blocks indicated by block header information, and then splice the target video metadata according to the chain association relationship and the multiple video metadata fragments. It ensures that the various metadata fragments can be spliced ​​in the correct order during the recovery process, avoiding video metadata damage or inconsistency caused by incorrect order.

[0102] When the spliced ​​video metadata is detected as complete video metadata, the spliced ​​target video metadata is restored to the preset storage space. After the spliced ​​video metadata is detected as complete video metadata, it is restored to the preset storage space, which effectively prevents the erroneous recovery result caused by data loss or damage during the recovery process and improves the reliability of the recovery process. Thereby, the efficiency of video metadata recovery is improved, especially when the video metadata is missing or damaged, the complete video metadata can be quickly reconstructed.

[0103] In an optional implementation, in order to further accurately determine multiple target logical blocks from multiple logical blocks, the block header information includes: an offset and a status flag, the offset corresponds to a logical block; based on the multiple block header information, multiple target logical blocks are determined from the multiple logical blocks, including: searching for a first flag in multiple status flags, and determining that the logical block corresponding to the first flag is the first target logical block; starting from the first offset corresponding to the first target logical block, searching for the target logical block corresponding to each offset in turn until the last target logical block is found, thereby obtaining multiple target logical blocks and a chain association relationship, and the status flag of the last target logical block is the last flag.

[0104] In this embodiment, the offset may be the position corresponding to a certain logic block, specifically, the distance from the current logic block to the corresponding logic block, or the starting address of the corresponding logic block. The status flag may be a flag that marks the position of the logic block in a group of associated logic blocks, such as the first position, the last position, the middle position, etc. First, the first position flag is searched in multiple block header information. It may be a flag used to indicate which logic block is the starting point of the chain association relationship. Once the first position flag is found, the position of the first target logic block can be determined, and this logic block is the starting point of multiple target logic blocks.

[0105] Starting from the first target logic block, search for other target logic blocks in sequence. Starting from the first offset corresponding to the first target logic block, determine the position of the target logic block according to each offset in sequence. Find the target logic blocks one by one until the last target logic block is found, and determine the corresponding chain association relationship between them in sequence.

[0106] The method provided in this embodiment determines the first target logical block corresponding to the first and last flags from multiple logical blocks through the first flag in the status flag, starts from the first offset, searches for the target logical block corresponding to each offset in turn, until the last target logical block is found, and obtains multiple target logical blocks and the chain association relationship between the target logical blocks. Through the offset and status flag in the block header information, the target logical block in multiple logical blocks can be accurately determined. The offset identifies the position of the corresponding logical block, and the status flag provides whether the target logical block is at the first and last positions. The combination of the two can effectively identify the target logical block in turn from multiple logical blocks, ensuring accurate positioning during the recovery process.

[0107] In an optional implementation, in order to further avoid incomplete metadata of the spliced ​​target video, Figure 2 FIG. 2 is a flowchart of a method for recovering video metadata according to an embodiment of the present invention. Figure 2 As shown, the above method also includes:

[0108] Step S201: If the last target logical block does not exist in the first set, it is determined that the spliced ​​target video metadata is incomplete video metadata.

[0109] One way to determine that the spliced ​​target video metadata is incomplete video metadata is: first check whether the first set contains the last target logical block. If the first set does not contain the last target logical block, it means that the spliced ​​target video metadata is missing or incomplete. If the last target logical block is missing, the spliced ​​data is determined to be incomplete video metadata.

[0110] Step S202, obtaining a second set.

[0111] The second set includes a plurality of logic blocks that are different from the logic blocks in the first set.

[0112] One way to obtain the second set is to collect and pre-process video metadata from multiple data sources, perform segmentation, storage, labeling and indexing, and finally generate the second set.

[0113] Step S203: determine the interruption offset from the offsets of the logic blocks in the first set.

[0114] The interruption offset corresponds to a logic block in the second set. The interruption offset may be an offset to which a corresponding logic block does not exist in the first set.

[0115] One way to determine the interrupt offset is to search the logical blocks in the first set for an offset corresponding to a logical block that does not exist in the first set.

[0116] Step S204, starting from the interruption offset, searching the logic block corresponding to each offset in the second set in turn until the last target logic block is found and a complete chain association relationship is obtained.

[0117] One way to find the last target logic block is: since the interrupt offset corresponds to a logic block in the second set, the target logic block can be searched in the second set from the interrupt offset until the last target logic block is found, and a complete chain association relationship can be obtained.

[0118] Step S205 , based on the complete chain association relationship, the video metadata segment of the first target logical block is sequentially spliced ​​to the video metadata segment of the last target logical block to obtain complete target video metadata.

[0119] A method for splicing video metadata fragments is: according to a complete chain association relationship, the association order of multiple target logical blocks from the first target logical block to the last target logical block is determined; according to the association order, the video metadata fragments in the multiple target logical blocks are connected end to end in sequence for splicing to obtain complete target video metadata.

[0120] Step S206: restore the complete target video metadata to the preset storage space.

[0121] That is, the complete target video metadata is stored in the corresponding address in the preset storage space.

[0122] The method provided in this embodiment determines that the target video metadata is incomplete by determining that the last target logical block does not exist in the first set, then obtains the second set, and continues to search for the logical block corresponding to each offset in the second set based on the interruption offset until the last target logical block is found and a complete chain association relationship is obtained, then the video metadata fragments are spliced ​​in sequence, and the complete target video metadata obtained after splicing is restored to a preset storage space, and the complete video metadata is spliced ​​by continuing to search for the target logical block in the second set based on the interruption offset from the search, thereby enhancing the flexibility of data recovery. Even if the original data is missing or interrupted, the complete target video metadata can still be restored by re-associating the logical blocks in different sets.

[0123] In an optional implementation, in order to further accurately obtain the first set, the obtaining of the first set includes:

[0124] Obtain resource occupancy of a server, where the server is used to store logic blocks; based on the resource occupancy and a first target threshold, select a target number of logic blocks to form the first set.

[0125] In this embodiment, the resource occupancy of the server may be the occupancy of the central processing unit, the occupancy of the memory, the occupancy of the storage space, the occupancy of the network bandwidth, etc. The first target threshold may be a preset occupancy threshold of the central processing unit, the occupancy threshold of the memory, the occupancy threshold of the storage space, the occupancy threshold of the network bandwidth, etc. For example, when the occupancy of the central processing unit of the server reaches 80% (the first target threshold), 50 (target number) logic blocks are selected to form the first set.

[0126] The method provided in this embodiment obtains the resource occupancy rate of the server storing the logical blocks, determines the target number of selected logical blocks based on the resource occupancy rate and the first target threshold, and forms the target number of logical blocks into a first set. By introducing a logical block selection strategy based on the resource occupancy rate and the first target threshold in the process of obtaining the first set, a more efficient and flexible video metadata recovery process is achieved. The utilization efficiency of system resources is improved, the adaptability and robustness of the system are enhanced, the recovery speed and overall stability are optimized, and a strong guarantee is provided for efficient and reliable video metadata recovery.

[0127] In an optional implementation, in order to further accurately select the target number of logic blocks, the target number of logic blocks are selected based on the resource occupancy rate and the first target threshold to form the first set, including:

[0128] Based on the resource occupancy rate and the first target threshold, determine the target number; obtain the block header information of each logic block; based on the block header information, select multiple associated logic blocks; when the number of the multiple associated logic blocks is greater than the target number, select the target number of logic blocks from the multiple associated logic blocks to form the first set; or, when the number of the multiple associated logic blocks is equal to the target number, form the first set with multiple associated logic blocks; or, when the number of the multiple associated logic blocks is less than the target number and the resource occupancy rate is less than or equal to the second target threshold, select multiple supplementary logic blocks; form the first set with multiple associated logic blocks and multiple supplementary logic blocks; or, when the number of the multiple associated logic blocks is less than the target number and the resource occupancy rate is greater than the second target threshold, form the first set with multiple associated logic blocks.

[0129] In this embodiment, the resource occupancy rate corresponding to the first target threshold value may be set, and the size relationship between the resource occupancy rate and the first target threshold value may be compared, and different target quantities may be determined according to different comparison results. Further, the target quantity is the number of logic blocks that the first set can accommodate, and the first set may be formed according to the size relationship between the number of multiple associated logic blocks and the number of logic blocks that the first set can accommodate. Specifically, if the number of multiple associated logic blocks is greater than the target quantity, the first set may be formed from the associated logic blocks of part of the target quantity; if the multiple associated logic blocks are not enough to fill the first set, that is, the number of associated logic blocks is less than the target quantity, the first set may be further formed according to the size relationship between the resource occupancy rate and the second target threshold value. Specifically, if the resource occupancy rate is less than or equal to the second target threshold value, it means that the resource occupancy rate of the current server has not exceeded the standard, and the logic blocks may continue to be selected to be supplemented to the first set; if the resource occupancy rate is greater than the second target threshold value, it means that the resource occupancy rate of the current server is too high, so the supplemented logic blocks are not continued to be filled into the first set, and the multiple associated logic blocks are directly formed into the first set.

[0130] The method provided in this embodiment determines the target number based on the resource occupancy rate and the first target threshold, and then selects the associated logical blocks based on the block header information of the logical blocks, and then forms the first set with different strategies according to the size relationship between the number of associated logical blocks and the target number, and flexibly selects logical blocks based on the resource occupancy rate and the target threshold. This embodiment realizes efficient, stable and intelligent resource management in the video metadata recovery process, thereby improving the recovery efficiency, enhancing the stability, adaptability and automation level of the system, optimizing resource usage, and reducing human intervention, providing a strong guarantee for reliable and efficient video metadata recovery.

[0131] In an optional implementation, in order to further accurately split the video metadata into multiple logical blocks, before the above step S101, the above method also includes: acquiring video metadata; splitting the above video metadata into multiple video metadata segments; storing the multiple video metadata segments as block data information in multiple logical blocks respectively; determining the association relationship between the multiple logical blocks based on the order of the multiple video metadata segments; and determining the block header information of each logical block based on the above association relationship.

[0132] In this embodiment, the video metadata may be obtained from a video stream or a video file, and may include information such as the duration, frame rate, resolution, encoding format, and key frame position of the video data. The splitting method may be: a complete video metadata is divided into multiple segments according to certain rules, and each segment includes a part of the video data information, and the splitting may be performed according to time or content blocks. The logical block is a data storage unit, and the split video metadata segments are stored in multiple logical blocks respectively. The association relationship between the logical blocks may be determined according to the temporal order of the video metadata segments, and then the block header information of the logical blocks is determined.

[0133] The method provided in this embodiment divides the acquired video metadata into multiple video metadata segments, and then stores the video source data segments as block data information in multiple logical blocks respectively, and determines the block header information of the logical blocks based on the association relationship determined by the order of the video metadata segments. This achieves the effect of storing the video metadata in the form of logical blocks. This further improves the storage and recovery efficiency of the video metadata, enhances the flexibility, reliability and automation level of the system, optimizes the utilization of storage resources and the accuracy of video metadata processing, and provides a more efficient solution for video metadata management and large-scale storage.

[0134] In an optional implementation, in order to further verify the integrity of the spliced ​​target video metadata, the block header information of the above-mentioned logical block and the above-mentioned target video metadata include: checksum information; the above-mentioned verification that the above-mentioned spliced ​​target video metadata is complete video metadata includes: when the checksum information of multiple above-mentioned target logical blocks matches the checksum information of the above-mentioned spliced ​​target video metadata, it is determined that the above-mentioned spliced ​​target video metadata is complete.

[0135] In this embodiment, the checksum information can be a data summary calculated by an algorithm to verify the integrity of the video metadata. Each logic block and the spliced ​​target video metadata can calculate an independent checksum information to verify whether the data is damaged or tampered with during the transmission or splicing process. By comparing the checksum information of the target logic block with the checksum information of the spliced ​​target video metadata, if the two match, it can be determined that the spliced ​​target video metadata is complete.

[0136] The method provided in this embodiment determines that the target video metadata to be spliced ​​is complete by matching the block header information of the logical block with the checksum information in the target video metadata, thereby avoiding inconsistencies caused by data damage or loss, and can ensure that there is no data loss or damage during the splicing process, thereby improving the reliability of the video metadata, and can significantly reduce the impact caused by errors in the transmission or splicing process, thereby ensuring the integrity of the final video metadata.

[0137] In an optional implementation, in order to further determine the first target threshold, before selecting a target number of logic blocks based on the resource occupancy rate and the first target threshold to form the first set, the method further includes:

[0138] The maximum load values ​​of multiple different resource types of the server are obtained, wherein one resource type corresponds to one maximum load value; and the minimum maximum load value is selected from the maximum load values ​​of the multiple different resource types as the first target threshold.

[0139] In this embodiment, the system has multiple resource types, such as processors, memory, storage, network bandwidth, etc. Each resource type has a maximum load value, which indicates the maximum load degree that the resource can bear in the system. The system will select the smallest maximum load value from the maximum load values ​​of these different resource types as the first target threshold. The reason for selecting the smallest maximum load value is that the system must ensure that the load of all resource types remains within a safe range. If the load of a resource exceeds the set maximum load value, it may cause the performance of the entire system to degrade or a bottleneck to occur. By selecting the smallest maximum load value, the system obtains a conservative and most stringent threshold, which will be used in the subsequent logic block selection process.

[0140] The method provided in this embodiment can effectively optimize resource utilization and improve system stability by first obtaining and selecting maximum load values ​​of multiple different resource types of the server before selecting a target number of logic blocks based on the server's resource occupancy rate and the first target threshold, and selecting the smallest maximum load value as the first target threshold.

[0141] In an optional implementation, the resource occupancy rate of the server includes resource occupancy rates of multiple different resource types.

[0142] The above-mentioned selecting a target number of logic blocks based on the above-mentioned resource occupancy rate and the first target threshold value to form the above-mentioned first set includes:

[0143] According to the correspondence between the resource type and the maximum load value, determine the target resource type corresponding to the above-mentioned first target threshold; select the resource occupancy rate of the above-mentioned target resource type from the resource occupancy rates of the above-mentioned different resource types; based on the resource occupancy rate of the above-mentioned target resource type and the first target threshold, select the target number of logic blocks to form the above-mentioned first set.

[0144] In this embodiment, different resource types may have different maximum load values ​​or limits. Each resource type may have different usage limits in different situations. The system needs to select the appropriate resource type based on the current load situation. The system selects the resource type with the highest current occupancy rate based on the resource type determined in the first step. Based on the current resource occupancy rate of the target resource type and the set first target threshold, the system determines which logic blocks need to be processed. The system will select a specific number of logic blocks for processing based on the resource occupancy and the target threshold. This target number of logic blocks is selected under the condition that the resource occupancy does not exceed the set threshold.

[0145] The method provided in this embodiment can determine the most suitable resource type to adjust the target threshold according to the corresponding relationship between the resource occupancy rate and the maximum load value of different resource types. By selecting the most suitable target resource type from multiple resource types, excessive use of certain resources can be effectively avoided. By setting the target resource type corresponding to the maximum load value, the system can prevent a certain resource type from affecting the stability of the overall service due to overload. When dynamically selecting the target resource type and adjusting the load based on the resource occupancy rate of the type, it can better adapt to the changing load requirements and enhance the server's ability to cope with large-scale concurrent tasks.

[0146] In an optional implementation, after the above step S103, the method further includes:

[0147] From the block data information of the multiple target logical blocks, the timestamp information of the multiple video metadata segments is obtained; by comparing the timestamp information of the multiple target video metadata segments with a preset time range, it is determined whether the timestamp information of the multiple target video metadata segments is within the preset time range; and, based on the timestamp information of the multiple video metadata segments and the chain association relationship, it is determined whether the order of the target video metadata complies with a preset video playback order rule; if so, it is determined that the spliced ​​target video metadata is valid video metadata.

[0148] In this embodiment, the timestamp information may be the time point of each key frame or data block corresponding to the video metadata segment, and may be defined based on the duration of video playback. The timestamps of the various video metadata segments should be ordered and coherent. The timestamps of the video metadata segments should be within a certain range. If the judgment result shows that the timestamps and order of multiple video metadata segments meet the preset rules, the system will determine that these video metadata segments can be spliced ​​into a valid video metadata.

[0149] The method provided in this embodiment can ensure that the splicing order of each video metadata segment is reasonable and complies with the preset rules by verifying the timestamps of the target video metadata segments. During the splicing process, if the timestamps of multiple target video metadata segments meet the preset time range and chain association rules, the system can accurately determine that these data segments are valid and continuous, thereby ensuring the integrity of the video metadata after splicing and avoiding data loss or duplication.

[0150] In an optional implementation, it also includes:

[0151] According to the above-mentioned preset time range, the maximum preset time and the minimum preset time are determined; if the timestamp information of multiple of the above-mentioned target video metadata segments is greater than the above-mentioned minimum preset time and less than the above-mentioned maximum preset time, it is determined that the timestamp information of multiple of the above-mentioned target video metadata segments is within the above-mentioned preset time range.

[0152] In this embodiment, the timestamps of multiple video metadata segments are checked one by one, and firstly, it is determined whether they are within a preset time range. Then, through the chain association relationship, the system checks whether the timestamps between the segments meet the playback order rules to ensure that the video metadata segments are spliced ​​in the correct order. If all the segments meet the timestamps within the preset range and the order of the video metadata segments meets the rules, then these segments can be spliced ​​into a valid video metadata.

[0153] The method provided in this embodiment verifies the timestamp information of multiple video metadata segments to ensure that they are within a preset time range and are spliced ​​in a reasonable order, thereby avoiding video content errors caused by timestamp confusion or inconsistent order, and ensuring that the spliced ​​video data is accurate. Based on the timestamp information and the chain association relationship, it is possible to effectively determine whether the order of multiple video metadata segments complies with the rules for video playback.

[0154] In an optional implementation, it also includes:

[0155] According to the above-mentioned chain association relationship, the order of the multiple target video metadata segments is determined; if the order of the multiple target video metadata segments is the same as the order of the timestamp information of the multiple target video metadata segments, it is determined that the order of the target video metadata complies with the above-mentioned preset video playback order rule.

[0156] In this embodiment, when multiple video metadata segments are spliced, the system determines the playback order of these segments according to preset rules. For example, segment A should probably be played before segment B. By comparing the timestamps and order of multiple video metadata segments, the system can confirm whether the segments are correctly sorted. The metadata of each video metadata segment contains timestamps, which identify the start and end times of the segments. The system compares these timestamps with the actual playback order. For example, the timestamp of segment A should be earlier than the timestamp of segment B, and the system will check whether these timestamps are arranged in order from small to large. The system will confirm whether they comply with these rules by checking the chain association relationship and timestamp information between the video metadata segments. For example, if the end timestamp of segment A is later than the start timestamp of segment B, it does not comply with the preset sequence rules, which may cause jumps or discontinuities during playback.

[0157] The method provided in this embodiment determines the order of multiple target video metadata segments through a chain association relationship and compares it with the timestamp information, so as to ensure that the splicing order of the video metadata segments is correct. The method automatically determines whether the order of the video metadata segments conforms to the preset rules, reduces the possibility of manual intervention and human error, and improves the automation level of the splicing process.

[0158] In an optional implementation, before splicing the target video metadata, redundancy checking and repairing are performed, and the redundancy checking and repairing include:

[0159] The video metadata fragment of each logical block is repeatedly checked to ensure that no data loss or damage occurs in each fragment.

[0160] When it is detected that the checksum information of a certain logic block does not match the expected value, it is repaired by finding redundant data or using a recovery algorithm.

[0161] If the mismatched logical block cannot be repaired, the logical block is marked as invalid, and an attempt is made to recover the video metadata fragment of the logical block from a backup or other resources.

[0162] If the lost data cannot be recovered, the reliability of data recovery is ensured by notifying the system administrator or triggering the preset automated backup mechanism.

[0163] The method provided in this embodiment can ensure the integrity of data during the splicing process by performing a repeatability check on the video metadata segments of each logical block. If data loss or damage occurs in a segment, the redundancy check and repair mechanism can detect and process it in time, thereby preventing the damaged data from affecting the final video splicing result.

[0164] Figure 31 is a schematic diagram of the architecture of a method for recovering video metadata according to an embodiment of the present invention. The architecture includes: a scheduling layer, a task layer, a logic block layer, and a data layer.

[0165] The scheduling layer includes a scheduling module. The scheduling module is used to schedule multiple sets (a first set, a second set, and an nth set) to restore video metadata.

[0166] The task layer includes n divided sets, including: a first set, a second set, and up to an nth set. Each set includes multiple logic blocks.

[0167] The logic block layer includes logic blocks corresponding to each set, each set includes 50 logic blocks, and n sets sequentially include the 1st to 50nth logic blocks.

[0168] The data layer includes the block header information and block data information corresponding to each logical block. The set size of each logical block is 1G, and each logical block includes a block header information and 256 logical blocks of 4M in size. The block header information can include information such as the type of video metadata segment, block size, load channel number (i.e., video stream source number) and offset.

[0169] In addition, an embodiment of the present invention further provides a video metadata recovery device. Figure 4 is a schematic diagram of a video metadata recovery device according to an embodiment of the present invention, such as Figure 4 As shown, the recovery device includes:

[0170] The acquisition module 401 is used to acquire a first set, where the first set includes multiple logical blocks, each of the logical blocks includes block header information and block data information, the block header information indicates the association relationship between the multiple logical blocks, and the block data information is a video metadata segment.

[0171] The determination module 402 is used to determine a plurality of target logic blocks from the plurality of logic blocks according to the plurality of block header information, and the relationship between the plurality of target logic blocks is a chain association relationship.

[0172] The splicing module 403 is used to splice multiple video metadata segments of multiple target logical blocks based on the chain association relationship to obtain spliced ​​target video metadata.

[0173] The recovery module 404 is used to recover the spliced ​​target video metadata to a preset storage space if it is verified that the spliced ​​target video metadata is complete video metadata.

[0174] The present invention provides a video metadata recovery device, which can effectively find multiple video metadata fragments scattered in multiple target logical blocks by acquiring multiple logical blocks and determining multiple target logical blocks according to the association relationship between the multiple logical blocks indicated by block header information, and then splice the target video metadata according to the chain association relationship and the multiple video metadata fragments. It ensures that each metadata fragment can be spliced ​​in the correct order during the recovery process, avoiding damage or inconsistency of video metadata due to sequence errors. When it is detected that the spliced ​​video metadata is complete video metadata, the spliced ​​target video metadata is restored to a preset storage space. After detecting that the spliced ​​video metadata is complete video metadata, it is restored to the preset storage space, which effectively prevents erroneous recovery results caused by data loss or damage during the recovery process, and improves the reliability of the recovery process. Thereby, the efficiency of video metadata recovery is improved, especially when the video metadata is missing or damaged, the complete video metadata can be quickly reconstructed. The recovery device also includes: a processing module.

[0175] In an optional implementation manner, the block header information includes: an offset and a status flag, the offset corresponding to a logical block;

[0176] The above-mentioned determination module 402 is also used to search for the first flag in multiple status flags, and determine that the logic block corresponding to the above-mentioned first flag is the first target logic block; starting from the first offset corresponding to the above-mentioned first target logic block, search for the target logic block corresponding to each offset in turn until the last target logic block is found, and obtain multiple above-mentioned target logic blocks and the above-mentioned chain association relationship, and the status flag of the above-mentioned last target logic block is the last flag.

[0177] In an optional embodiment, the recovery device also includes: a processing module, which is used to determine that the spliced ​​target video metadata is incomplete video metadata if the last target logical block does not exist in the first set; obtain a second set, the second set includes multiple logical blocks different from the logical blocks in the first set; determine an interruption offset from the offset of the logical block in the first set, and the interruption offset corresponds to a logical block in the second set; starting from the interruption offset, search for the logical block corresponding to each offset in the second set in turn until the last target logical block is found and a complete chain association relationship is obtained; based on the complete chain association relationship, splice the video metadata fragment of the first target logical block in turn to the video metadata fragment of the last target logical block to obtain complete target video metadata; and restore the complete target video metadata to the preset storage space.

[0178] In an optional implementation, the acquisition module is further used to acquire resource occupancy of a server, where the server is used to store logic blocks; based on the resource occupancy and the first target threshold, a target number of logic blocks are selected to form the first set.

[0179] In an optional embodiment, the processing module is further used to determine the target number based on the resource occupancy rate and the first target threshold; obtain block header information of each logic block; select multiple associated logic blocks based on the block header information; when the number of the multiple associated logic blocks is greater than the target number, select the target number of logic blocks from the multiple associated logic blocks to form the first set; or, when the number of the multiple associated logic blocks is equal to the target number, form the first set with multiple associated logic blocks; or, when the number of the multiple associated logic blocks is less than the target number and the resource occupancy rate is less than or equal to the second target threshold, select multiple supplementary logic blocks; form the first set with multiple associated logic blocks and multiple supplementary logic blocks; or, when the number of the multiple associated logic blocks is less than the target number and the resource occupancy rate is greater than the second target threshold, form the first set with multiple associated logic blocks.

[0180] In an optional implementation, the processing module is further used to obtain video metadata; split the video metadata into multiple video metadata segments; store the multiple video metadata segments as block data information in multiple logical blocks respectively; determine the association relationship between the multiple logical blocks based on the order of the multiple video metadata segments; and determine the block header information of each logical block based on the association relationship.

[0181] In an optional implementation, the block header information of the above-mentioned logical block and the above-mentioned target video metadata include: checksum information; the above-mentioned processing module is also used to determine that the above-mentioned spliced ​​target video metadata is complete when the checksum information of multiple above-mentioned target logical blocks matches the checksum information of the above-mentioned spliced ​​target video metadata.

[0182] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0183] The video metadata recovery device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0184] The embodiment of the present invention also provides a computer device having the above Figure 4 The video metadata recovery device is shown.

[0185] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0186] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include an integrated circuit. The integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0187] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0188] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0189] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0190] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0191] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0192] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0193] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for recovering video metadata, characterized in that: The method comprises: Acquire a first set, the first set includes a plurality of logic blocks, each of the logic blocks includes block header information and block data information, the block header information indicates an association relationship between the plurality of logic blocks, and the block data information is a video metadata segment; Determine a plurality of target logic blocks from the plurality of logic blocks according to the plurality of block header information, wherein the relationship between the plurality of target logic blocks is a chain association relationship; Based on the chain association relationship, multiple video metadata segments of multiple target logical blocks are spliced ​​together to obtain spliced ​​target video metadata; If it is verified that the spliced ​​target video metadata is complete video metadata, the spliced ​​target video metadata is restored to a preset storage space.

2. The method according to claim 1, characterized in that The block header information includes: an offset and a status flag, wherein the offset corresponds to a logical block; Determining a plurality of target logical blocks from the plurality of logical blocks according to the plurality of block header information includes: Searching for a first flag among a plurality of status flags, and determining that a logic block corresponding to the first flag is a first target logic block; Starting from the first offset corresponding to the first target logic block, the target logic block corresponding to each offset is searched in turn until the last target logic block is found, and multiple target logic blocks and the chain association relationship are obtained, and the status flag of the last target logic block is the last flag.

3. The method according to claim 2, characterized in that The method further comprises: If the last target logical block does not exist in the first set, determining that the spliced ​​target video metadata is incomplete video metadata; Acquire a second set, the second set including a plurality of logic blocks different from the logic blocks in the first set; determining an interrupt offset from offsets of logic blocks in the first set, the interrupt offset corresponding to a logic block in the second set; Starting from the interruption offset, searching the logic blocks corresponding to each offset in the second set in sequence until the last target logic block is found and a complete chain association relationship is obtained; Based on the complete chain association relationship, the video metadata fragment of the first target logical block is sequentially spliced ​​to the video metadata fragment of the last target logical block to obtain the complete target video metadata; The complete target video metadata is restored to the preset storage space.

4. The method according to any one of claims 1 to 3, characterized in that: The obtaining of the first set includes: Obtaining a resource occupancy rate of a server, where the server is used to store a logic block; Based on the resource occupancy rate and the first target threshold, a target number of logic blocks are selected to form the first set.

5. The method according to claim 4, characterized in that The step of selecting a target number of logic blocks based on the resource occupancy rate and the first target threshold to form the first set includes: Determining the target quantity based on the resource occupancy rate and the first target threshold; Get the block header information of each logical block; Based on the block header information, selecting a plurality of associated logical blocks; When the number of the plurality of associated logic blocks is greater than the target number, selecting the target number of logic blocks from the plurality of associated logic blocks to form the first set; or, When the number of the plurality of associated logic blocks is equal to the target number, grouping the plurality of associated logic blocks into the first set; or, When the number of the plurality of associated logic blocks is less than the target number, and the resource occupancy rate is less than or equal to a second target threshold, selecting a plurality of supplementary logic blocks; Grouping a plurality of the associated logic blocks and a plurality of the supplemented logic blocks into the first set; or, When the number of the plurality of associated logic blocks is less than the target number, and the resource occupancy rate is greater than the second target threshold, the plurality of associated logic blocks are grouped into the first set.

6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Get video metadata; Splitting the video metadata into a plurality of video metadata segments; storing the plurality of video metadata segments as block data information in a plurality of logic blocks respectively; Determining an association relationship between the plurality of logic blocks based on an order of the plurality of video metadata segments; Based on the association relationship, block header information of each logic block is determined.

7. The method according to any one of claims 1 to 3, characterized in that: The block header information of the logic block and the target video metadata include: checksum information; The verification that the spliced ​​target video metadata is complete video metadata includes: When the checksum information of the plurality of target logical blocks matches the checksum information of the spliced ​​target video metadata, it is determined that the spliced ​​target video metadata is complete.

8. The method according to claim 4, characterized in that Before selecting a target number of logic blocks based on the resource occupancy rate and the first target threshold to form the first set, the method further includes: Obtaining maximum load values ​​of multiple different resource types of the server, wherein one resource type corresponds to one maximum load value; A minimum maximum load value is selected from the maximum load values ​​of the multiple different resource types as the first target threshold.

9. The method according to claim 8, characterized in that The resource occupancy rate of the server includes resource occupancy rates of multiple different resource types; The step of selecting a target number of logic blocks based on the resource occupancy rate and the first target threshold to form the first set includes: Determine, according to the correspondence between the resource type and the maximum load value, the target resource type corresponding to the first target threshold; Selecting the resource occupancy rate of the target resource type from the resource occupancy rates of the multiple different resource types; Based on the resource occupancy rate of the target resource type and a first target threshold, a target number of logic blocks are selected to form the first set.

10. The method according to any one of claims 1 to 3, characterized in that: After splicing multiple video metadata segments of multiple target logical blocks based on the chain association relationship to obtain spliced ​​target video metadata, the method further includes: Acquire timestamp information of a plurality of video metadata segments from block data information of a plurality of target logical blocks; By comparing the timestamp information of the plurality of target video metadata segments with a preset time range, determining whether the timestamp information of the plurality of target video metadata segments is within the preset time range, and determining whether the order of the target video metadata complies with a preset video playback order rule according to the timestamp information of the plurality of video metadata segments and the chain association relationship; If so, it is determined that the spliced ​​target video metadata is valid video metadata.

11. The method according to claim 10, characterized in that Also includes: Determine a maximum preset time and a minimum preset time according to the preset time range; If the timestamp information of the plurality of target video metadata segments is greater than the minimum preset time and less than the maximum preset time, it is determined that the timestamp information of the plurality of target video metadata segments is within the preset time range.

12. The method according to claim 11, characterized in that Also includes: Determining the order of the plurality of target video metadata segments according to the chain association relationship; If the order of the multiple target video metadata segments is the same as the order of the timestamp information of the multiple target video metadata segments, it is determined that the order of the target video metadata complies with the preset video playback order rule.

13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the video metadata recovery method according to any one of claims 1 to 12 by executing the computer instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the video metadata recovery method according to any one of claims 1 to 12.

15. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the video metadata recovery method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Monitoring video fragment restoration method and device

    CN104301682A

  • Web end video playing method and device and computer equipment

    CN112423117A

  • Multi-channel video data processing method and device, electronic equipment and medium

    CN113259715A

  • Method and system for whole-process trace leaving of video manuscript gathering, editing, and check

    US20220189172A1