Video tamper-proofing method and system, electronic equipment and storage medium

By dividing the video into blocks and uploading them to the server for storage using a chained hash structure, the problem of low reliability in video anti-tampering is solved, and a highly efficient video anti-tampering solution is achieved, which is suitable for resource-constrained devices.

CN121462801APending Publication Date: 2026-02-03SHENZHEN STREAMING VIDEO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511821193.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing methods for preventing video tampering have low reliability, especially since locally stored hash values ​​are easily regenerated, making it difficult to prevent video content tampering.

Method used

The recorded video is divided into video blocks according to preset rules. A chain structure is used to combine the hash values ​​of each group of images into the final cumulative hash value of the video block, and then uploads it along with the metadata to the server for storage. The integrity of the video block is ensured through the hash chain structure.

Benefits of technology

It improves the reliability of video anti-tampering, reduces network bandwidth consumption and storage costs, is suitable for resource-constrained devices, and ensures that tampering with any frame of a video block will result in a change in the cumulative hash value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121462801A_ABST
    Figure CN121462801A_ABST
Patent Text Reader

Abstract

The invention provides a video tamper-proofing method and system, electronic equipment and a storage medium. The method comprises the following steps: dividing a recorded video into at least one video block according to a preset rule; combining the hash values of each group of images in the video block by using a chain structure to obtain a final accumulated hash value of the video block, each group of images comprising at least one frame of image; and uploading the final accumulated hash value of the video block and the metadata to a server for storage. According to the scheme, the recorded video is divided into the video blocks, the chain structure is adopted to combine the hash values of each group of images in the video blocks to obtain the final accumulated hash values of the video blocks, and the final accumulated hash values of the video blocks and the metadata are uploaded to the server side to be stored so as to prevent the video blocks from being tampered. And when any frame of image of the video block is tampered, the calculated accumulated hash value is changed, so that the tampering-proof reliability of the video is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video monitoring, and in particular to a video tamper-proofing method and system, an electronic device and a storage medium. BACKGROUND

[0002] Videos recorded by monitoring devices such as dash cams are usually stored in local storage, and these videos can be used as evidence when an accident occurs. However, with the development of artificial intelligence technology, the content of the video is very easy to be tampered with, which will seriously affect the reliability and safety of the video as evidence.

[0003] The current way to prevent video tampering is to record the hash of the video in the local file or the local video frame header, but the hash recorded locally is easy to be regenerated to tamper with, and the reliability of video tamper-proofing is low. SUMMARY

[0004] Therefore, the embodiments of the present application provide a video tamper-proofing method, system, electronic device and storage medium to solve the problem of low reliability of the current way to prevent video tampering.

