Video anti-tampering method, device, electronic device and storage medium

By parsing and encrypting video data packets, the problem of hidden security risks in network camera transmission is solved, the hardware cost is reduced, and the security of video data transmission is improved.

CN115866299BActive Publication Date: 2024-09-24AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211465157.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2024-09-24
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

In existing video surveillance systems, network cameras have security risks of clear text transmission when transmitting video data, which results in the need to frequently replace cameras to improve security, but the hardware cost is high.

Method used

By parsing the video data packets, detecting the network abstraction layer data type, generating custom network abstraction layer data and using the initial key to encrypt the video data, the security of the video data during transmission is ensured.

Benefits of technology

It reduces the frequency of camera replacement and hardware costs, achieves security and reliability of video data during transmission, and avoids the risk of tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866299B
    Figure CN115866299B
Patent Text Reader

Abstract

The present application provides a video anti-tampering method, device, electronic device and storage medium, the video anti-tampering method comprises: parsing a video data packet from a video acquisition device to obtain network abstraction layer data; detecting the type of the network abstraction layer data; after detecting the first network abstraction layer data of the type of a sequence parameter set, generating custom network abstraction layer data according to the first network abstraction layer data, wherein the custom network abstraction layer data includes an encrypted initial key; encrypting the second video abstraction layer data after the first video abstraction layer data and of the type of a non-sequence parameter set according to the initial key; and sequentially sending the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data to a data receiving end. This solution can reduce costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video anti-tampering method, device, electronic device and storage medium. Background Art

[0002] In the existing national video surveillance system, when network cameras transmit the collected video data to the server, they usually transmit it in plain text, which poses a great security risk.

[0003] The existing technology for protecting network videos requires upgrading the camera. However, directly upgrading and replacing the camera will result in very high hardware costs. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a video anti-tampering method, device, electronic device and storage medium, which can reduce costs.

[0005] According to a first aspect of an embodiment of the present application, a video anti-tampering method is provided, the method comprising: parsing a video data packet from a video acquisition device to obtain network abstraction layer data; detecting the type of the network abstraction layer data; upon detecting first network abstraction layer data of a sequence parameter set type, generating custom network abstraction layer data according to the first network abstraction layer data, wherein the custom network abstraction layer data comprises an encrypted initial key; encrypting second video abstraction layer data of a non-sequence parameter set type that follows the first video abstraction layer data according to the initial key; and sending the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data to a data receiving end in sequence.

[0006] In a possible implementation method, generating a custom type of network abstraction layer data according to the first video abstraction layer data includes: performing a hash operation on the first network abstraction layer data to obtain a first hash value; and generating custom network abstraction layer data according to the first hash value.

[0007] In a possible implementation, the generating of custom network abstraction layer data according to the first hash value includes: generating the initial key through a random function; generating signature data according to the first hash value and the initial key; generating custom network abstraction layer data including an identification code of the video acquisition device and the signature data.

[0008] In a possible implementation method, generating signature data based on the first hash value and the initial secret key includes: obtaining a timestamp based on the current time; performing a hash operation on the identification code, the timestamp, the initial secret key and the first hash value to obtain a second hash value; and encrypting the timestamp, the initial secret key and the second hash value by using the private key of the video acquisition device to obtain signature data.

[0009] In a possible implementation method, the hashing operation on the first network abstraction layer data to obtain the first hash value includes: performing a hashing operation on the first network abstraction layer data through an SM3 hash algorithm to obtain the first hash value; and / or encrypting the timestamp, the initial key and the second hash value through the private key of the video acquisition device to obtain the signature data includes: encrypting the timestamp, the initial key and the second hash value through an SM2 encryption algorithm according to the private key of the video acquisition device to obtain the signature data.

[0010] In a possible implementation, encrypting the second video abstraction layer data that follows the first video abstraction layer data and is a non-sequence parameter set according to the initial key includes: generating a key stream through a ZUC algorithm according to the initial key; and encrypting the second video abstraction layer data through the key stream.

[0011] According to a second aspect of an embodiment of the present application, a video anti-tampering device is provided, including: a parsing module, used to parse a video data packet from a video acquisition device to obtain video abstraction layer data; a detection module, used to detect the type of the video abstraction layer data; a generation module, used to generate network abstraction layer data of a custom type according to first video abstraction layer data after detecting first video abstraction layer data of a sequence parameter set type; an encryption module, used to encrypt second video abstraction layer data of a non-sequence parameter set type following the first video abstraction layer data; and a sending module, used to send the network abstraction layer data of the custom type, the first video abstraction layer data and the second video abstraction layer data in sequence to a data receiving end.

