Video data processing method, electronic equipment and storage medium

By splitting video data into video units and merging storage based on cloud performance, the problem of low efficiency of video data storage in the security industry has been solved, and space saving and efficiency improvement have been achieved.

CN119322864AInactive Publication Date: 2025-01-17ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411866619.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-01-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the large-scale business scenarios of the security industry, the storage of video data has led to an increase in local space usage and increased costs, and there are problems of low storage efficiency and read and write efficiency, affecting business operations.

Method used

Split the video data into multiple video units, merge it into video objects according to the cloud performance of object storage, and store the video objects in the object storage, obtain index information, determine the index file, and store the path information of the index file in the local database , reduce local space usage, improve storage efficiency and read and write efficiency.

Benefits of technology

It effectively reduces local space usage, reduces storage costs, and improves storage, read and write efficiency, which meets the business needs of the security industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322864A_ABST
    Figure CN119322864A_ABST
Patent Text Reader

Abstract

The invention discloses a video data processing method, electronic equipment and a storage medium. The method comprises the following steps: acquiring a plurality of video units corresponding to video data; merging the plurality of video units according to the cloud performance of the object storage, storing the merged video objects in the object storage, and obtaining first index information corresponding to each video object; determining an index file by using the first index information, further obtaining path information of the index file and storing the path information in a local database, and storing the index file in an object storage; according to the method and the device, the video data is divided into the plurality of video units, the video units are combined into the video object according to the cloud performance of the object storage, the video object and the corresponding index file are stored in the object storage, and the path information of the index file is stored in the local database, so that the occupation of the local space is effectively reduced, and the user experience is improved. The cost is reduced, and the corresponding storage efficiency and read-write efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video data processing, and in particular to a video data processing method, electronic equipment and storage medium. Background Art

[0002] With the explosive growth of computer applications, the processing of video data has entered a stage of rapid development, and the challenges of video data storage have gradually increased.

[0003] At present, the storage of video data, especially in large-scale business scenarios in the security industry, is usually stored by connecting to distributed file systems or local storage systems. When the amount of video data increases, it will occupy more local space and increase costs. In addition, both storage efficiency and read and write efficiency may have high latency, and will block application layer services, which does not meet the current business scenarios of the security industry. Summary of the invention

[0004] The main technical problem solved by the present application is to provide a video data processing method, an electronic device and a storage medium, by splitting the video data into multiple video units, and then merging them according to the cloud performance of the storage database to obtain multiple video objects, and then storing the video objects in the object storage, and obtaining the corresponding index information of the video objects, and then determining the index file, storing the index file in the object database, and storing the path information of the index file in the local database, effectively reducing the local space occupied, reducing costs, and improving the corresponding storage efficiency and read-write efficiency.

[0005] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a video data processing method, applied to the storage end, including: obtaining multiple video units corresponding to the video data to be stored; merging the multiple video units according to the cloud performance of the object storage, and storing the merged video objects in the object storage, and obtaining the first index information corresponding to each of the video objects; determining the index file using the first index information, and then obtaining the path information of the index file, and storing the path information in a local database, wherein the index file is stored in the object storage.

[0006] In some embodiments, the multiple video units are merged according to the cloud performance of the object storage, the merged video object is stored in the object storage, and the first index information corresponding to each of the video objects is obtained, including: obtaining the cloud performance of the object storage; using the cloud performance to determine the video object from at least one of the video units, and storing the video object in the object storage; obtaining a first relationship between the video object and each of the video units in the video object, using the first relationship to obtain second index information corresponding to each of the video units, and then using the second index information to determine the first index information.

[0007] In some embodiments, the use of the cloud performance to determine the video object from at least one of the video units and store the video object in the object storage includes: building a corresponding cache queue for each communication channel, and caching at least one of the video units in the cache queue; merging at least one of the video units in the cache queue into the video object, wherein the merged number of the video units is dynamically adjusted according to the cloud performance of the object storage, and the merged number is positively correlated with the cloud performance; and storing the video object in the object storage using the object storage protocol.