[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions:

[0006] The first aspect of the embodiments of the present application discloses a video tamper-proofing method, which comprises:

[0007] dividing the recorded video into at least one video block according to a preset rule;

[0008] combining the hash values of each group of images in the video block using a chain structure to obtain the final cumulative hash value of the video block, each group of images comprising at least one image;

[0009] uploading the final cumulative hash value of the video block and the metadata to the server side for storage.

[0010] Preferably, the step of combining the hash values of each group of images in the video block using a chain structure to obtain the final cumulative hash value of the video block comprises:

[0011] S1: calculating the hash value of the first group of images of the video block to obtain a first hash value;

[0012] S2: setting the cumulative hash value as the first hash value;

[0013] S3: determining whether there is a next group of images in the video block;

[0014] If the judgment is yes, the next group of images is acquired, the current hash value of the next group of images is calculated, the current hash value is spliced with the accumulated hash value, and a new accumulated hash value is calculated based on the splicing result;

[0015] If the judgment is no, the current accumulated hash value is determined as the final accumulated hash value of the video block.

[0016] S4: repeating step S3 until each group of images of the video block is processed to obtain the final accumulated hash value of the video block.

[0017] Preferably, the metadata of the video block at least includes: the ID of the device recording the video block, the start timestamp and the end timestamp of the video block.

[0018] After uploading the final accumulated hash value and the metadata of the video block to the server side for storage, the method further comprises:

[0019] Acquiring a video block to be verified;

[0020] According to the metadata of the video block to be verified, the final accumulated hash value corresponding to the metadata is queried from the server side;

[0021] The hash values of each group of images in the video block to be verified are combined in a chain structure to obtain a second accumulated hash value of the video block to be verified.

[0022] If the final accumulated hash value and the second accumulated hash value are consistent, it is determined that the video block to be verified has not been tampered with.

[0023] If the final accumulated hash value and the second accumulated hash value are inconsistent, it is determined that the video block to be verified has been tampered with.

[0024] Preferably, the recorded video is divided into at least one video block according to a preset rule, which comprises:

[0025] Identifying the format of the recorded video;

[0026] If the format of the recorded video is a file format, the recorded video is taken as a single video block.

[0027] If the format of the recorded video is a streaming format, the recorded video is divided into multiple video blocks according to a preset time length or a preset frame number.

[0028] Preferably, after the recorded video is divided into multiple video blocks according to a preset time length or a preset frame number, the method further comprises:

[0029] inserting a marker frame at a boundary of the video block, the marker frame comprising at least a start time stamp, a block sequence number and a block type identifier of the video block.

[0030] Preferably, the final accumulated hash value and the metadata of the video block are uploaded to a server end for storage, comprising:

[0031] The final accumulated hash value and the metadata of the video block are digitally signed using a pre-generated private key.

[0032] The final accumulated hash value and the metadata of the video block after digital signature are uploaded to the server end for storage through a secure channel.

[0033] Preferably, the method further comprises:

[0034] Determining a video block to be deleted from the local storage according to a data management strategy;

[0035] If the confirmation information related to the video block to be deleted received from the server end is received, the video block to be deleted is deleted, and the confirmation information represents that the final accumulated hash value of the video block to be deleted has been successfully uploaded to the server end.

[0036] The second aspect of the embodiment of the application discloses a video tamper-proofing system, comprising:

[0037] A division unit is configured to divide a recorded video into at least one video block according to a preset rule;

[0038] A calculation unit is configured to combine hash values of each group of images in the video block in a chain structure to obtain a final accumulated hash value of the video block, and each group of images comprises at least one image;

[0039] An uploading unit is configured to upload the final accumulated hash value and metadata of the video block to a server end for storage.

[0040] The third aspect of the embodiment of the application discloses an electronic device, comprising a processor and a memory, which are connected through a communication bus; wherein the processor is configured to call and execute a program stored in the memory; and the memory is configured to store the program, and the program is used to implement the video tamper-proofing method disclosed in the first aspect of the embodiment of the application.

[0041] The fourth aspect of the embodiment of the application discloses a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to implement the video tamper-proofing method disclosed in the first aspect of the embodiment of the application.

[0042] Based on the video tamper-proofing method, system, electronic device and storage medium provided by the embodiment of the present application, the method is: dividing the recorded video into at least one video block according to a preset rule; combining the hash values of each group of images in the video block by using a chain structure to obtain the final cumulative hash value of the video block, each group of images including at least one image; uploading the final cumulative hash value of the video block and the metadata to the server end for storage. The present scheme divides the recorded video into video blocks, and then combines the hash values of each group of images in the video block by using a chain structure to obtain the final cumulative hash value of the video block, and uploads the final cumulative hash value of the video block and the metadata to the server end for storage to prevent the video block from being tampered with. Tampering with any image of the video block will cause the calculated cumulative hash value to change, thereby improving the reliability of video tamper-proofing. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on the provided drawings.

[0044] Figure 1 The flowchart of the video tamper-proofing method provided by the embodiment of the present application;

[0045] Figure 2 The flowchart of the video tamper-proofing method provided by the embodiment of the present application;

[0046] Figure 3 The flowchart of the video tamper-proofing method provided by the embodiment of the present application;

[0047] Figure 4 The flowchart of the video tamper-proofing method provided by the embodiment of the present application;

[0048] Figure 5 The flowchart of the video tamper-proofing method provided by the embodiment of the present application;

[0049] Figure 6 The architecture example diagram of the device end, verification end and server end provided by the embodiment of the present application;

[0050] Figure 7 The architecture example diagram of the device end, verification end and server end provided by the embodiment of the present application;

[0051] Figure 8 The structure block diagram of the video tamper-proofing system provided by the embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0053] In the present application, the terms “comprising”, “containing” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the sentence “comprising a…” does not exclude the presence of other identical elements in the process, method, article or equipment including the element.

[0054] In the field of video monitoring, the videos recorded by monitoring devices such as driving recorders are usually stored in local storage, and these videos can be used as evidence when an accident occurs. However, with the development of artificial intelligence technology, the content of the video is very easy to be tampered with (for example, AI face changing and other means for video tampering), which will seriously affect the reliability and safety of the video as evidence.

[0055] After research, it is found that the current ways to prevent video tampering mainly include the following three anti-tampering methods:

[0056] The first anti-tampering method is to directly upload the complete video to a remote server for storage to avoid local tampering risks. However, this first anti-tampering method requires a large amount of network bandwidth and storage resources, has a high economic cost, and is not suitable for bandwidth-limited or offline environments.

