Video access method, video storage method, video access device, video storage device and computer equipment

By using blockchain technology to store integrity verification parameters and image metadata in video storage systems, the problem of difficult integrity and accuracy in video storage is solved, and high reliability and security of video access is achieved.

CN119919843APending Publication Date: 2025-05-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311427923.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the prior art, video storage systems cannot effectively ensure the integrity and accuracy of videos and are vulnerable to tampering.

Method used

Blockchain technology is used to store the integrity verification parameters and image metadata of videos, verify the integrity of video frames by comparing the integrity verification parameters and image metadata, and store video frames in a distributed storage system.

Benefits of technology

Ensure the integrity and accuracy of video frames during transmission and storage, and improve the reliability and security of video access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919843A_ABST
    Figure CN119919843A_ABST
Patent Text Reader

Abstract

The invention relates to a video access method and device, a video storage method and device, computer equipment, a storage medium and a computer program product. The embodiment of the invention can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and the like. The method comprises the steps of receiving a video access request; comparing an access video identifier in the video access request with a video identifier in each piece of image metadata on the block chain to obtain target image metadata, and extracting a target frame identifier from the target image metadata; comparing the target frame identifier with a frame identifier in each piece of storage metadata on the block chain to obtain target storage metadata; acquiring a distributed storage position corresponding to the target storage metadata, and extracting a target video frame based on the distributed storage position; performing integrity verification on the target video frame by using the integrity verification parameter; and under the condition that the integrity verification is passed, constructing a return video corresponding to the video access request based on the target video frame.
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 access method, a video storage method, an apparatus, a computer device, a storage medium, and a computer program product. Background Art

[0002] With the development of computer technology, many devices have the function of video acquisition, such as cameras, mobile phones, computers, etc. Videos are data that take up a relatively large amount of space. How to store videos securely is a problem that needs to be solved urgently.

[0003] In traditional technology, a dedicated storage system is configured for video storage, and the collected videos are stored in the storage system. After receiving the video access request, the storage system directly returns the matching video. However, the video returned in this way may be tampered with and the accuracy is not high. Summary of the invention

[0004] Based on this, it is necessary to provide a video access method, video storage method, device, computer equipment, computer-readable storage medium and computer program product that can improve video accuracy in response to the above technical problems.

[0005] In a first aspect, the present application provides a video access method. The method comprises:

[0006] receiving a video access request, wherein the video access request carries an access video identifier;

[0007] Compare the access video identifier with the video identifier in each image metadata on the blockchain to obtain the successfully matched target image metadata, and extract the target frame identifier corresponding to the access video identifier from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly;

[0008] Compare the target frame identifier with the frame identifiers in each storage metadata on the blockchain to obtain the successfully matched target storage metadata, and store each storage metadata on the blockchain in correspondence with each distributed storage location;

[0009] Obtain a distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract a target video frame from the corresponding distributed storage system; obtain an integrity check parameter corresponding to the target image metadata, and use the integrity check parameter to perform an integrity check on the target video frame;

[0010] If the integrity check passes, a return video corresponding to the video access request is constructed based on the target video frame.

[0011] In a second aspect, the present application provides a video storage method. The method comprises:

[0012] Extracting the video frames to be stored from the video to be stored according to the target rule;

[0013] Generate integrity check parameters for the video frame to be stored, and obtain image metadata for the video frame to be stored, where the image metadata for the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored;

[0014] Upload the integrity check parameters and image metadata to the blockchain, where the integrity check parameters and image metadata are stored correspondingly;

[0015] Distributed storage is performed on the video frames to be stored, and a distributed storage location of the video frames to be stored and storage metadata of the video frames to be stored are obtained, wherein the storage metadata of the video frames to be stored includes a frame identifier of the video frames to be stored;

[0016] The distributed storage location and storage metadata are uploaded to the blockchain, where the distributed storage location and storage metadata are stored correspondingly.

[0017] In a third aspect, the present application also provides a video access device. The device includes:

[0018] A receiving module receives a video access request, wherein the video access request carries an access video identifier;

[0019] A comparison module is used to compare the access video identifier with the video identifier in each image metadata on the blockchain, obtain the target image metadata that has been successfully compared, and extract the target frame identifier corresponding to the access video identifier from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly;

[0020] The comparison module is also used to compare the target frame identifier with the frame identifier in each storage metadata on the blockchain to obtain the successfully compared target storage metadata, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location;

[0021] A verification module is used to obtain a distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract a target video frame from the corresponding distributed storage system; obtain an integrity verification parameter corresponding to the target image metadata, and use the integrity verification parameter to perform integrity verification on the target video frame;

[0022] The construction module is used to construct a return video corresponding to the video access request based on the target video frame when the integrity check passes.

[0023] In a fourth aspect, the present application also provides a video storage device. The device includes:

[0024] An extraction module, used for extracting the video frames to be stored from the video to be stored according to the target rule;

[0025] A generating module, used to generate integrity check parameters of the video frame to be stored, and obtain image metadata of the video frame to be stored, wherein the image metadata of the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored;

[0026] An upload module is used to upload integrity check parameters and image metadata to the blockchain, where the integrity check parameters and image metadata are stored correspondingly;

[0027] A storage module, used for distributing and storing the video frames to be stored, obtaining the distributed storage locations of the video frames to be stored and the storage metadata of the video frames to be stored, wherein the storage metadata of the video frames to be stored includes the frame identifiers of the video frames to be stored;

[0028] The upload module is also used to upload the distributed storage location and storage metadata to the blockchain, where the distributed storage location and storage metadata are stored correspondingly.

[0029] In a fifth aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method provided in the first aspect or the second aspect when executing the computer program.

[0030] In a sixth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method provided in the first aspect or the second aspect is implemented.

[0031] In a seventh aspect, the present application further provides a computer program product, including a computer program, which implements the method provided in the first aspect or the second aspect when executed by a processor.

[0032] The above-mentioned video access method, video storage method, device, computer equipment, storage medium and computer program product first receive a video access request, which carries an access video identifier; then, the access video identifier is compared with the video identifier in each image metadata on the blockchain to obtain the target image metadata with successful comparison, and the target frame identifier corresponding to the access video identifier is extracted from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly; the integrity check parameters and image metadata are stored in a blockchain manner to ensure that the integrity check parameters and image metadata cannot be tampered with and are easy to audit, and can also improve the traceability of the integrity check parameters and image metadata; then, the target frame identifier and each storage metadata on the blockchain are stored in a corresponding manner. The target storage metadata of the successful comparison is obtained by comparing the frame identifier in the data, and the storage metadata on the blockchain is stored in correspondence with each distributed storage location; the distributed storage location and storage metadata are stored in a blockchain manner, which can ensure that the distributed storage location and storage metadata cannot be tampered with and are easy to audit, and can also improve the traceability of the distributed storage location and storage metadata; finally, the distributed storage location corresponding to the target storage metadata is obtained, and the target video frame is extracted from the corresponding distributed storage system based on the distributed storage location; the integrity check parameters corresponding to the target image metadata are obtained, and the integrity check parameters are used to perform integrity check on the target video frame; if the integrity check passes, the return video corresponding to the video access request is constructed based on the target video frame. This method of first using the integrity check parameters to perform integrity check on the target video frame can ensure that the target video frame is complete and has not been tampered with, and improves the accuracy of the returned video. Moreover, the blockchain has the characteristic of being tamper-proof, which improves the security of data such as integrity check parameters, image metadata, distributed storage locations, and storage metadata on the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A diagram of an application environment of a video access method in an embodiment;

[0034] Figure 2 A schematic diagram of a flow chart of a video access method in one embodiment;

[0035] Figure 3 It is a flowchart of a target frame identification acquisition step in one embodiment;

[0036] Figure 4 A schematic diagram of a process flow of a video storage method in one embodiment;

[0037] Figure 5 The figure is a schematic diagram of a process of uploading integrity check parameters and image metadata to a chain in one embodiment;

[0038] Figure 6A schematic diagram of a distributed storage process in one embodiment;

[0039] Figure 7 A schematic diagram of a server framework in one embodiment;

[0040] Figure 8 A structural block diagram of a video access device in one embodiment;

[0041] Fig. 9 is a structural block diagram of a video storage device in one embodiment;

[0042] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The video access method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other servers. The server 104 can receive a video access request sent by the terminal 102, and the video access request carries an access video identifier; then, the access video identifier is compared with the video identifier in each image metadata on the blockchain to obtain the target image metadata with successful comparison, and the target frame identifier corresponding to the access video identifier is extracted from the target image metadata; each image metadata on the blockchain and each integrity verification parameter are stored correspondingly; then, the target frame identifier is compared with the frame identifier in each storage metadata on the blockchain to obtain the target storage metadata with successful comparison, and each storage metadata on the blockchain and each distributed storage location are stored correspondingly; the distributed storage location corresponding to the target storage metadata is obtained, and based on the distributed storage location, the target video frame is extracted from the corresponding distributed storage system to obtain the target video frame; then, the integrity verification parameter corresponding to the target image metadata is obtained, and the integrity verification parameter is used to perform integrity verification on the target video frame; if the integrity verification passes, a return video corresponding to the video access request is constructed based on the target video frame, and the return video is sent to the terminal 102.

[0045] Among them, blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0046] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational detection. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status detection, node equipment health status detection, etc.

[0047] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can superimpose business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.