[0008] In some embodiments, the use of the first index information to determine the index file and then obtain the path information of the index file includes: obtaining a first number of the video objects and using the first number to determine the common information; obtaining second index information corresponding to each of the video units in the video object, wherein the second index information includes at least: index time, file name, file length and offset information within the file; using the common information and the second index information to determine the first index information and then determine the index file; in response to storing the index file in the object storage, obtaining the path information of the index file from the object storage.

[0009] In some embodiments, in response to the upload time of the current video object reaching the preset switching time, the determined historical index file is stored in the object storage; a new index file is created using the index information corresponding to the current video object, and the path information of the new index file is added to the local database.

[0010] In some embodiments, obtaining multiple video units corresponding to the video data to be stored includes: constructing segmentation conditions, wherein the segmentation conditions include time interval information, bit stream size information, and data size information; and using the segmentation conditions to segment the video data to be stored into multiple video units.

[0011] To solve the above technical problems, another technical solution adopted in the present application is: to provide a video data processing method, applied to the reading end, including: in response to a query instruction, using the path information of the index file, downloading the index file in the object storage to the local cache, wherein the path information of the index file is stored in the local database; using the first index information in the index file, establishing a memory index; in response to a playback instruction, obtaining the target playback time corresponding to the playback instruction; using the memory index to download the video unit in the video object corresponding to the target playback time to the local cache, and then playing back the video unit, wherein the video object uses the cloud performance of the object storage to merge multiple video units.

[0012] In some embodiments, in response to a second number of data frames corresponding to the video unit reaching a first preset number, pre-reading is initiated through a pre-reading thread pool, and the video unit is added to a pre-reading queue; in response to a third number of data frames corresponding to the video unit reaching a second preset number, the video unit is read from the pre-reading queue and downloaded to a local cache.

[0013] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, the electronic device comprising a memory and a processor coupled to the memory, the memory storing at least one computer program, and the at least one computer program, when loaded and executed by the processor, is used to implement the video data processing method as described above.

[0014] To solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium, wherein the computer-readable storage medium has at least one program, and when the at least one program is loaded and executed by the processor, it is used to implement the video data processing method as described above.

[0015] Different from the current technology, the video data processing method provided by the present application includes: obtaining multiple video units corresponding to the video data to be stored; merging the multiple video units according to the cloud performance of the object storage, and storing the merged video object in the object storage, and obtaining the first index information corresponding to each video object; using the first index information to determine the index file, and then obtaining the path information of the index file, and storing the path information in the local database, wherein the index file is stored in the object storage; that is, in the present application, by splitting the video data into multiple video units, and then merging them according to the cloud performance of the storage database, multiple video objects are obtained, and then the video objects are stored in the object storage, and the corresponding index information of the video objects is obtained, and then the index file is determined, and the index file is stored in the object database, and the path information of the index file is stored in the local database, which effectively reduces the local space occupancy, reduces costs, and improves the corresponding storage efficiency and read-write efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 It is a flowchart of an embodiment of a video data processing method applied to a storage end in the present application; Figure 2 It is a flowchart of a specific operation embodiment of a video data processing method applied to a storage end in the present application; Figure 3 It is a flowchart of an embodiment of a video data processing method applied to a reader in the present application; Figure 4 It is a schematic diagram of the interaction process between the client and the object storage in this application; Figure 5 It is a structural diagram of an embodiment of a video data processing system in the present application; Figure 6 It is a structural schematic diagram of an embodiment of an electronic device in the present application; Figure 7 It is a structural diagram of an embodiment of a computer-readable storage medium in the present application. DETAILED DESCRIPTION

[0017] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.

[0018] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0019] Traditional video data processing methods usually store video data by connecting to distributed file systems or local storage systems, especially in large-scale business scenarios in the security industry. As the amount of video data increases, more local space will be occupied, increasing costs. In addition, both storage efficiency and read-write efficiency may have high latency, and the application layer business will be blocked, which does not meet the current business scenarios of the security industry.

