A park video monitoring data compression transmission storage method, system and medium

CN122601651APending Publication Date: 2026-08-18WUHAN TIANQI CLOUD INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610865462.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]现有技术中,园区视频监控往往覆盖范围广、点位数量多,设备需要24小时不间断采集视频数据,直接进行视频数据传输和存储将大量占用园区网络带宽,造成网络拥堵,现有传统压缩方法为统一压缩标准,针对监控场景中的静态背景与动态目标进行区分处理的效率有限,在长时间连续监控的场景下,无法有效降低整体数据量,不能满足大规模园区监控系统低带宽、低存储成本的使用需求

Benefits of technology

[0056]1、本发明首先提取视频监控数据中实时视频的基准帧,以及基准帧对应的时间戳,而后基于基准帧和对应的时间戳构建基准帧的数据表,有益于减少重复数据发送上传至数据库,针对园区监控场景的静态背景中仅保留基准帧,降低整体用于上传的数据量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601651A_ABST
    Figure CN122601651A_ABST
Patent Text Reader

Abstract

The application discloses a kind of park video monitoring data compression transmission storage method, system and medium, it is related to data compression transmission storage technical field, solve the current park video monitoring data transmission and storage and occupy the problem of a lot of park network bandwidth, method is: extracting the reference frame of real-time video in video monitoring data and the timestamp corresponding to reference frame, then the data table of reference frame is constructed;Reference frame is constructed to be inquired timestamp interval, then according to timestamp index, all reference frame corresponding storage address that satisfy the inquired timestamp interval is obtained, and the two-dimensional integer array of reference frame is obtained by storage address, image data of reference frame is constructed based on two-dimensional integer array;Reference frame is compressed and handled, and all reference frame and reference frame are encoded in corresponding order, and park compressed video of compression processing completion is obtained by encoding, the compression transmission and fast calculation of park video monitoring data are realized by the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data compression, transmission and storage technology, specifically a method, system and medium for compressing, transmitting and storing video surveillance data in a park. Background Technology

[0002] Data compression transmission and storage refers to the process of compressing raw data to reduce its size while retaining useful information, and then transmitting the compressed data to a target device or server for storage via a communication network. By reducing data redundancy and decreasing data size, network bandwidth consumption can be reduced, data transmission efficiency can be improved, storage space consumption can be reduced, and the needs for subsequent data retrieval, analysis, and use can be guaranteed.

[0003] In existing technologies, park video surveillance often covers a wide area and has a large number of points. The equipment needs to collect video data 24 hours a day. Directly transmitting and storing video data will consume a large amount of park network bandwidth and cause network congestion. Existing traditional compression methods use a uniform compression standard, which has limited efficiency in distinguishing between static backgrounds and dynamic targets in the monitoring scene. In the case of long-term continuous monitoring, it cannot effectively reduce the overall data volume and cannot meet the low bandwidth and low storage cost requirements of large-scale park monitoring systems.

[0004] Therefore, this invention proposes a method, system, and medium for compressing, transmitting, and storing video surveillance data in a park. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method, system, and medium for compressing, transmitting, and storing video surveillance data in a park.

[0006] The technical problem to be solved by this invention is:

[0007] How to achieve compressed transmission and rapid calculation of video surveillance data in the park.

[0008] The objective of this invention can be achieved through the following technical solutions:

[0009] A method for compressing, transmitting, and storing video surveillance data in a park, the method comprising:

[0010] Step S1: Extract the reference frame of the real-time video from the video surveillance data, as well as the timestamp corresponding to the reference frame, and construct a data table of the reference frame based on the reference frame and the corresponding timestamp.

[0011] Step S2: Construct the query timestamp range of the reference frame based on the query request data, then obtain the storage address corresponding to all reference frames that meet the query timestamp range based on the timestamp index, and obtain the two-dimensional integer array of the reference frame through the storage address, and construct the image data of the reference frame based on the two-dimensional integer array.

[0012] Step S3: Based on the image data and reference frame data, the reference frame is compressed. Then, according to the corresponding order of the video frame images in the real-time video, all the reference frames and reference frames are encoded to obtain the compressed video of the park.