[0048] The terminal 102 includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. The server 104 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0049] In some embodiments, Figure 2 As shown, a video access method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0050] Step 202: Receive a video access request, where the video access request carries an access video identifier.

[0051] The video access request may be sent by the terminal to the server, or may be triggered by an object on the server, which is not limited in the embodiment of the present application.

[0052] Among them, the video access request carries an access video identifier, which can be the name or ID of the video that the object wants to access. The video access request can also carry an object identifier, which can be the name or ID of the object. The video access request can also carry the time period that the object wants to access.

[0053] In some embodiments, taking the example of a video access request being sent from a terminal to a server, the object can log in to a corresponding application using a user name and password on the terminal, and select the video to be accessed on the interactive interface provided by the application. The application can obtain the identifier of the video selected by the object, and use the identifier as the access video identifier. Based on the access video identifier, a video access request is generated, and the video access request is sent to the server.

[0054] In some embodiments, taking the example of an object triggering a video access request on a server, the object can log in to the server using a username and password, and select the video to be accessed on the interactive interface provided by the server. The server can obtain the identifier of the video selected by the object, and use the identifier as the access video identifier, and generate a video access request based on the access video identifier.

[0055] Step 204, compare the access video identifier with the video identifier in each image metadata on the blockchain to obtain the successfully matched target image metadata, and extract the target frame identifier corresponding to the access video identifier from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly.

[0056] After receiving the video access request, the server may parse the video access request to obtain various information included in the video access request, and extract the access video identifier from the information.

[0057] Among them, there are multiple groups of verification data on the blockchain, each group of verification data corresponds to a video frame, and each group of verification data includes the integrity verification parameters of the video frame and the image metadata of the video frame. Usually, the integrity verification parameters and the image metadata are stored correspondingly.

[0058] Exemplarily, the integrity check parameter and the image metadata may be stored in a KV storage manner, for example, the integrity check parameter is used as a key Key and the image metadata is stored as a value Value.

[0059] Among them, image metadata includes intra-frame metadata and video metadata. Intra-frame metadata includes information associated with the corresponding video frame, such as the frame identifier, image timestamp, type, encoding details, etc. of the corresponding video frame. The type is used to indicate whether the corresponding video frame is an I frame or a P frame. Video metadata includes information describing the video in which the corresponding video frame is located, such as video identifier, encoding format, total playback time, total number of frames, audio configuration, etc. The integrity check parameter can be a hash value of the corresponding video frame.

[0060] Among them, after the server obtains the access video identifier, it can compare the access video identifier with the video identifier in each image metadata on the blockchain. If the two are consistent, the corresponding image metadata will be used as the target image metadata with successful comparison. The target image metadata may be one or more, or there may be no target image metadata with successful comparison. In this case, a prompt message that the video does not exist can be returned.

[0061] After obtaining the target image metadata, the server extracts a frame identifier from the target image metadata, and uses the extracted frame identifier as the target frame identifier corresponding to the access video identifier.

[0062] Step 206, compare the target frame identifier with the frame identifier in each storage metadata on the blockchain to obtain the successfully matched target storage metadata, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location.

[0063] Among them, there are multiple groups of storage data on the blockchain, each group of storage data corresponds to a video frame, and each group of storage data includes a distributed storage location of the video frame and storage metadata of the video frame. Usually, the distributed storage location and the storage metadata correspond to each other.

[0064] Exemplarily, the distributed storage location and storage metadata may be stored in a KV storage manner, for example, the distributed storage location is used as a key Key, and the storage metadata is stored as a value Value.

[0065] The storage metadata includes information related to the distributed storage of the corresponding video frame, such as the storage time of the corresponding video frame, the frame identifier, etc. The distributed storage location may be a content identifier (CID) of the corresponding video frame.

[0066] Among them, after the server obtains the target frame identifier, it can compare the target frame identifier with the video identifier in each storage metadata on the blockchain. If the two are consistent, the corresponding storage metadata will be used as the target storage metadata with successful comparison.

[0067] Step 208, obtain the distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract the target video frame from the corresponding distributed storage system; obtain the integrity check parameters corresponding to the target image metadata, and use the integrity check parameters to perform integrity check on the target video frame.

[0068] Among them, since each storage metadata and each distributed storage location on the blockchain are stored correspondingly, after obtaining the target storage metadata, the server can obtain the distributed storage location corresponding to the target storage metadata.

[0069] Exemplarily, each storage metadata and each distributed storage location on the blockchain is stored in a KV storage manner, with the distributed storage location being the key and the storage metadata being the value. After obtaining the target storage metadata, the server can extract the key corresponding to the target storage metadata, and use the extracted key as the distributed storage location corresponding to the target storage metadata.

[0070] After obtaining the distributed storage location corresponding to the target storage metadata, the server can extract the target video frame from the corresponding distributed storage system based on the distributed storage location.

[0071] Since each image metadata and each integrity check parameter on the blockchain are stored correspondingly, after obtaining the target image metadata, the server can obtain the integrity check parameter corresponding to the target image metadata.

[0072] Exemplarily, each image metadata and each integrity verification parameter on the blockchain is stored in a KV storage manner, where the integrity verification parameter is the key and the image metadata is the value. After obtaining the target image metadata, the server can extract the key corresponding to the target image metadata and use the extracted key as the integrity verification parameter corresponding to the target image metadata.

[0073] The server may generate current verification parameters of the target video frame, compare the current verification parameters with integrity verification parameters corresponding to the target image metadata, and determine that the integrity verification has passed if the two are consistent.

[0074] Step 210: If the integrity check passes, construct a return video corresponding to the video access request based on the target video frame.

[0075] Among them, the frame identifier can be a frame number, and there may be multiple target image metadata that are successfully matched. In this case, multiple target video frames can be obtained. The multiple target video frames can be sorted and combined according to their respective frame numbers to obtain the return video corresponding to the video access request.

[0076] Among them, when the video access request is sent by the terminal to the server, the server can send the return video to the terminal, and the terminal plays the return video after receiving the return video; when the video access request is triggered by the object on the server, the server can directly play the return video.

[0077] In the above embodiment, first, a video access request is received, and the video access request carries an access video identifier; then, the access video identifier is compared with the video identifier in each image metadata on the blockchain to obtain the target image metadata that has been successfully compared, and the target frame identifier corresponding to the access video identifier is extracted from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly; the integrity check parameters and image metadata are stored in a blockchain manner, which can ensure that the integrity check parameters and image metadata cannot be tampered with and are easy to audit, and can also improve the traceability of the integrity check parameters and image metadata; then, the target frame identifier is compared with the frame identifier in each stored metadata on the blockchain to obtain a comparison. The target storage metadata is successfully stored, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location; the distributed storage location and storage metadata are stored in a blockchain manner, which can ensure that the distributed storage location and storage metadata cannot be tampered with and are easy to audit, and can also improve the traceability of the distributed storage location and storage metadata; finally, the distributed storage location corresponding to the target storage metadata is obtained, and the target video frame is extracted from the corresponding distributed storage system based on the distributed storage location; the integrity check parameters corresponding to the target image metadata are obtained, and the integrity check parameters are used to perform integrity check on the target video frame; if the integrity check passes, the return video corresponding to the video access request is constructed based on the target video frame. This method of first using the integrity check parameters to perform integrity check on the target video frame can ensure that the target video frame is complete and has not been tampered with, and improves the accuracy of the returned video. Moreover, the blockchain has the characteristic of being tamper-proof, which improves the security of data such as integrity check parameters, image metadata, distributed storage locations, and storage metadata on the blockchain.

[0078] In some embodiments, the video access request also carries a query time period, see Figure 3 As shown, the video access method provided in the embodiment of the present application further includes:

[0079] Step 302: extract image timestamps from metadata of each target image.

[0080] Among them, the video access request also carries a query time period, which can be a time period specified by the object. When the video access request is sent by the terminal to the server, the object can specify the query time period through the interactive interface provided by the corresponding application. When the video access request is triggered by the object on the server, the object can specify the query time period through the interactive interface provided by the server.

[0081] The query time period includes the start time of the video and the end time of the video. The server can convert the start time of the video into a timestamp to obtain a start timestamp, and also convert the end time of the video into a timestamp to obtain an end timestamp.

[0082] After obtaining the target image metadata that has been successfully matched, the server extracts the image timestamp from the target image metadata and determines whether the image timestamp is between the start timestamp and the end timestamp. If so, the image timestamp is used as the timestamp of each target in the query time period. In the case of multiple target image metadata, the above processing is performed on each target image metadata to obtain multiple target timestamps.

[0083] Step 304 , compare the extracted timestamps of each image with the query time period to obtain the timestamps of each target within the query time period; and use the target image metadata where each target timestamp is located as the target metadata.

[0084] Step 306: extract the target frame identifier corresponding to the accessed video identifier from the target metadata.

[0085] Among them, after obtaining the target timestamp, the server uses the target image metadata where the target timestamp is located as the target metadata, extracts the target frame identifier corresponding to the access video identifier from the target metadata, and performs subsequent frame identifier comparison, distributed storage location acquisition, target video frame extraction, integrity verification, video construction and other steps, thereby obtaining the return video corresponding to the access video identifier and the query time period.

[0086] In the above embodiment, the video access request also carries a query time period. The server can search for target metadata whose image timestamp is within the query time period from the metadata of each target image, extract the target frame identifier corresponding to the access video identifier from the target metadata, and perform a series of subsequent steps such as frame identifier comparison and distributed storage location acquisition. This method can obtain a return video corresponding to the access video identifier and the query time period, so that the object can access videos of any time period, thereby improving the flexibility of video access.

