Video data access method and device based on cloud edge fusion, equipment and medium
By receiving video read requests in a distributed storage system, reading and filling the video data in the erasure data block, and using the erasure algorithm to calculate the original video data, solving the problem that video data cannot be read and written in the hyper-fault domain state, realizing the analysis and access of video data, and improving the availability of video data.
Patent Information
- Application Number
- CN202510142063.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-16
AI Technical Summary
When the distributed storage system is in a super-failed domain state, video data cannot be read and written, resulting in normal video data being unable to be parsed and accessed.
By receiving the video read request, determining the address information, reading the video data in the erasure data block, and determining whether it is necessary to fill the zeros based on the number of copies until the total number of copies of the erasure data block is reached, and then using the erasure algorithm to calculate the original video data.
In the hyper-fault domain state, through the combination of zero-filling and erasure algorithms, the reading and writing functions of video data can be maintained, damaged video data can be reduced, and damaged video data can be resolved, thereby improving the availability of video data.
Smart Images

Figure CN120017867A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage technology, and in particular to a video data access method, device, equipment and medium based on cloud-edge fusion. Background Art
[0002] In the cloud-edge fusion storage system, edge devices often deploy streaming network data applications with large data volumes, such as video surveillance. To cope with the large amount of image / video data storage needs, video surveillance storage systems usually store data in cloud servers and access them when in use. The system undertakes functions such as video access, storage, forwarding, networking, and management, and is divided into a video surveillance application subsystem and a data storage subsystem. The data storage subsystem uses a distributed storage system to store video data and expands capacity by adding storage nodes.
[0003] However, as the number of hard disk devices increases, the difficulty of maintenance and the risk of failure also increase, so a fault-tolerant mechanism is needed to ensure data security. Erasure coding technology is a commonly used fault-tolerant mechanism. Its core is to divide the original data into K data blocks and calculate M check blocks, which are stored in different nodes. When any block is lost but any K blocks exist, the data can be calculated and restored. However, when only any K-1 blocks exist, the data cannot be restored. This state is called the super fault domain state. For video surveillance storage systems, the super fault domain state makes it impossible to read and write video data, and then it is impossible to parse undamaged video data, which affects video services.
[0004] In view of the above, how to solve the problem that when the distributed storage system is currently in a super fault domain state, it stops reading and writing data, making it impossible to parse and access normal video data is an urgent problem to be solved by technicians in this field. Summary of the invention
[0005] The purpose of the present invention is to provide a video data access method, device, equipment and medium based on cloud-edge fusion to solve the problem that when the distributed storage system is currently in a super fault domain state, it stops reading and writing data, making normal video data unable to be parsed and accessed.
[0006] In order to solve the above technical problems, the present invention provides a video data access method based on cloud-edge fusion, which is applied to a distributed storage system; the method comprises:
[0007] When receiving a first video read request sent by the video surveillance application subsystem layer, determining address information in the first video read request;
[0008] Reading target video data in a corresponding erasure correction data block according to the address information; wherein a group of video data is stored in only one erasure correction data block;
[0009] Determine whether the number of copies of the target video data is less than the total number of copies of the erasure data blocks;
[0010] If yes, fill the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure correction data block;
[0011] The target video data are calculated according to the erasure correction algorithm to obtain the corresponding original video data, and the original video data is returned to the video surveillance application subsystem layer.
[0012] On the one hand, before receiving the first video read request sent by the video surveillance application subsystem layer, the method further includes:
[0013] Receive video write data through the video surveillance application subsystem layer and store it in memory;
[0014] Applying for a segment file in a node of a corresponding channel of the memory through the video surveillance application subsystem layer; wherein each node of the distributed storage system contains a plurality of segment files of the same quantity and equal storage space size;
[0015] The video data in the memory is written into the segment file through the video surveillance application subsystem layer.
[0016] On the other hand, the video surveillance application subsystem layer stores video write data into memory, including:
[0017] Convert video write data into picture groups in memory;
[0018] The picture group includes a picture group header, an internal coding frame, a forward prediction frame and a bidirectional interpolation frame; the picture group header includes a picture group identifier, a camera channel identifier, a picture group length and an internal coding frame time;
[0019] Correspondingly, the video data in the memory is written into the segment file through the video surveillance application subsystem layer, including:
[0020] The picture group in the memory is written into the segment file through the video surveillance application subsystem layer.
[0021] On the other hand, the video surveillance application subsystem layer applies for segment files in the node of the corresponding channel in the memory, including:
[0022] According to the segment number of each segment file in the node, apply for the segment file that is not fully written in the picture group storage space in the node;
[0023] The segment file consists of a segment file header, a picture group storage space and a file tail; the segment file header contains the camera channel identifier, the first frame time of the segment file, the size of the segment file free space and the segment number.
[0024] On the other hand, the video surveillance application subsystem layer writes the picture group in the memory into the segment file, including:
[0025] According to the GOP length of the GOP and the free space size of the segment file, it is determined whether the remaining GOP storage space of the segment file can be written into the GOP;
[0026] If not, the current segment file is marked as full;
[0027] According to the segment number of each segment file in the node, apply for a new segment file with empty picture group storage space in the node, and update the segment file header corresponding to the new segment file;
[0028] Write the picture group into the picture group storage space of the new segment file, and update the segment file free space size of the new segment file;
[0029] If so, the picture group is written into the picture group storage space of the segment file, and the segment file free space size of the segment file is updated.
[0030] On the other hand, after the picture group in the memory is written into the segment file through the video surveillance application subsystem layer, it also includes:
[0031] Write the segment file header of the segment file into the first erasure correction data block;
[0032] According to the picture group length of the picture group in the segment file, determining whether the picture group is allowed to write the first erasure correction data block;
[0033] If yes, write the picture group into the first erasure correction data block;
[0034] If not, the picture group is written into the second erasure correction data block.
[0035] On the other hand, after the picture group in the memory is written into the segment file through the video surveillance application subsystem layer, it also includes:
[0036] Generate metadata based on the segment number of the segment file, the camera channel identifier of the picture group and the internal coding frame time;
[0037] Store the metadata in the metadata server.
[0038] On the other hand, it also includes:
[0039] The video surveillance application subsystem layer receives a second video read request;
[0040] The video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request;
[0041] The video monitoring application subsystem layer searches for a corresponding target picture group in the data of the target segment file according to the second video read request, and outputs the target picture group.
[0042] On the other hand, the video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request, including:
[0043] The video surveillance application subsystem layer performs metadata retrieval in the metadata server according to the camera channel identifier and the internal encoding frame time in the second video read request to obtain the corresponding target segment number;
[0044] The video surveillance application subsystem layer determines the corresponding target segment file according to the target segment number.
[0045] On the other hand, before the video surveillance application subsystem layer searches for the corresponding target picture group in the data of the target segment file according to the second video read request, after the video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request, it also includes:
[0046] The video surveillance application subsystem layer determines whether the data of the target segment file is in the memory;
[0047] If not, the video surveillance application subsystem layer reads the data in the target segment file into memory;
[0048] Correspondingly, the video surveillance application subsystem layer searches for a corresponding target picture group in the data of the target segment file according to the second video read request, including:
[0049] The video monitoring application subsystem layer searches for the corresponding target picture group in the data of the target segment file in the memory according to the time information in the second video read request.
[0050] On the other hand, the video surveillance application subsystem layer reads the data in the target segment file into the memory, including:
[0051] The video surveillance application subsystem layer calculates the starting logical address of the target segment file in the distributed storage system according to the target segment number and the size of the target segment file;
[0052] The video surveillance application subsystem layer reads the data in the target segment file into the memory according to the starting logical address of the target segment file.
[0053] On the other hand, after the video surveillance application subsystem layer outputs the target picture group, it also includes:
[0054] The video surveillance application subsystem layer deletes the target picture group from the data of the target segment file in the memory.
[0055] In order to solve the above technical problems, the present invention also provides a video data access device based on cloud-edge fusion, which is applied to a distributed storage system; the device includes:
[0056] A determination module, configured to determine address information in the first video read request when receiving the first video read request sent by the video surveillance application subsystem layer;
[0057] A reading module, used for reading target video data in a corresponding erasure correction data block according to address information; wherein a group of video data is stored in only one erasure correction data block;
[0058] A judgment module, used to judge whether the number of copies of the target video data is less than the total number of copies of the erasure data blocks; if so, triggering the filling module;
[0059] A filling module, used for filling the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure data block;
[0060] The calculation module is used to calculate each target video data according to the erasure correction algorithm to obtain the corresponding original video data, and return the original video data to the video surveillance application subsystem layer.
[0061] In order to solve the above technical problems, the present invention also provides a video data access device based on cloud-edge fusion, comprising:
[0062] Memory for storing computer programs;
[0063] A processor is used to implement the steps of the above-mentioned video data access method based on cloud-edge fusion when executing a computer program.
[0064] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned video data access method based on cloud-edge fusion are implemented.
[0065] The video data access method based on cloud-edge fusion provided by the present invention is applied to a distributed storage system. Specifically, when a first video read request issued by the video surveillance application subsystem layer is received, the address information in the first video read request is determined; the target video data is read in the corresponding erasure data block according to the address information; wherein a group of video data is stored in only one erasure data block; it is determined whether the number of copies of the target video data is less than the total number of copies of the erasure data block; if so, the target video data is padded with zeros until the number of copies of the target video data reaches the total number of copies of the erasure data block; the corresponding original video data is obtained by calculating each target video data according to the erasure algorithm, and the original video data is returned to the video surveillance application subsystem layer.
[0066] The beneficial effect of the present invention is that each group of video data is pre-stored in only one erasure data block, and is not stored across erasure data blocks. When multiple nodes or disk failures occur and the distributed storage system enters a super fault domain, and a video read request is received, the distributed storage system fills in zeros to make up the number of erasure data blocks, and calculates the original video data corresponding to the target video data according to the erasure algorithm, thereby maintaining the read and write functions, so that after the video surveillance storage system enters the super fault domain, the damaged video data is reduced, and the undamaged video data can still be parsed, which effectively improves the availability of video data. On this basis, the present invention also provides a data boundary-aware video storage data layout method in a cloud-edge fusion scenario, and divides the storage space presented by the distributed storage system layer into segment files of fixed size at the video surveillance application subsystem layer, and the segment files store video data in units of GOP, thereby achieving reasonable storage of video data.
[0067] In addition, the present invention also provides a video data access device, equipment and medium based on cloud-edge fusion, with the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 A flowchart of a video data access method based on cloud-edge fusion provided by an embodiment of the present invention;
[0070] Figure 2 A schematic diagram of a segment file provided by an embodiment of the present invention;
[0071] Figure 3 A schematic diagram of a video data access device based on cloud-edge fusion provided by an embodiment of the present invention;
[0072] Figure 4 A schematic diagram of a video data access device based on cloud-edge fusion provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] The core of the present invention is to provide a video data access method, device, equipment and medium based on cloud-edge fusion to solve the problem that when the distributed storage system is currently in a super fault domain state, it stops reading and writing data, making normal video data unable to be parsed and accessed.
[0075] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0076] In the cloud-edge fusion storage system, edge devices often deploy streaming network data applications with large data volumes, such as video surveillance. The video surveillance storage system consists of surveillance devices such as cameras and data storage devices. To meet the needs of large amounts of image / video data storage, the system usually stores data in a cloud server and accesses it when in use. The system undertakes functions such as video access, storage, forwarding, networking, and management, and is divided into a video surveillance application subsystem and a data storage subsystem. The video surveillance application subsystem is responsible for functions other than video storage, while the data storage subsystem focuses on video storage. Video encoding is a key link in the video surveillance application subsystem, in which Group of Pictures (GOP) is an important concept, consisting of I frames, P frames, and B frames. Among them, I frames are intra coded frames, which can be used as reference points for random access and can be regarded as a complete image. The first frame of a group of pictures must be an I frame, and there is only one I frame in a GOP; P frames are forward predicted frames, which record the changes relative to the previous frame; B frames are bi-directional predicted frames, which record the differences relative to the previous and next frames. The GOP structure affects video compression efficiency and image quality.
[0077] The data storage subsystem usually uses a distributed storage system to store video data, and expands the capacity by adding storage nodes. However, as the number of hard disk devices increases, the difficulty of maintenance and the risk of failure increase, so a fault-tolerant mechanism is required to ensure data security. Erasure coding technology is a commonly used fault-tolerant mechanism, and its core is to divide the original data into K data blocks and calculate M check blocks, which are stored in different nodes. When any block is lost but any K blocks exist, the recovery data can be calculated. However, when only any K-1 blocks exist, the data cannot be recovered, and this state is called a super-fault domain state. For video surveillance storage systems, the super-fault domain state makes it impossible to read and write video data, and then it is impossible to parse undamaged video data, which affects video services. Therefore, in order to solve the above problems, the present invention provides a video data access method based on cloud-edge fusion, which is specifically applied to distributed storage systems.
[0078] Figure 1A flowchart of a video data access method based on cloud-edge fusion provided by an embodiment of the present invention. Figure 1 As shown, the method includes:
[0079] S10: When a first video read request sent by the video surveillance application subsystem layer is received, address information in the first video read request is determined.
[0080] Specifically, when a node or hard disk of a distributed storage system fails and enters a super fault domain state, if a first video read request sent by the video surveillance application subsystem layer is received, the address information in the first video read request is first required to locate the erasure data block according to the address information.
[0081] S11: Reading target video data in a corresponding erasure correction data block according to the address information.
[0082] Among them, a group of video data is stored in only one erasure data block.
[0083] Further, the target video data is read in the corresponding erasure data block according to the address information. It should be noted that the target video data is data pre-stored in the erasure data block, and is a set of video data with a complete image. In the present invention, a set of complete video data is stored in only one erasure data block, and one erasure data block may contain multiple sets of complete video data. In this embodiment, there is no limitation on the type of video data, for example, it may be GOP.
[0084] S12: Determine whether the number of copies of the target video data is less than the total number of copies of the erasure correction data blocks. If so, proceed to step S13.
[0085] It can be understood that the erasure code consists of K erasure data blocks and M erasure check blocks; in the case of non-super fault domain, the normal original data can be calculated based on any K data in K+M; in the case of super fault domain, if at least M+1 data are faulty, the total number of erasure blocks is less than K. Therefore, in order to determine whether the target video data can be directly calculated and read, it is necessary to determine whether the number of target video data is less than the total number of erasure data blocks.
[0086] If it is confirmed that the number of target video data is not less than the total number of erasure data blocks, it is considered that the corresponding original video data can be directly calculated according to the erasure algorithm for each target video data, and the original video data is returned to the video surveillance application subsystem layer.
[0087] S13: Fill the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure correction data blocks.
[0088] S14: Calculate each target video data according to the erasure correction algorithm to obtain the corresponding original video data, and return the original video data to the video surveillance application subsystem layer.
[0089] If it is confirmed that the number of copies of the target video data is less than the total number of copies of the erasure data block, it is considered that the number of copies of the target video data is insufficient, and the target video data needs to be padded with zeros until the number of copies of the target video data reaches the total number of copies of the erasure data block, that is, K copies of the erasure data block are collected. Finally, the corresponding original video data is calculated according to the erasure algorithm, and the original video data is returned to the video surveillance application subsystem layer, realizing the parsing access of the undamaged video data.
[0090] In addition, the number of erasure check blocks (M value) can be increased in the specific implementation. By increasing the number of erasure check blocks, the system has more redundant information available for data recovery when facing node failure or data loss. This reduces the probability of entering the super fault domain state and improves data reliability. At the same time, in addition to erasure coding technology, a multi-copy strategy can also be used to copy data and store it on different nodes. In this way, even if some nodes fail, the copies on other nodes can still provide data access.
[0091] In this embodiment, each set of video data is pre-stored in only one erasure data block, and is not stored across erasure data blocks. When multiple nodes or disk failures occur and the distributed storage system enters a super fault domain, and a video read request is received, the distributed storage system fills in zeros to make up the number of erasure data blocks, and calculates the original video data corresponding to the target video data according to the erasure algorithm, thereby maintaining the read and write functions, so that after the video surveillance storage system enters the super fault domain, the damaged video data is reduced, and the undamaged video data can still be parsed, effectively improving the availability of video data.
[0092] Figure 2 A schematic diagram of a segment file provided by an embodiment of the present invention. Based on the above embodiment, in order to better store video data, in some embodiments, before receiving the first video read request sent by the video surveillance application subsystem layer, it also includes:
[0093] S15: Receive video write data through the video surveillance application subsystem layer and store it into the memory.
[0094] S16: Apply for a segment file in a node of a corresponding channel in the memory through the video surveillance application subsystem layer.
[0095] Each node of the distributed storage system contains a plurality of segment files of the same quantity and storage space size.
[0096] S17: Writing the video data in the memory into the segment file through the video surveillance application subsystem layer.
[0097] Specifically, in this embodiment, the storage space of the video surveillance application subsystem layer is provided by a distributed storage system. Figure 2 As shown, the distributed storage system consists of nodes 1, ..., node N. All nodes provide the same storage space. The storage space of each node is divided into segments, and the number of segment files that can be accommodated in the storage space of each node is calculated according to the segment file size set by the system. For example, the system sets the segment file size to 1G, the storage space of node 1 is divided into segment_1_0, segment_1_1, ..., segment_1_k, and the storage space of node N is divided into segment_N_0, segment_N_1, ..., segment_N_k.
[0098] Therefore, in order to store video data in the distributed storage system, the video write data is received by the video surveillance application subsystem layer, and the video write data is stored in the memory. Furthermore, the video surveillance application subsystem layer applies for a segment file in the node of the channel corresponding to the memory. It should be noted that the multiple channels of the memory have corresponding distributed storage system nodes, for example, channel 1 corresponds to node 1, and channel 2 corresponds to node 2. After applying for the segment file, the video surveillance application subsystem layer writes the video write data in the memory into the segment file.
[0099] It should also be noted that, in some embodiments, in order to better store and write video data, the video surveillance application subsystem layer will convert the video write data into GOP in the memory when storing the video write data into the memory. It should be noted that the writing of video data can be organized into one GOP or multiple GOPs, depending on the number of I frames in the data. Specifically, a new GOP is organized every time a new I frame appears. In addition, the GOP includes a GOP header, an I frame, a P frame, and a B frame; the GOP header includes a GOP identifier, a camera channel identifier, a GOP length, and an I frame time. Finally, after applying for the segment file, the video surveillance application subsystem layer writes the GOP in the memory into the segment file. It should be noted that in this embodiment, there is no restriction on the segment file application process and the process of writing the GOP into the segment file, which depends on the specific implementation situation.
[0100] In this embodiment, a data boundary-aware video storage data layout method is provided in a cloud-edge fusion scenario. At the video surveillance application subsystem layer, the storage space presented by the distributed storage system layer is divided into segment files of a fixed size. The segment files store video data in units of GOP, thereby achieving reasonable storage of video data.
[0101] Based on the above embodiments, in some embodiments, the video surveillance application subsystem layer applies for a segment file in a node of a channel corresponding to the memory, including:
[0102] S161: According to the segment number of each segment file in the node, apply for the segment files whose storage space of the picture group is not full in the node.
[0103] The segment file consists of a segment file header, a picture group storage space and a file tail; the segment file header contains the camera channel identifier, the first frame time of the segment file, the size of the segment file free space and the segment number.
[0104] In order to apply for segment files in the node, the segment files whose storage space of the picture group is not full are applied for in the node according to the segment numbers of the segment files in the node.
[0105] It should be noted that the segment file consists of a segment file header, GOP storage space and a file tail; the segment file header contains the camera channel identifier, the first frame time of the segment file, the size of the segment file free space and the segment number. In a node, each segment file has a corresponding segment number. Therefore, when applying for a segment file, it is necessary to apply according to the segment number of each segment file in the node. For example, according to the sequence of segment numbers from small to large, apply for a segment file whose GOP storage space is not full in the node, or according to another specific sequence, apply for a segment file whose GOP storage space is not full in the node. In this way, the application of segment files is realized.
[0106] Based on the above embodiments, in some embodiments, the video surveillance application subsystem layer writes the picture group in the memory into the segment file, including:
[0107] S171: judging whether the GOP storage space remaining in the segment file can be written into the GOP according to the GOP length of the GOP and the free space size of the segment file; if not, proceeding to step S172; if yes, proceeding to step S175.
[0108] S172: Mark the current segment file as full;
[0109] S173: According to the segment number of each segment file in the node, apply for a new segment file with an empty picture group storage space in the node, and update the segment file header corresponding to the new segment file;
[0110] S174: writing the picture group into the picture group storage space of the new segment file, and updating the segment file free space size of the new segment file;
[0111] S175: Write the picture group into the picture group storage space of the segment file, and update the segment file free space size of the segment file.
[0112] In order to write the GOP into the segment file, in this embodiment, it is specifically determined whether the remaining GOP storage space of the segment file can be used to write the GOP according to the GOP length of the GOP and the segment file free space size of the segment file. If the remaining GOP storage space of the segment file is sufficient to write the GOP, the GOP is written into the GOP storage space of the segment file, and the segment file free space size of the segment file is updated.
[0113] If the remaining GOP storage space of the segment file is insufficient to write the GOP, the current segment file is marked as full, and a new segment file with empty GOP storage space is applied for in the node according to the segment number of each segment file in the node. It can be understood that the application method for a new segment file is the same as that for the previous segment file. At the same time, the segment file header corresponding to the new segment file is updated, specifically the camera channel identifier and the first frame time of the segment file are updated. Finally, the GOP is written into the GOP storage space of the new segment file, and the size of the segment file free space of the new segment file is updated; in this way, the GOP is ensured to be stored completely in one segment file.
[0114] In order to generate an erasure data block containing a GOP to prevent data loss, based on the above embodiments, in some embodiments, after the picture group in the memory is written into the segment file through the video surveillance application subsystem layer, the following is further included:
[0115] S18: writing the segment file header of the segment file into the first erasure correction data block;
[0116] S19: judging whether the picture group is allowed to be written into the first erasure correction data block according to the picture group length of the picture group in the segment file; if so, writing the picture group into the first erasure correction data block; if not, writing the picture group into the second erasure correction data block.
[0117] Specifically, first write the segment file header of the segment file into the first erasure data block. It should be noted that the first erasure data block is an erasure data block specified by the distributed storage system. Further, based on the GOP length of the GOP in the segment file, determine whether the GOP is allowed to be written into the first erasure data block, and specifically determine whether the length of the remaining space of the first erasure data block is not less than the GOP length. If so, write the GOP into the first erasure data block; if not, write the GOP into the second erasure data block. It should be noted that the second erasure data block is also an erasure data block specified by the distributed storage system. The difference from the first erasure data block is that they are not the same data block, and the remaining space of the second erasure data block allows the GOP to be written.
[0118] It is worth noting that writing a GOP into an erasure data block is to avoid GOP being stored across two erasure data blocks. This is because when a node or hard disk fails, the entire erasure data block will be damaged, while the erasure data blocks on normal nodes or hard disks are not damaged; if a GOP is stored across erasure data blocks, when one of the erasure data blocks is damaged, the data in the normal erasure data block cannot be used.
[0119] It should also be noted that when a node or hard disk of a distributed storage system fails and enters a super fault domain state, since the core write process is designed based on the erasure code redundancy mechanism, the erasure code redundancy mechanism remains unchanged, and therefore the write process remains unchanged.
[0120] In order to facilitate retrieval of video data stored in a distributed storage system, based on the above embodiments, in some embodiments, after writing the picture group in the memory into the segment file through the video surveillance application subsystem layer, the following is further included:
[0121] S20: Generate metadata according to the segment number of the segment file, the camera channel identifier of the picture group and the internal coding frame time;
[0122] S21: Store the metadata in a metadata server.
[0123] Specifically, after the GOP in the memory is written into the segment file through the video surveillance application subsystem layer, metadata can be further generated according to the segment number of the segment file, the camera channel identifier of the GOP and the internal coding frame time, and the metadata is stored in the metadata server. It should be noted that the metadata server is independent of the distributed storage system.
[0124] Based on the generation and storage of the above metadata, in some embodiments, when the distributed storage system is not in a super fault domain state, the method further includes:
[0125] S22: The video surveillance application subsystem layer receives a second video read request;
[0126] S23: The video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request;
[0127] S24: The video surveillance application subsystem layer searches for a corresponding target picture group in the data of the target segment file according to the second video read request, and outputs the target picture group.
[0128] Specifically, when the distributed storage system is not in a super fault domain state, the video surveillance application subsystem layer receives a second video read request, the video surveillance application subsystem layer determines the corresponding target segment file based on the second video read request, and finally queries the corresponding target GOP in the data of the target segment file based on the second video read request, and outputs the target GOP.
[0129] It should be noted that the method for determining the target segment file is not limited in this embodiment. At the same time, the location for reading the data of the query target segment file is not limited in this embodiment, and the data can be read in a distributed storage system or in a memory, depending on the specific implementation situation.
[0130] In some embodiments, in order to accurately determine the target segment file corresponding to the second video read request, the video surveillance application subsystem layer specifically searches metadata in the metadata server according to the camera channel identifier and the internal encoding frame time in the second video read request to obtain the corresponding target segment number, and finally determines the corresponding target segment file according to the target segment number. In this way, the target segment file is accurately determined.
[0131] In addition, in order to improve the reading speed of video data, after the video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request, it can further determine whether the data of the target segment file is in the memory. If it is confirmed that the data of the target segment file is in the memory, the corresponding target GOP can be directly queried in the data of the target segment file in the memory according to the time information in the second video read request, without accessing the distributed storage system, thereby improving the video reading efficiency. If it is confirmed that the data of the target segment file is not in the memory, the video surveillance application subsystem layer needs to read the data in the target segment file into the memory; then, according to the time information in the second video read request, the corresponding target GOP is queried in the data of the target segment file in the memory.
[0132] It should also be noted that in order to read the data in the target segment file as a whole into the memory, the video surveillance application subsystem layer calculates the starting logical address of the target segment file in the distributed storage system based on the target segment number and the size of the target segment file, and reads the data in the target segment file into the memory based on the starting logical address of the target segment file.
[0133] In summary, the reading of video data in the non-super fault domain state is realized. In addition, considering that the video data that has been read is unlikely to be read again, in order to save memory storage space, after the video surveillance application subsystem layer outputs the target GOP, the target GOP can be further deleted from the data of the target segment file in the memory. Since the target GOP is still backed up in the distributed storage system, this not only saves memory storage space, but also does not affect the next reading of the target GOP.
[0134] In the above embodiment, the video data access method based on cloud-edge fusion is described in detail. The present invention also provides an embodiment corresponding to the video data access device based on cloud-edge fusion.
[0135] Figure 3A schematic diagram of a video data access device based on cloud-edge fusion provided by an embodiment of the present invention. The device is applied to a distributed storage system; Figure 3 As shown, the device comprises:
[0136] A determination module 10, configured to determine address information in the first video read request when receiving a first video read request sent by the video surveillance application subsystem layer;
[0137] A reading module 11 is used to read target video data in a corresponding erasure correction data block according to address information; wherein a group of video data is stored in only one erasure correction data block;
[0138] A judging module 12 is used to judge whether the number of copies of the target video data is less than the total number of copies of the erasure data blocks; if so, a filling module 13 is triggered;
[0139] A filling module 13, used for filling the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure correction data block;
[0140] The calculation module 14 is used to calculate each target video data according to the erasure correction algorithm to obtain the corresponding original video data, and return the original video data to the video monitoring application subsystem layer.
[0141] In some embodiments, it also includes:
[0142] The video write data is received through the video surveillance application subsystem layer, and the video write data is converted into a picture group in the memory; wherein the picture group includes a picture group header, an internal coding frame, a forward prediction frame and a bidirectional interpolation frame; the picture group header includes a picture group identifier, a camera channel identifier, a picture group length and an internal coding frame time; a segment file is applied for in a node of a corresponding channel in the memory through the video surveillance application subsystem layer; wherein each node of the distributed storage system includes a plurality of segment files of the same number and equal storage space size; the picture group in the memory is written into the segment file through the video surveillance application subsystem layer.
[0143] In some embodiments, the video surveillance application subsystem layer applies for segment files in the node of the channel corresponding to the memory, including: according to the segment number of each segment file in the node, applying for segment files whose picture group storage space is not full in the node; wherein the segment file is composed of a segment file header, a picture group storage space and a file tail; the segment file header contains the camera channel identifier, the first frame time of the segment file, the size of the segment file free space and the segment number.
[0144] In some embodiments, the video surveillance application subsystem layer writes the picture group in the memory into the segment file, including: judging whether the picture group can be written into the picture group in the remaining picture group storage space of the segment file according to the picture group length of the picture group and the size of the segment file free space of the segment file; if not, marking the current segment file as full; applying for a new segment file with empty picture group storage space in the node according to the segment number of each segment file in the node, and updating the segment file header corresponding to the new segment file; writing the picture group into the picture group storage space of the new segment file, and updating the size of the segment file free space of the new segment file; if yes, writing the picture group into the picture group storage space of the segment file, and updating the size of the segment file free space of the segment file.
[0145] In some embodiments, it also includes:
[0146] A first writing submodule, used for writing a segment file header of a segment file into a first erasure correction data block;
[0147] The first judgment submodule is used to judge whether the picture group is allowed to be written into the first erasure correction data block according to the picture group length of the picture group in the segment file; if so, write the picture group into the first erasure correction data block; if not, write the picture group into the second erasure correction data block.
[0148] In some embodiments, it also includes:
[0149] A first generating submodule is used to generate metadata according to the segment number of the segment file, the camera channel identifier of the picture group and the internal coding frame time;
[0150] The first storage submodule is used to store the metadata into the metadata server.
[0151] In some embodiments, it also includes:
[0152] The video surveillance application subsystem layer receives the second video read request; the video surveillance application subsystem layer performs metadata retrieval in the metadata server according to the camera channel identifier and the internal encoding frame time in the second video read request to obtain the corresponding target segment number; the video surveillance application subsystem layer determines the corresponding target segment file according to the target segment number; the video surveillance application subsystem layer determines whether the data of the target segment file is in the memory; if not, the video surveillance application subsystem layer calculates the starting logical address of the target segment file in the distributed storage system according to the target segment number and the size of the target segment file; the video surveillance application subsystem layer reads the data in the target segment file into the memory according to the starting logical address of the target segment file; the video surveillance application subsystem layer queries the corresponding target picture group in the data of the target segment file in the memory according to the time information in the second video read request, and outputs the target picture group; if so, the video surveillance application subsystem layer queries the corresponding target picture group in the data of the target segment file in the memory according to the time information in the second video read request, and outputs the target picture group.
[0153] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0154] In addition, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned video data access method based on cloud-edge fusion.
[0155] Figure 4 A schematic diagram of a video data access device based on cloud-edge fusion provided by an embodiment of the present invention. Figure 4 As shown, the video data access device based on cloud-edge fusion includes:
[0156] A memory 20, used for storing computer programs;
[0157] The processor 21 is used to implement the steps of the video data access method based on cloud-edge fusion mentioned in the above embodiment when executing a computer program.
[0158] The video data access device based on cloud-edge fusion provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0159] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array. The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0160] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the video data access method based on cloud-edge fusion disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be short-term storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to data involved in the video data access method based on cloud-edge fusion.
[0161] In some embodiments, the video data access device based on cloud-edge fusion may also include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0162] Those skilled in the art will understand that Figure 4 The structure shown in does not constitute a limitation on the video data access device based on cloud-edge fusion and may include more or fewer components than shown in the figure.
[0163] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0164] It is understandable that if the method in the above embodiment 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, 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, and the computer software product is stored in a storage medium to execute 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), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0165] The above is a detailed introduction to a video data access method, device, equipment and medium based on cloud-edge fusion provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0166] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A video data access method based on cloud-edge fusion, characterized in that: Applied to a distributed storage system; the method comprises: When receiving a first video read request sent by the video surveillance application subsystem layer, determining address information in the first video read request; Reading target video data in a corresponding erasure correction data block according to the address information; wherein a group of video data is stored in only one erasure correction data block; Determining whether the number of copies of the target video data is less than the total number of copies of the erasure correction data blocks; If yes, fill the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure data block; The target video data are calculated according to an erasure correction algorithm to obtain the corresponding original video data, and the original video data are returned to the video surveillance application subsystem layer.
2. The video data access method based on cloud-edge fusion according to claim 1 is characterized in that: Before receiving the first video read request sent by the video surveillance application subsystem layer, the method further includes: Receive video write data through the video surveillance application subsystem layer and store it in the memory; Applying for a segment file in a node of a channel corresponding to the memory through the video surveillance application subsystem layer; wherein each node of the distributed storage system contains a plurality of segment files of the same number and equal storage space size; The video write data in the memory is written into the segment file through the video surveillance application subsystem layer.
3. The video data access method based on cloud-edge fusion according to claim 2 is characterized in that: The video surveillance application subsystem layer stores the video writing data into the memory, including: Converting the video write data into a group of pictures in a memory; The picture group includes a picture group header, an internal coding frame, a forward prediction frame and a bidirectional interpolation frame; the picture group header includes a picture group identifier, a camera channel identifier, a picture group length and an internal coding frame time; Correspondingly, writing the video write data in the memory into the segment file through the video surveillance application subsystem layer includes: The picture group in the memory is written into the segment file through the video surveillance application subsystem layer.
4. The video data access method based on cloud-edge fusion according to claim 3 is characterized in that: The video surveillance application subsystem layer applies for a segment file in a node of a channel corresponding to the memory, including: According to the segment number of each segment file in the node, applying for the segment file whose storage space of the picture group is not full in the node; The segment file is composed of a segment file header, a picture group storage space and a file tail; the segment file header contains a camera channel identifier, a first frame time of the segment file, a segment file free space size and a segment number.
5. The video data access method based on cloud-edge fusion according to claim 4 is characterized in that: The video surveillance application subsystem layer writes the picture group in the memory into the segment file, including: According to the GOP length of the GOP and the free space size of the segment file of the segment file, determining whether the GOP storage space remaining in the segment file can be written into the GOP; If not, the current segment file is marked as full; According to the segment number of each segment file in the node, applying for a new segment file with an empty picture group storage space in the node, and updating the segment file header corresponding to the new segment file; Writing the picture group into the picture group storage space of the new segment file, and updating the segment file free space size of the new segment file; If so, the picture group is written into the picture group storage space of the segment file, and the segment file free space size of the segment file is updated.
6. The video data access method based on cloud-edge fusion according to claim 5 is characterized in that: After the picture group in the memory is written into the segment file through the video surveillance application subsystem layer, the method further includes: Writing the segment file header of the segment file into the first erasure correction data block; According to the GOP length of the GOP in the segment file, determining whether to allow the GOP to write the first erasure correction data block; If yes, writing the picture group into the first erasure correction data block; If not, the picture group is written into the second erasure correction data block.
7. The video data access method based on cloud-edge fusion according to claim 5 is characterized in that: After the picture group in the memory is written into the segment file through the video surveillance application subsystem layer, the method further includes: Generate metadata according to the segment number of the segment file, the camera channel identifier of the picture group and the internal coding frame time; The metadata is stored in a metadata server.
8. The video data access method based on cloud-edge fusion according to claim 7 is characterized in that: Also includes: The video surveillance application subsystem layer receives a second video read request; The video surveillance application subsystem layer determines a corresponding target segment file according to the second video read request; The video surveillance application subsystem layer searches for a corresponding target picture group in the data of the target segment file according to the second video read request, and outputs the target picture group.
9. The video data access method based on cloud-edge fusion according to claim 8 is characterized in that: The video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request, including: The video surveillance application subsystem layer performs metadata retrieval in the metadata server according to the camera channel identifier and the internal encoding frame time in the second video read request to obtain the corresponding target segment number; The video surveillance application subsystem layer determines the corresponding target segment file according to the target segment number.
10. The video data access method based on cloud-edge fusion according to claim 9 is characterized in that: Before the video surveillance application subsystem layer searches for the corresponding target picture group in the data of the target segment file according to the second video read request, and after the video surveillance application subsystem layer determines the corresponding target segment file according to the second video read request, the method further includes: The video surveillance application subsystem layer determines whether the data of the target segment file is in the memory; If not, the video surveillance application subsystem layer reads the data in the target segment file into the memory; Correspondingly, the video surveillance application subsystem layer searches for a corresponding target picture group in the data of the target segment file according to the second video read request, including: The video surveillance application subsystem layer searches for the corresponding target picture group in the data of the target segment file in the memory according to the time information in the second video read request.
11. The video data access method based on cloud-edge fusion according to claim 10 is characterized in that: The video surveillance application subsystem layer reads the data in the target segment file into the memory, including: The video surveillance application subsystem layer calculates the starting logical address of the target segment file in the distributed storage system according to the target segment number and the size of the target segment file; The video surveillance application subsystem layer reads the data in the target segment file into the memory according to the starting logical address of the target segment file.
12. The video data access method based on cloud-edge fusion according to claim 10 or 11, characterized in that: After the video surveillance application subsystem layer outputs the target picture group, the method further includes: The video surveillance application subsystem layer deletes the target picture group from the data of the target segment file in the memory.
13. A video data access device based on cloud-edge fusion, characterized in that: Applied to a distributed storage system; the device comprises: A determination module, configured to determine address information in a first video read request when receiving a first video read request sent by the video surveillance application subsystem layer; A reading module, used for reading target video data in a corresponding erasure correction data block according to the address information; wherein a group of video data is stored in only one erasure correction data block; A judging module, used for judging whether the number of copies of the target video data is less than the total number of copies of the erasure data blocks; if so, triggering a filling module; The filling module is used to fill the target video data with zeros until the number of copies of the target video data reaches the total number of copies of the erasure data block; The calculation module is used to calculate each target video data according to the erasure correction algorithm to obtain the corresponding original video data, and return the original video data to the video monitoring application subsystem layer.
14. A video data access device based on cloud-edge fusion, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the video data access method based on cloud-edge fusion as described in any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the video data access method based on cloud-edge fusion as described in any one of claims 1 to 12 are implemented.
Citation Information
Cited By
Smart traffic data storage method, system and device based on Internet of Things, and medium
CN120336431A
Video data control method and device and computer readable storage medium
CN120529116A