[0013] Furthermore, the video surveillance data includes real-time video of the park, as well as the video frame rate of the real-time video.

[0014] Further, step S1 includes the following sub-steps:

[0015] Step S11: Obtain real-time video of the park, divide the real-time video into video segments according to a preset time interval, and then divide the video segments into video frame images according to the video frame rate.

[0016] Step S12: Select the first video frame image in the video segment as the reference frame, and record the other video frame images in the same video segment other than the reference frame as reference frames. Then, number all the pixels in the reference frame.

[0017] Step S13: Obtain the R, G, and B values ​​of all pixels in the reference frame, and then construct a one-dimensional array by writing the R, G, and B values ​​of the pixels into the one-dimensional array to obtain the one-dimensional array of the corresponding pixels.

[0018] Step S14: Write all one-dimensional arrays into the outer array structure according to the pixel number order to obtain a two-dimensional integer array of the reference frame;

[0019] Step S15: Take the time node when the real-time video starts to be captured as the initial time node, calculate the time interval between adjacent video frames based on the video frame rate of the real-time video, and then accumulate the initial time node according to the time interval to calculate the capture time node corresponding to all video frames, and use the capture time node as the timestamp of the corresponding video frame image.

[0020] Step S16: Obtain the timestamps of all reference frames, and merge the timestamps and the two-dimensional integer array into a data table for the same reference frame;

[0021] Step S17: Use the timestamp as the reference frame and the video segment number to which the reference frame belongs;

[0022] Step S18: Merge reference frames of the same video segment into a reference frame set, and merge the reference frame sets of all video segments into reference frame data for real-time video.

[0023] Furthermore, the induction process of step S16 is as follows:

[0024] Step S1601: Create a data table in the database to store the reference frame data, and then create a function script to receive the two-dimensional integer array corresponding to the reference frame.

[0025] Step S1602: Check if the Unix timestamp format is valid;

[0026] If the value of the timestamp is a positive integer between [initial time node, current time node], then the corresponding timestamp is considered to be in a valid format;

[0027] If the value of the timestamp is not a positive integer between [initial time node, current time node], then the corresponding timestamp is determined to be an invalid format, and the original timestamp is converted to Unix timestamp format;

[0028] In step S1603, the function script executes the insert statement by calling the database execution interface, writes the two-dimensional integer array to the two-dimensional integer array field of the data table, and writes the timestamp to the timestamp field.

[0029] Furthermore, the query request data consists of the start and end timestamps of the query when the staff queries the live video.

[0030] Further, step S2 includes the following sub-steps:

[0031] Step S21: Construct a timestamp index based on all timestamp fields in the data table. The specific construction process is as follows:

[0032] Sort all timestamp fields in ascending order, use the timestamp value as the index key and the storage address of the corresponding base frame in the data table as the index value, and store the key-value pairs in a B+ tree structure to complete the construction of the timestamp index;

[0033] Step S22: Record the timestamp interval formed by the start timestamp and the end timestamp as the query timestamp interval of the base frame, and then locate the corresponding storage address of all base frames that satisfy the query timestamp interval in the timestamp index.

[0034] Step S23: Traverse the two-dimensional integer array according to the pixel number order, read the R value, G value and B value stored in each row of the two-dimensional integer array, restore the corresponding pixel according to the R value, G value and B value, and splice all the pixels according to the number order to obtain the complete reference frame.

[0035] Step S24: Merge all reference frames that belong to the timestamp range to be queried into image data of the reference frame.

[0036] Further, step S3 includes the following sub-steps:

[0037] Step S31: Detect the main body region of all reference frames in all base frame and reference frame data using a target detection algorithm, and obtain the R value, G value, and B value of all pixels within the main body region;

[0038] Step S32: Obtain the number of the first reference frame in the image data, obtain the number of the same video segment in the reference frame data based on the number of the first reference frame, and extract all reference frames contained in the corresponding video segment from the reference frame data according to the number of the video segment.

[0039] Step S33: Modify the R, G, and B values ​​of all pixels in the reference frame except for the main area to the R, G, and B values ​​of the corresponding pixels at the same position in the base frame;