[0020] Therefore, a video data processing method is provided, which splits the video data into multiple video units, merges the video units into video objects according to the cloud performance of object storage, and then stores the video objects in the object storage, obtains the index file of the video object and stores it in the object storage, and stores the path information of the index file in the local database, thereby effectively reducing the local space occupied, reducing costs, and improving the corresponding storage efficiency and read-write efficiency.

[0021] See also Figure 1 , Figure 1 is a flow chart of an embodiment of a video data processing method applied to a storage end in the present application; it should be noted that if there is a substantial result, the method of the present application is not based on Figure 1 The process sequence shown is limited.

[0022] like Figure 1 As shown, the video data processing method applied to the storage end may include the following steps.

[0023] S10. Acquire multiple video units corresponding to the video data to be stored.

[0024] The video data refers to the video data acquired by the video acquisition device, which may be historical video data or real-time video data, specifically streaming data; the video unit refers to GOP data (Group of Pictures), which is generally the distance between two IDR frames (Instantaneous Decoder Refresh Frames), used to describe the video sequence structure, and may be a group of pictures.

[0025] Specifically, the video data to be stored is acquired by using a video acquisition device, and the video data is segmented to obtain a plurality of video units, that is, a plurality of GOP data.

[0026] S20. Merge multiple video units according to the cloud performance of the object storage, store the merged video objects in the object storage, and obtain first index information corresponding to each video object.

[0027] Among them, object storage refers to a database that stores objects through the object storage protocol (S3 protocol, Amazon Simple Storage Service), which is a type of distributed storage; cloud performance refers to the comprehensive representation of cloud computing power, network performance and storage performance corresponding to object storage; the merged video object here is used as the storage object, and the storage object refers to the transmission file corresponding to the file uploaded by object creation (put object), that is, object data; the first index information refers to the index information corresponding to the video, which may include index time, file name, file length and offset information within the file, etc.

[0028] Specifically, after obtaining multiple video units of video data, the cloud performance of object storage is used to merge the multiple video units, that is, at least one video unit is merged into one video object, and then the video object is stored in the object storage through the object storage protocol, and in response to the video object being stored in the object storage, the first index information consisting of the index time, file name, file length and offset information within the file corresponding to each video object is obtained, and the index time is the time corresponding to when the index is established.

[0029] S30. Determine an index file using the first index information, and then obtain path information of the index file, and store the path information in a local database, wherein the index file is stored in an object storage.

[0030] The index file refers to a data structure in a database used to improve data retrieval efficiency, and records data-related information in the database; the path information of the index file refers to path-related information for storing the index file.

[0031] Specifically, after obtaining the first index information corresponding to the video object, the first index information can be used to determine the index file of the video object, store the index file in the object storage, obtain the path information of the index file in the object storage, and store the path information in the local database to reduce local space occupancy.

[0032] In this embodiment, the video data is split into multiple video units, and then the video units are merged into video objects based on the cloud performance of the object storage, and then the video objects are stored in the object storage, the index file of the video object is obtained and stored in the object storage, and the path information of the index file is stored in the local database, which effectively reduces the local space occupied, reduces costs, and improves the corresponding storage efficiency and read and write efficiency.

[0033] In some embodiments, step S10 of acquiring multiple video units corresponding to the video data to be stored may include the following operations.

[0034] First, segmentation conditions are constructed, wherein the segmentation conditions include time interval information, code stream size information, data size information, etc.

[0035] The segmentation condition refers to the condition based on which the video data is segmented, and the video unit obtained by segmentation is a video unit that can be decoded independently, that is, GOP data.

[0036] Specifically, the time interval information, the bitstream size information and the data size information are set to form the segmentation condition. The time interval information may range from 1 to 10 seconds, such as 2 seconds, 4 seconds, 5 seconds, 6 seconds, 8 seconds, etc.; the bitstream size information may range from 1 MB to 10 MB, such as 2 MB, 4 MB, 6 MB, 8 MB, etc.; the data size information may range from 0.5 MB to 4 MB, such as 1 MB, 2 MB, etc. In this embodiment, the time interval information of 2 seconds, the bitstream size information of 4 MB and the data size information of 1 MB are used as the segmentation condition.

