A method and system for protecting privacy data security in the Internet of Things
By analyzing the motion changes of macroblocks at the edge computing layer or application layer, determining encryption parameters and feeding them back to the perception layer, the problem of insufficient encryption capabilities of IoT data is solved, data security and encryption capabilities are improved, and data leakage risks are reduced.
Patent Information
- Application Number
- CN202411456646.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-18
AI Technical Summary
In the encryption process of IoT data, there are problems such as single keys and insufficient encryption capabilities, which leads to low data security and difficulty in effectively protecting private data.
By analyzing the direction consistency and information consistency of the motion change direction of macroblocks at the edge computing layer or application layer, determining the encryption parameters, and feeding them back to the perception layer for encryption, dynamic adaptive encryption of the perception layer is achieved, and a single key is avoided change.
It improves the encryption capability and security of IoT data, reduces the risk of data stolen and leaked, and solves the problem of poor encryption results caused by weak hardware analysis capabilities of perception layer.
Smart Images

Figure CN118972646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of confidential communication technology, and in particular to a method and system for protecting privacy data security in the Internet of Things. Background Art
[0002] With the continuous large-scale application of the Internet of Things, the data security problem of the Internet of Things has become increasingly severe, and to a certain extent has become a bottleneck hindering the development of the Internet of Things. While digital and intelligent devices bring convenience to people, they also expose society to the risk of privacy data leakage. The Internet of Things can collect, transmit and process massive amounts of data, including a large amount of privacy data. This data has huge commercial and social value. Driven by interests, data may be stolen and leaked.
[0003] The existing IoT architecture is mainly divided into the perception layer, network layer, edge computing layer and application layer, in which data is collected through sensors, cameras and other terminal devices in the perception layer. Since the types of data collected by the same terminal device during the collection process are the same, when encrypting and processing data at the edge computing layer, an unavoidable problem is that too much identical data leads to a single key using the same encryption method, which makes IoT data insecure. In addition, the current IoT data transmits the data collected by the perception layer to the edge computing layer through the network layer, and finally reaches the application layer to realize the analysis of IoT data. The existing adaptive encryption method only encrypts the local analysis results of the data transmitted to the edge computing layer, and cannot realize feedback adjustment of the encryption of the collected data based on the big data analysis results of the application layer. The encryption capability of the perception layer is relatively weak, resulting in limitations in targeted encryption, which also leads to low security of IoT data. Summary of the invention
[0004] In order to solve the technical problem that the current IoT data encryption technology makes the IoT data security low, the purpose of the present invention is to provide an IoT privacy data security protection method and system, and the technical solution adopted is as follows:
[0005] The present invention provides a method for protecting privacy data security in the Internet of Things, the method comprising:
[0006] Determine a reference block in a key frame in a surveillance video and a compressed macroblock in a forward reference frame of a prediction frame corresponding to the key frame;
[0007] Determine the target position of the macroblock to be encrypted and the target macroblock corresponding to the next motion trend in the compressed macroblock based on the motion behavior information of the compressed macroblock compared to the reference block;
[0008] Determining a target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame;
[0009] The target encryption parameters are fed back to the perception layer to perform perception layer encryption on the target macroblock in the target position.
[0010] Furthermore, based on the motion behavior information of the compressed macroblock compared with the reference block, the step of determining the macroblock to be encrypted in the compressed macroblock includes:
[0011] Obtaining a motion vector angle of the compressed macroblock compared to the reference block and a mean value of the motion vector angles of all accumulated trend blocks corresponding to the compressed macroblock;
[0012] Determining the vector direction consistency of the compressed macroblock using the motion vector angle and the motion vector angle mean;
[0013] Determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency;
[0014] Determining a macroblock to be encrypted from the compressed macroblocks according to the degree of expression of the motion behavior trend;
[0015] The accumulated trend block represents each compressed macroblock of each frame through which the line between the reference block and the compressed macroblock passes.
[0016] Furthermore, the step of determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency includes:
[0017] Obtaining the number of macroblocks of the compressed macroblock in a frame corresponding to any accumulated trend block that is identical to a reference frame of the accumulated trend block;
[0018] The degree of expression of the motion behavior trend of the compressed macroblock is calculated by using the vector direction consistency and the number of identical macroblocks.
[0019] Furthermore, the step of determining the macroblock to be encrypted from the compressed macroblock according to the degree of expression of the motion behavior trend includes:
[0020] Comparing the motion behavior trend performance degree with a preset degree threshold, and determining a compressed macroblock whose motion behavior trend performance degree is greater than the preset degree threshold as a preferred compressed macroblock;
[0021] All preferred compressed macroblocks in the forward reference frame of the last prediction frame are determined as macroblocks to be encrypted.
[0022] Further, the step of determining the target position of the target macroblock under the next motion trend corresponding to the compressed macroblock includes:
[0023] Determine a frame interval between the key frame and the macroblock to be encrypted;
[0024] In the case where the frame interval is greater than the number of forward reference frames of the remaining unanalyzed prediction frames, determining the inferred motion vector of the macroblock to be encrypted;
[0025] Taking the position of the macroblock to be encrypted as the origin, the inferred motion vector is used to determine the target position of the target macroblock under the next motion trend.
[0026] Furthermore, the step of determining the inferred motion vector of the macroblock to be encrypted includes:
[0027] Based on the macroblock to be encrypted, obtaining the number of cumulative trend blocks and the average value of the vector distance between two adjacent cumulative trend blocks in frame order;
[0028] The inferred motion modulus value of the macroblock to be encrypted is calculated by using the number of accumulated trend blocks and the mean value of the vector distance;
[0029] The direction of the macroblock to be encrypted is used as the inference direction, and the inferred motion modulus value and the inference direction are combined to obtain the inferred motion vector.
[0030] Furthermore, the step of determining the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame includes:
[0031] Determine a first mean value of residual values of all pixels of the macroblock to be encrypted compared with the reference block;
[0032] Determine the difference between the mean grayscale values of pixels in the target macroblock and all macroblocks in a preset number of neighborhoods, and determine a second mean of the difference between the mean grayscale values;
[0033] Using the first mean value and the second mean value, a misalignment parameter is calculated;
[0034] Determining the shearing direction based on the quadrant in which the inferred direction is located;
[0035] The target encryption parameter of the target macroblock is obtained by combining the staggered parameter and the staggered direction.
[0036] Furthermore, the step of feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position includes:
[0037] Packaging the target encryption parameters into a control signal through an edge computing layer;
[0038] Transmitting the control signal as a configuration update file to the perception layer through the serial port of the edge computing layer;
[0039] In response to the configuration update file, the target macroblock in the surveillance video is encrypted at the perception layer through the perception layer.
[0040] Further, the step of determining the reference block in the key frame in the surveillance video and the compressed macroblock in the forward reference frame of the prediction frame corresponding to the key frame comprises:
[0041] Determine multiple key frames in the surveillance video and the predicted frame forward reference frame corresponding to each key frame based on the key frame analysis of the perception layer;
[0042] The key frame and the forward reference frame of the prediction frame are compressed and divided into a plurality of macroblocks with corresponding positions and the same size, the macroblocks in the key frame are used as reference blocks, and the macroblocks with motion behavior information in the forward reference frame of the prediction frame are used as compressed macroblocks.
[0043] The present invention also provides an Internet of Things privacy data security protection system, the system is used to implement the Internet of Things privacy data security protection method as described in any one of the above items; the system comprises:
[0044] A perception analysis module, used to determine the reference blocks in the key frames in the surveillance video and the compressed macro blocks in the forward reference frames of the prediction frames corresponding to the key frames;
[0045] An application analysis module is used to determine the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock corresponding to the next motion trend based on the motion behavior information of the compressed macroblock compared with the reference block; and determine the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame;
[0046] The edge analysis module is used to feed back the target encryption parameters to the perception layer to perform perception layer encryption on the target macroblock in the target position.
[0047] The present invention has the following beneficial effects:
[0048] The steps are as follows: determining the reference block in the key frame in the surveillance video and the compressed macroblock in the forward reference frame of the prediction frame corresponding to the key frame; determining the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock under the next motion trend based on the motion behavior information of the compressed macroblock compared with the reference block; determining the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame; and feeding the target encryption parameter back to the perception layer to perform perception layer encryption on the target macroblock in the target position.
[0049] The present invention analyzes the directional consistency and information consistency of the motion changes of macroblocks over multiple frames in the edge computing layer or the application layer, analyzes the compressed macroblock area showing obvious behavior information (consistent motion direction, consistent residual amount) to obtain the corresponding encryption parameters, and predicts the target macroblock to which the next motion behavior information may be transmitted, and feeds the encryption parameters and target macroblock information back to the perception layer, thereby reducing the analysis pressure of the perception layer and improving the encryption capability at the perception layer, realizing encryption of big data at the perception layer, solving the defect of poor encryption effect caused by weak hardware analysis capability in the perception layer, and realizing real-time adjustment of encryption parameters based on the prediction of motion trends, thereby avoiding the unification of secret keys for the same encryption method, improving the encryption capability of data at the perception layer and the source of data acquisition, greatly improving the security of IoT data, and reducing the risk of data theft and leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. 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.
[0051] Figure 1 A flowchart of a method for protecting privacy data security in the Internet of Things provided by an embodiment of the present invention;
[0052] Figure 2 A detailed flow chart of step S2 in a method for protecting privacy data security in the Internet of Things provided by one embodiment of the present invention;
[0053] Figure 3 A detailed flow chart of step S2 in a method for protecting privacy data security in an Internet of Things provided by another embodiment of the present invention;
[0054] Figure 4 A detailed flow chart of step S210 in a method for protecting privacy data security in an Internet of Things provided by an embodiment of the present invention;
[0055] Figure 5 A detailed flow chart of step S3 in a method for protecting privacy data security in the Internet of Things provided by one embodiment of the present invention;
[0056] Figure 6 A schematic diagram of the structure of the hardware operating environment of the Internet of Things privacy data security protection device involved in the embodiment of the present invention;
[0057] Figure 7Schematic diagram of the framework structure of the Internet of Things privacy data security protection system involved in the embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a privacy data security protection method for the Internet of Things proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0059] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0060] The following is a detailed description of a method for protecting the privacy data security of the Internet of Things provided by the present invention in conjunction with the accompanying drawings.
[0061] Embodiment 1:
[0062] For the IoT privacy data security protection method provided by the present invention, please refer to Figure 1 , which shows a flowchart of the steps of a method for protecting the security of Internet of Things privacy data provided by an embodiment of the present invention.
[0063] The method comprises:
[0064] Step S1, determining a reference block in a key frame in a surveillance video and a compressed macroblock in a forward reference frame of a prediction frame corresponding to the key frame;
[0065] In video coding, I frame (Intra-coded Frame, key frame), P frame (Predicted Frame, predicted frame) and B frame are the basis of video compression.
[0066] In this embodiment, the H.264 algorithm may be used for video compression. In the H.264 standard, a P frame supports selecting one of at most 16 reference frames as a reference frame for a coding block, and different blocks in a frame may select different reference frames. In an RTC (Real-Time Communication) scenario, all blocks in a P frame refer to the same reference frame, and generally the previous frame of the current coding frame is selected as the reference frame.
[0067] The specific scenario targeted by this embodiment may be:
[0068] When encrypting videos collected by monitoring IoT devices, the existing technology encrypts based on the key information of the video, mainly according to the information of key frames and macroblocks in the collected video. However, the encryption at the perception layer and edge computing layer is mainly based on the movement of the target in the monitoring video, and is not combined with the feedback from further analysis of the IoT data at the application layer to adjust the encryption method. In addition, the data collected by the IoT terminal devices is similar for a long time, which puts a test on the security of the privacy information against brute force cracking.
[0069] Step S1 specifically includes:
[0070] Determine multiple key frames in the surveillance video and the predicted frame forward reference frame corresponding to each key frame based on the key frame analysis of the perception layer;
[0071] The key frame and the forward reference frame of the prediction frame are compressed and divided into a plurality of macroblocks with corresponding positions and the same size, the macroblocks in the key frame are used as reference blocks, and the macroblocks with motion behavior information in the forward reference frame of the prediction frame are used as compressed macroblocks.
[0072] Surveillance video is collected through monitoring equipment, where the surveillance video can be 30 frames per second. Based on the key frame analysis of the perception layer, several key frames I frames and P frame forward reference frames after each key frame can be obtained, where the I frame and P frame forward reference frames are determined by the H.264 compression algorithm. Intra-frame compression is used to achieve compression in the key frames, and inter-frame prediction is used to achieve compression in the P frame forward reference frames.
[0073] During the specific compression process, each P-frame forward reference frame and I-frame will be divided into several macroblocks with the same corresponding positions and sizes. For each compressed macroblock in the P-frame forward reference frame, there is a reference block in the I-frame. After compressing the information of the I-frame, the compressed macroblock in the P-frame forward reference frame only retains its motion estimate (motion behavior information) compared to the reference block in the I-frame, where the motion estimate can include motion vector data compared to the reference block, and data on the residual value between the compressed macroblock and the reference block.
[0074] Step S2, determining the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock corresponding to the next motion trend based on the motion behavior information of the compressed macroblock compared with the reference block;
[0075] In step S2, the motion behavior information, as described above, mainly refers to the motion vector and residual data of the moving target in the compressed macroblock of each frame, wherein the motion vector reflects the movement direction of the moving target in the video, and the residual data reflects the difference between the compressed macroblock or the macroblock to be encrypted and the reference block, that is, the change of the moving target information.
[0076] For macro blocks that need to be encrypted:
[0077] When objects with obvious motion trends in surveillance videos are compressed using the H.264 algorithm, the positions of objects showing motion trends are different in each frame, and they show certain obvious motion trends. For the forward reference frame after the key frame, if the same object has motion traces on multiple frames, then the same object has and only has the same macroblock on different frames, and the reference block of the macroblock on each frame should correspond to approximately the same area on the key frame, and show obvious motion traces on all existing frames. Therefore, the reference blocks corresponding to all compressed macroblocks can be marked on the key frame first, and then through regional analysis, if the compressed macroblocks corresponding to the same area on the key frame meet the requirement of one compressed macroblock corresponding to one frame, and the motion vector direction of each macroblock is consistent, then these compressed macroblocks show obvious motion direction trends, that is, the degree of motion behavior trend performance of each compressed macroblock is obtained, and then the macroblocks to be encrypted can be selected. Based on the macroblocks to be encrypted, as well as the motion vector and motion modulus value, the position where the next motion trend of the moving target will appear can be predicted, that is, the target position of the target macroblock can be determined, so that the target macroblock can be dynamically and adaptively encrypted.
[0078] More specifically, taking any set of key frames and their forward reference frames as an example for analysis, the reference blocks of all compressed macroblocks in the forward reference frame are mapped to each macroblock in the key frame. After mapping, each macroblock in the key frame will correspond to an indefinite number of compressed macroblocks. For macroblocks with motion trends, their vector directions are consistent because of the existence of motion trajectories. For compressed macroblocks with no motion trends, they are usually blank spaces in surveillance videos, environmental interference, etc., so they appear disorderly distributed in the surveillance video, and the same reference block will only correspond to one or a few compressed macroblocks in a forward reference frame.
[0079] In a preferred embodiment, please refer to Figure 2 , the step S2 comprises:
[0080] Step S20, obtaining a motion vector angle of the compressed macroblock compared to the reference block and a mean value of the motion vector angles of all accumulated trend blocks corresponding to the compressed macroblock;
[0081] Step S21, determining the vector direction consistency of the compressed macroblock using the motion vector angle and the motion vector angle mean;
[0082] Step S22, determining the degree of motion behavior trend expression of the compressed macroblock according to the vector direction consistency;
[0083] Specifically, the step S22 includes:
[0084] Obtaining the number of macroblocks of the compressed macroblock in a frame corresponding to any accumulated trend block that is identical to a reference frame of the accumulated trend block;
[0085] The degree of expression of the motion behavior trend of the compressed macroblock is calculated by using the vector direction consistency and the number of identical macroblocks.
[0086] Step S23, determining a macroblock to be encrypted from the compressed macroblocks according to the degree of expression of the motion behavior trend;
[0087] The accumulated trend block represents each compressed macroblock of each frame through which the line between the reference block and the compressed macroblock passes.
[0088] Specifically, the step S23 includes:
[0089] Comparing the motion behavior trend performance degree with a preset degree threshold, and determining a compressed macroblock whose motion behavior trend performance degree is greater than the preset degree threshold as a preferred compressed macroblock;
[0090] All preferred compressed macroblocks in the forward reference frame of the last prediction frame are determined as macroblocks to be encrypted.
[0091] For example, for the qth compressed macroblock in the pth forward reference frame following the i-th key frame:
[0092] (1) On the line connecting the position of the reference block in the i-th frame and the position of the q-th compressed macroblock in the p-th forward reference frame, each compressed macroblock of each frame passed (since the compressed macroblocks in the forward reference frame are only moving objects, then the non-moving macroblocks are not compressed macroblocks, so the number of macroblocks passed between the q-th compressed macroblock and its reference frame is not necessarily the number of compressed macroblocks, and there may be more than one macroblock occupied by a moving target, so the motion trajectory of the same moving target is composed of multiple compressed macroblocks) (from 1 to p, there are a total of p frames), recorded as the cumulative trend block of the q-th compressed macroblock in the p-th forward reference frame;
[0093] (2) If the directions of the cumulative trend blocks all point to the qth compressed macroblock, it means that the qth compressed macroblock is more likely to be caused by its cumulative trend block. Therefore, the calculation method for vector direction consistency is:
[0094]
[0095] in, is the motion vector angle of the qth compressed macroblock compared to the reference block, It is the mean value of the motion vector angles of all accumulated trend blocks of the qth compressed macroblock, where the motion vector is the vector pointed to by the reference block of each compressed macroblock, including direction and distance, and exp represents an exponential function with a natural constant as the base.
[0096] (3) It should be pointed out that if the qth compressed macroblock and its reference block are scene blanks or environmental changes, then when the H.264 algorithm is used to compress the video, the reference blocks of all compressed macroblocks with similar information may be the same. As a result, although the direction of the cumulative trend blocks of the compressed macroblocks is consistent, these compressed macroblocks are not caused by target motion. The moving target only appears once in each frame of the surveillance video, so they are selected using the above logic.
[0097]
[0098] in, is the uniqueness of the motion trend of the qth compressed macroblock in the pth forward reference frame of the ith key frame, The number of macroblocks (the number of identical macroblocks) in the frame corresponding to the k-th cumulative trend block of the q-th compressed macroblock in the p-th forward reference frame of the ith key frame is the same as the reference frame of the k-th cumulative trend block. If the number of identical macroblocks is 0, it means that the q-th compressed macroblock appears alone in the corresponding frame, that is, the moving target has unique motion trend. Then, the larger the value, the more likely it is that the q-th compressed macroblock in the p-th forward reference frame represents a moving target.
[0099] A degree threshold may be preset as 0.68, and the macroblocks with motion trend uniqueness greater than the threshold are recorded as preferred compressed macroblocks.
[0100] (4) In a group of key frames and their forward reference frames, since the key frames are selected based on motion change analysis, the moving object is more likely to appear in the key frame. However, the motion trend of the moving object may end in the forward reference frame, or it may not end and extend to the next key frame and its forward reference frame. Therefore, it is necessary to select the compressed macroblock that ends the motion in the current key frame as the macroblock to be encrypted, and the macroblock that extends to the next key frame group as the macroblock to be encrypted.
[0101] For the i-th key frame and all its forward reference frames, all the preferred compressed macroblocks in the last forward reference frame of the i-th key frame are recorded as macroblocks to be encrypted, and the first forward reference frame of the i-th key frame to the last forward reference frame are used instead of the preferred compressed macroblocks in the cumulative trend block of other compressed macroblocks as macroblocks to be encrypted. This operation avoids the preferred compressed macroblocks between the start and end of the movement being used as macroblocks to be encrypted. In this way, when predicting the movement, the position where the movement has occurred in the current key frame is encrypted in the frames that do not correspond to the subsequent time. In other words, it is determined that a preferred compressed macroblock in this frame is not used as the cumulative trend block of other macroblocks to be encrypted in some subsequent frames. That is, when encrypting, only the macroblocks at the end of the movement are encrypted, and the macroblocks in the movement process are not encrypted, because the position of the target macroblock is predicted before encryption.
[0102] In another preferred embodiment, please refer to Figure 3 , the step S2 comprises:
[0103] Step S200, determining the frame interval between the key frame and the macroblock to be encrypted;
[0104] Step S210, when the frame interval is greater than the number of forward reference frames of the remaining unanalyzed prediction frames, determining the inferred motion vector of the macroblock to be encrypted;
[0105] Please refer to Figure 4 The step S210 specifically includes:
[0106] Step S211, based on the macroblock to be encrypted, obtaining the number of cumulative trend blocks and the average value of the vector distance between two adjacent cumulative trend blocks in frame order;
[0107] Step S212, using the number of accumulated trend blocks and the mean value of the vector distance, calculate the inferred motion modulus value of the macroblock to be encrypted;
[0108] Step S213: taking the direction of the macroblock to be encrypted as an inference direction, and obtaining an inferred motion vector by combining the inferred motion modulus value and the inference direction.
[0109] Step S220, taking the location of the macroblock to be encrypted as the origin, and using the inferred motion vector to determine the target location of the target macroblock under the next motion trend.
[0110] For example, referring to the above embodiment, for the jth macroblock to be encrypted, it is necessary to infer the position of the target macroblock in the next key frame:
[0111] First, determine the frame interval. If the position of the inferred target macroblock is still in the forward reference frame of the current key frame, it means that the target macroblock in the current forward reference frame has ended in the current key frame group and no further encryption and inference are required. Therefore, first calculate and analyze the frame interval of the motion trend (since the time corresponding to a group of key frames is extremely short, it is assumed that the speed of the moving target is stable in a short time).
[0112] For the i-th key frame, the frame interval of the j-th macroblock to be encrypted in its p-th forward reference frame is:
[0113]
[0114] in, is the number of accumulated trend blocks of the jth macroblock to be encrypted in the pth forward reference frame, represents the upsampling function.
[0115] When the frame interval When it is greater than the difference between the number of all forward reference frames of the i-th key frame and p (that is, the number of forward reference frames of the remaining unanalyzed predicted frames), it is considered that encryption is required, that is, the frame in which the next movement of the moving target occurs is in the next key frame, which means that the moving target disk has not finished moving in the current key frame. Therefore, the inferred direction and distance can be further obtained. In simple terms, here we see whether the current remaining moving target is in the next key frame and its forward reference frame, or in the current key frame and its forward reference frame. If the frame interval is greater than the number of forward reference frames of the remaining unanalyzed predicted frames, it is in the motion picture of the next motion trend and in the next key frame group. If it is less than or equal to, it is in the current key frame group.
[0116] The inferred direction is: the direction of the jth macroblock to be encrypted
[0117] The inferred motion modulus is:
[0118]
[0119] is the average of the vector distances between two adjacent cumulative trend blocks of the jth macroblock to be encrypted in the pth forward reference frame in frame order, is the number of accumulated trend blocks of the jth macroblock to be encrypted in the pth forward reference frame, is the inferred motion magnitude value of the jth macroblock to be encrypted in the pth forward reference frame. The inferred direction and the inferred motion magnitude value constitute the inferred motion vector of the jth macroblock to be encrypted in the pth forward reference frame.
[0120] Taking the position of the jth macroblock to be encrypted in the pth forward reference frame as the origin, the position of its inferred motion vector is the target position of the target macroblock.
[0121] Step S3, determining a target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame;
[0122] The present invention can implement the encryption method of surveillance video with a two-dimensional Arnold encryption algorithm, wherein the two-dimensional Arnold encryption algorithm performs a shear transformation on the image through an encryption matrix, and hides the image information by changing the positions of pixels. Therefore, the more obvious the information change of the macroblock is, the deeper the result of the transformation and hiding is required.
[0123] The encryption matrix of the two-dimensional Arnold encryption algorithm is:
[0124]
[0125] Among them, b affects the horizontal misalignment and c affects the vertical misalignment.
[0126] The target encryption parameters include the shearing parameter and the shearing direction, where the selection logic of the shearing parameter can be:
[0127] Miscutting will change the pixel information of the macroblocks around the macroblock to be encrypted into the macroblock to be encrypted. The greater the change in the information content of the macroblock to be encrypted, that is, the greater the residual amount, the worse the information consistency, and the more it needs to be hidden in the next target macroblock. Therefore, the greater the magnitude of the miscutting, and changing the magnitude of the miscutting is mainly to change the size of the miscutting parameter. The larger the parameter, the farther the position of the pixel changes during miscutting.
[0128] Regarding the selection of the shearing direction: if the inferred direction is in quadrants 1 or 4, then the calculated parameter is b, and the larger of the two factors is taken as b, and the smaller one is taken as c. If the inferred direction is in quadrants 2 or 3, then the calculated parameter is c, and the size of the factors is selected in reverse.
[0129] In short, the target encryption parameters are determined based on the two-dimensional Arnold encryption algorithm and the residual between the macroblock to be encrypted and the key frame reference block (change in motion target information).
[0130] In a preferred embodiment, please refer to Figure 5 , the step S3 comprises:
[0131] Step S30, determining a first mean value of residual values of all pixels of the macroblock to be encrypted compared with the reference block;
[0132] Step S31, determining a difference between the mean grayscale values of pixels in the target macroblock and all macroblocks in a preset number of neighborhoods, and determining a second mean of the difference between the mean grayscale values;
[0133] Step S32, using the first mean and the second mean, calculating a shearing parameter;
[0134] Step S33, determining the shearing direction based on the quadrant where the inferred direction is located;
[0135] Step S34, combining the shearing parameter and the shearing direction to obtain the target encryption parameter of the target macroblock.
[0136] The consistency of the residual amount (which can be reflected as a residual value, that is, residual data) is the difference between the macroblock to be encrypted and the reference block, that is, the change in the moving target information.
[0137] Then the calculation method of the shear parameter of the jth macroblock to be encrypted in the pth forward reference frame is:
[0138]
[0139] in It is the mean (first mean) of the residual values of all pixels of the jth macroblock to be encrypted in the pth forward reference frame. The larger the value, the more it means that the moving target has changed during the movement, which may be a change in behavior or a change in information, so it needs to be hidden. It is the mean (second mean) of the difference between the target macroblock corresponding to the jth macroblock to be encrypted in the pth forward reference frame and the mean of the grayscale values of the corresponding pixels in all macroblocks in its 8-neighborhood. The larger the value, the greater the difference between the position of the target macroblock and the surrounding area in the next movement, and the more a strong shear transform is needed for information hiding.
[0140] Furthermore, the shearing parameters Factor the number and find the two factors with the smallest difference.
[0141] Choice of shearing direction: If the inference direction is in quadrants 1 or 4, the calculated parameter is b. The larger of the two factors is taken as b, and the smaller one is taken as c. If the inference direction is in quadrants 2 or 3, the calculated parameter is c, and the size of the factors is chosen conversely.
[0142] At this point, the target position and encryption matrix of the jth target macroblock to be encrypted in the pth forward reference frame are obtained. Target encryption parameters of the form .
[0143] Step S4, feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position.
[0144] Specifically, the step S4 includes:
[0145] Packaging the target encryption parameters into a control signal through an edge computing layer;
[0146] Transmitting the control signal as a configuration update file to the perception layer through the serial port of the edge computing layer;
[0147] In response to the configuration update file, the target macroblock in the surveillance video is encrypted at the perception layer through the perception layer.
[0148] After obtaining the position and encryption matrix of the target macroblock in the next key frame, since the surveillance cameras of the edge computing layer and the perception layer are connected through the network layer, it means that the terminal device and the edge computing layer are in the same network, and the edge computing layer is located in the micro server. Therefore, the edge computing layer packages the position and encryption matrix into a control signal and transmits it to the perception layer through the hardware interface (serial port) of the edge gateway as a configuration update file. After the perception layer obtains the position and encryption matrix of the macroblock to be encrypted, it uses H.264 compression encoding to analyze the collected surveillance video to obtain the key frame, and then uses the encryption matrix as a parameter in the forward reference frame corresponding to the macroblock to be encrypted, and uses two-dimensional Arnold transformation to realize the encryption of the surveillance video, and then transmits the encrypted video to the edge computing layer through the network layer.
[0149] Repeat the above operations to achieve real-time IoT privacy data encryption based on the analysis feedback from the edge computing layer.
[0150] Since the method of analyzing the secret key is implemented in the edge computing layer, there is no need to transmit the secret key together with the encrypted file, which ensures the security of IoT privacy monitoring. Further, after the edge computing layer obtains the next key frame and its forward reference frame, it uses the secret key fed back to the perception layer by the edge computing layer to decrypt it, and repeats the above steps to analyze the area that needs to be encrypted in the next key frame. Repeat this operation to achieve the purpose of encrypting the IoT video according to the motion trend of the moving target, and solve the problem of poor encryption effect caused by weak hardware analysis capabilities in the perception layer. At this time, the perception layer only needs to complete video acquisition and two-dimensional Arnold shear transform encryption, which does not involve big data analysis and calculation, reducing the analysis pressure of the perception layer and improving the encryption capability of the perception layer.
[0151] In order to facilitate further understanding of the above-mentioned embodiments of the present invention, the inventive concept of the present invention can be roughly summarized as follows:
[0152] Since the analysis capability of the acquisition equipment at the perception layer is relatively weak, traditional encryption of surveillance video data is usually performed at the edge computing layer. At this time, data transmission from the perception layer to the edge computing layer has been performed using the network layer. If the surveillance video information is monitored through the network during this stage, the theft of surveillance video information can be achieved. Therefore, the present invention proposes a method of compressing the data at the perception layer, and returning the motion vector data and residual value of the macroblock to the perception layer after analysis at the edge computing layer, thereby realizing compression and encryption of the key frame to be acquired next time and its P frame forward reference frame.
[0153] For a macroblock in a forward reference frame, it represents the information that has changed in the current forward reference frame compared with the previous frame or several previous frames and its key frames. For surveillance video, the monitored area of the surveillance video does not change much over a long period of time, and if the change is caused by the environment, such as wind blowing the leaves, then the residual value should be chaotic, and the motion vector data of the macroblock compared to the reference block does not have continuity over multiple frames. Therefore, the present invention analyzes the consistency of the change direction and information consistency of the macroblock over multiple frames in the edge computing layer, obtains encryption parameters for the area showing obvious behavior information (consistent motion direction, consistent residual amount), predicts the macroblock (position information) to which the next behavior information may be transmitted, and feeds the encryption parameters and position information back to the perception layer to implement encryption at the perception layer, and the secret key is in the edge computing layer, which can be analyzed at the edge computing layer or transmitted to the application layer for analysis.
[0154] The present invention analyzes the directional consistency and information consistency of the motion changes of macroblocks over multiple frames in the edge computing layer or the application layer, analyzes the compressed macroblock area showing obvious behavior information (consistent motion direction, consistent residual amount) to obtain the corresponding encryption parameters, and predicts the target macroblock to which the next motion behavior information may be transmitted, and feeds the encryption parameters and target macroblock information back to the perception layer, thereby reducing the analysis pressure of the perception layer and improving the encryption capability at the perception layer, realizing encryption of big data at the perception layer, solving the defect of poor encryption effect caused by weak hardware analysis capability in the perception layer, and realizing real-time adjustment of encryption parameters based on the prediction of motion trends, thereby avoiding the unification of secret keys for the same encryption method, improving the encryption capability of data at the perception layer and the source of data acquisition, greatly improving the security of IoT data, and reducing the risk of data theft and leakage.
[0155] Embodiment 2:
[0156] The embodiment of the present invention also provides an IoT privacy data security protection device, which can be a system device including a monitoring camera, a communication module, and a data processing terminal.
[0157] like Figure 6 As shown, Figure 6 It is a structural diagram of the hardware operating environment of the Internet of Things privacy data security protection device involved in the embodiment of the present invention.
[0158] like Figure 6 As shown, the Internet of Things privacy data security protection device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display (Display), an input unit such as a control panel, and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WIFI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. The memory 1005 as a computer storage medium may include an Internet of Things privacy data security protection program.
[0159] Those skilled in the art will understand that Figure 6 The hardware structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0160] Continue to refer to Figure 6 , Figure 6 The memory 1005 as a computer-readable storage medium may include an operating system, a user interface module, a network communication module, and an IoT privacy data security protection program.
[0161] exist Figure 6 In the embodiment, the network communication module is mainly used to connect to the server and can communicate data with the server; and the processor 1001 can call the Internet of Things privacy data security protection program stored in the memory 1005 and execute the steps in the above embodiments.
[0162] The hardware structure of the above-mentioned Internet of Things privacy data security protection device is used to implement various embodiments of the Internet of Things privacy data security protection method of the present invention.
[0163] Embodiment three:
[0164] In addition, the present invention also provides an Internet of Things privacy data security protection system, please refer to Figure 7 , the Internet of Things privacy data security protection system includes:
[0165] The perception analysis module A10 is used to determine the reference block in the key frame in the surveillance video and the compressed macroblock in the forward reference frame of the prediction frame corresponding to the key frame;
[0166] The application analysis module A20 is used to determine the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock corresponding to the next motion trend based on the motion behavior information of the compressed macroblock compared with the reference block; and determine the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame;
[0167] The edge analysis module A30 is used to feed back the target encryption parameters to the perception layer to perform perception layer encryption on the target macroblock in the target position.
[0168] Furthermore, the application analysis module A20 is also used for:
[0169] Obtaining a motion vector angle of the compressed macroblock compared to the reference block and a mean value of the motion vector angles of all accumulated trend blocks corresponding to the compressed macroblock;
[0170] Determining the vector direction consistency of the compressed macroblock using the motion vector angle and the motion vector angle mean;
[0171] Determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency;
[0172] Determining a macroblock to be encrypted from the compressed macroblocks according to the degree of expression of the motion behavior trend;
[0173] The accumulated trend block represents each compressed macroblock of each frame through which the line between the reference block and the compressed macroblock passes.
[0174] Furthermore, the application analysis module A20 is also used for:
[0175] Obtaining the number of macroblocks of the compressed macroblock in a frame corresponding to any accumulated trend block that is identical to a reference frame of the accumulated trend block;
[0176] The degree of expression of the motion behavior trend of the compressed macroblock is calculated by using the vector direction consistency and the number of identical macroblocks.
[0177] Furthermore, the application analysis module A20 is also used for:
[0178] Comparing the motion behavior trend performance degree with a preset degree threshold, and determining a compressed macroblock whose motion behavior trend performance degree is greater than the preset degree threshold as a preferred compressed macroblock;
[0179] All preferred compressed macroblocks in the forward reference frame of the last prediction frame are determined as macroblocks to be encrypted.
[0180] Furthermore, the application analysis module A20 is also used for:
[0181] Determine a frame interval between the key frame and the macroblock to be encrypted;
[0182] In the case where the frame interval is greater than the number of forward reference frames of the remaining unanalyzed prediction frames, determining the inferred motion vector of the macroblock to be encrypted;
[0183] Taking the position of the macroblock to be encrypted as the origin, the inferred motion vector is used to determine the target position of the target macroblock under the next motion trend.
[0184] Furthermore, the application analysis module A20 is also used for:
[0185] Based on the macroblock to be encrypted, obtaining the number of cumulative trend blocks and the average value of the vector distance between two adjacent cumulative trend blocks in frame order;
[0186] The inferred motion modulus value of the macroblock to be encrypted is calculated by using the number of accumulated trend blocks and the mean value of the vector distance;
[0187] The direction of the macroblock to be encrypted is used as the inference direction, and the inferred motion modulus value and the inference direction are combined to obtain the inferred motion vector.
[0188] Furthermore, the application analysis module A20 is also used for:
[0189] Determine a first mean value of residual values of all pixels of the macroblock to be encrypted compared with the reference block;
[0190] Determine the difference between the mean grayscale values of pixels in the target macroblock and all macroblocks in a preset number of neighborhoods, and determine a second mean of the difference between the mean grayscale values;
[0191] Using the first mean value and the second mean value, a misalignment parameter is calculated;
[0192] Determining the shearing direction based on the quadrant in which the inferred direction is located;
[0193] The target encryption parameter of the target macroblock is obtained by combining the staggered parameter and the staggered direction.
[0194] Furthermore, the edge analysis module A30 is also used for:
[0195] Packaging the target encryption parameters into a control signal through an edge computing layer;
[0196] Transmitting the control signal as a configuration update file to the perception layer through the serial port of the edge computing layer;
[0197] In response to the configuration update file, the target macroblock in the surveillance video is encrypted at the perception layer through the perception layer.
[0198] Furthermore, the edge analysis module A30 is also used for:
[0199] Determine multiple key frames in the surveillance video and the predicted frame forward reference frame corresponding to each key frame based on the key frame analysis of the perception layer;
[0200] The key frame and the forward reference frame of the prediction frame are compressed and divided into a plurality of macroblocks with corresponding positions and the same size, the macroblocks in the key frame are used as reference blocks, and the macroblocks with motion behavior information in the forward reference frame of the prediction frame are used as compressed macroblocks.
[0201] The specific implementation methods of the Internet of Things privacy data security protection system of the present invention are basically the same as the above-mentioned embodiments of the Internet of Things privacy data security protection method, and will not be repeated here.
[0202] In addition, the present invention also provides a computer-readable storage medium. The computer-readable storage medium of the present invention stores an Internet of Things privacy data security protection program, wherein when the Internet of Things privacy data security protection program is executed by a processor, the steps of the Internet of Things privacy data security protection method as described above are implemented.
[0203] Among them, the method implemented when the Internet of Things privacy data security protection program is executed can refer to the various embodiments of the Internet of Things privacy data security protection method of the present invention, and will not be repeated here.
[0204] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0205] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0206] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0207] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0208] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0210] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0211] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0212] The above description is only a preferred embodiment of the present invention, and does not limit the scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the protection scope of the present invention.
Claims
1. A method for protecting the privacy data security of the Internet of Things, characterized in that: The method comprises: Determine a reference block in a key frame in a surveillance video and a compressed macroblock in a forward reference frame of a prediction frame corresponding to the key frame; Determine the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock corresponding to the next motion trend based on the motion behavior information of the compressed macroblock compared to the reference block; Determining a target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame; Feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position; The step of determining a macroblock to be encrypted in the compressed macroblock based on the motion behavior information of the compressed macroblock compared with the reference block comprises: Obtaining a motion vector angle of the compressed macroblock compared to the reference block and a mean value of the motion vector angles of all accumulated trend blocks corresponding to the compressed macroblock; Determining the vector direction consistency of the compressed macroblock using the motion vector angle and the motion vector angle mean; Determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency; Determining a macroblock to be encrypted from the compressed macroblocks according to the degree of expression of the motion behavior trend; Wherein, the accumulated trend block represents each compressed macroblock of each frame through which the line between the reference block and the compressed macroblock passes; The step of determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency comprises: Obtaining the number of macroblocks of the compressed macroblock in a frame corresponding to any accumulated trend block that is identical to a reference frame of the accumulated trend block; Utilizing the consistency of the vector direction and the number of identical macroblocks, calculating the degree of expression of the motion behavior trend of the compressed macroblock; The step of determining the macroblock to be encrypted from the compressed macroblock according to the degree of expression of the motion behavior trend comprises: Comparing the motion behavior trend performance degree with a preset degree threshold, and determining a compressed macroblock whose motion behavior trend performance degree is greater than the preset degree threshold as a preferred compressed macroblock; Determine all the preferred compressed macroblocks in the forward reference frame of the last prediction frame as macroblocks to be encrypted; The step of feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position comprises: Packaging the target encryption parameters into a control signal through an edge computing layer; Transmitting the control signal as a configuration update file to the perception layer through the serial port of the edge computing layer; In response to the configuration update file, performing perception layer encryption on a target macroblock in the surveillance video through the perception layer; The step of determining a reference block in a key frame in a surveillance video and a compressed macroblock in a forward reference frame of a prediction frame corresponding to the key frame comprises: Determine multiple key frames in the surveillance video and the predicted frame forward reference frame corresponding to each key frame based on the key frame analysis of the perception layer; The key frame and the forward reference frame of the prediction frame are compressed and divided into a plurality of macroblocks with corresponding positions and the same size, the macroblocks in the key frame are used as reference blocks, and the macroblocks with motion behavior information in the forward reference frame of the prediction frame are used as compressed macroblocks.
2. The method for protecting the privacy data security of the Internet of Things according to claim 1 is characterized in that: The step of determining the target position of the target macroblock corresponding to the compressed macroblock under the next motion trend comprises: Determine a frame interval between the key frame and the macroblock to be encrypted; In the case where the frame interval is greater than the number of forward reference frames of the remaining unanalyzed prediction frames, determining the inferred motion vector of the macroblock to be encrypted; Taking the position of the macroblock to be encrypted as the origin, the inferred motion vector is used to determine the target position of the target macroblock under the next motion trend.
3. The method for protecting the privacy data security of the Internet of Things according to claim 2 is characterized in that: The step of determining the inferred motion vector of the macroblock to be encrypted comprises: Based on the macroblock to be encrypted, obtaining the number of cumulative trend blocks and the average value of the vector distance between two adjacent cumulative trend blocks in frame order; The inferred motion modulus value of the macroblock to be encrypted is calculated by using the number of accumulated trend blocks and the mean value of the vector distance; The direction of the macroblock to be encrypted is used as the inference direction, and the inferred motion modulus value and the inference direction are combined to obtain the inferred motion vector.
4. The method for protecting the privacy data security of the Internet of Things according to claim 3 is characterized in that: The step of determining the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame comprises: Determine a first mean value of residual values of all pixels of the macroblock to be encrypted compared with the reference block; Determine the difference between the mean grayscale values of pixels in the target macroblock and all macroblocks in a preset number of neighborhoods, and determine a second mean of the difference between the mean grayscale values; Using the first mean value and the second mean value, a misalignment parameter is calculated; Determining the shearing direction based on the quadrant in which the inferred direction is located; The target encryption parameter of the target macroblock is obtained by combining the staggered parameter and the staggered direction.
5. An Internet of Things privacy data security protection system, characterized in that: The system is used to implement the Internet of Things privacy data security protection method according to any one of claims 1 to 4; the system includes: A perception analysis module, used to determine the reference blocks in the key frames in the surveillance video and the compressed macro blocks in the forward reference frames of the prediction frames corresponding to the key frames; An application analysis module is used to determine the target position of the macroblock to be encrypted in the compressed macroblock and the target macroblock corresponding to the next motion trend based on the motion behavior information of the compressed macroblock compared with the reference block; and determine the target encryption parameter of the target macroblock according to the consistency of the residual amount between the macroblock to be encrypted and the key frame; An edge analysis module, used for feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position; The step of determining a macroblock to be encrypted in the compressed macroblock based on the motion behavior information of the compressed macroblock compared with the reference block comprises: Obtaining a motion vector angle of the compressed macroblock compared to the reference block and a mean value of the motion vector angles of all accumulated trend blocks corresponding to the compressed macroblock; Determining the vector direction consistency of the compressed macroblock using the motion vector angle and the motion vector angle mean; Determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency; Determining a macroblock to be encrypted from the compressed macroblocks according to the degree of expression of the motion behavior trend; Wherein, the accumulated trend block represents each compressed macroblock of each frame through which the line between the reference block and the compressed macroblock passes; The step of determining the degree of expression of the motion behavior trend of the compressed macroblock according to the vector direction consistency comprises: Obtaining the number of macroblocks of the compressed macroblock in a frame corresponding to any accumulated trend block that is identical to a reference frame of the accumulated trend block; Utilizing the consistency of the vector direction and the number of identical macroblocks, calculating the degree of expression of the motion behavior trend of the compressed macroblock; The step of determining the macroblock to be encrypted from the compressed macroblock according to the degree of expression of the motion behavior trend comprises: Comparing the motion behavior trend performance degree with a preset degree threshold, and determining a compressed macroblock whose motion behavior trend performance degree is greater than the preset degree threshold as a preferred compressed macroblock; Determine all the preferred compressed macroblocks in the forward reference frame of the last prediction frame as macroblocks to be encrypted; The step of feeding back the target encryption parameter to the perception layer to perform perception layer encryption on the target macroblock in the target position comprises: Packing the target encryption parameters into a control signal through an edge computing layer; Transmitting the control signal as a configuration update file to the perception layer through the serial port of the edge computing layer; In response to the configuration update file, performing perception layer encryption on a target macroblock in the surveillance video through the perception layer; The step of determining a reference block in a key frame in a surveillance video and a compressed macroblock in a forward reference frame of a prediction frame corresponding to the key frame comprises: Determine multiple key frames in the surveillance video and the predicted frame forward reference frame corresponding to each key frame based on the key frame analysis of the perception layer; The key frame and the forward reference frame of the prediction frame are compressed and divided into a plurality of macroblocks with corresponding positions and the same size, the macroblocks in the key frame are used as reference blocks, and the macroblocks with motion behavior information in the forward reference frame of the prediction frame are used as compressed macroblocks.