[0040] Step S34: Repeat steps S32 and S33 to replace the pixel values ​​of non-main areas of all reference frames in all video segments in turn to obtain the replaced reference frames.

[0041] Step S35: Subtract the R, G, and B values ​​of the main region in the reference frame from the R, G, and B values ​​of the same pixel coordinates in the reference frame, and take the absolute values ​​to calculate the R, G, and B value differences between corresponding two pixels.

[0042] Furthermore, step S3 also includes the following sub-steps:

[0043] Step S36: When the R value difference is less than the first difference threshold, the G value difference is less than the second difference threshold, and the B value difference is less than the third difference threshold, the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame are replaced with the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame.

[0044] When any one of the following conditions is met: R value difference is greater than or equal to the first difference threshold, G value difference is greater than or equal to the second difference threshold, and B value difference is greater than or equal to the third difference threshold, the R value, G value and B value corresponding to the pixels in the main region of the reference frame remain unchanged;

[0045] Step S37: Repeat steps S35 and S36 to determine whether the pixels in the main body region of all reference frames need to be replaced, until all the pixels in the main body region of all reference frames have been determined, then proceed to step S38.

[0046] Step S38: Sort the reference frame and the processed reference frame according to the order of the video frame images in the video segment, and then obtain the compressed video of the park after compression processing through the video encoding algorithm.

[0047] Secondly, a park video surveillance data compression, transmission and storage system includes a data acquisition module, a data table construction module, a reference construction module, an index query module, an image construction module and a compression encoding module;

[0048] The data acquisition module is used to collect video surveillance data of the park, as well as query request data when staff query real-time video, and send the video surveillance data to the data table construction module and the reference construction module, and send the query request data to the index query module.

[0049] The data table construction module is used to extract the reference frame of real-time video from the video surveillance data, obtain the timestamp corresponding to the reference frame, and then construct the reference frame data table based on the reference frame and the timestamp, and send the reference frame data table to the image construction module.

[0050] The reference construction module is used to extract reference frames other than the base frame in the real-time video based on the video surveillance data, construct reference frame data based on the reference frames, and send the reference frame data to the compression encoding module.

[0051] The index query module is used to construct a timestamp index. After receiving the query request data, it constructs the timestamp range to be queried for the base frame based on the query request data and sends the timestamp range to be queried to the image construction module.

[0052] The image construction module is used to construct image data of the reference frame based on the timestamp range to be queried and the data table, and send the image data to the compression encoding module;

[0053] The compression encoding module is used to compress all reference frames based on image data and reference frame data, and then obtain the compressed campus video through an encoding algorithm.

[0054] Thirdly, a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method.

[0055] Compared with the prior art, the beneficial effects of the present invention are:

[0056] 1. This invention first extracts the reference frame of real-time video from the video surveillance data, as well as the timestamp corresponding to the reference frame. Then, it constructs a data table of the reference frame based on the reference frame and the corresponding timestamp, which helps to reduce duplicate data transmission and upload to the database. For static backgrounds in park monitoring scenarios, only the reference frame is retained, reducing the overall amount of data used for uploading.

[0057] 2. This invention constructs the query timestamp range of the reference frame by querying the request data, then obtains the storage address corresponding to all reference frames that meet the query timestamp range according to the timestamp index, and obtains a two-dimensional integer array of the reference frame through the storage address. Finally, it constructs the image data of the reference frame based on the two-dimensional integer array. The corresponding monitoring data can be obtained according to the time index, realizing the need for staff to quickly retrieve monitoring data from the database, and improving the efficiency of retrieving monitoring data.

[0058] 3. This invention compresses reference frames based on image data and reference frame data, and then encodes all reference frames and reference frames according to the corresponding order of video frame images in real-time video. Finally, the compressed video of the park is obtained by encoding, which significantly improves the accuracy of compression processing, avoids repeated compression and storage of static backgrounds in reference frames, and meets the usage requirements of low bandwidth and low storage cost in the park. Attached Figure Description

[0059] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.

[0060] Figure 1 This is a flowchart of the method of the present invention;

[0061] Figure 2 This is a flowchart of the method for compressing real-time video in this invention;