[0057] The second anti-tampering method is to calculate the hash of the complete video (equivalent to a large file) at one time. However, this second anti-tampering method will cause huge memory resource consumption, and it is difficult to implement in devices with small memory such as embedded devices.

[0058] The third anti-tampering method records the hash of the video in the local file or the local video frame header. However, when using the third anti-tampering method, the hash recorded locally is easy to be regenerated and tampered with, and the reliability of video anti-tampering is low.

[0059] In general, the current ways to prevent video tampering have problems such as easy tampering of local video storage, high server storage cost, and difficulty in calculating the hash of a large file.

[0060] To this end, the embodiment of the present application provides a video tamper-proofing method, a system, an electronic device and a storage medium. The video is divided into video blocks, and the hash values of each group of images in the video blocks are combined to obtain the final cumulative hash value of the video block by using a chain structure. The final cumulative hash value of the video block and the metadata are uploaded to the server end for storage to prevent the video block from being tampered with. Tampering with any frame of image of the video block will cause the calculated cumulative hash value to change, thereby improving the reliability of video tamper-proofing.

[0061] Referring to Figure 1 , a flowchart of a video tamper-proofing method provided by the embodiment of the present application is shown. The video tamper-proofing method comprises the following steps:

[0062] Step S101: Dividing the recorded video into at least one video block according to a preset rule.

[0063] In the process of specifically implementing step S101, the device end divides the recorded video into at least one video block according to a preset rule.

[0064] It should be noted that the device end is a monitoring device (for example, a driving recorder). The device end is equipped with a camera, a processor, a local storage (for example, an SD card or a built-in flash memory) and a network module (for example, a wifi or a cellular module). The device end records video in real time and stores the video locally. The recorded video is divided into video blocks.

[0065] In some embodiments, the specific implementation manner of dividing the recorded video into at least one video block is as follows: identifying the format of the recorded video. If the format of the recorded video is a file format (for example, an MP4 format), the recorded video is taken as a single video block. If the format of the recorded video is a streaming format (for example, an H.564 stream), the recorded video is blocked according to a preset time length or a preset frame number to obtain a plurality of video blocks.

[0066] That is to say, the device end stores the recorded video in a file format or a streaming format locally, and divides the video into video blocks in different ways according to the format of the video.

[0067] If the format of the recorded video is a file format (equivalent to the entire video being a file), then a single file (equivalent to the entire video) is directly taken as a video block.

[0068] If the format of the recorded video is a streaming format, then the video is blocked according to a preset time length (for example, one hour) or a preset frame number (for example, 1800 frames), thereby obtaining at least one video block.

[0069] In some embodiments, the recorded video is divided into a plurality of video blocks according to a preset time length or a preset number of frames, and a marker frame is inserted at the boundary of each video block, the marker frame including at least a start timestamp of the video block, a block number, and a block type identifier.

[0070] It should be noted that the marker frame can be an SEI (Supplemental Enhancement Information) frame or a custom metadata frame. The "block type identifier" is represented by a bit or a variable, for example, a bit is agreed to be 1 to indicate that the video is divided at this position, which is to ensure that the verification end (which will be described in the subsequent content) can accurately restore the same video block range as when the hash value is generated.

[0071] Step S102: combining the hash values of each group of images in the video block using a chain structure to obtain a final cumulative hash value of the video block, each group of images including at least one frame of image.

[0072] In the process of implementing step S102, the device end combines the hash values of each group of images in the video block using a chain structure to calculate a hash chain, thereby calculating a final cumulative hash value (denoted as H_final) of the video block, wherein each group of images (i.e., image group) includes N frames of images, and N is greater than or equal to 1.

[0073] In the above manner, a corresponding final cumulative hash value can be calculated for each video block.

[0074] Step S103: uploading the final cumulative hash value of the video block and the metadata to the server end for storage.

[0075] In the process of implementing step S103, for each video block, the device end uploads the final cumulative hash value (H_final) of the video block and the metadata to the server end for secure storage.

[0076] The metadata of the video block at least includes: the ID (referred to as device ID) of the device recording the video block, the start timestamp and the end timestamp of the video block; and if the format of the recorded video is a file format, the metadata of the video block will additionally record the file name.

[0077] It should be noted that, in order to ensure the security of the hash value uploading process, an asymmetric encryption mechanism (only as an example, other encryption mechanisms can also be used) can be used between the device end and the server end for data legitimacy verification.

[0078] Specifically, each device end (i.e., a monitoring device) generates a unique asymmetric key pair (e.g., RSA 2048 bits) at the time of factory shipment, which includes a public key and a private key; the private key is stored in a hardware security module (HSM) or a trusted execution environment (TEE) of the device end, and the public key is pre-registered to the server end.