[0012] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0013] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0014] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, which is tangibly stored on a computer-readable medium and includes computer-executable instructions, which, when executed, cause at least one processor to perform the method described in the first aspect.

[0015] Based on the video anti-tampering method provided by the above scheme, the video data packet from the video acquisition device is parsed to obtain the network abstraction layer data, and the type of the network abstraction layer data is detected. When the first network abstraction layer data of the type of the sequence parameter set is detected, the custom network abstraction layer data is generated according to the detected first network abstraction layer data, and the second video abstraction layer data is encrypted by the initial secret key. Finally, the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data are sent to the data receiving end. This scheme divides the network abstraction layer data in the video data packet into the first network abstraction layer data and the second network abstraction layer data, and generates the custom network abstraction layer data according to the first network abstraction layer data, and then encrypts the second network abstraction layer data. The generated custom network abstraction layer data and the encryption of the second network abstraction layer data ensure that the video will not be tampered with during the transmission process. Compared with the traditional upgrade method of replacing the camera, this method can reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0017] Figure 1 A flowchart of a video anti-tampering method provided by an embodiment of the present application;

[0018] Figure 2 A flowchart of another video anti-tampering method provided by an embodiment of the present application;

[0019] Figure 3 A schematic diagram of a video anti-tampering device provided by an embodiment of the present application;

[0020] Figure 4 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0022] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0023] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0024] Video anti-tampering method

[0025] Figure 1 1 is a flow chart of a video playback tampering method provided by an embodiment of the present application. Figure 1 As shown, the video anti-tampering method includes steps 101 to 105:

[0026] Step 101: Parse the video data packet from the video acquisition device to obtain network abstraction layer data.

[0027] Network cameras or NVRs provide many transmission protocols based on IP networks. Real-time video streams are transmitted over IP networks. Through a combination of multiple protocols, they can adapt to various complex network transmission environments. The most common ones are the Real-time Transport Protocol and the Real-time Transport Control Protocol. The basic function of these protocols is to package the encoded video raw stream into the TCP or UDP network data stream. The routers in the middle will not make changes to the TCP / UDP data packets.

[0028] By parsing the TCP and UDP video data packets from the video acquisition device, the network abstraction layer data after video encoding is obtained.

[0029] Step 102: Detect the type of network abstraction layer data.

[0030] In the network abstraction layer data, an image is called a sequence (a sequence is a piece of data with the same characteristics). When an image is very different from the previous image and cannot be generated by referring to the previous frame, the previous sequence ends and the next sequence begins, that is, a complete frame is generated for this image. Images are organized in sequences. A sequence is a data stream after encoding an image, starting with a key frame and ending with the next key frame. Therefore, the network abstraction layer data is in the form of video sequences, which refers to a group of images that are highly correlated using the same encoding parameters and are decoded independently of other parts of the video. In H.264, a video sequence is equivalent to the group of images between two starting instant decoding frames.

[0031] Each sequence is divided into two types, one is a sequence parameter set and the other is a non-sequence parameter set.

[0032] Step 103: When first network abstraction layer data of a sequence parameter set type is detected, generate custom network abstraction layer data according to the first network abstraction layer data.

[0033] The custom network abstraction layer data includes the encrypted initialization key.

[0034] 5 bits of binary can be used to represent 32 bits of different types of custom network abstraction layer data. 0-23 are used by the RTP network high-level protocol, 24-31 are user-defined types, and the custom network abstraction layer data of this solution uses 30.

[0035] Before sending the first network abstraction layer data of the sequence parameter set type, it is necessary to insert a custom network abstraction layer data, wherein the custom network abstraction layer data is generated according to the first network abstraction layer data.

[0036] Step 104: Encrypt the second video abstraction layer data that follows the first video abstraction layer data and is of a non-sequence parameter set type according to the initial key.

[0037] When the second video abstraction layer data of the type bit non-sequence parameter set is detected, the initial key in the custom network abstraction layer data is used to encrypt the second video abstraction layer data to ensure that the second video abstraction layer data will not be arbitrarily tampered with during transmission, thereby ensuring the security of the second video abstraction layer data transmission.

[0038] Step 105: Send the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data to the data receiving end in sequence.

[0039] In an embodiment of the present application, the video data packet of the video acquisition device is parsed to obtain network abstraction layer data, the type of the network abstraction layer data is detected, and after the first network abstraction layer data of the detected type is a sequence parameter set, custom network abstraction layer data is generated according to the first network abstraction layer data, and then the second network abstraction layer data of the non-sequence parameter set type is detected and the second network abstraction layer data is encrypted, and finally the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data are sent to the data receiving end. After the data receiving end receives these data, it is necessary to use the stored public key and the identification code of the video acquisition device to parse and verify the network abstraction layer data. The verification ensures that the network abstraction layer data will not be tampered with. Compared with the traditional upgrade method of replacing the camera, this method can reduce costs.