[0062] Figure 3 This is an overall system block diagram of the present invention. Detailed Implementation

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

[0064] Example 1, please refer to Figure 1 and Figure 2As shown, the technical solution provided by this invention is: a method for compressing, transmitting, and storing video surveillance data in a park. This method first divides the real-time video of the park into video segments of fixed duration. Then, it divides the video segments into video frame images according to the video frame rate. The first video frame image within a video segment is used as the reference frame, and the remaining video frame images within one second are used as reference frames. The RGB values ​​of all pixels in the reference frame and the timestamp of the reference frame are merged and summarized into a data table for the same reference frame. Other video frame images within the same video segment are merged and summarized into reference frame data. Based on the query request data, a query timestamp interval for the reference frame is constructed. Then, all timestamps satisfying the query request are obtained according to the timestamp index. The system queries the storage address corresponding to the reference frame in the timestamp interval and obtains a two-dimensional integer array of the reference frame through the storage address. Based on the two-dimensional integer array, it constructs the image data of the reference frame. The system detects the main body region in all reference frames and reference frames. Based on the R-value difference, G-value difference, and B-value difference between pixels in the main body region, it determines whether the corresponding pixel in the reference frame needs to be replaced with the corresponding R-value, G-value, and B-value of the pixel in the same position in the reference frame. After all the pixels in the main body region of all reference frames have been determined, the reference frames and the processed reference frames are sorted according to the order of the video frame images in the video segment. Then, the compressed video of the park is obtained through the video encoding algorithm.

[0065] In this embodiment, the method is as follows:

[0066] Step S1: Extract the reference frame of the real-time video from the video surveillance data, as well as the timestamp corresponding to the reference frame, and construct a data table of the reference frame based on the reference frame and the corresponding timestamp.

[0067] Specifically, the video surveillance data includes real-time video of the park and the video frame rate of the real-time video. The real-time video can be collected by surveillance cameras deployed in the park. The video frame rate and video resolution can be obtained from the output parameters of the surveillance cameras. The data table is specifically a data table in MySQL format. In this embodiment, the video frame rate of the real-time video is 25 frames per second.

[0068] In this embodiment, step S1 includes the following sub-steps:

[0069] Step S11: Obtain real-time video of the park, divide the real-time video into video segments according to a preset time interval, and then divide the video segments into video frame images according to the video frame rate.

[0070] In practice, the preset time interval is one second; for example, in this embodiment, the video frame rate is 25 frames per second, and the preset time interval is one second, so the video segment is divided into 25 video frame images.

[0071] Step S12: Select the first video frame image in the video segment as the reference frame, and record the other video frame images in the same video segment other than the reference frame as reference frames. Then, number all the pixels in the reference frame.

[0072] Specifically, the pixel numbering order is as follows: the pixel in the upper left corner of the reference frame is numbered as 1, and all pixels are numbered in order from left to right and from top to bottom; in this embodiment, the total number of pixel numbers is 1024×768.

[0073] Step S13: Obtain the R, G, and B values ​​of all pixels in the reference frame, and then construct a one-dimensional array by writing the R, G, and B values ​​of the pixels into the one-dimensional array to obtain the one-dimensional array of the corresponding pixels.

[0074] In practice, the length of the one-dimensional array is three; the R, G, and B values ​​are specifically the red, green, and blue color component values ​​corresponding to the pixel, with a value range of 0 to 255; for example, if the R value of any pixel is 120, the G value is 85, and the B value is 210, then the one-dimensional array corresponding to the pixel is [120, 85, 210].

[0075] Step S14: Write all one-dimensional arrays into the outer array structure according to the pixel number order to obtain a two-dimensional integer array of the reference frame;

[0076] In practice, the outer array structure is a one-dimensional array with the same number of elements as the total number of pixels, where each element of the outer array corresponds to a one-dimensional array of a single pixel; the two-dimensional integer array is stored using the int[][] type, the number of rows of the two-dimensional integer array corresponds to the total number of pixels in the base frame, and the number of columns is fixed at three, storing the R value, G value and B value of the corresponding pixel respectively; for example, the element in the first row and first column of the two-dimensional integer array is the R value of pixel number 1, the element in the first row and second column is the G value of pixel number 1, and the element in the first row and third column is the B value of pixel number 1;