[0037] Furthermore, the video data to be stored is divided into a plurality of video units using the segmentation conditions.

[0038] Specifically, the video data to be stored is divided into a plurality of video units using the segmentation conditions that the time interval information is 2 seconds, the code stream size information is 4 MB, and the data size information is 1 MB.

[0039] Furthermore, each communication channel first caches a video unit (GOP data) in a local database, and uses the video unit (GOP data) as the smallest unit of the upload object.

[0040] In some embodiments, step S20 merges multiple video units according to the cloud performance of the object storage, stores the merged video objects in the object storage, and obtains the first index information corresponding to each video object, which may include the following operations.

[0041] First, get the cloud performance of object storage.

[0042] Among them, the cloud performance of object storage is a comprehensive reflection of cloud computing power, network performance and storage performance. Weighted calculation can be set, that is, a weight value is set for each parameter, and then the weight value and the corresponding cloud computing power, network performance and storage performance are used for calculation to obtain a comprehensive value. For example, the cloud computing power corresponds to a first weight value, the network performance corresponds to a second weight value, the storage performance has a third weight value, and each parameter is set to three levels of high, medium and low, and then a comprehensive value is calculated to represent the cloud performance.

[0043] Next, the at least one video unit is determined as a video object using cloud performance, and the video object is stored in an object storage.

[0044] When the cloud performance is good, increase the number of merged data units. When the cloud performance decreases, reduce the number of merged data units. For example, the first weight value is 3, the second weight value is 3, and the third weight value is 4. The three levels of high, medium and low are 3, 2, and 1 respectively. If the comprehensive value corresponding to the current cloud performance is greater than 15, the number of merged data units can be increased. If the comprehensive value corresponding to the current cloud performance is less than the comprehensive value corresponding to the historical cloud performance, the number of merged data units can be reduced, thereby reducing the number of video objects, because storage in object storage is stored in data objects, thereby reducing the number of data object uploads, that is, reducing the frequency of object creation (put object) calls and reducing performance consumption.

[0045] In some embodiments, there is at least one data unit in a video object.

[0046] Furthermore, the following operations may also be included.

[0047] A corresponding cache queue is constructed for each communication channel, and at least one video unit is cached in the cache queue.

[0048] Among them, the communication channel refers to the channel between the client and the sub-node of the object storage, which can also be the smallest unit of video data. The management node manages the relevant processing work and ensures that the channel exists on only one sub-node at the same time; the cache queue refers to the queue established during the caching process and exists in the business layer.

[0049] Specifically, a cache queue is established for each communication channel, and the value of the cache queue can be adjusted according to the machine memory and the total number of channels. When each frame of video data is called back, it is put into the frame cache queue, and the frame cache queue constitutes a video unit, and then at least one video unit is put into the cache queue.

[0050] Then, at least one video unit in the cache queue is merged into a video object, wherein the merged number of video units is dynamically adjusted according to the cloud performance of the object storage.

[0051] Among them, one or more video units can be cached in the cache queue, and at least one video unit in the cache queue is merged into one video object according to the cloud performance of the object storage.

[0052] For example, when the cloud performance is low, 1-2 video units can be merged. When the cloud performance is medium, 2-8 video units can be merged. When the cloud performance is high, 8-20 video units can be merged.

[0053] In some embodiments, index-related records may also be added to the video unit, such as index time, file name, etc., and the related time in the local cache and the related time in the object storage may be updated.

[0054] Then, the video object is stored in the object storage using the object storage protocol.

[0055] The object storage protocol (S3 protocol) is a protocol required for storing video objects in object storage.

[0056] Specifically, after obtaining the video object, the object storage protocol (S3 protocol) is used to call object creation (putobject) to upload the video object to the object storage.