[0087] In some embodiments, integrity check parameters are used to perform integrity check on the target video frame, including: obtaining a parameter generation algorithm for the integrity check parameters, using the parameter generation algorithm to generate current check parameters for the target video frame, and comparing the current check parameters with the integrity check parameters; when the current check parameters are consistent with the integrity check parameters, determining that the integrity check has passed.

[0088] The parameter generation algorithm of the integrity check parameter may be preset. Exemplarily, the integrity check parameter may be a hash value, and the parameter generation algorithm may be a hash function SHA256.

[0089] After obtaining the parameter generation algorithm of the integrity check parameter, the server can use the parameter generation algorithm to generate the current check parameter of the target video frame, and compare the current check parameter with the integrity check parameter corresponding to the target image metadata. If the two are consistent, it means that the target video frame is complete, and it is determined that the integrity check has passed; if the two are inconsistent, it means that the target video frame is incomplete, and it is determined that the integrity check has not passed. In the case of multiple target image metadata, for each target image metadata, the integrity check of the corresponding target video frame can be performed in the above manner.

[0090] Among them, when the integrity check of any target video frame fails, a prompt message indicating that the access video has been tampered with can be directly returned, or the target frame identifier of the target video frame can be recorded, and the return video corresponding to the video access request can be constructed based on the target video frame. When the video access request is sent by the terminal to the server, the return video and the recorded target frame identifier are sent to the terminal, and the terminal plays the return video and displays the received target frame identifier and the prompt message that the target frame identifier has been tampered with; when the video access request is triggered by an object on the server, the return video is played directly, and the recorded target frame identifier and the prompt message that the target frame identifier has been tampered with are displayed.

[0091] In the above embodiment, after the target video frame is extracted, the current verification parameter of the target video frame is generated by using a parameter generation algorithm, and the current verification parameter is compared with the integrity verification parameter; when the current verification parameter and the integrity verification parameter are consistent, it is determined that the integrity verification has passed, and then the return video corresponding to the video access request is constructed based on the target video frame. This method of first using the integrity verification parameter to perform an integrity check on the target video frame can ensure that the target video frame is complete and has not been tampered with, thereby improving the accuracy of the returned video.

[0092] In some embodiments, the target video frame is an encrypted video frame, and a return video corresponding to the video access request is constructed based on the target video frame, including: obtaining an encryption key of the target video frame, decrypting the target video frame using the encryption key to obtain a decrypted video frame; obtaining multiple decrypted video frames corresponding to the access video identifier, and constructing a return video corresponding to the video access request based on the frame numbers corresponding to each of the multiple decrypted video frames.

[0093] The target video frame is an encrypted video frame. After extracting the target video frame, the server can obtain the encryption key of the target video frame, and use the encryption key to decrypt the target video frame to obtain a decrypted video frame.

[0094] In the case where there are multiple target image metadata, there are also multiple target video frames. After decrypting each video frame, multiple decrypted video frames can be obtained, and these decrypted video frames are used as multiple decrypted video frames corresponding to the access video identifier. The multiple decrypted video frames can be sorted and combined according to their respective frame numbers to obtain the return video corresponding to the video access request.

[0095] In the above embodiment, when the target video frame is an encrypted video frame, after extracting the target video frame, the server needs to first decrypt the target video frame to obtain a decrypted video frame; based on multiple decrypted video frames corresponding to the access video identifier, a return video corresponding to the video access request is constructed. This method of encrypting the video frame before storing it improves data security.

[0096] In some embodiments, the video access request also carries an object identifier; the method further includes: obtaining the scope of access rights associated with the object identifier; and when the scope of access rights includes an access video identifier, comparing the access video identifier with the video identifier in the metadata of each image on the blockchain.

[0097] Among them, the video access request also carries an object identifier. The server can input the object identifier into a smart contract with a permission control function and execute the smart contract. The execution of the contract will output a permission judgment result, which is used to indicate whether the object identifier has access rights to access the video identifier.

[0098] Among them, the smart contract can obtain the permission judgment result through the following steps: obtain the access permission scope associated with the object identifier, the access permission scope includes each video identifier that the object identifier can access, and compare the access video identifier with each video identifier in the access permission scope. If it can be successfully compared with any video identifier, it is determined that the access permission scope includes the access video identifier, and the permission judgment result is that the object identifier has the access permission to access the video identifier. If the access video identifier and all video identifiers in the access permission scope fail to compare, it is determined that the access permission scope does not include the access video identifier, and the permission judgment result is that the object identifier does not have the access permission to access the video identifier.

[0099] Among them, when the server determines that the scope of access rights includes access to the video identifier, it then performs subsequent steps such as video identifier comparison, frame identifier comparison, distributed storage location acquisition, target video frame extraction, integrity verification, and video construction. If the object identifier in the video access request does not have access rights to access the video identifier, the corresponding video will not be returned.

[0100] In some embodiments, the video access request also carries an object identifier. Before comparing the access video identifier with the video identifier in the metadata of each image on the blockchain, the access permission scope associated with the object identifier can also be obtained. When the access permission scope includes the access video identifier, the access video identifier is compared with the video identifier in the metadata of each image on the blockchain. This permission control method ensures that only objects with permission to access the corresponding video can successfully access it, thereby improving data privacy.

[0101] In some embodiments, Figure 4 As shown, a video storage method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0102] Step 402: extracting video frames to be stored from the video to be stored according to the target rule.

[0103] In some embodiments, the server may be connected to a camera, and after the camera collects the original video data, the original video data may be sent to the server. Alternatively, the server may use the video data stored in the server as the original video data.

[0104] The original video data includes image streams and metadata information. The metadata information includes intra-frame metadata and video metadata of each image in the image stream. The intra-frame metadata includes information associated with the corresponding image, such as the frame ID, image timestamp, type, encoding details, etc. of the corresponding image. The type is used to indicate whether the corresponding image is an I frame or a P frame. Video metadata includes information describing the image stream, such as the video ID, encoding format, total playback time, total number of frames, audio configuration, etc. of the image stream.

[0105] Among them, each image in the image stream is in a compressed encoding format. The server can decode, preprocess and other operations on the image stream to obtain the video to be stored. The images in the image stream and the video frames in the video to be stored correspond one to one. The video frames to be stored are extracted from the video to be stored according to the target rules.

[0106] In some embodiments, after obtaining the video to be stored, the server obtains the intra-frame metadata of the current video frame for each video frame in the video to be stored, extracts the frame type from the intra-frame metadata, and uses the video frame with a frame type of I frame as the video frame to be stored.

[0107] In some embodiments, after obtaining the video to be stored, the server first determines whether each video frame in the video to be stored is an I frame. If it is an I frame, it then determines the image difference between the video frame and the previous frame in the video to be stored. When the image difference is greater than or equal to a preset threshold, the current video frame is used as the video frame to be stored.

[0108] The video storage method provided in the embodiment of the present application can be applied to the storage of security videos. For example, the security videos can be urban public security videos, community and residential property management videos, commercial facility security videos, traffic detection videos, special facilities and important places security videos, etc. The embodiment of the present application does not limit this.

[0109] Step 404: Generate integrity check parameters for the video frame to be stored, and obtain image metadata for the video frame to be stored. The image metadata for the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored.

[0110] The parameter generation algorithm of the integrity check parameter may be preset, and illustratively, the integrity check parameter may be a hash value, and the parameter generation algorithm may be a hash function SHA256. After determining the video frame to be stored, the server may use the parameter generation algorithm to generate the integrity check parameter of the video frame to be stored.

[0111] Among them, the original video data contains image streams and metadata information. The metadata information includes intra-frame metadata and video metadata of each image in the image stream. The server can parse the metadata information to obtain the intra-frame metadata and video metadata of each image in the image stream. The images in the image stream correspond to the video frames in the video to be stored one by one. After the video frame to be stored is extracted, the image in the image stream corresponding to the video frame to be stored can be determined, and the intra-frame metadata of the image is used as the intra-frame metadata of the video frame to be stored. The frame identifier in the intra-frame metadata is the frame identifier of the video frame to be stored.

[0112] For each video frame to be stored, the intra-frame metadata of the video frame to be stored and the parsed video metadata can be used as the image metadata of the video frame to be stored, and the video identifier in the parsed video metadata is the video identifier of the video to be stored.

[0113] Step 406, upload the integrity check parameters and the image metadata to the blockchain, where the integrity check parameters and the image metadata are stored correspondingly.

[0114] After the server obtains the integrity check parameters and image metadata of the video frame to be stored, it can generate a transaction request based on the integrity check parameters and image metadata, and submit the transaction request to the blockchain node. The blockchain node uploads the integrity check parameters and image metadata to the blockchain by calling the corresponding smart contract based on the transaction request.

[0115] Among them, the integrity check parameters and image metadata uploaded to the blockchain are stored correspondingly. Exemplarily, the integrity check parameters and image metadata uploaded to the blockchain can be stored in a KV storage manner. Exemplarily, the integrity check parameters are used as the key Key and the image metadata is stored as the value Value.

[0116] Step 408 , the video frames to be stored are distributedly stored to obtain the distributed storage locations of the video frames to be stored and the storage metadata of the video frames to be stored, wherein the storage metadata of the video frames to be stored includes the frame identifiers of the video frames to be stored.