[0077] Step S15: Take the time node when the real-time video starts to be captured as the initial time node, calculate the time interval between adjacent video frames based on the video frame rate of the real-time video, and then accumulate the initial time node according to the time interval to calculate the capture time node corresponding to all video frames, and use the capture time node as the timestamp of the corresponding video frame image.

[0078] The specific formula for calculating the time interval between adjacent video frames is: Time interval = 1 / Video frame rate;

[0079] Step S16: Obtain the timestamps of all reference frames, and merge the timestamps and the two-dimensional integer array into a data table for the same reference frame. The specific merging process is as follows:

[0080] Step S1601: Create a data table in the database to store the reference frame data, and then create a function script to receive the two-dimensional integer array corresponding to the reference frame.

[0081] The data table includes a two-dimensional integer array field and a timestamp field; the actual function script is a PL / Python function script.

[0082] Step S1602: Check if the Unix timestamp format is valid;

[0083] If the value of the timestamp is a positive integer between [initial time node, current time node], then the corresponding timestamp is considered to be in a valid format;

[0084] If the value of the timestamp is not a positive integer between [initial time node, current time node], then the corresponding timestamp is determined to be an invalid format, and the original timestamp is converted to Unix timestamp format;

[0085] In step S1603, the function script executes the insert statement by calling the database execution interface, writes the two-dimensional integer array to the two-dimensional integer array field of the data table, and writes the timestamp to the timestamp field;

[0086] In practice, the database execution interface is plpy.execute();

[0087] Step S17: Use the timestamp as the reference frame and the video segment number to which the reference frame belongs;

[0088] It should be noted that one timestamp uniquely corresponds to one reference frame;

[0089] Step S18: Merge reference frames of the same video segment into a reference frame set, and merge the reference frame sets of all video segments into reference frame data for real-time video.

[0090] Step S2: Construct the query timestamp range of the reference frame based on the query request data, then obtain the storage address corresponding to all reference frames that meet the query timestamp range based on the timestamp index, and obtain the two-dimensional integer array of the reference frame through the storage address, and construct the image data of the reference frame based on the two-dimensional integer array.

[0091] Specifically, the query request data includes the start and end timestamps of the query when staff query real-time video.

[0092] In this embodiment, step S2 includes the following sub-steps:

[0093] Step S21: Construct a timestamp index based on all timestamp fields in the data table. The specific construction process is as follows:

[0094] Sort all timestamp fields in ascending order, use the timestamp value as the index key and the storage address of the corresponding base frame in the data table as the index value, and store the key-value pairs in a B+ tree structure to complete the construction of the timestamp index;

[0095] Specifically, the key-value pair consists of (timestamp value, storage address).

[0096] Step S22: Record the timestamp interval formed by the start timestamp and the end timestamp as the query timestamp interval of the base frame, and then locate the corresponding storage address of all base frames that satisfy the query timestamp interval in the timestamp index.

[0097] For example, when the timestamp range to be queried is [1767254400, 1767254700], the corresponding time nodes are [2026-01-01 08:00:00, 2026-01-01 08:05:00]. Within the timestamp range to be queried, the storage addresses of all reference frames within the timestamp range to be queried are read sequentially, and the two-dimensional integer array of the corresponding reference frames is obtained through the storage addresses.

[0098] Step S23: Traverse the two-dimensional integer array according to the pixel number order, read the R value, G value and B value stored in each row of the two-dimensional integer array, restore the corresponding pixel according to the R value, G value and B value, and splice all the pixels according to the number order to obtain the complete reference frame.

[0099] Specifically, the process of restoring the corresponding pixels based on the R, G, and B values ​​is as follows: Construct a blank image with the same size as the reference frame; determine the coordinate position of the pixel in the blank image according to the pixel number; assign the read R, G, and B values ​​to the corresponding pixel coordinate position to complete the color restoration of a single pixel; and obtain the restored reference frame after all pixels have been assigned values.