[0040] In a possible implementation, generating network abstraction layer data of a user-defined type according to the first video abstraction layer data includes:

[0041] A hash operation is performed on the first network abstraction layer data to obtain a first hash value.

[0042] Generate custom network abstraction layer data according to the first hash value.

[0043] The type of the first network abstraction layer data is a sequence parameter set, which is used to transmit parameter encoding of the sequence fragment. Therefore, in order to ensure that the first network abstraction layer data can be encoded normally, the sequence parameter set must be transmitted first. Usually, a higher transmission priority is given to the sequence parameter set or a more secure channel is used to transmit the sequence parameter set.

[0044] This solution is to transmit the sequence parameter set by generating a more secure channel, namely, custom network abstraction layer data.

[0045] By performing a hash operation on the first network abstraction layer data, the first network abstraction layer data generates an information summary code, that is, a first hash value; and according to the first hash value, the custom network abstraction layer data is generated.

[0046] In an embodiment of the present application, custom network abstraction layer data is generated according to the first network abstraction layer data, and is used to transmit the first network abstraction layer data of a sequence parameter set type, so that the sequence parameter set has a transmission priority.

[0047] In a possible implementation, generating custom network abstraction layer data according to the first hash value includes:

[0048] Generate the initial secret key through a random function.

[0049] An initial secret key is randomly generated according to a random function, and the initial secret key is used by the data receiving end to parse the received video data.

[0050] Generate signature data based on the first hash value and the initial secret key.

[0051] The first network abstraction layer data of the identified type of sequence parameter set is small and important key data, so the first video abstraction layer data needs to be signed to ensure that the first network abstraction layer data cannot be tampered with. Since the first hash value is obtained by performing a hash operation on the first network abstraction layer data, the signature data is generated according to the first hash value and the initial key, which is essentially signing the first network abstraction layer data.

[0052] Generate custom network abstraction layer data including an identification code and signature data of a video acquisition device.

[0053] The identification code of the video acquisition device is not encrypted, but the signature data is encrypted. The generated custom network abstraction layer data includes the identification code and signature data of the video acquisition device.

[0054] In an embodiment of the present application, signature data is generated based on the first hash value and the initial key, and finally custom network abstraction layer data including an identification code and signature data of the video acquisition device is generated for wired transmission of first network abstraction layer data of the sequence parameter set type.

[0055] In a possible implementation, generating signature data according to the first hash value and the initial key includes:

[0056] Get a timestamp based on the current time.

[0057] In an implementable example, the timestamp may be recorded in the format of year, month, and day, such as 2022.1.1.

[0058] A hash operation is performed on the identification code, the timestamp, the initial key, and the first hash value to obtain a second hash value.

[0059] Since the total data volume of the identification code, timestamp, initial key and first hash value may reach more than 1kB, the large data volume will take up a lot of time and space, so the identification code, timestamp, initial key and first hash value must be hashed to obtain the second hash value.

[0060] The timestamp, initial secret key and second hash value are encrypted by the private key of the video acquisition device to obtain the signature data.

[0061] In the embodiment of the present application, when all important parameters are carried in the network abstraction layer data of the custom type, the data volume is large, which will take up a lot of time and space. Therefore, the identification code, timestamp, initial key and first hash value are subjected to a second hash operation to obtain the second hash value, and then the timestamp, initial key and second hash value are encrypted by the private key of the video acquisition device to obtain the signature data. This ensures that the data volume carried by the network abstraction layer data of the custom type is small, and that the carried data will not be easily tampered with after being encrypted, so that the data can be transmitted safely.

[0062] In a possible implementation manner, performing a hash operation on the first network abstraction layer data to obtain a first hash value includes:

[0063] A hash operation is performed on the first network abstraction layer data using the SM3 hash algorithm to obtain a first hash value.

[0064] When detecting first network abstraction layer data whose type is a sequence parameter set, a first hash value is obtained by calculating through an SM3 hash function, and the first hash value may be a digest value.

[0065] The signature data obtained by encrypting the timestamp, initial key and second hash value through the private key of the video acquisition device includes:

[0066] According to the private key of the video acquisition device, the timestamp, the initial secret key and the second hash value are encrypted by the SM2 encryption algorithm to obtain the signature data.

[0067] The timestamp, initial secret key and second hash value may be tampered with during the data transmission process. Therefore, it is necessary to encrypt them using the SM2 encryption algorithm based on the private key of the video acquisition device to obtain the signature data.