[0117] Among them, a distributed storage system is deployed in the server, and the server can transfer the video frames to be stored to the distributed storage system, and the distributed storage system performs distributed storage on the video frames to be stored and returns the distributed storage location of the video frames to be stored.

[0118] The server extracts the frame identifier of the video frame to be stored from the image metadata of the video frame to be stored, and generates the storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored. Alternatively, when returning the distributed storage location, the distributed storage system may also return the distributed storage time of the video frame to be stored, and the server may generate the storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored, the distributed storage time and other information.

[0119] Step 410, uploading the distributed storage location and storage metadata to the blockchain, where the distributed storage location and storage metadata are stored correspondingly.

[0120] Among them, after the server obtains the distributed storage location and storage metadata of the video frame to be stored, it can generate a transaction request based on the distributed storage location and storage metadata, and submit the transaction request to the blockchain node. The blockchain node uploads the distributed storage location and storage metadata to the blockchain based on the transaction request by calling the corresponding smart contract.

[0121] Among them, the distributed storage location and storage metadata uploaded to the blockchain are stored correspondingly. Exemplarily, the distributed storage location and storage metadata uploaded to the blockchain can be stored in a KV storage manner. Exemplarily, the distributed storage location is used as the key Key and the storage metadata is stored as the value Value.

[0122] In the above embodiment, first, the video frames to be stored are extracted from the video to be stored according to the target rule, and then only the video frames to be stored are stored, and not all the video frames of the video to be stored, thereby reducing the amount of data storage. After the video frames to be stored are extracted, integrity check parameters of the video frames to be stored are generated, and image metadata of the video frames to be stored are obtained, and the image metadata of the video frames to be stored include: a frame identifier of the video frames to be stored and a video identifier of the video to be stored; the integrity check parameters and the image metadata are uploaded to the blockchain, and the integrity check parameters and the image metadata are stored correspondingly in the blockchain; then, the video frames to be stored are distributedly stored, and the distributed storage locations of the video frames to be stored and the storage metadata of the video frames to be stored are obtained, and the storage metadata of the video frames to be stored include the frame identifier of the video frames to be stored; the distributed storage locations and the storage metadata are uploaded to the blockchain, and the distributed storage locations and the storage metadata are stored correspondingly in the blockchain. After receiving the video access request, the frame identifier of the video frame that the object wants to access can be matched according to the video identifier in the metadata of each image on the blockchain, and the distributed storage location of the video frame can be found based on the frame identifier. The video frame is extracted from the distributed storage location, and the integrity check parameter is used to perform integrity check on the video frame. If the check passes, the return video is constructed based on the video frame. This method of first using the integrity check parameter to perform integrity check on the target video frame can ensure that the target video frame is complete and has not been tampered with, which improves the accuracy of the returned video. In addition, the blockchain has the characteristic of being tamper-proof, which improves the security of data uploaded to the blockchain, such as integrity check parameters, image metadata, distributed storage location, storage metadata, etc.

[0123] In some embodiments, the video storage method adopted by the embodiments of the present application also includes: receiving original video data, the images contained in the original video data are in a compressed encoding format; for each image contained in the original video data, decoding the current image to obtain a decoded image, preprocessing the decoded image to obtain a preprocessed image corresponding to the current image, the preprocessing including at least one of image quality enhancement, denoising and scaling; constructing a video to be stored based on the preprocessed images corresponding to each image contained in the original video data.

[0124] As described in the above embodiments, the server can be connected to the camera, and after the camera collects the original video data, the original video data can be sent to the server. Alternatively, the server can use the data in the video file stored in the server as the original video data.

[0125] Among them, the original video data includes an image stream and metadata information. Each image in the image stream is in a compressed encoding format. The compressed encoding format can be H.264, H.265 or MPEG-4, etc., which is not limited to this embodiment of the present application.

[0126] Among them, the server can perform the following processing according to the order of images in the image stream: decode the current image to obtain a decoded image. For example, when the compression coding format can be H.264, the current image is decoded using the decoding method corresponding to H.264; when the compression coding format can be H.265, the current image is decoded using the decoding method corresponding to H.265; when the compression coding format can be MPEG-4, the current image is decoded using the decoding method corresponding to MPEG-4.

[0127] After the decoded image is obtained, the decoded image may be subjected to image quality enhancement, denoising, scaling and rotation processing in sequence, or any one or more of the above-mentioned processing may be performed on the decoded image to obtain a pre-processed image.

[0128] The above-mentioned processing is performed sequentially according to the order of images in the image stream, so as to obtain a pre-processed image stream, which can be used as the video to be stored.

[0129] In the above embodiment, a specific process is provided for processing the original video data to obtain the video to be stored after the original video data is received. The image in the original video data can be in any common compression encoding format, which improves the compatibility of data storage.

[0130] In some embodiments, video frames to be stored are extracted from the video to be stored according to target rules, including: for each video frame in the video to be stored, obtaining intra-frame metadata of the current video frame, extracting the frame type from the intra-frame metadata, and when the frame type is a key frame, obtaining the image difference between the current video frame and the forward video frame, and when the image difference is greater than or equal to a preset threshold, using the current video frame as the video frame to be stored.

[0131] After the server obtains the video to be stored, since the images in the image stream correspond to the video frames in the video to be stored one by one, the original video data includes the image stream and metadata information, and the metadata information includes the intra-frame metadata and video metadata of each image in the image stream. The original video data is parsed to obtain the intra-frame metadata of each image in the image stream. For each video frame in the video to be stored, the image in the video stream corresponding to the video frame can be determined, and the intra-frame metadata of the image can be obtained. The intra-frame metadata is used as the intra-frame metadata of the video frame. The intra-frame metadata of the video frame includes the frame type, and the frame type can be extracted. When the frame type is a key frame, the image difference between the video frame and the forward video frame is obtained. The forward video frame can be the previous video frame of the video frame, or it can be the N video frames before the video frame. When the forward video frame is the N video frames before the video frame, the difference information between the video frame and each of the N video frames can be obtained, and the N difference information is averaged to obtain the image difference between the video frame and the forward video frame. After obtaining the image difference between the video frame and the forward video frame, the server compares the image difference with a preset threshold, and if the image difference is greater than or equal to the preset threshold, the video frame is used as a video frame to be stored.

[0132] In the above embodiment, a specific method of extracting video frames to be stored from the video to be stored is provided. Subsequently, only the video frames to be stored will be distributedly stored, and not all video frames of the video to be stored will be stored, thereby reducing the amount of data storage and reducing storage costs.

[0133] In some embodiments, generating integrity check parameters of the video frame to be stored includes: using a hash algorithm to generate a hash value of the video frame to be stored, and using the hash value as the integrity check parameter of the video frame to be stored.

[0134] After extracting the video frame to be stored, the server may use a hash algorithm to generate a hash value of the video frame to be stored, and use the hash value as an integrity check parameter of the video frame to be stored.

[0135] Exemplarily, the hash algorithm may be a message digest (MD) or a hash function (SHA), and the embodiments of the present application do not limit this.

[0136] In the above embodiment, after the video frame to be stored is extracted, a hash algorithm is used to generate a hash value of the video frame to be stored, and the hash value and the image metadata of the video frame to be stored are subsequently uploaded to the blockchain. The hash value can be used to perform integrity verification on the stored video frame to ensure that the video returned to the object is complete and has not been tampered with, thereby improving the accuracy of the returned video.

[0137] In some embodiments, see Figure 5 As shown, the integrity check parameters and image metadata are uploaded to the blockchain, which specifically includes the following steps:

[0138] Step 502, generating a transaction request based on the integrity check parameters, the image metadata, and the target contract identifier, where the target contract identifier is the identifier of the smart contract used to upload the integrity check parameters and the image metadata.

[0139] Among them, after obtaining the integrity verification parameters and image metadata of the video frame to be stored, the server can query the identifier of the smart contract used to upload the integrity verification parameters and image metadata, use the identifier as the target contract identifier, and generate a transaction request based on the integrity verification parameters of the video frame to be stored, the image metadata and the target contract identifier.

[0140] Step 504, submit the transaction request to the blockchain node to instruct the blockchain node to parse the transaction request, obtain the integrity verification parameters, image metadata and target contract identifier, and upload the integrity verification parameters and image metadata to the blockchain by calling the smart contract corresponding to the target contract identifier.

[0141] The embodiment of the present application provides a blockchain network, which includes multiple blockchain nodes, and a transaction request can be submitted to any blockchain node. For example, blockchain nodes can be deployed at the headquarters, branches, and offices of a group using the video storage method provided by the embodiment of the present application.

[0142] For the convenience of explanation, the blockchain node that receives the transaction request in the blockchain network is called the target node. After receiving the transaction request, the target node parses the transaction request to obtain the integrity verification parameters, image metadata and target contract identifier. Based on the target contract identifier, the smart contract for uploading the integrity verification parameters and image metadata is found, and the integrity verification parameters and image metadata are used as input parameters of the smart contract to execute the smart contract, and the data storage structure of the integrity verification parameters and image metadata can be obtained. The target node can broadcast the data storage structure and the transaction request to other nodes in the blockchain network. Other nodes also parse the transaction request and call the corresponding smart contract to process the integrity verification parameters and image metadata to obtain the data storage structure. The data storage structure is compared with the data storage result sent by the target node. If the two are consistent, a vote is cast in favor. When the number of blockchain nodes that vote in favor exceeds a certain threshold, each blockchain node will upload the integrity verification parameters and image metadata to the chain.