[0100] Step S24: Merge all reference frames that belong to the timestamp range to be queried into image data of the reference frame.

[0101] Step S3: Based on the image data and reference frame data, the reference frame is compressed. Then, according to the corresponding order of the video frame images in the real-time video, all the reference frames and reference frames are encoded to obtain the compressed video of the park after compression.

[0102] Specifically, the encoding process involves encoding the base frame and reference frame into a compressed video of the park using the H.264 / H.265 algorithm;

[0103] In this embodiment, step S3 includes the following sub-steps:

[0104] Step S31: Detect the main body region of all reference frames in all base frame and reference frame data using a target detection algorithm, and obtain the R value, G value, and B value of all pixels within the main body region;

[0105] In practice, object detection algorithms can identify and locate people, vehicles, or other moving targets in a reference frame. Object detection algorithms are a mature existing technology. The object detection algorithm first extracts multi-scale features from the input reference frame, and then obtains the location box of the target region through candidate box generation and classification regression. The area enclosed by the location box is recorded as the main body region. It should be specifically noted that the main body region is the area obtained by selecting the main body in the reference frame and the base frame with a rectangle of a fixed size.

[0106] Step S32: Obtain the number of the first reference frame in the image data, obtain the number of the same video segment in the reference frame data based on the number of the first reference frame, and extract all reference frames contained in the corresponding video segment from the reference frame data according to the number of the video segment.

[0107] Step S33: Modify the R, G, and B values ​​of all pixels in the reference frame except for the main area to the R, G, and B values ​​of the corresponding pixels at the same position in the base frame;

[0108] Step S34: Repeat steps S32 and S33 to replace the pixel values ​​of non-main areas of all reference frames in all video segments in turn to obtain the replaced reference frames.

[0109] Step S35: Subtract the R, G, and B values ​​of the main region in the reference frame from the R, G, and B values ​​of the same pixel coordinates in the reference frame, and take the absolute values ​​to calculate the R, G, and B value differences between the corresponding two pixels.

[0110] Step S36: When the R value difference is less than the first difference threshold, the G value difference is less than the second difference threshold, and the B value difference is less than the third difference threshold, the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame are replaced with the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame.

[0111] When any one of the following conditions is met: R value difference is greater than or equal to the first difference threshold, G value difference is greater than or equal to the second difference threshold, and B value difference is greater than or equal to the third difference threshold, the R value, G value and B value corresponding to the pixels in the main region of the reference frame remain unchanged;

[0112] In reality, there is no comparative relationship between the first, second, and third difference thresholds;

[0113] Step S37: Repeat steps S35 and S36 to determine whether the pixels in the main body region of all reference frames need to be replaced, until all the pixels in the main body region of all reference frames have been determined, then proceed to step S38.

[0114] Step S38: Sort the reference frame and the processed reference frame according to the order of the video frame images in the video segment, and then obtain the compressed video of the park after compression processing through the video encoding algorithm.

[0115] The video encoding algorithm is specifically the H.264 / H.265 algorithm. The encoding process is as follows: the reference frame and the base frame after compression are arranged according to the order of the video frame images and then sent to the encoder. The encoder divides the base frame and the reference frame into several groups. The first frame of each group is used as the key frame for complete compression. The remaining frames only record the difference information between the frame and the frame before and after. The difference information is specifically the set of differences between the pixel position and the corresponding R value, G value and B value.

[0116] Example 2, please refer to Figure 3 As shown, based on another concept of the same invention, a park video surveillance data compression transmission and storage system is proposed, including a data acquisition module, a data table construction module, a reference construction module, an index query module, an image construction module and a compression encoding module;

[0117] The data acquisition module is used to collect video surveillance data of the park and query request data when staff query real-time video, and sends the video surveillance data to the data table construction module and the reference construction module, and sends the query request data to the index query module.

[0118] The data table construction module is used to extract the reference frame of real-time video from the video surveillance data, obtain the timestamp corresponding to the reference frame, and then construct the reference frame data table based on the reference frame and the timestamp, and send the reference frame data table to the image construction module.