[0068] In an embodiment of the present application, a hash operation is performed on the first network abstraction layer data through the SM3 hash algorithm to obtain a first hash value, so that less space and time are occupied during data transmission. The timestamp, the initial key and the second hash value are encrypted through the SM2 encryption algorithm to obtain signature data, so that the data is not tampered with, thereby ensuring the security of data transmission.

[0069] Figure 2 FIG. 1 is a flowchart of another video anti-tampering method provided by an embodiment of the present application. Figure 2 As shown, step 104 of encrypting the second video abstraction layer data of a non-sequence parameter set type after the first video abstraction layer data according to the initial key includes sub-steps 1041 to 1042:

[0070] Sub-step 1041: Generate a key stream using the ZUC algorithm according to the initial secret key.

[0071] The ZUC (Zu Chongzhi) algorithm is a stream cipher standard that generates a key stream based on the initial secret key using the ZUC algorithm.

[0072] Sub-step 1042: Encrypt the second video abstraction layer data using the key stream.

[0073] In the embodiment of the present application, the second video abstraction layer data is encrypted by using the generated key stream so that the second video abstraction layer data will not be tampered with at will during the transmission process, thereby ensuring the real-time and secure transmission of the video data.

[0074] Preferably, by using SM2 encryption algorithm, SM3 hash algorithm and ZUC algorithm, which are all domestic cryptographic algorithms, the video acquisition equipment can be transformed into domestic cryptographic algorithms without manual training or software docking, and can be directly connected to the network cable, which greatly saves the engineering costs and personnel costs of domestic cryptographic transformation. The online video content can be authenticated to prevent the video from being tampered with, and copyright protection can be achieved, especially the video source of the self-media website can be traced. As long as the video content is transmitted on the network, it can be authenticated and encrypted for anti-counterfeiting, and it has strong compatibility.

[0075] Video anti-tampering device

[0076] Figure 3 Schematic diagram of a video anti-tampering device provided in an embodiment of the application. Figure 3 As shown, the video anti-tampering device includes:

[0077] The parsing module 301 is used to parse the video data packets from the video acquisition device to obtain the video abstraction layer data;

[0078] A detection module 302, used to detect the type of video abstraction layer data;

[0079] A generating module 303 is configured to generate network abstraction layer data of a user-defined type according to the first video abstraction layer data after detecting the first video abstraction layer data of the sequence parameter set type;

[0080] An encryption module 304 is used to encrypt the second video abstraction layer data of the non-sequence parameter set type following the first video abstraction layer data according to the initial key;

[0081] The sending module 305 is used to send the network abstraction layer data of the user-defined type, the first video abstraction layer data and the second video abstraction layer data to the data receiving end in sequence.

[0082] In the embodiment of the present application, the parsing module 301 parses the video data packet from the video acquisition device to obtain the network abstraction layer data, the detection module 302 detects the type of the network abstraction layer data, the generation module 303 generates the custom network abstraction layer data according to the detected first network abstraction layer data after detecting the first network abstraction layer data of the type of the sequence parameter set, the encryption module 304 encrypts the second video abstraction layer data by the initial key, and the sending module 305 finally sends the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data to the data receiving end. This solution divides the network abstraction layer data in the video data packet into the first network abstraction layer data and the second network abstraction layer data, and generates the custom network abstraction layer data according to the first network abstraction layer data, and then encrypts the second network abstraction layer data. The generated custom network abstraction layer data and the encryption of the second network abstraction layer data ensure that the video will not be tampered with or eavesdropped during the transmission process, and can also be used to authenticate the source or copyright of the video. Compared with the traditional upgrade method of replacing the camera, this method can reduce costs.

[0083] It should be noted that the above-mentioned video anti-tampering device and the above-mentioned video anti-tampering method embodiment are based on the same concept. The specific content can be found in the description of the above-mentioned video anti-tampering method embodiment, which will not be repeated here.

[0084] Electronic devices

[0085] Reference Figure 4 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

[0086] like Figure 4 As shown, the electronic device 400 may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0087] in:

[0088] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .

[0089] The communication interface 404 is used to communicate with other electronic devices or servers.

[0090] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned video anti-tampering method embodiment.

[0091] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0092] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0093] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0094] The program 410 may be specifically used to enable the processor 402 to execute the video anti-tampering method in any of the aforementioned embodiments.

[0095] The specific implementation of each step in program 410 can refer to the corresponding description of the corresponding steps and units in any of the aforementioned video anti-tampering method embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiments, which will not be repeated here.