[0143] In the above embodiment, a specific method of uploading integrity verification parameters and image metadata to the blockchain is provided, which can ensure that the data cannot be tampered with and is easy to audit. In addition, blockchain storage can also improve data traceability and facilitate data management and retrieval.

[0144] In some embodiments, before distributing the video frames to be stored, it also includes: generating an encryption key for the video to be stored, using the encryption key to encrypt the video frames to be stored, and obtaining encrypted video frames to be stored; distributing the video frames to be stored, including: distributing the encrypted video frames to be stored.

[0145] Among them, in order to prevent the video frame from being maliciously accessed, the video storage method provided in the embodiment of the present application also includes generating an encryption key for the video to be stored, and before the video frame to be stored is distributedly stored, the encryption key is used to encrypt the video frame to be stored to obtain the encrypted video frame to be stored; and the encrypted video frame to be stored is distributedly stored. In this case, after receiving the video access request and extracting the target video frame in the manner provided in the above embodiment, the server needs to obtain the encryption key of the target video frame, use the encryption key to decrypt the target video frame, thereby obtaining a decrypted video frame, and construct a return video corresponding to the video access request based on the decrypted video frame.

[0146] In some embodiments, after extracting the video frame to be stored, the server first generates the integrity check parameters of the video frame to be stored, and then encrypts the video frame to be stored. In this case, after receiving the video access request, the server extracts the target video frame from the corresponding distributed storage system through the method provided in the above embodiment, first decrypts the target video frame to obtain the decrypted video frame, and then generates the integrity check parameters of the decrypted video frame, and compares the integrity check parameters with the integrity check parameters obtained from the blockchain to verify whether the decrypted video frame is complete.

[0147] In some embodiments, after extracting the video frame to be stored, the server first encrypts the video frame to be stored to obtain the encrypted video frame to be stored, and then generates the integrity check parameter of the encrypted video frame to be stored. In this case, after receiving the video access request, the server extracts the target video frame from the corresponding distributed storage system through the method provided in the above embodiment, and then generates the integrity check parameter of the target video frame, and compares the integrity check parameter with the integrity check parameter obtained from the blockchain. If the two are consistent, it means that the integrity check of the target video frame passes, and then the target video frame is decrypted to obtain the decrypted video frame.

[0148] In the above embodiment, an encryption key for the video to be stored can also be generated, and the encryption key is used to encrypt the video frame to be stored to obtain the encrypted video frame to be stored, and the encrypted video frame to be stored is distributedly stored. This encryption and storage method can prevent the video frame from being maliciously accessed, thereby improving data security.

[0149] In some embodiments, see Figure 6 As shown, the video frames to be stored are distributedly stored to obtain the distributed storage locations of the video frames to be stored and the storage metadata of the video frames to be stored, including the following steps:

[0150] Step 602: Send the video frame to be stored to a distributed storage client in the distributed storage system.

[0151] Among them, a distributed storage system is deployed in the server, and the distributed storage system includes a distributed storage client, a file segmentation node and multiple data storage nodes, which can transmit the video frames to be stored to the distributed storage client.

[0152] Step 604: forward the video frames to be stored to the file segmentation nodes in the distributed storage system through the distributed storage client.

[0153] Step 606, the video frame to be stored is segmented by the file segmentation node to obtain multiple image blocks, and the multiple image blocks are stored in each data storage node in the distributed storage system to obtain storage index information corresponding to each of the multiple image blocks.

[0154] Among them, the distributed storage client forwards the video frame to be stored to the file segmentation node, the file segmentation node segments the received video frame to be stored to obtain multiple image blocks, and sends the multiple image blocks to multiple data storage nodes according to the distributed storage rules. The data storage node that receives the image block generates storage index information of the image block, stores the image block according to the storage index information, and returns the storage index information to the distributed storage client.

[0155] Step 608: Generate a distributed storage location of the video frame to be stored based on the storage index information corresponding to each of the plurality of image blocks.

[0156] Among them, the distributed storage client can return the received storage index information, and the server generates a distributed storage location of the video frame to be stored based on the various storage index information returned by the distributed storage client.

[0157] Step 610: extract the frame identifier of the video frame to be stored from the image metadata of the video frame to be stored, and generate storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored.

[0158] The server extracts the frame identifier of the video frame to be stored from the image metadata of the video frame to be stored, and generates the storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored. When returning the distributed storage location, the distributed storage client may also return the distributed storage time of the video frame to be stored, and the server may generate the storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored, the distributed storage time and other information.

[0159] In the above embodiment, a specific method for distributed storage of the video frames to be stored is provided. By storing the video frames to be stored in a distributed storage system, the availability and anti-attack capability of the data can be improved. The distributed storage system divides the video frames to be stored into multiple image blocks and stores them in different nodes in a distributed manner, thereby reducing the risk of single point failure.

[0160] In some embodiments, see Figure 7 As shown, the server may include the following modules: video input and parsing module, key frame extraction module, hash and encryption module, blockchain module, distributed storage module, permission control and identity authentication module, data recovery and integrity verification module.

[0161] The following is an introduction to the units included in the video input and analysis module and the functions of each unit:

[0162] The video input and analysis module is used to receive the original video data, analyze and preprocess the original video data, and obtain the video to be stored. The video input and analysis module includes: a video acquisition interface, a video decoder, a video preprocessing unit, a video metadata analysis unit, a video frame buffer management unit, and a module communication and coordination unit.

[0163] The video acquisition interface is used to collect raw video data. The video acquisition interface can be connected to a camera, and the video data sent by the camera can be used as raw video data, or the data in the video file stored in the server can be used as raw video data. The embodiment of the present application does not limit the source of the raw video data.

[0164] Among them, the original video data includes an image stream and metadata information. Each image in the image stream is in a compressed encoding format. The compressed encoding format can be H.264, H.265 or MPEG-4, etc. The embodiment of the present application does not limit the compressed encoding format.

[0165] The video decoder is used to decode each image in the image stream in sequence according to the order of the images in the image stream to obtain a decoded image. The images in the image stream are in a compressed coding format. Decoding can be understood as converting the images in the compressed coding format into uncompressed images for further processing. The decoded image can be an image in RGB format or an image in YUV format. In order to support various compressed coding formats, the video decoder here can be a general decoder or a decoder for a specific coding standard.

[0166] Wherein, each time the video decoder obtains a decoded image through decoding, the decoded image can be transmitted to the video preprocessing unit, and the video preprocessing unit can sequentially perform image quality enhancement, denoising, scaling and rotation processing on the received decoded image, or perform any one or more of the above-mentioned multiple processing on the decoded image to obtain a preprocessed image, which is clearer than the initial decoded image and can improve the accuracy of subsequent key frame extraction. Each time the preprocessing unit obtains a preprocessed image, the preprocessed image can be transmitted to the video frame buffer management unit, and the image sequence composed of all preprocessed images can be used as a video stream to be stored.

[0167] The video metadata parsing unit is used to parse the original video data, and can obtain the intra-frame metadata and video metadata of each image in the image stream. The intra-frame metadata includes information associated with the corresponding image, such as the frame identifier, image timestamp, type, encoding details, etc. of the corresponding image. The video metadata includes information describing the image stream, such as the video identifier, encoding format, total playback time, total number of frames, audio configuration, etc. of the image stream. The video metadata parsing unit can pass the parsed data to the key frame extraction module.

[0168] The video frame buffer management unit is used to store the pre-processed image to be transmitted to the key frame extraction module. The buffer strategy of the video frame buffer management unit can be adjusted according to the server resources and real-time requirements.

[0169] The module communication and coordination unit is used to send the data parsed by the video metadata parsing unit and the pre-processed image in the video frame buffer management unit to the key frame extraction module through event triggering, message queue or other communication methods. For the convenience of explanation, the data parsed by the video metadata parsing unit is called metadata information.

[0170] Among them, in order to ensure the scalability and compatibility of the server, the interface and communication method between each unit in the video input and analysis module can be flexibly adjusted according to actual needs. The server can be deployed in the cloud, edge computing devices or dedicated hardware to adapt to different application scenarios and performance requirements.

[0171] The following introduces the units included in the key frame extraction module and the functions of each unit:

[0172] The key frame extraction module is used to extract key frames from the video stream to be stored, that is, to extract the video frames to be stored. These key frames are independent and complete video images, which can realize effective video data backup and storage. The key frame extraction module includes: frame type identification unit, key frame selection unit, key frame cache management unit, key transmission and synchronization unit, module configuration and optimization unit, module detection and diagnosis unit, etc.

[0173] Among them, the frame type identification unit is used to receive metadata information and a preprocessed image, extract the intra-frame metadata of the preprocessed image from the metadata information, extract the frame type from the intra-frame metadata, and determine whether the frame type is a key frame. If so, the preprocessed image is transmitted to the key frame selection unit; if not, the preprocessed image is discarded.

[0174] Among them, the key frame selection unit is used to receive the preprocessed image sent by the frame type identification unit, obtain the preprocessed image and a previously received preprocessed image for comparison, and obtain the image difference between the two. If the image difference is greater than or equal to a preset threshold, the preprocessed image is used as the video frame to be stored, and the intra-frame metadata and video metadata of the video frame to be stored are obtained. The intra-frame metadata and video metadata are used as the image metadata of the video frame to be stored, and the image metadata of the video frame to be stored is transmitted to the blockchain module.