[0119] The reference construction module is used to extract reference frames other than the base frame in the real-time video based on the video surveillance data, construct reference frame data based on the reference frames, and send the reference frame data to the compression encoding module.

[0120] The index query module is used to construct a timestamp index. After receiving the query request data, it constructs the timestamp range to be queried for the base frame based on the query request data and sends the timestamp range to be queried to the image construction module.

[0121] The image construction module is used to construct image data of the reference frame based on the timestamp range to be queried and the data table, and send the image data to the compression encoding module;

[0122] The compression encoding module is used to compress all reference frames based on image data and reference frame data, and then obtain the compressed campus video through an encoding algorithm.

[0123] In embodiment three, this invention also provides a computer storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described method for compressing, transmitting, and storing campus video surveillance data. For specific implementation details, please refer to the method embodiment, which will not be repeated here.

[0124] The computer program product of the method for compressing, transmitting and storing video surveillance data in a park provided by the embodiments of the present invention includes a computer storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and / or device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0126] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0127] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for compressing, transmitting, and storing video surveillance data in a park, characterized in that, The methods include: Step S1: Extract the reference frame of the real-time video from the video surveillance data, as well as the timestamp corresponding to the reference frame, and construct a data table of the reference frame based on the reference frame and the corresponding timestamp. Step S2: Construct the query timestamp range of the reference frame based on the query request data, then obtain the storage address corresponding to all reference frames that meet the query timestamp range based on the timestamp index, and obtain the two-dimensional integer array of the reference frame through the storage address, and construct the image data of the reference frame based on the two-dimensional integer array. Step S3: Based on the image data and reference frame data, the reference frame is compressed. Then, according to the corresponding order of the video frame images in the real-time video, all the reference frames and reference frames are encoded to obtain the compressed video of the park.

2. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 1, characterized in that, The video surveillance data includes real-time video of the park, as well as the video frame rate of the real-time video.

3. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 2, characterized in that, Step S1 includes the following sub-steps: Step S11: Obtain real-time video of the park, divide the real-time video into video segments according to a preset time interval, and then divide the video segments into video frame images according to the video frame rate. Step S12: Select the first video frame image in the video segment as the reference frame, and record the other video frame images in the same video segment other than the reference frame as reference frames. Then, number all the pixels in the reference frame. Step S13: Obtain the R, G, and B values ​​of all pixels in the reference frame, and then construct a one-dimensional array by writing the R, G, and B values ​​of the pixels into the one-dimensional array to obtain the one-dimensional array of the corresponding pixels. Step S14: Write all one-dimensional arrays into the outer array structure according to the pixel number order to obtain a two-dimensional integer array of the reference frame; Step S15: Take the time node when the real-time video starts to be captured as the initial time node, calculate the time interval between adjacent video frames based on the video frame rate of the real-time video, and then accumulate the initial time node according to the time interval to calculate the capture time node corresponding to all video frames, and use the capture time node as the timestamp of the corresponding video frame image. Step S16: Obtain the timestamps of all reference frames, and merge the timestamps and the two-dimensional integer array into a data table for the same reference frame; Step S17: Use the timestamp as the reference frame and the video segment number to which the reference frame belongs; Step S18: Merge reference frames of the same video segment into a reference frame set, and merge the reference frame sets of all video segments into reference frame data for real-time video.

4. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 3, characterized in that, The induction process of step S16 is as follows: Step S1601: Create a data table in the database to store the reference frame data, and then create a function script to receive the two-dimensional integer array corresponding to the reference frame. Step S1602: Check if the Unix timestamp format is valid; If the value of the timestamp is a positive integer between [initial time node, current time node], then the corresponding timestamp is considered to be in a valid format; If the value of the timestamp is not a positive integer between [initial time node, current time node], then the corresponding timestamp is determined to be an invalid format, and the original timestamp is converted to Unix timestamp format; In step S1603, the function script executes the insert statement by calling the database execution interface, writes the two-dimensional integer array to the two-dimensional integer array field of the data table, and writes the timestamp to the timestamp field.

5. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 1, characterized in that, The query request data consists of the start and end timestamps of the query when the staff queries the live video.

6. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 5, characterized in that, Step S2 includes the following sub-steps: Step S21: Construct a timestamp index based on all timestamp fields in the data table. The specific construction process is as follows: Sort all timestamp fields in ascending order, use the timestamp value as the index key and the storage address of the corresponding base frame in the data table as the index value, and store the key-value pairs in a B+ tree structure to complete the construction of the timestamp index; Step S22: Record the timestamp interval formed by the start timestamp and the end timestamp as the query timestamp interval of the base frame, and then locate the corresponding storage address of all base frames that satisfy the query timestamp interval in the timestamp index. Step S23: Traverse the two-dimensional integer array according to the pixel number order, read the R value, G value and B value stored in each row of the two-dimensional integer array, restore the corresponding pixel according to the R value, G value and B value, and splice all the pixels according to the number order to obtain the complete reference frame. Step S24: Merge all reference frames that belong to the timestamp range to be queried into image data of the reference frame.

7. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 1, characterized in that, Step S3 includes the following sub-steps: Step S31: Detect the main body region of all reference frames in all base frame and reference frame data using a target detection algorithm, and obtain the R value, G value, and B value of all pixels within the main body region; Step S32: Obtain the number of the first reference frame in the image data, obtain the number of the same video segment in the reference frame data based on the number of the first reference frame, and extract all reference frames contained in the corresponding video segment from the reference frame data according to the number of the video segment. Step S33: Modify the R, G, and B values ​​of all pixels in the reference frame except for the main area to the R, G, and B values ​​of the corresponding pixels at the same position in the base frame; Step S34: Repeat steps S32 and S33 to replace the pixel values ​​of non-main areas of all reference frames in all video segments in turn to obtain the replaced reference frames. Step S35: Subtract the R, G, and B values ​​of the main region in the reference frame from the R, G, and B values ​​of the same pixel coordinates in the reference frame, and take the absolute values ​​to calculate the R, G, and B value differences between corresponding two pixels.

8. The method for compressing, transmitting, and storing video surveillance data in a park according to claim 7, characterized in that, Step S3 further includes the following sub-steps: Step S36: When the R value difference is less than the first difference threshold, the G value difference is less than the second difference threshold, and the B value difference is less than the third difference threshold, the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame are replaced with the R, G, and B values ​​corresponding to the pixels in the main body region of the reference frame. When any one of the following conditions is met: R value difference is greater than or equal to the first difference threshold, G value difference is greater than or equal to the second difference threshold, and B value difference is greater than or equal to the third difference threshold, the R value, G value and B value corresponding to the pixels in the main region of the reference frame remain unchanged; Step S37: Repeat steps S35 and S36 to determine whether the pixels in the main body region of all reference frames need to be replaced, until all the pixels in the main body region of all reference frames have been determined, then proceed to step S38. Step S38: Sort the reference frame and the processed reference frame according to the order of the video frame images in the video segment, and then obtain the compressed video of the park after compression processing through the video encoding algorithm.

9. A system for compressing, transmitting, and storing video surveillance data in a park, characterized in that, It includes a data acquisition module, a data table construction module, a reference construction module, an index query module, an image construction module, and a compression encoding module; The data acquisition module is used to collect video surveillance data of the park, as well as query request data when staff query real-time video, and send the video surveillance data to the data table construction module and the reference construction module, and send the query request data to the index query module. The data table construction module is used to extract the reference frame of real-time video from the video surveillance data, obtain the timestamp corresponding to the reference frame, and then construct the reference frame data table based on the reference frame and the timestamp, and send the reference frame data table to the image construction module. The reference construction module is used to extract reference frames other than the base frame in the real-time video based on the video surveillance data, construct reference frame data based on the reference frames, and send the reference frame data to the compression encoding module. The index query module is used to construct a timestamp index. After receiving the query request data, it constructs the timestamp range to be queried for the base frame based on the query request data and sends the timestamp range to be queried to the image construction module. The image construction module is used to construct image data of the reference frame based on the timestamp range to be queried and the data table, and send the image data to the compression encoding module; The compression encoding module is used to compress all reference frames based on image data and reference frame data, and then obtain the compressed campus video through an encoding algorithm.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1 to 8.