[0057] In some implementations, when uploading a video object to the object storage, it is also necessary to add a line of index records in the index file. The added index record is the first index information of the currently uploaded video object.

[0058] Then, a first relationship between the video object and each video unit in the video object is obtained, second index information corresponding to each video unit is obtained using the first relationship, and the first index information is further determined using the second index information.

[0059] The first relationship is used to characterize the association relationship between the video object and each video unit in the video object. The second index information is the index information corresponding to the video unit, including the index time, file name, file length and file offset information of the video unit, and the first index information includes the second index information of multiple video units in the video object.

[0060] Specifically, after the video object is stored in the object storage, the association relationship between the video object and each video unit in the video object is determined and used as the first relationship, and then the second index information corresponding to each video unit in the video object is determined using the first relationship.

[0061] Furthermore, in this application, object creation (put object) is used to upload files. The object storage protocol (S3) is a REST-style interface that uses HTTP short links. If the normal 40 milliseconds per frame is used, and object creation (putobject) is called for each frame, a large amount of short link overhead will be generated. Therefore, when using the object storage protocol (S3) to connect to object storage, it is necessary to control the appropriate video object (object data).

[0062] In this embodiment, by merging multiple video units into a video object, the number of video objects used for transmission is effectively reduced, thereby effectively reducing the call frequency of object creation (put object), reducing performance consumption, and increasing storage efficiency.

[0063] In some embodiments, step S30 uses the first index information to determine the index file, and then obtains the path information of the index file, and stores the path information in a local database, wherein the index file is stored in an object storage, and may include the following operations.

[0064] First, a first number of video objects is obtained, and public information is determined using the first number.

[0065] The first quantity refers to the quantity of video objects that need to be uploaded.

[0066] Specifically, a first number of video objects to be uploaded is obtained, and the first number is used as public information. In some embodiments, the public information may also include a version number of the index file to solve the problem of confusion caused by adding content to the index file later.

[0067] Next, second index information corresponding to each video unit in the video object is obtained.

[0068] The second index information at least includes: index time, file name, file length and file offset information.

[0069] For example, the index time, file name, file length and file offset information are divided by a separator to form the second index information of each video unit, the index time refers to the time when the current video unit is indexed, the file name refers to the file name of the file where the current video unit is located, and the file length refers to the length of the file where the current video unit is located, which can also be the number of characters. The file offset information refers to whether the position of the video unit in the file has changed.

[0070] Then, the index file is determined using the common information and the second index information.

[0071] Specifically, a table structure is established using the public information and the second index information to determine the corresponding index file.

[0072] Furthermore, in response to storing the index file in the object storage, path information of the index file is obtained from the object storage.

[0073] Specifically, the index file is stored in the object storage, and the storage location of the index file in the object storage is correspondingly obtained as the path information of the index file, and the path information of the index file is stored in the local database.

[0074] Further, in response to the upload time of the current video object reaching the preset switching time, the determined historical index file is stored in the object storage.

[0075] The preset switching time refers to a preset period for regularly generating an index file. The preset period may be half an hour, that is, an index file is generated every half an hour.

[0076] Specifically, an index file is generated every half an hour, that is, the preset switching time is also half an hour, which can be counted from the start of video data processing; when the upload time of the current video object reaches the preset switching time, the previously generated historical index file is stored in the object storage.

[0077] A new index file is created using the first index information corresponding to the current video object, and path information of the new index file is added to the local database.

[0078] Specifically, because the current video object has no association with the historical index file, a new index file needs to be created to record the current video object. Therefore, a new index file is created using the first index information corresponding to the current video object, and the path information of the new index file is obtained, and the path information of the new index file is added to the local database.

[0079] In some embodiments, the specific operation flow of the video data processing method applied to the storage end is as follows.

[0080] See also Figure 2 , Figure 2 It is a flowchart of a specific operation embodiment of a video data processing method applied to a storage end in the present application.