[0079] The server end maintains a device public key database that at least includes the public keys of various device ends, and the device public key database has a unique ID (e.g., a device serial number) of the device end as an index key. Among them, if the server end uses a block chain, the public key of the device end is registered to the distributed ledger through a smart contract to ensure that the public key cannot be tampered with.

[0080] In some embodiments, the specific way in which the device end uploads the final cumulative hash value and metadata of the video block to the server end for storage is that the device end uses the pre-generated private key to digitally sign the final cumulative hash value (H_final) and metadata of the video block (the signature algorithm can be), and uploads the final cumulative hash value and metadata of the video block that has completed digital signature to the server end for storage through a secure channel.

[0081] It should be noted that the digital signature can use a preset signature algorithm such as RSA-PSS or ECDSA, and the secure channel can use "TLS.13".

[0082] In actual application, the server end includes a secure server or a block chain, which provides a tamper-proof storage environment, and the server end establishes an index based on the metadata of the video block to facilitate quick retrieval of the final cumulative hash value.

[0083] If the server end uses a block chain, the final cumulative hash value (H_final) and metadata of the uploaded video block are recorded on the distributed ledger in the form of a transaction.

[0084] In some embodiments, the present scheme manages all video blocks through a data management strategy (e.g., a FIFO strategy) for local storage.

[0085] Specifically, all video blocks are saved to a local storage; the to-be-deleted video blocks are determined from the local storage according to the data management strategy, which are "video blocks that need to be deleted" determined by the data management strategy.

[0086] If the confirmation information related to the to-be-deleted video block has been received from the server end, the to-be-deleted video block is deleted, and the confirmation information indicates that the final cumulative hash value and metadata of the to-be-deleted video block have been successfully uploaded to the server end.

[0087] For example, a first-in-first-out (FIFO) strategy is used to manage local storage of all video blocks, when video blocks are cyclically overwritten in the local storage, the first-in-first-out (FIFO) strategy is used to determine a to-be-deleted video block (deletion is in units of blocks), and after it is confirmed that the final accumulated hash value and metadata of the to-be-deleted video block have been successfully uploaded to the server side, the to-be-deleted video block is deleted.

[0088] In the embodiment of the application, by dividing the recorded video into video blocks, and then combining the hash values of each group of images in the video blocks in a chain structure to obtain the final accumulated hash value of the video block, the final accumulated hash value of the video block and the metadata are uploaded to the server side for storage to prevent the video block from being tampered with, and tampering with any frame of image of the video block will cause the calculated accumulated hash value to change, thereby improving the reliability of video tamper prevention.

[0089] For the above-mentioned embodiment of the application Figure 1 The content of dividing the recorded video into video blocks involved in step S101 is described in more detail below. Figure 2 The process of dividing the recorded video into video blocks is described below with reference to the flowchart shown in FIG. 2. Figure 2 The process of dividing the recorded video into video blocks includes the following steps.

[0090] Step S201: Identify the format of the recorded video. If the format of the recorded video is a file format (MP4 format), perform step S202 and step S208; if the format of the recorded video is a streaming format (H.564 stream), perform step S203 and subsequent steps.

[0091] Step S202: Take a single file as a video block.

[0092] In the process of implementing step S202, if the format of the recorded video is a file format (MP4 format), the recorded video is taken as a single video block.

[0093] Step S203: Determine the block basis. If the block basis is to block according to a preset time length, perform step S204; if the block basis is to block according to a preset frame number, perform step S205.

[0094] Step S204: Block the video according to the preset time length, and perform step S206.

[0095] Step S205: Block the video according to the preset frame number, and perform step S206.

[0096] Step S206: Ensure that the boundaries of the video blocks are aligned with GOPs.

[0097] In the implementation of step S206, for a video in streaming format, when the video is divided into video blocks, the boundaries of the divided video blocks should be aligned with the Group of Pictures (GOP).

[0098] It should be noted that, for a video in streaming format, the first frame of a video block should be the I frame of a GOP (i.e. the first frame of a GOP), and the last frame of a video block should be the last frame of a GOP after the video is divided into video blocks.

[0099] Step S207: inserting a marker frame at the boundary of a video block.

[0100] Step S208: generating metadata of a video block.

[0101] In the implementation of step S208, the metadata of a video block is generated, thereby associating metadata with each video block.

[0102] The above Figure 2 is an example of dividing a video block.

[0103] For the above-mentioned embodiments of the present application Figure 1 The process of obtaining the final cumulative hash value of a video block in step S102 is shown in Figure 3 , which shows a flowchart of the process of obtaining the final cumulative hash value of a video block according to an embodiment of the present application, including the following steps:

[0104] Step S301: calculating the hash value of the first group of images of a video block to obtain a first hash value.

[0105] It should be noted that each group of images of a video block includes N frames of images, and N is greater than or equal to 1; an image includes the following data: pixel data, timestamp, and frame type; the timestamp and frame type are stored in the data header of a frame structure.

[0106] In the implementation of step S301, the first group of images of a video block is obtained, and the hash value of the first group of images is calculated using a hash function (e.g. a cryptographic security algorithm such as SHA-256) to obtain a first hash value.

[0107] Step S302: setting the cumulative hash value as the first hash value.

[0108] In the implementation of step S302, the cumulative hash value is set as the first hash value, i.e. the initial cumulative hash value is set as the “hash value of the first group of images”.

[0109] Step S303: determining whether the video block has a next group of images. If the determination is yes, step S304 is performed; if the determination is no, step S305 is performed.

[0110] In the implementation of step S303, it is determined whether there is a next group of images to be processed. If yes, step S304 is performed; if no, step S305 is performed.

[0111] Step S304: obtaining the next group of images, calculating the current hash value of the next group of images; concatenating the current hash value with the cumulative hash value, calculating a new cumulative hash value based on the concatenation result, and returning to step S303.

[0112] In the implementation of step S304, if there is a next group of images to be processed, the next group of images is obtained and the current hash value of the next group of images is calculated. The current hash value is concatenated with the cumulative hash value, and the hash value of the concatenation result of the current hash value and the cumulative hash value is calculated to obtain a new cumulative hash value, i.e., new cumulative hash value = hash calculation result of the concatenation result. Return to step S303 to continue updating the cumulative hash value.

[0113] Step S305: determining the current cumulative hash value as the final cumulative hash value of the video block.

[0114] In the implementation of step S305, if there is no next group of images to be processed, the current cumulative hash value is determined as the final cumulative hash value of the video block.

[0115] It should be noted that step S303 is repeatedly performed until each group of images of the video block is processed, thereby obtaining the final cumulative hash value of the video block.

[0116] The above is a related description of how to obtain the final cumulative hash value of the video block.

[0117] To better understand how to obtain the final cumulative hash value, taking an example of each group of images of the video block including 1 frame of image (i.e., N = 1), through Figure 4 another flowchart for obtaining the final cumulative hash value of the video block is shown, Figure 4 including the following steps:

[0118] Step S401: obtaining the first frame of image of the video block.

[0119] Step S402: calculating the hash value of the first frame of image (denoted as hash_a).

[0120] Step S403: setting the cumulative hash value = hash_a.

[0121] Step S404: determining whether there is a next frame of image. If no, step S409 is performed; if yes, step S405 is performed.

[0122] Step S405: Acquire the next frame image.

[0123] Step S406: Calculate the current hash value (denoted as hash_n) of the current acquired image.

[0124] Step S407: Concatenate the accumulated hash value with hash_n.

[0125] Step S408: Perform hash calculation on the concatenation result to obtain a new accumulated hash value, and return to execute step S404.

[0126] Step S409: Determine the current accumulated hash value as H_final.

[0127] Step S410: Determine H_final as the final accumulated hash value of the video block.

[0128] To better understand the process of steps S401 to S410 described above, the following will again illustrate how to obtain H_final (N = 1 in this example).

[0129] For the first frame image of the video block, calculate the hash value of the first frame image (denoted as hash_a). Acquire the second frame image and calculate the hash value of the second frame image (denoted as hash_b), concatenate hash_a and hash_b, and then calculate the hash value of the concatenation result of hash_a and hash_b (denoted as hash_ab).

[0130] Acquire the third frame image and calculate the hash value of the third frame image (denoted as hash_c), concatenate hash_ab and hash_c, and then calculate the hash value of the concatenation result of hash_ab and hash_c (denoted as hash_abc). In this way, until the last frame image of the video block is calculated, a final accumulated hash value is obtained, which is H_final.

[0131] In the above example, the hash value is calculated for each frame image (N = 1). In order to reduce the amount of calculation, hash value can also be calculated for every N frames (N is greater than 1).

[0132] In some embodiments, if it is necessary to verify the authenticity of a video block, a verification end can be used to check whether the video block to be verified is tampered with. For example, when the video block is exported as evidence, the exported video block is the video block to be verified.

[0133] Referring to Figure 5 , a flowchart for verifying whether a video block to be verified is tampered with is shown, Figure 5 including the following steps:

[0134] Step S501: Obtain a video block to be verified.