[0096] In an embodiment of the present application, the video data packet of the video acquisition device is parsed to obtain network abstraction layer data, the type of the network abstraction layer data is detected, and after the first network abstraction layer data of the detected type is a sequence parameter set, custom network abstraction layer data is generated according to the first network abstraction layer data, and then the second network abstraction layer data of the non-sequence parameter set type is detected and the second network abstraction layer data is encrypted, and finally the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data are sent to the data receiving end. After the data receiving end receives these data, it is necessary to use the stored public key and the identification code of the video acquisition device to parse and verify the network abstraction layer data. The verification ensures that the network abstraction layer data will not be tampered with. Compared with the traditional upgrade method of replacing the camera, this method can reduce costs.

[0097] Computer storage media

[0098] The present application also provides a computer-readable storage medium that stores instructions for a machine to execute the video anti-tampering method as described herein. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0099] In this case, the program code read from the storage medium itself can implement the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute part of the present application.

[0100] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0101] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0102] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0103] Computer program product

[0104] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any one of the above-mentioned multiple method embodiments.

[0105] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0106] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the image annotation method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the image annotation method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the verification code generation method shown herein.

[0107] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0108] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A video anti-tampering method, the method include: Parse the video data packets from the video acquisition device to obtain network abstraction layer data; Detecting the type of the network abstraction layer data; After detecting first network abstraction layer data of a sequence parameter set type, generating custom network abstraction layer data according to the first network abstraction layer data, wherein the custom network abstraction layer data includes an encrypted initial key; Encrypting, according to the initial key, second network abstraction layer data following the first network abstraction layer data and of a non-sequence parameter set type; sending the custom network abstraction layer data, the first network abstraction layer data and the encrypted second network abstraction layer data to a data receiving end in sequence; The generating of network abstraction layer data of a user-defined type according to the first network abstraction layer data comprises: Performing a hash operation on the first network abstraction layer data to obtain a first hash value; Generate custom network abstraction layer data according to the first hash value; Generating custom network abstraction layer data according to the first hash value includes: Generate the initial secret key through a random function; Generate signature data according to the first hash value and the initial secret key; Generate custom network abstraction layer data including the identification code of the video acquisition device and the signature data; The step of generating signature data according to the first hash value and the initial secret key includes: Get the timestamp based on the current time; Performing a hash operation on the identification code, the timestamp, the initial key, and the first hash value to obtain a second hash value; The timestamp, the initial secret key and the second hash value are encrypted by the private key of the video acquisition device to obtain signature data.

2. The method according to claim 1, in, The performing a hash operation on the first network abstraction layer data to obtain a first hash value includes: performing a hash operation on the first network abstraction layer data through an SM3 hash algorithm to obtain the first hash value; and / or, The step of encrypting the timestamp, the initial key and the second hash value by using the private key of the video acquisition device to obtain signature data includes: According to the private key of the video acquisition device, the timestamp, the initial key and the second hash value are encrypted by the SM2 encryption algorithm to obtain the signature data.

3. The method according to any one of claims 1 to 2, in, The step of encrypting, according to the initial key, second network abstraction layer data that follows the first network abstraction layer data and is a non-sequence parameter set comprises: Generate a key stream using the ZUC algorithm according to the initial secret key; The second network abstraction layer data is encrypted using the key stream.

4. A video anti-tampering device, include: The parsing module is used to parse the video data packets from the video acquisition device to obtain the network abstraction layer data; A detection module, used to detect the type of the network abstraction layer data; A generating module, configured to generate network abstraction layer data of a user-defined type according to first network abstraction layer data after detecting first network abstraction layer data of a sequence parameter set type; an encryption module, configured to encrypt second network abstraction layer data of a non-sequence parameter set type following the first network abstraction layer data; A sending module, used to send the network abstraction layer data of the user-defined type, the first network abstraction layer data and the second network abstraction layer data to a data receiving end in sequence; The generating module is further configured to perform a hash operation on the first network abstraction layer data to obtain a first hash value; Also used to generate custom network abstraction layer data according to the first hash value; It is also used to generate the initial secret key through a random function; Also used to generate signature data according to the first hash value and the initial secret key; Also used to generate custom network abstraction layer data including the identification code of the video acquisition device and the signature data; It is also used to obtain a timestamp based on the current time; Also used for performing a hash operation on the identification code, the timestamp, the initial key and the first hash value to obtain a second hash value; It is also used to encrypt the timestamp, the initial secret key and the second hash value through the private key of the video acquisition device to obtain signature data.

5. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 3.

6. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

7. A computer program product tangibly stored on a computer readable medium and comprising computer executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1 to 3.