[0081] like Figure 2 As shown, wait for streaming data to be written, that is, video data to be written; add the video frame corresponding to the streaming data to the frame queue; whether the frame queue satisfies the generation of GOP, GOP is also a video unit, if not, return to the writing step, if satisfied, add the GOP to the cache queue; then add the GOP index record, and update the time, that is, update the end_time in the database; then determine whether it satisfies the writing, that is, whether it satisfies the writing to the object storage, if not, return to the writing step, if satisfied, merge the GOP and upload it to S3, that is, upload it to the object storage; then determine whether the index file needs to be cut, if necessary, upload the index file, create a new index file, insert the index information in the database, and end the process, or when the index file does not need to be cut, the process is also correspondingly ended; it can be understood that the database here is an object storage, that is, the index file is stored in the object storage.

[0082] In this embodiment, the video data is split into multiple video units, and then the video units are merged into video objects based on the cloud performance of the object storage, and then the video objects are stored in the object storage, the index file of the video object is obtained and stored in the object storage, and the path information of the index file is stored in the local cache, which effectively reduces the local space occupied, reduces costs, and improves the corresponding storage efficiency and read and write efficiency.

[0083] The present application also provides a video data processing method applied to a reading end.

[0084] See also Figure 3 , Figure 3 It is a flowchart of an embodiment of a video data processing method applied to a reading end in the present application.

[0085] like Figure 3 As shown, the video data processing method applied to the reading end may include the following operations.

[0086] S40. In response to the query instruction, the index file in the object storage is downloaded to the local cache using the path information of the index file, wherein the path information of the index file is stored in the local database.

[0087] The index file is stored in the object storage, and the obtained index file is stored in the local cache.

[0088] Specifically, when video data playback is required, in response to a query instruction, the index file is downloaded from the object storage to the local cache using the path information of the index file in the local database.

[0089] It can be understood that the path information of the index file is stored in the local database, and only the path information of the index file is stored in the local database; and the downloaded index files, video units, etc. are all in the local cache; the local cache refers to dividing a part of the local physical memory of the client, and the local cache is used to buffer the data written back by the client to the server.

[0090] S50: Create a memory index using the first index information in the index file.

[0091] The memory index refers to the first index information obtained by parsing the index file and is an index established by the index service itself.

[0092] Specifically, after the local database obtains the index file, it parses the index file to obtain the index information in the index file, and then the index service itself uses the index information to establish a memory index.

[0093] S60. In response to the playback instruction, obtain a target playback time corresponding to the playback instruction.

[0094] The playback instruction refers to the playback requirement.

[0095] Specifically, the playback requirement is obtained, and the playback instruction is determined according to the playback requirement, and then in response to the playback instruction, the target playback time corresponding to the playback instruction, that is, the corresponding timestamp, is determined; it may include the playback start time and the playback end time.

[0096] In some embodiments, the playback instruction may be an instruction for forward playback or an instruction for reverse playback.

[0097] S70, using the memory index to download the video unit in the video object corresponding to the target playback time to the local cache, and then play back the video unit, wherein the video object uses the cloud performance of the object storage to merge multiple video units.

[0098] Specifically, after obtaining the target playback time, the built-in index established by the index service itself is used to download the video units in the video object corresponding to the target playback time from the object storage to the local cache, and then during playback, the obtained video units are played back in the local cache.

[0099] In this embodiment, for video objects stored in the object storage, the path information of the index file stored in the local database is used to download the index file in the object storage to the local cache, and then a memory index is established. Then, the memory index is used to download the video units in the video objects in the object storage to the local cache for playback, effectively reducing the local space occupied, reducing costs, and improving the corresponding read and write efficiency.

[0100] In some embodiments, when the video data is played back, when the application layer needs to provide frame data, synchronous reading at this time will not provide data immediately, and there will be a large delay, which will also block the application layer. If the video object is downloaded in a public cloud environment, the delay will be even higher. A thread pool is provided to provide a pre-reading function for multi-channel video playback, which does not block the application layer from obtaining data. If there is no data, it returns busy and needs to be retried. If there is data, it is a complete frame of data.