[0175] The key frame cache management unit is used to cache the video frames to be stored to prevent the blockage caused by the mismatch between the extraction speed of the video frames to be stored and the processing speed of the subsequent processing module. A dynamically adjusted cache strategy can be set for the key frame cache management unit to adapt to different application scenarios.

[0176] Among them, the key transfer and synchronization unit is used to pass the video frames to be stored to the subsequent processing modules, such as the hash and encryption module. The key transfer and synchronization unit can use event triggering, message queue and other communication methods to communicate with the hash and encryption module. The two modules can agree on a communication protocol during the data transmission process.

[0177] The module configuration and optimization unit is used to customize configuration parameters according to actual needs, including key frame selection strategy, cache size of each module, etc. It is also used to optimize the performance of each module, such as through multi-threading, hardware acceleration, etc., to meet the needs of different application scenarios.

[0178] Among them, the module detection and diagnosis unit is used to realize the detection and diagnosis of the key frame extraction module, including the key frame extraction speed, cache management status, exception handling, etc., so as to timely analyze the server performance and operation status.

[0179] The following describes the units included in the hash and encryption module and the functions of each unit:

[0180] The hash and encryption module is used to generate hash values ​​of the video frames to be stored to ensure the integrity and consistency of the data, and is also used to encrypt the video frames to be stored as needed to improve the security of the data. The hash and encryption module includes: a hash processing unit, an encryption processing unit, an encryption key management unit, and a decoding processing and verification unit.

[0181] The hash processing unit is used to generate a hash value of the video frame to be stored by using a hash algorithm. By generating a unique hash value, the integrity and consistency of the data can be ensured, and the data can be prevented from being tampered with during transmission and storage.

[0182] The encryption processing unit is used to encrypt the video frame to be stored using an encryption key to obtain the encrypted video frame to be stored when the security of the video frame to be stored needs to be improved. The encryption processing may include symmetric encryption, asymmetric encryption, etc., which can be selected according to actual needs.

[0183] The encryption key management unit is used to perform operations such as encryption key generation, storage, distribution, and update. To ensure the security of the encryption process, the encryption key management unit can use strict policies to protect the encryption keys, such as using a hardware security module (HSM) to protect the encryption keys.

[0184] The decoding and verification unit is used to decrypt the target video frame after receiving the video access request and extracting the target video frame in the manner of the aforementioned embodiment.

[0185] Through the above design, the hash and encryption module can ensure the integrity and security of the video frames to be stored during transmission, storage and access.

[0186] The following is an introduction to the units included in the blockchain module and the functions of each unit:

[0187] The blockchain module is used to record the hash value and image metadata of the video frame to be stored on the blockchain, making the data tamper-proof and easy to audit. The blockchain module includes: blockchain nodes, smart contract units, hash and metadata submission units, data query and verification units, access control units, blockchain detection and diagnosis units, etc.

[0188] The embodiment of the present application provides a blockchain network, which includes multiple blockchain nodes. The deployment of blockchain nodes can be carried out according to actual needs, resources and security. The blockchain network is used to realize the recording and synchronization of hash values ​​and image metadata. For example, blockchain nodes can be deployed at the group headquarters, branches and offices.

[0189] Among them, the smart contract unit stores smart contracts with multiple functions, such as: smart contracts for uploading hash values ​​and image metadata, smart contracts for uploading distributed storage locations and storage metadata, smart contracts for access permission control, etc.

[0190] Among them, the hash and metadata submission unit is used to package the hash value, the image metadata of the video frame to be stored, and the target contract identifier into a transaction request, and submit the transaction request to the blockchain node to instruct the blockchain node to upload the hash value and image metadata to the blockchain by calling the smart contract corresponding to the target contract identifier.

[0191] The data query and verification unit is used to provide a query interface, allowing objects to query hash values ​​and image metadata according to actual needs. Smart contracts can be used for permission control during the query process to ensure that only authorized objects can access the query results.

[0192] Among them, the access control unit is used to define access control policies using smart contracts to ensure that only authenticated and authorized objects can access relevant data on the blockchain.

[0193] The blockchain detection and diagnosis unit is used to detect the operation status of blockchain nodes and smart contracts to ensure that data is correctly recorded on the blockchain. The detection items include: node status, smart contract execution, data recording, exception handling, etc., which are not limited in the embodiments of this application.

[0194] Through the above design, the blockchain module provides a secure and reliable recording and query environment for hash values ​​and image metadata.

[0195] The following describes the units included in the distributed storage module and the functions of each unit:

[0196] The distributed storage module is used to store the encrypted video frames to be stored in the distributed storage system to achieve high availability and anti-attack performance of data storage. The distributed storage module includes: a node deployment unit, a front-end integration unit, a file upload and storage unit, a file metadata management unit, a file retrieval and download unit, and a storage performance optimization unit. Exemplarily, the distributed storage system in the embodiment of the present application can be an Inter Planetary File System (IPFS).

[0197] The node deployment unit is used to deploy one or more distributed storage nodes. The node deployment unit can establish its own distributed storage network based on the deployed distributed storage nodes, or add the deployed distributed storage nodes to a public distributed storage network. Node deployment can be based on actual needs, resources, performance and security considerations.

[0198] Among them, the front-end integration unit is used to integrate the distributed storage client or software development kit (Software Development Kit, referred to as SDK), the distributed storage client or SDK is used to achieve connection and interaction with the distributed storage nodes, and the distributed storage client and each distributed storage node in the distributed storage network can constitute a distributed storage system.

[0199] The file upload and storage unit is used to add the encrypted video frames to be stored to the distributed storage network through the above-mentioned distributed storage client or SDK. The distributed storage nodes in the distributed storage network include file segmentation nodes and data storage nodes. The file upload and storage unit can pass the encrypted video frames to be stored to the distributed storage client or SDK. The distributed storage client or SDK forwards the encrypted video frames to be stored to the file segmentation node. The file segmentation node segments the encrypted video frames to be stored to obtain multiple image blocks, and stores the multiple image blocks to each data storage node, obtains storage index information corresponding to each of the multiple image blocks, and returns the storage index information to the distributed storage client. The distributed storage client returns the storage index information to the file upload and storage unit. The file upload and storage unit transmits the storage index information to the file metadata management unit.

[0200] Among them, the file metadata management unit is used to generate a distributed storage location of the encrypted video frame to be stored based on the storage index information corresponding to each of the multiple image blocks, and extract the frame identifier of the encrypted video frame to be stored from the image metadata of the encrypted video frame to be stored, and generate storage metadata of the encrypted video frame to be stored based on the frame identifier of the encrypted video frame to be stored, and upload the distributed storage location and the storage metadata to the blockchain.

[0201] Among them, the file retrieval and downloading unit is used to, after receiving a video access request, obtain the target storage metadata through the method provided in the aforementioned embodiment, obtain the distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract the target video frame from the corresponding distributed storage system through the distributed storage client or SDK.

[0202] In order to ensure storage performance and reliability, the storage performance optimization unit is used to pin the distributed storage location of the encrypted video frame to be stored by filling labels. For example, the label filling method can use the pin operation to ensure that the encrypted video frame to be stored will not be garbage collected. In addition, an IPFS cluster can be used to achieve data synchronization and load balancing between multiple nodes.

[0203] The following describes the units included in the permission control and authentication module and the functions of each unit:

[0204] The permission control and authentication module is used for identity authentication and permission control to ensure that only authorized objects can access video frames to ensure data security. The permission control and authentication module includes: object registration and management unit, identity authentication unit, access permission management unit, smart contract collaboration unit, exception handling and logging unit.

[0205] The object registration and management unit is used to implement the registration and management functions of the object, collect and store the basic information of the object, such as user name, password, contact information, etc. A unique object ID is assigned to each registered object.

[0206] The identity authentication unit is used to provide identity authentication functions for the object, allowing users to log in with a user name and password.

[0207] The access rights management unit is used to define different levels of access rights, which correspond to different access rights ranges, and each access rights range contains at least one video ID. The access rights management unit is also used to assign corresponding access rights to each object and associate these rights with the object ID.

[0208] The smart contract collaboration unit is used to work with the smart contract in the blockchain module to achieve access control of hash values ​​and image metadata. The smart contract can obtain the access permission scope associated with the object identifier; if the access permission scope includes the access video identifier, the step of comparing the access video identifier with the video identifier in the metadata of each image on the blockchain is performed.

[0209] Among them, the exception handling and logging unit is used to handle exceptions that occur in the permission control and identity authentication modules, and record log information of key operations (such as login, query, recovery, etc.). This information is very important for subsequent audits and problem location.

[0210] Through the above design, the permission control and authentication module can ensure that only authorized objects can access and restore key frame data.

[0211] The following describes the units included in the data recovery and integrity verification module and the functions of each unit:

[0212] The data recovery and integrity verification module is used to recover key frame data from the distributed storage system and perform integrity verification based on the hash value on the blockchain to ensure that the recovered data has not been tampered with. The data recovery and integrity verification module includes: a hash value and metadata query unit, a file retrieval unit, an integrity verification unit, a decryption processing unit, a file output unit, etc.

[0213] Among them, the query unit of hash value and metadata is used to compare the access video identifier with the video identifier in each image metadata on the blockchain, obtain the target image metadata with successful comparison, extract the target frame identifier corresponding to the access video identifier from the target image metadata, compare the target frame identifier with the frame identifier in each storage metadata on the blockchain, obtain the target storage metadata with successful comparison, and obtain the distributed storage location corresponding to the target storage metadata.