[0135] In the implementation of step S501, the video block to be verified is obtained from the local storage by the verification terminal, for example, a video block to be used as evidence is obtained from the local storage, and the video block to be used as evidence is the video block to be verified.

[0136] It should be noted that the verification terminal can be a mobile application and a web application, which provides a user interface for a user to operate (such as initiating verification), and is used to verify the authenticity of the video block.

[0137] Step S502: According to the metadata of the video block to be verified, query the final cumulative hash value corresponding to the metadata from the server side.

[0138] In the implementation of step S502, the metadata of the video block to be verified is parsed by the verification terminal, and the final cumulative hash value (H_final) of the video block to be verified is retrieved (or queried) from the server side according to the device ID, the start timestamp and the end timestamp in the metadata of the video block to be verified.

[0139] Step S503: Combine the hash values of each group of images in the video block to be verified in a chain structure to obtain a second cumulative hash value of the video block to be verified.

[0140] In the implementation of step S503, the hash values of each group of images in the video block to be verified are combined in a chain structure, and the second cumulative hash value (denoted as H_final') of the video block to be verified is calculated.

[0141] It should be noted that the specific way of calculating the second cumulative hash value (H_final') can refer to the above content about calculating the final cumulative hash value (H_final), which will not be repeated here.

[0142] Step S504: If the final cumulative hash value of the video block to be verified and the second cumulative hash value are consistent, it is determined that the video block to be verified has not been tampered with.

[0143] In the implementation of step S504, it is compared whether the final cumulative hash value (H_final) of the video block to be verified and the second cumulative hash value (H_final') recalculated are consistent.

[0144] If the final cumulative hash value (H_final) of the video block to be verified and the second cumulative hash value (H_final') are consistent, it is determined that the video block to be verified has not been tampered with.

[0145] Step S505: If the final accumulated hash value of the to-be-verified video block and the second accumulated hash value are inconsistent, it is determined that the to-be-verified video block is tampered.

[0146] In the implementation of step S505, if the final accumulated hash value (H_final) of the to-be-verified video block and the second accumulated hash value (H_final') are inconsistent, it is determined that the to-be-verified video block is tampered.

[0147] The above Figure 5 is the relevant description about checking whether the to-be-verified video block is tampered.

[0148] From the above contents of each embodiment, it can be seen that the present scheme realizes video tamper-proofing through the device end, the verification end and the server end. The architecture example diagram of the device end, the verification end and the server end is as shown in Figure 6 , the device end 601 is equipped with a camera 6011, a processor 6012, a local memory 6013 and a network module 6014, the verification end 602 includes a user interface 6021 and a verification module 6022, and the server end 603 includes a security server / blockchain 6031, a metadata index 6032 and a public key database 6033.

[0149] The camera 6011 records a video, and the processor 6012 divides the recorded video into video blocks and stores them into the local memory 6013; the processor 6012 calculates the final accumulated hash value of the video blocks, and uploads the final accumulated hash value of the video blocks and the metadata to the server end 603 through the network module 6014.

[0150] The verifier uploads the to-be-verified video block, the user interface 6021 initiates verification for the to-be-verified video block, the verification module 6022 queries the final accumulated hash value of the to-be-verified video block from the server end 603, the verification module 6022 calculates the second accumulated hash value of the to-be-verified video block, and the verification module 6022 compares the final accumulated hash value of the to-be-verified video block and the second accumulated hash value to determine whether the to-be-verified video block is tampered.

[0151] Further, the interaction process of the device end, the verification end and the server end is as shown in Figure 7 , which includes the following steps: Figure 7

[0152] Step S701: The device end captures a video and divides the video into video blocks.

[0153] Step S702: The device end calculates the final accumulated hash value of each video block.

[0154] Step S703: The device end signs the final accumulated hash value of the video block and the metadata using a private key.

[0155] ​Step S704: The device end uploads the signed data to the server end for secure storage.

[0156] It should be noted that the signed data includes the final cumulative hash value of the video block and the metadata.

[0157] Step S705: The user requests the verification end to verify whether a certain video is tampered with.

[0158] Step S706: The verification end splits the video into a video block to be verified.

[0159] Step S707: The verification end calculates a second cumulative hash value of the video block to be verified.

[0160] Step S708: The verification end queries the final cumulative hash value of the video block to be verified from the server end.

[0161] Step S709: The verification end compares the final cumulative hash value and the second cumulative hash value of the video block to be verified.

[0162] Step S710: The verification end returns the verification result to the user.

[0163] It should be noted that if the final cumulative hash value and the second cumulative hash value of the video block to be verified are consistent, the verification result indicates that the video block to be verified is not tampered with. If the final cumulative hash value and the second cumulative hash value of the video block to be verified are inconsistent, the verification result indicates that the video block to be verified is tampered with.

[0164] The above is the related description of the video tamper-proofing method according to the embodiments of the present application. As can be seen from the content of the above embodiments, the present scheme has the following beneficial effects:

[0165] 1. Only the hash value (final cumulative hash value) and the metadata are uploaded to the server end, and the entire video does not need to be uploaded, which can significantly reduce the network bandwidth consumption and storage cost.

[0166] 2. The hash value (final cumulative hash value) uploaded to the server end adopts a hash chain structure of cryptography, and the hash value of each frame of image depends on all previous frames of image. Any tampering of a frame of image will cause the second cumulative hash value to change, and the hash value (final cumulative hash value) uploaded to the server end adopts digital signature to ensure its authenticity and integrity.

[0167] 3. The calculation overhead of hash calculation and chain updating operation is low, and the present scheme can be efficiently run on a resource-limited embedded device, avoiding the memory bottleneck of large file hash calculation.

[0168] Corresponding to the above-mentioned video tamper-proofing method according to the embodiments of the present application, see Figure 8The embodiment of the present application also provides a structural diagram of a video tamper-proof system, which comprises a division unit 801, a calculation unit 802 and an uploading unit 803.

[0169] The division unit 801 is used for dividing a recorded video into video blocks according to a preset rule.

[0170] The calculation unit 802 is used for combining the hash values of each group of images in the video block in a chain structure to obtain a final accumulated hash value of the video block, wherein each group of images comprises at least one frame of image.

[0171] The uploading unit 803 is used for uploading the final accumulated hash value of the video block and metadata to a server end for storage.

[0172] In some embodiments, the calculation unit 802 is specifically used for: S1, calculating the hash value of the first group of images of the video block to obtain a first hash value; S2, setting an accumulated hash value as the first hash value; S3, judging whether the video block has a next group of images; if the judgment is yes, obtaining the next group of images, calculating a current hash value of the next group of images; splicing the current hash value and the accumulated hash value, and calculating a new accumulated hash value based on the splicing result; if the judgment is no, determining the current accumulated hash value as the final accumulated hash value of the video block; and S4, repeating step S3 until each group of images of the video block is processed to obtain the final accumulated hash value of the video block.

[0173] In some embodiments, the metadata of the video block at least comprises: the ID of a device recording the video block, the start timestamp and the end timestamp of the video block; and the video tamper-proof system further comprises:

[0174] The checking unit is used for obtaining a video block to be verified; querying the final accumulated hash value corresponding to the metadata from the server end according to the metadata of the video block to be verified; combining the hash values of each group of images in the video block to be verified in a chain structure to obtain a second accumulated hash value of the video block to be verified; if the final accumulated hash value of the video block to be verified is consistent with the second accumulated hash value, determining that the video block to be verified is not tampered; and if the final accumulated hash value of the video block to be verified is not consistent with the second accumulated hash value, determining that the video block to be verified is tampered.

[0175] In some embodiments, the division unit 801 is specifically used for: identifying the format of the recorded video; if the format of the recorded video is a file format, taking the recorded video as a single video block; and if the format of the recorded video is a streaming format, dividing the recorded video according to a preset time length or a preset frame number to obtain a plurality of video blocks.

[0176] In some embodiments, the dividing unit 801 is further configured to insert a marker frame at a boundary of the video block, the marker frame comprising at least a start time stamp of the video block, a block sequence number and a block type identifier after dividing the recorded video into the video block according to the preset time length or the preset number of frames.

[0177] In some embodiments, the uploading unit 803 is specifically configured to use a pre-generated private key to digitally sign the final accumulated hash value and the metadata of the video block; and upload the final accumulated hash value and the metadata of the video block after the digital signature to the server end for storage through a secure channel.

[0178] In some embodiments, the video tamper-proofing system further comprises:

[0179] The data management unit is configured to save all the video blocks into a local storage; determine a video block to be deleted from the local storage according to a data management strategy; and delete the video block to be deleted if a confirmation information related to the video block to be deleted and fed back by the server end is received, the confirmation information representing that the final accumulated hash value of the video block to be deleted has been successfully uploaded to the server end.

[0180] Preferably, the embodiment of the present application further provides an electronic device, comprising a processor and a memory, the processor and the memory being connected through a communication bus; wherein the processor is configured to invoke and execute a program stored in the memory; and the memory is configured to store the program, the program being used to implement the video tamper-proofing method provided by the method embodiment.

[0181] Preferably, the embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the video tamper-proofing method provided by the method embodiment.

[0182] In summary, the embodiment of the present application provides a video tamper-proofing method, system, electronic device and storage medium, by dividing a recorded video into video blocks, then combining hash values of each group of images in the video blocks to obtain a final accumulated hash value of the video block by using a chain structure, uploading the final accumulated hash value of the video block and metadata to the server end for storage to prevent the video block from being tampered, and any frame of image of the video block being tampered will cause the calculated accumulated hash value to change, thereby improving the reliability of video tamper-proofing.

[0183] The various embodiments described in this specification are described in progressive order, with each embodiment building on the previous one. The same or similar elements in each embodiment are denoted by the same or similar reference signs. For each embodiment, the differences between that embodiment and the preceding ones are described in more detail. In particular, the system or system embodiments are described more briefly than the method embodiments, since they are substantially similar to the method embodiments. The system and system embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located at one place or distributed over multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor.

[0184] The person skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be realized in electronic hardware, computer software, or a combination of both. The disclosure has been presented in the form of functional generalizations so as to clearly illustrate the interchangeability of hardware and software. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0185] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the scope of the application. Therefore, the present application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A video tamper-proofing method, characterized by, The method comprises: dividing a recorded video into at least one video block according to a preset rule; combining hash values of each group of images in the video block by using a chain structure to obtain a final cumulative hash value of the video block, each group of images comprising at least one image frame; uploading the final cumulative hash value and metadata of the video block to a server end for storage.

2. The method of claim 1, wherein, The step of combining the hash values of each group of images in the video block by using the chain structure to obtain the final cumulative hash value of the video block comprises: S1: calculating a hash value of a first group of images of the video block to obtain a first hash value; S2: setting a cumulative hash value as the first hash value; S3: determining whether the video block has a next group of images; if yes, obtaining the next group of images, calculating a current hash value of the next group of images, splicing the current hash value and the cumulative hash value, and calculating a new cumulative hash value based on the splicing result; if no, determining the current cumulative hash value as the final cumulative hash value of the video block; S4: repeating step S3 until each group of images of the video block is processed to obtain the final cumulative hash value of the video block.

3. The method according to claim 1 or 2, characterized in that, The metadata of the video block at least comprises an ID of a device recording the video block, a start timestamp and an end timestamp of the video block; After uploading the final cumulative hash value and metadata of the video block to the server end for storage, the method further comprises: obtaining a video block to be verified; querying, according to the metadata of the video block to be verified, a final cumulative hash value corresponding to the metadata from the server end; combining hash values of each group of images in the video block to be verified by using the chain structure to obtain a second cumulative hash value of the video block to be verified; if the final cumulative hash value and the second cumulative hash value are consistent, determining that the video block to be verified is not tampered with; if the final cumulative hash value and the second cumulative hash value are inconsistent, determining that the video block to be verified is tampered with.

4. The method of claim 1, wherein, Dividing a recorded video into at least one video block according to a preset rule comprises: identifying a format of the recorded video; if the format of the recorded video is a file format, taking the recorded video as a single video block; if the format of the recorded video is a streaming format, dividing the recorded video into multiple video blocks according to a preset time length or a preset frame number.

5. The method of claim 4, wherein, After dividing the recorded video into multiple video blocks according to a preset time length or a preset frame number, the method further comprises: inserting a marker frame at a boundary of the video block, the marker frame at least comprising a start timestamp, a block serial number and a block type identifier of the video block.

6. The method of claim 1, wherein, Uploading the final cumulative hash value and metadata of the video block to the server end for storage comprises: using a pre-generated private key to digitally sign the final cumulative hash value and metadata of the video block; uploading the final cumulative hash value and metadata of the video block after digital signature to the server end for storage through a secure channel.

7. The method of claim 1, wherein, The method further comprises: determining a video block to be deleted from a local storage according to a data management strategy; If the server-side feedback related to the to-be-deleted video block has been received, the to-be-deleted video block is deleted, and the confirmation information of the server-side feedback represents that the final accumulated hash value of the to-be-deleted video block has been successfully uploaded to the server side.

8. A video tamper-evident system characterized in that, The system comprises: a division unit configured to divide a recorded video into at least one video block according to a preset rule; a calculation unit configured to combine hash values of each group of images in the video block in a chain structure to obtain a final accumulated hash value of the video block, each group of images comprising at least one image frame; an uploading unit configured to upload the final accumulated hash value and metadata of the video block to a server side for storage.

9. An electronic device, comprising: comprise: a processor and a memory connected through a communication bus; wherein the processor is configured to call and execute a program stored in the memory; the memory is configured to store a program, and the program is configured to implement the video tamper-proofing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the video tamper-proofing method according to any one of claims 1-7.