[0101] Specifically, in response to the second number of data frames corresponding to the video unit being lower than the first preset number, pre-reading is initiated through the pre-reading thread pool, and the video unit is added to the pre-reading queue.

[0102] The first preset number refers to the number of pre-reading initiations, which may be 50 frames.

[0103] When the second number of data frames corresponding to the video unit is less than 50 frames, the pre-reading thread initiates pre-reading and adds the corresponding video unit to the pre-reading queue.

[0104] In response to the third number of data frames corresponding to the video unit reaching the second preset number, the video unit is read from the pre-read queue and downloaded to the local database.

[0105] The second preset number refers to the upper limit of pre-reading, which may be 100 frames.

[0106] When the third number of data frames corresponding to the video unit reaches 100 frames, that is, the data frames in the pre-read queue reach 100 frames, the video unit can be read from the pre-read queue and downloaded to the local cache.

[0107] In some embodiments, when the forward and reverse playback sequences are switched, the data that has been pre-read in the local cache memory needs to be discarded. Pre-reading needs to consider the forward and reverse playback issues. Forward playback is backward pre-reading, while reverse playback is forward pre-reading. However, the frames in the same video unit (GOP data) are sequential.

[0108] In this embodiment, the video data is split into multiple video units, and then the video units are merged into video objects based on the cloud performance of the object storage, and then the video objects are stored in the object storage, the index file of the video object is obtained and stored in the object storage, and the path information of the index file is stored in the local database, which effectively reduces the local space occupied, reduces costs, and improves the corresponding storage efficiency and read and write efficiency.

[0109] Furthermore, the interaction process between the client and object storage is demonstrated.

[0110] See also Figure 4 , Figure 4 It is a schematic diagram of the interaction process between the client and object storage in this application.

[0111] like Figure 4 As shown, management node: storage management service is responsible for responding to client requests and managing front-end devices and sub-nodes; mysql is deployed on the management node and is responsible for recording the path of the index file and some common information. mysql is a relational database management system, that is, a management system. In the storage architecture of this solution, the channel is the smallest unit of video recording, and the management node ensures that the channel is only on one sub-node at the same time. Sub-node: The storage sub-service is responsible for accessing client data and writing data to the object storage connected to the object storage protocol (S3). The index service is responsible for managing index files, connecting to mysql, and going to mysql for table association and storage for each channel.

[0112] In some embodiments, a video data processing system is also provided.

[0113] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of a video data processing system in the present application.

[0114] like Figure 5 As shown, the video data processing system 400 includes: a first acquisition module 410, a second acquisition module 420 and a third acquisition module 430; wherein the first acquisition module 410 is used to obtain multiple video units corresponding to the video data to be stored; the second acquisition module 420 merges the multiple video units according to the cloud performance of the object storage, and stores the merged video objects in the object storage, and obtains the first index information corresponding to each video object; the third acquisition module 430 uses the first index information to determine the index file, and then obtains the path information of the index file, and stores the path information in the local database, wherein the index file is stored in the object storage.

[0115] In some embodiments, an electronic device is also provided.

[0116] See also Figure 6, Figure 6 1 is a schematic diagram of the structure of an electronic device in an embodiment of the present application. The electronic device can execute the steps of the video data processing method in the above method.

[0117] The electronic device 500 includes a memory 520, a processor 510 coupled to the memory, and at least one computer program stored in the memory 520 and executable on the processor 510; when the processor 510 loads and executes the at least one computer program, it is used to implement the steps of the video data processing method in the above method. For related contents, please refer to the detailed description of the above method, which will not be repeated here.

[0118] In some embodiments, a computer-readable storage medium is also included.

[0119] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of a computer-readable storage medium in the present application.

[0120] The computer readable storage medium 600 stores at least one program 610, which is used to implement the steps of the video data processing method in the above method when loaded and executed by the processor. For related contents, please refer to the detailed description of the above method, which will not be repeated here.