[0214] The file retrieval unit is used to extract the target video frame from the distributed storage system according to the distributed storage location corresponding to the target storage metadata.

[0215] The integrity verification unit is used to obtain the hash value corresponding to the target image metadata and use the hash value to perform integrity verification on the target video frame. If the file hash value is consistent with the hash value recorded on the blockchain, the verification is successful; otherwise, it means that the target video frame may have been tampered with during transmission or storage.

[0216] The decryption processing unit is used to obtain the encryption key of the target video frame when the target video frame is an encrypted video frame, and use the encryption key to decrypt the target video frame. The decryption process should use the correct key, which can be achieved by working in conjunction with the key management module.

[0217] The file output unit is used to construct and output the return video corresponding to the video access request based on the target video frame so that the object can be further processed or played.

[0218] In some embodiments, a video storage method is provided, comprising the following steps:

[0219] Receive original video data, wherein the images contained in the original video data are in a compressed encoding format; for each image contained in the original video data, decode the current image to obtain a decoded image, preprocess the decoded image to obtain a preprocessed image corresponding to the current image, wherein the preprocessing includes at least one of image quality enhancement, denoising and scaling; construct a video to be stored based on the preprocessed images corresponding to each image contained in the original video data.

[0220] For each video frame in the video to be stored, the intra-frame metadata of the current video frame is obtained, and the frame type is extracted from the intra-frame metadata. When the frame type is a key frame, the image difference between the current video frame and the forward video frame is obtained. When the image difference is greater than or equal to a preset threshold, the current video frame is used as the video frame to be stored.

[0221] A hash algorithm is used to generate a hash value of the video frame to be stored, and the hash value is used as an integrity check parameter of the video frame to be stored. Image metadata of the video frame to be stored is obtained, and the image metadata of the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored;

[0222] Generate a transaction request based on the integrity check parameters, image metadata, and target contract identifier, where the target contract identifier is the identifier of the smart contract used to upload the integrity check parameters and image metadata; submit the transaction request to the blockchain node to instruct the blockchain node to parse the transaction request, obtain the integrity check parameters, image metadata, and target contract identifier, and upload the integrity check parameters and image metadata to the blockchain by calling the smart contract corresponding to the target contract identifier. The integrity check parameters and image metadata are stored correspondingly in the blockchain;

[0223] Generate an encryption key for the video to be stored, use the encryption key to encrypt the video frame to be stored, and obtain the encrypted video frame to be stored; send the encrypted video frame to be stored to a distributed storage client in the distributed storage system, forward the encrypted video frame to be stored to a file segmentation node in the distributed storage system through the distributed storage client, segment the encrypted video frame to be stored through the file segmentation node to obtain multiple image blocks, and store the multiple image blocks in each data storage node in the distributed storage system to obtain storage index information corresponding to each of the multiple image blocks; generate a distributed storage location of the encrypted video frame to be stored based on the storage index information corresponding to each of the multiple image blocks, extract the frame identifier of the encrypted video frame to be stored from the image metadata of the encrypted video frame to be stored, and generate storage metadata of the encrypted video frame to be stored based on the frame identifier of the encrypted video frame to be stored.

[0224] The distributed storage location and storage metadata are uploaded to the blockchain, where the distributed storage location and storage metadata are stored correspondingly.

[0225] Receive a video access request, which carries an access video identifier, a query time period, and an object identifier. Obtain the scope of access rights associated with the object identifier; when the scope of access rights includes the access video identifier, compare the access video identifier with the video identifier in the metadata of each image on the blockchain to obtain successfully matched target image metadata, extract image timestamps from each target image metadata respectively, compare each extracted image timestamp with the query time period to obtain each target timestamp within the query time period; use the target image metadata where each target timestamp is located as the target metadata; extract the target frame identifier corresponding to the access video identifier from the target metadata. Each image metadata and each integrity check parameter on the blockchain are stored correspondingly;

[0226] The target frame identifier is compared with the frame identifier in each storage metadata on the blockchain to obtain the successfully matched target storage metadata. Each storage metadata on the blockchain is stored in correspondence with each distributed storage location.

[0227] Obtain the distributed storage location corresponding to the target storage metadata, and extract the target video frame from the corresponding distributed storage system based on the distributed storage location; obtain the integrity check parameters corresponding to the target image metadata, obtain the parameter generation algorithm of the integrity check parameters, use the parameter generation algorithm to generate the current check parameters of the target video frame, and compare the current check parameters with the integrity check parameters; when the current check parameters are consistent with the integrity check parameters, determine that the integrity check has passed.

[0228] When the integrity check passes and the target video frame is an encrypted video frame, the encryption key of the target video frame is obtained, and the target video frame is decrypted using the encryption key to obtain a decrypted video frame; multiple decrypted video frames corresponding to the access video identifier are obtained, and based on the frame serial numbers corresponding to the multiple decrypted video frames, a return video corresponding to the video access request is constructed.

[0229] In the above embodiment, the integrity check parameter is used to perform an integrity check on the target video frame; if the integrity check passes, a return video corresponding to the video access request is constructed based on the target video frame. This method of first performing an integrity check on the target video frame using the integrity check parameter can ensure that the target video frame is complete and has not been tampered with, thereby improving the accuracy of the return video.

[0230] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0231] Based on the same inventive concept, the embodiment of the present application also provides a video access device for implementing the video access method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more video access device embodiments provided below can refer to the limitations on the video access method above, and will not be repeated here.

[0232] In one embodiment, Figure 8 As shown, a video access device is provided, comprising:

[0233] The receiving module 801 receives a video access request, wherein the video access request carries an access video identifier;

[0234] The comparison module 802 is used to compare the access video identifier with the video identifier in each image metadata on the blockchain, obtain the target image metadata that has been successfully compared, and extract the target frame identifier corresponding to the access video identifier from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly;

[0235] The comparison module 802 is further used to compare the target frame identifier with the frame identifier in each storage metadata on the blockchain to obtain the successfully compared target storage metadata, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location;

[0236] Verification module 803 is used to obtain the distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract the target video frame from the corresponding distributed storage system; obtain the integrity verification parameter corresponding to the target image metadata, and use the integrity verification parameter to perform integrity verification on the target video frame;

[0237] The construction module 804 is used to construct a return video corresponding to the video access request based on the target video frame when the integrity check passes.

[0238] In some embodiments, the video access request also carries a query time period, and the comparison module 802 is further used to extract image timestamps from the metadata of each target image, respectively, compare the extracted image timestamps with the query time period, and obtain the target timestamps within the query time period; use the target image metadata where each target timestamp is located as the target metadata; and extract the target frame identifier corresponding to the access video identifier from the target metadata.

[0239] In some embodiments, the verification module 803 is also used to obtain a parameter generation algorithm for the integrity verification parameters, use the parameter generation algorithm to generate the current verification parameters of the target video frame, and compare the current verification parameters with the integrity verification parameters; when the current verification parameters are consistent with the integrity verification parameters, it is determined that the integrity check has passed.

[0240] In some embodiments, the target video frame is an encrypted video frame, and the construction module 804 is also used to obtain the encryption key of the target video frame, decrypt the target video frame using the encryption key to obtain a decrypted video frame; obtain multiple decrypted video frames corresponding to the access video identifier, and construct a return video corresponding to the video access request based on the frame numbers corresponding to the multiple decrypted video frames.

[0241] In some embodiments, the video access request also carries an object identifier; the video access device also includes a permission control module for obtaining the scope of access permissions associated with the object identifier; when the scope of access permissions includes an access video identifier, the access video identifier is compared with the video identifier in the metadata of each image on the blockchain.

[0242] In one embodiment, Fig. 9 As shown, a video storage device is provided, comprising:

[0243] An extraction module 901 is used to extract a video frame to be stored from the video to be stored according to a target rule;

[0244] A generating module 902 is used to generate integrity check parameters of the video frame to be stored, and obtain image metadata of the video frame to be stored, where the image metadata of the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored;

[0245] An upload module 903 is used to upload the integrity check parameters and the image metadata to the blockchain, where the integrity check parameters and the image metadata are stored correspondingly;

[0246] The storage module 904 is used to perform distributed storage on the video frame to be stored, and obtain the distributed storage location of the video frame to be stored and the storage metadata of the video frame to be stored, wherein the storage metadata of the video frame to be stored includes the frame identifier of the video frame to be stored;

[0247] The upload module 903 is also used to upload the distributed storage location and storage metadata to the blockchain, where the distributed storage location and storage metadata are stored correspondingly.

[0248] In some embodiments, the video storage device also includes a parsing module for receiving original video data, wherein the images contained in the original video data are in a compressed encoding format; for each image contained in the original video data, a current image is decoded to obtain a decoded image, and the decoded image is preprocessed to obtain a preprocessed image corresponding to the current image, wherein the preprocessing includes at least one of image quality enhancement, denoising, and scaling; based on the preprocessed images corresponding to each image contained in the original video data, a video to be stored is constructed.

[0249] In some embodiments, the extraction module 901 is specifically used to obtain the intra-frame metadata of the current video frame for each video frame in the video to be stored, extract the frame type from the intra-frame metadata, and when the frame type is a key frame, obtain the image difference between the current video frame and the forward video frame, and when the image difference is greater than or equal to a preset threshold, use the current video frame as the video frame to be stored.

[0250] In some embodiments, the generation module 902 is specifically configured to generate a hash value of the video frame to be stored by using a hash algorithm, and use the hash value as an integrity check parameter of the video frame to be stored.