[0121] The above solution splits the video data into multiple video units, merges the video units into video objects based on the cloud performance of object storage, and then stores the video objects in the object storage, obtains the index file of the video object and stores it in the object storage, and stores the path information of the index file in the local database, which effectively reduces the local space occupied, reduces costs, and improves the corresponding storage efficiency and read and write efficiency.

[0122] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0126] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A video data processing method, characterized in that: Applied to the storage side, including: Acquire multiple video units corresponding to the video data to be stored; Merging the plurality of video units according to the cloud performance of the object storage, storing the merged video objects in the object storage, and obtaining first index information corresponding to each of the video objects; An index file is determined using the first index information, and then path information of the index file is obtained, and the path information is stored in a local database, wherein the index file is stored in the object storage.

2. The method according to claim 1, characterized in that The step of merging the plurality of video units according to the cloud performance of the object storage, storing the merged video objects in the object storage, and obtaining first index information corresponding to each of the video objects includes: Obtaining cloud performance of the object storage; Determining the video object from at least one of the video units using the cloud performance, and storing the video object in the object storage; A first relationship between the video object and each of the video units in the video object is obtained, second index information corresponding to each of the video units is obtained using the first relationship, and the first index information is further determined using the second index information.

3. The method according to claim 2, characterized in that The step of determining the video object by using the at least one video unit using the cloud performance, and storing the video object in the object storage, comprises: Building a corresponding cache queue for each communication channel, and caching at least one of the video units into the cache queue; Merging at least one of the video units in the cache queue into the video object, wherein the number of the merged video units is dynamically adjusted according to the cloud performance of the object storage, and the merged number is positively correlated with the cloud performance; The video object is stored in the object storage using an object storage protocol.

4. The method according to claim 2, characterized in that: The determining the index file by using the first index information, and then obtaining the path information of the index file includes: Obtaining a first number of the video objects, and determining public information using the first number; Acquire second index information corresponding to each of the video units in the video object, wherein the second index information at least includes: index time, file name, file length, and file offset information; Determine the first index information and then determine the index file by using the public information and the second index information; In response to storing the index file in the object storage, path information of the index file is obtained from the object storage.

5. The method according to claim 4, characterized in that Also includes: In response to the upload time of the current video object reaching the preset switching time, storing the determined historical index file in the object storage; A new index file is created using the index information corresponding to the current video object, and path information of the new index file is added to the local database.

6. The method according to claim 1, characterized in that The step of obtaining a plurality of video units corresponding to the video data to be stored includes: Constructing segmentation conditions, wherein the segmentation conditions include time interval information, code stream size information, and data size information; The video data to be stored is divided into a plurality of video units using the segmentation condition.

7. A video data processing method, characterized in that: Applied to the reading side, including, In response to the query instruction, download the index file in the object storage to the local cache using the path information of the index file, wherein the path information of the index file is stored in the local database; Using the first index information in the index file, establishing a memory index; In response to a playback instruction, obtaining a target playback time corresponding to the playback instruction; The video unit in the video object corresponding to the target playback time is downloaded to the local cache using the memory index, and then the video unit is played back, wherein the video object is formed by merging multiple video units using the cloud performance of the object storage.

8. The method according to claim 7, characterized in that Also includes: In response to a second number of data frames corresponding to the video unit reaching a first preset number, initiating pre-reading through a pre-reading thread pool and adding the video unit to a pre-reading queue; In response to a third number of data frames corresponding to the video unit reaching a second preset number, the video unit is read from the pre-read queue and downloaded to the local cache.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor coupled to the memory, the memory stores at least one computer program, and when the at least one computer program is loaded and executed by the processor, it is used to implement the video data processing method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium has at least one program, and when the at least one program is loaded and executed by the processor, it is used to implement the video data processing method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Object cloud storage method and system

    CN112559799A

  • Video playing method and device, terminal equipment and storage medium

    CN113329267A

  • Image storing system and method based on GOP unit

    KR102090308B1