[0251] In some embodiments, the upload module 903 is specifically used to generate a transaction request based on the integrity verification parameters, image metadata and target contract identifier, where the target contract identifier is the identifier of the smart contract used to upload the integrity verification parameters and image metadata; submit the transaction request to the blockchain node to instruct the blockchain node to parse the transaction request, obtain the integrity verification parameters, image metadata and target contract identifier, and upload the integrity verification parameters and image metadata to the blockchain by calling the smart contract corresponding to the target contract identifier.

[0252] In some embodiments, the storage module 904 is further used to generate an encryption key for the video to be stored, encrypt the video frame to be stored using the encryption key to obtain the encrypted video frame to be stored; and perform distributed storage on the encrypted video frame to be stored.

[0253] In some embodiments, the storage module 904 is specifically used to send the video frame to be stored to a distributed storage client in the distributed storage system, forward the video frame to be stored to a file segmentation node in the distributed storage system through the distributed storage client, segment the video frame to be stored through the file segmentation node to obtain multiple image blocks, and store the multiple image blocks in each data storage node in the distributed storage system to obtain storage index information corresponding to each of the multiple image blocks; based on the storage index information corresponding to each of the multiple image blocks, generate a distributed storage location of the video frame to be stored, extract the frame identifier of the video frame to be stored from the image metadata of the video frame to be stored, and generate storage metadata of the video frame to be stored based on the frame identifier of the video frame to be stored.

[0254] Each module in the above-mentioned video access device and video storage device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0255] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store integrity verification parameters, image metadata, etc. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video access method or a video storage method is implemented.

[0256] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0257] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0258] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0259] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0260] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0261] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0262] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0263] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A video access method, characterized in that: The method comprises: receiving a video access request, wherein the video access request carries an access video identifier; Compare the access video identifier with the video identifier in each image metadata on the blockchain to obtain the successfully compared target image metadata, and extract the target frame identifier corresponding to the access video identifier from the target image metadata; store each image metadata and each integrity check parameter on the blockchain in correspondence; The target frame identifier is compared with the frame identifiers in each storage metadata on the blockchain to obtain the successfully compared target storage metadata, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location; Obtain a distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract a target video frame from the corresponding distributed storage system; obtain an integrity check parameter corresponding to the target image metadata, and use the integrity check parameter to perform an integrity check on the target video frame; When the integrity check passes, a return video corresponding to the video access request is constructed based on the target video frame.

2. The method according to claim 1, characterized in that The video access request also carries a query time period, and the method further includes: Extracting image timestamps from metadata of each target image respectively, comparing the extracted timestamps of each image with the query time period, and obtaining timestamps of each target within the query time period; The target image metadata where each target timestamp is located is used as the target metadata; The step of extracting a target frame identifier corresponding to the access video identifier from the target image metadata includes: A target frame identifier corresponding to the access video identifier is extracted from the target metadata.

3. The method according to claim 1, characterized in that The using the integrity check parameter to perform integrity check on the target video frame includes: Acquire a parameter generation algorithm for the integrity check parameter, use the parameter generation algorithm to generate a current check parameter for the target video frame, and compare the current check parameter with the integrity check parameter; When the current verification parameter is consistent with the integrity verification parameter, it is determined that the integrity verification passes.

4. The method according to claim 1, characterized in that The target video frame is an encrypted video frame, and constructing a return video corresponding to the video access request based on the target video frame includes: Obtaining an encryption key of the target video frame, and using the encryption key to decrypt the target video frame to obtain a decrypted video frame; A plurality of decrypted video frames corresponding to the access video identifier are obtained, and a return video corresponding to the video access request is constructed based on frame sequence numbers corresponding to the plurality of decrypted video frames.

5. The method according to claim 1, characterized in that The video access request also carries an object identifier; the method further includes: Obtaining the scope of access rights associated with the object identifier; and when the scope of access rights includes the access video identifier, comparing the access video identifier with the video identifier in the metadata of each image on the blockchain.

6. A video storage method, characterized in that: The method comprises: Extracting the video frames to be stored from the video to be stored according to the target rule; Generate integrity check parameters of the video frame to be stored, and obtain image metadata of the video frame to be stored, wherein the image metadata of the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored; Uploading the integrity check parameter and the image metadata to a blockchain, where the integrity check parameter and the image metadata are stored correspondingly; Distributed storage is performed on the video frame to be stored to obtain a distributed storage location of the video frame to be stored and storage metadata of the video frame to be stored, wherein the storage metadata of the video frame to be stored includes a frame identifier of the video frame to be stored; The distributed storage location and the storage metadata are uploaded to a blockchain, where the distributed storage location and the storage metadata are stored correspondingly.

7. The method according to claim 6, characterized in that The method further comprises: Receiving original video data, wherein the original video data contains an image in a compressed encoding format; For each image included in the original video data, decode the current image to obtain a decoded image, and preprocess the decoded image to obtain a preprocessed image corresponding to the current image, wherein the preprocessing includes at least one of image quality enhancement, denoising, and scaling; The video to be stored is constructed based on the pre-processed images corresponding to each image contained in the original video data.

8. The method according to claim 6, characterized in that The step of extracting the video frames to be stored from the video to be stored according to the target rule includes: For each video frame in the video to be stored, the intra-frame metadata of the current video frame is obtained, the frame type is extracted from the intra-frame metadata, and when the frame type is a key frame, the image difference between the current video frame and the forward video frame is obtained, and when the image difference is greater than or equal to a preset threshold, the current video frame is used as the video frame to be stored.

9. The method according to claim 6, characterized in that The generating the integrity check parameter of the video frame to be stored includes: A hash algorithm is used to generate a hash value of the video frame to be stored, and the hash value is used as an integrity check parameter of the video frame to be stored.

10. The method according to claim 6, characterized in that The uploading of the integrity check parameter and the image metadata to the blockchain includes: Generate a transaction request based on the integrity check parameter, the image metadata, and a target contract identifier, where the target contract identifier is an identifier of a smart contract used to upload the integrity check parameter and the image metadata; Submit the transaction request to the blockchain node to instruct the blockchain node to parse the transaction request, obtain the integrity verification parameters, the image metadata and the target contract identifier, and upload the integrity verification parameters and the image metadata to the blockchain by calling the smart contract corresponding to the target contract identifier.

11. The method according to claim 6, characterized in that Before performing distributed storage on the video frames to be stored, the method further includes: Generate an encryption key for the video to be stored, and use the encryption key to encrypt the video frame to be stored to obtain an encrypted video frame to be stored; The step of distributing the video frames to be stored includes: The encrypted video frames to be stored are distributedly stored.

12. The method according to claim 6, characterized in that The step of distributing the video frame to be stored to obtain the distributed storage location of the video frame to be stored and the storage metadata of the video frame to be stored includes: Sending the video frame to be stored to a distributed storage client in a distributed storage system, forwarding the video frame to be stored to a file segmentation node in the distributed storage system through the distributed storage client, segmenting the video frame to be stored through the file segmentation node to obtain a plurality of image blocks, and storing the plurality of image blocks in each data storage node in the distributed storage system to obtain storage index information corresponding to each of the plurality of image blocks; Based on storage index information corresponding to each of the multiple image blocks, a distributed storage location of the video frame to be stored is generated, a frame identifier of the video frame to be stored is extracted from the image metadata of the video frame to be stored, and based on the frame identifier of the video frame to be stored, storage metadata of the video frame to be stored is generated.

13. A video access device, characterized in that: The device comprises: A receiving module receives a video access request, wherein the video access request carries an access video identifier; A comparison module is used to compare the access video identifier with the video identifier in each image metadata on the blockchain to obtain the successfully compared target image metadata, and to extract the target frame identifier corresponding to the access video identifier from the target image metadata; each image metadata and each integrity check parameter on the blockchain are stored correspondingly; The comparison module is further used to compare the target frame identifier with the frame identifiers in each storage metadata on the blockchain to obtain the successfully compared target storage metadata, and each storage metadata on the blockchain is stored in correspondence with each distributed storage location; A verification module is used to obtain a distributed storage location corresponding to the target storage metadata, and based on the distributed storage location, extract a target video frame from the corresponding distributed storage system; obtain an integrity verification parameter corresponding to the target image metadata, and use the integrity verification parameter to perform integrity verification on the target video frame; A construction module is used to construct a return video corresponding to the video access request based on the target video frame when the integrity check passes.

14. A video storage device, characterized in that: The device comprises: An extraction module, used for extracting the video frames to be stored from the video to be stored according to the target rule; A generating module, configured to generate integrity check parameters of the video frame to be stored, and obtain image metadata of the video frame to be stored, wherein the image metadata of the video frame to be stored includes: a frame identifier of the video frame to be stored and a video identifier of the video to be stored; An uploading module, used to upload the integrity check parameter and the image metadata to a blockchain, where the integrity check parameter and the image metadata are stored correspondingly; A storage module, used for distributing and storing the video frame to be stored, obtaining a distributed storage location of the video frame to be stored and storage metadata of the video frame to be stored, wherein the storage metadata of the video frame to be stored includes a frame identifier of the video frame to be stored; The upload module is further used to upload the distributed storage location and the storage metadata to the blockchain, where the distributed storage location and the storage metadata are stored correspondingly.

15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Cited By

  • Encryption access method and device of power grid dispatching cloud platform, computer equipment and readable storage medium

    CN121056186A

  • Image generation method and device, equipment and storage medium

    CN121644890A