WO2021208952A1 - Block chain-based image data recording, obtaining and verifying - Google Patents

Block chain-based image data recording, obtaining and verifying Download PDF

Info

Publication number
WO2021208952A1
WO2021208952A1 PCT/CN2021/087185 CN2021087185W WO2021208952A1 WO 2021208952 A1 WO2021208952 A1 WO 2021208952A1 CN 2021087185 W CN2021087185 W CN 2021087185W WO 2021208952 A1 WO2021208952 A1 WO 2021208952A1
Authority
WO
WIPO (PCT)
Prior art keywords
image data
blockchain
hash value
data frame
image
Prior art date
Application number
PCT/CN2021/087185
Other languages
French (fr)
Chinese (zh)
Inventor
吴莹强
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021208952A1 publication Critical patent/WO2021208952A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/71Indexing; Data structures therefor; Storage structures

Definitions

  • the embodiments of this specification relate to the field of image processing technology, specifically, to the recording, acquisition, and verification of image data based on blockchain.
  • Network cameras are widely used in various fields. They are different from traditional cameras. In addition to the image capture function, the network camera is also equipped with a digital compression controller and a WEB-based operating system, which can compress and encrypt video data and pass the internet. Or the wireless network sends it to the end user.
  • the image data processing capability of the webcam makes the webcam be used as a surveillance camera, and the generated video stream is often used as a basis for video surveillance, video evidence, and proof of events that occur.
  • the embodiments of this specification provide a blockchain-based image data recording, acquisition, and verification method and device, which can detect the image data output of the image sensor in the camera equipment, and monitor the image sensor output image data
  • the hash calculation can be performed at the source of the image data frame (ie, the image sensor), which avoids The image data frame has been maliciously tampered with.
  • each image data frame has image index information
  • the image index information includes time stamp information
  • the first hash value of the image data frame and the image index information are recorded on the blockchain, so that the user of the image data can
  • the first hash value is obtained from the blockchain based on the image index information, and the image data is verified based on the first hash value to verify whether the image data is credible.
  • a blockchain-based image data recording method the method is executed by a camera device, and the method includes: monitoring the image data output of an image sensor in the camera device; When the image data frame of the image data output by the image sensor is monitored, a hash calculation is performed on the output image data frame to obtain the first hash value of the image data frame, and the image data frame has image index information,
  • the image index information includes time stamp information; and the first hash value of the image data frame and the image index information are recorded in the blockchain.
  • the camera device serves as a client of the blockchain network of the blockchain, and records the first hash value and image index information of the image data frame to the
  • the blockchain includes: providing the first hash value and image index information of the image data frame to the corresponding blockchain node of the blockchain network, so as to record to the corresponding blockchain node via the corresponding blockchain node Blockchain.
  • the camera device serves as a blockchain node of the blockchain network of the blockchain, and records the first hash value and image index information of the image data frame
  • To the blockchain includes: packing the first hash value and image index information of the image data frame into a block, the block including the image index information and the corresponding first hash value;
  • the block is broadcast to the consensus node of the blockchain network for consensus processing; after the consensus node reaches a consensus, the block is recorded on the blockchain.
  • the method further includes: for the image data frame, using the private key of the camera device to sign the first hash value and image index information of the image data frame; and Recording the first hash value and image index information of the image data frame to the blockchain includes: recording the first hash value and image index information of the signed image data frame in the block chain.
  • the image index information further includes the device identifier and/or the camera position information of the camera device.
  • the image index information of the image data frame and the first hash value of the image data frame and the image index information are between the storage addresses on the blockchain. Index relationship.
  • recording the first hash value and image index information of the image data frame to the blockchain includes: recording the image data frame and the image data frame The first hash value and image index information are recorded in the blockchain.
  • the image data includes video data or still image data.
  • a blockchain-based image data acquisition method which is executed by an image data acquisition device, and the method includes: The image data acquisition request of the captured image data, the image data acquisition request includes the time period information of the image data to be acquired; the image data with the time stamp information that matches the time period information is queried in the blockchain And sending the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame shot by the camera device, the first image data frame The hope value and the image index information are stored in the block of the blockchain according to the above-mentioned image data recording method.
  • a blockchain-based image data verification method the method is executed by an image data verification device, and the method includes: The image data verification request of the captured image data, the image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information; the image data frame of the image data to be verified is hashed to obtain the first Two hash values; query the first hash value corresponding to the timestamp information of each second hash value in the blockchain; compare each second hash value with the corresponding first hash value; And based on the comparison result between each second hash value and the corresponding first hash value, sending notification information to the image data verifier for indicating whether the image data to be verified has passed the verification, wherein the The first hash value and image index information of the image data frame captured by the imaging device are stored in the block of the blockchain according to the image data recording method described above.
  • a block chain-based image data recording device the device is applied to a camera device to execute, the image data recording device includes: a monitoring unit monitors the camera device The image data output of the image sensor; when the hash calculation unit detects the image data frame of the image data output by the image sensor, it performs a hash calculation on the output image data frame to obtain the first hash of the image data frame Value, the image data frame has image index information, the image index information includes time stamp information; and the uplink processing unit records the first hash value of the image data frame and the image index information to the blockchain .
  • the camera device serves as a client of the blockchain network of the blockchain
  • the uplink processing unit converts the first hash value of the image data frame and
  • the image index information is provided to the corresponding blockchain node of the blockchain network to be recorded to the blockchain via the corresponding blockchain node.
  • the camera device is used as a blockchain node of the blockchain network of the blockchain
  • the chain processing unit chain includes: a block generation module converts the image The first hash value and image index information of the data frame are packaged into a block, the block includes the image index information and the corresponding first hash value; the consensus processing module broadcasts the block to the block The consensus node of the chain network performs consensus processing; and the block recording module records the block on the blockchain after the consensus node reaches a consensus.
  • the method further includes: for the image data frame, the signature unit uses the private key of the imaging device to sign the first hash value and the image index information of the image data frame
  • the on-chain processing unit records the first hash value and image index information of the signed image data frame to the blockchain.
  • the uplink processing unit records the image data frame, the first hash value of the image data frame, and image index information to the blockchain.
  • a block chain-based image data acquisition device including: a data acquisition request receiving unit receives an image data acquisition request for image data captured by a camera device from an image data requester
  • the image data acquisition request includes the time period information of the image data to be acquired; the data query unit searches the blockchain for image data frames with time stamp information that matches the time period information; and a data sending unit Send the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame shot by the camera device, the first hash value of the image data frame, and
  • the image index information is stored in the block of the blockchain according to the image data recording method described above.
  • a blockchain-based image data verification device including: a data verification request receiving unit receives an image data verification request for image data shot by a camera device from an image data verification party
  • the image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information;
  • the hash calculation unit performs a hash calculation on the image data frame of the image data to be verified to obtain the second hash value;
  • the hash value query unit queries the first hash value corresponding to the time stamp information of each second hash value in the blockchain;
  • the hash value comparison unit compares each second hash value with the corresponding first hash value And the notification unit, based on the comparison result between each second hash value and the corresponding first hash value, sends to the image data verifier an instruction to indicate whether the image data to be verified has passed the verification
  • the notification information wherein the first hash value and image index information of the image data frame captured by the camera device are stored in the block of the blockchain according to any one of the above-
  • an imaging device including the image data recording device as described in any one of the above.
  • an electronic device including at least one processor and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one The processor executes the image data recording method as described above.
  • a machine-readable storage medium which stores executable instructions that, when executed, cause the machine to execute the image data recording method described above.
  • an electronic device including: at least one processor; and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the At least one processor executes the image data acquisition method or the image data verification method as described above.
  • a machine-readable storage medium which stores executable instructions that, when executed, cause the machine to execute the image data acquisition method or the image data verification method described above.
  • Fig. 1 shows a schematic diagram of an example environment of an embodiment of the present specification
  • FIG. 2 shows a schematic diagram of an example architecture of a network formed by a camera device and a blockchain network according to an embodiment of the present specification
  • Fig. 3 shows an exemplary flow chart of a method for recording image data based on a blockchain according to an embodiment of the present specification
  • Fig. 4 shows an exemplary schematic diagram of image data frames generated by a camera device composed of an optical lens and an image sensor
  • FIG. 5 shows an exemplary schematic diagram of the consensus process of the embodiment of the present specification
  • FIG. 6 shows an exemplary schematic diagram of the format of a pre-preparation message, a preparation message, and a confirmation message in the consensus process of the embodiment of the present specification
  • Fig. 7 shows an exemplary flow chart of a method for acquiring image data based on a blockchain according to an embodiment of the present specification
  • FIG. 8 shows an exemplary flowchart of a method for verifying image data based on a blockchain according to an embodiment of the present specification
  • FIG. 9 shows an exemplary block diagram of a block chain-based image data recording device 800 according to an embodiment of the present specification
  • FIG. 10 shows an exemplary block diagram of a block chain-based image data acquisition device 900 according to an embodiment of the present specification
  • FIG. 11 shows an exemplary block diagram of a block chain-based image data verification device 1100 according to an embodiment of the present specification
  • FIG. 12 shows an exemplary block diagram of an electronic device used in a method for recording image data to a blockchain according to an embodiment of the present specification
  • FIG. 13 shows an exemplary block diagram of an electronic device used in the method for obtaining image data from a blockchain according to an embodiment of the present specification.
  • FIG. 14 shows an exemplary block diagram of an electronic device used in a method for verifying image data based on a blockchain according to an embodiment of the present specification.
  • the term “including” and its variations mean open terms, meaning “including but not limited to”.
  • the term “based on” means “based at least in part on.”
  • the terms “one embodiment” and “an embodiment” mean “at least one embodiment.”
  • the term “another embodiment” means “at least one other embodiment.”
  • the terms “first”, “second”, etc. may refer to different or the same objects. Other definitions can be included below, whether explicit or implicit. Unless clearly indicated in the context, the definition of a term is consistent throughout the specification.
  • Blockchain is a chain data structure that connects and combines data blocks sequentially in chronological order, and cryptographically ensures that the data blocks cannot be tampered with or forged.
  • Each block in the blockchain is linked to the previous block by including the encrypted hash of the immediately preceding block in the blockchain.
  • Each block also includes a timestamp, a cryptographic hash of the block, and one or more transactions.
  • the transaction that has been verified by the nodes of the blockchain network is hashed and a Merkle tree is formed. In the Merkle tree, the data at the leaf nodes is hashed, and for each branch of the Merkle tree, all the hash values of the branch are concatenated at the root of the branch. The above processing is performed on the Merkle tree until the root node of the entire Merkle tree.
  • the root node of the Merkle tree stores hash values representing all data in the Merkle tree.
  • a hash value claims to be a transaction stored in the Merkle tree it can be quickly verified by judging whether the hash value is consistent with the structure of the Merkle tree.
  • the blockchain network is a network of computing nodes used to manage, update and maintain one or more blockchain structures.
  • the blockchain network may include a public blockchain network, a private blockchain network, or a consortium blockchain network.
  • the consensus process is controlled by the nodes of the consensus network.
  • the public blockchain network can be considered as a public network of participating entities.
  • most entities (nodes) must sign each block in sequence, and add the signed block to the blockchain of the blockchain network.
  • Examples of public blockchain networks may include specific peer-to-peer payment networks.
  • the public blockchain network supports public transactions. Public transactions are shared among all nodes in the public blockchain network and stored in the global blockchain.
  • a global blockchain refers to a blockchain that is replicated across all nodes.
  • a consensus agreement is implemented in the public blockchain network. Examples of consensus protocols include but are not limited to: proof-of-work (POW), proof-of-stake (POS), and proof-of-authority (POA).
  • Private blockchain networks are provided for specific entities.
  • the read and write permissions of each node in the private blockchain network are strictly controlled. Therefore, a private blockchain network is usually also called a permissioned network, which restricts who is allowed to participate in the network and the level of network participation (for example, only in certain transaction situations).
  • a private blockchain network various types of access control mechanisms can be used (for example, existing participants vote to add new entities, regulatory agencies control permissions, etc.).
  • the alliance blockchain network is private among participating entities.
  • the consensus process is controlled by authorized nodes.
  • a consortium composed of several (for example, 10) entities (for example, financial institutions, insurance companies) can operate a consortium blockchain network, and each entity operates at least one node in the consortium blockchain network. Therefore, the consortium blockchain network can be considered as a private network of participating entities.
  • each participating entity node
  • each block may be signed by a subset of participating entities (nodes) (for example, at least 7 entities), and the block may be added to the blockchain.
  • Fig. 1 shows a schematic diagram of an example environment 100 of an embodiment of the present specification.
  • the example environment 100 allows entities to participate in the blockchain network 102.
  • the blockchain network 102 may be, for example, a public blockchain, a private blockchain, or a consortium blockchain blockchain network.
  • the example environment 100 may include computing devices 104, 106, 108, 110, 112, and a network 114.
  • the network 114 may include a local area network (LAN), a wide area network (WAN), the Internet, or a combination thereof, and is connected to a website, a user device (such as a computing device), and a back-end system.
  • the computing devices 104, 106, 108, 110, 112 may access the network 114 through wired and/or wireless communication.
  • the computing devices 106, 108 may be nodes of a cloud computing system (not shown), or each computing device 106, 108 may be a separate cloud computing system, including being interconnected by a network and acting as a distributed processing system Multiple computers at work.
  • the computing devices 104-108 can run any appropriate computing system to enable them to serve as nodes in the blockchain network 102.
  • the computing devices 104-108 may include, but are not limited to, servers, desktop computers, notebook computers, tablet computing devices, and smart phones.
  • the computing devices 104 to 108 may be attributed to related entities and used to implement corresponding services.
  • the service may be used to manage transactions between a certain entity or multiple entities.
  • the computing devices 104-108 respectively store the blockchain ledger corresponding to the blockchain network 102.
  • the computing device 104 may be (or include) a web server for providing browser functions, and the web server may provide visual information related to the blockchain network 102 based on the network 114.
  • the computing device 104 may not participate in block verification, but monitor the blockchain network 102 to determine when other nodes (for example, computing devices 106-108) reach a consensus, and generate corresponding blocks accordingly.
  • Chain visual user interface for example, computing devices 106-108
  • the computing devices 110 and 112 may be client devices connected to the blockchain network 102.
  • the computing device 110 may be a terminal device at a medical institution platform
  • the computing device 112 may be a terminal device at an advertising supervision platform.
  • Computing devices 110 and 112 may include, but are not limited to, servers, desktop computers, notebook computers, tablet computing devices, and smart phones.
  • the computing device 104 may receive a request initiated by a client device (for example, the computing device 110 or the computing device 112) for the blockchain visualization user interface.
  • a client device for example, the computing device 110 or the computing device 112
  • the nodes of the blockchain network 102 can also serve as client devices.
  • a user of the computing device 108 can use a browser running on the computing device 108 to send the aforementioned request to the computing device 104.
  • the computing device 104 may generate a blockchain visual user interface (such as a web page) based on the stored blockchain ledger, and send the generated blockchain visual user interface to the requesting client device.
  • a blockchain visual user interface such as a web page
  • the request for the blockchain visualization user interface may include user authorization information, before the blockchain visualization user interface is generated and sent to the requesting client device ,
  • the computing device 104 may verify the user authorization information, and return to the corresponding blockchain visual user interface after the verification is passed.
  • the blockchain visual user interface may be displayed on the client device (for example, it may be displayed in the user interface 116 shown in FIG. 1).
  • the display content of the user interface 116 can also be updated accordingly.
  • the user's interaction with the user interface 116 may result in requests for other user interfaces, such as displaying block lists, block details, transaction lists, transaction details, account lists, account details, contract lists, contract details, or user requests for blocks
  • the search result page generated by the implementation of the search on the chain network, etc.
  • FIG. 2 shows a schematic diagram of an exemplary architecture of a network 200 formed by a camera device and a blockchain network in an embodiment of the present specification.
  • the camera device 210 serves as a client of the blockchain network 214 and is connected to a server device 220 in communication.
  • the server device 220 is a blockchain node in the blockchain network 214 or a component thereof.
  • the connection of the server device 220 to the camera device 210 shown in FIG. 2 is only an example, and the server device 220 may also be communicatively connected with other multiple camera devices.
  • the imaging device 210 shoots and generates image data, such as images or videos.
  • the imaging device 210 transmits the generated image data to the server device 220.
  • the server device 220 For example, office buildings are equipped with several camera equipment to monitor the office building. These camera equipment are connected to the server equipment in the office building. The camera equipment generates video data in real time during the shooting process and sends the video data to the server equipment in real time. Store it.
  • the server device 220 as a blockchain node or part of the blockchain network 214, can upload the received image data to the blockchain 216 for storage, which can prevent the stored image data from being deleted or tampered with .
  • the image data acquisition device 230 and the image data verification device 240 can also be used as a blockchain node or a component part of the blockchain network 214, and the image data acquisition device 230 can query and acquire image data frames from the blockchain 216
  • the image data verification device 240 can query the corresponding first hash value from the blockchain 216, and verify the image data frame of the image data to be verified based on the first hash value.
  • the camera device may be a blockchain node or a component part of the blockchain network.
  • the generated image data can be directly packaged and chained to the blockchain for storage.
  • the camera device is connected to the server device, and the server device is communicatively connected to the blockchain node in the blockchain network.
  • the camera device can send the generated image data to the server device, the server device then sends the received image data to the communication connected blockchain node, and then the blockchain node will package the image data and upload it to the chain. Blockchain for storage.
  • FIG. 3 shows a flowchart of an example of a method for recording image data based on a blockchain according to an embodiment of the present specification.
  • the image data recording method can be executed by a camera device.
  • the camera device in the embodiment of this specification can include any one of a network camera, a surveillance camera, a driving recorder that can be networked, and a camera that can be networked. The following takes a network camera as an example for description.
  • the image data output of the image sensor in the camera device is monitored.
  • the imaging device includes at least an optical lens and an image sensor, and the optical lens of the imaging device can be composed of several lens systems.
  • FIG. 4 shows a schematic diagram of an example of image data frames generated by an imaging device composed of an optical lens and an image sensor.
  • the image sensor collects the generated light signal, converts the collected light signal into an electrical signal, and outputs image data for rendering into a frame of image through the encoding method.
  • the image sensor may include CCD (charge coupled device, charge coupled device), CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide semiconductor), film, etc.
  • the image data may include video data or still image data
  • the still image data may be an image.
  • the recorded image data is still image data
  • one frame of image data output by the image sensor is the still image data to be recorded.
  • the recorded image data is video
  • the video composed of several image data frames output by the image sensor is the video data to be recorded.
  • Hash calculation is a process of converting an image data frame (provided as character string data) into a fixed-length first hash value (also provided as character string data). After performing a hash calculation on the image data frame, even if the image data frame is slightly changed, a completely different first hash value will be obtained.
  • the first hash value is usually generated by using a hash function to perform a hash calculation on the image data frame. Examples of hash functions include, but are not limited to, Secure Hash Algorithm (SHA)-256, which outputs a 256-bit first hash value.
  • SHA Secure Hash Algorithm
  • the video data is composed of multiple image data frames
  • the image sensor sequentially outputs each image data frame according to the time sequence of shooting.
  • the camera device performs a hash calculation on the output image data frame to obtain the first hash value of the image data frame, until all the image data frames constituting the video data are calculated.
  • a hash calculation is performed.
  • the image data frame has a one-to-one correspondence with the first hash value, and different image data frames correspond to different first hash values.
  • Each image data frame generated by the camera device is generated by the image sensor in the camera device, and the generated image data frame is then processed by other components in the camera device, such as combining multiple frames of images into one video. Or, store the generated image or video to a memory card or transfer it to other devices. Therefore, when the image data frame of the image data is generated and output by the image sensor, a hash calculation is performed to obtain the corresponding first hash value, which prevents the image data frame from being deleted or tampered with during subsequent processing and transmission. This makes the source of the generated image data believable.
  • the image data frame has image index information
  • the image index information has a one-to-one correspondence with the image data frame
  • the image index information can be used to query the corresponding image data frame on the blockchain.
  • the image index information may include time stamp information, and the time stamp information included in the image index information of each image data frame is a time stamp corresponding to the image data frame.
  • the time stamp corresponding to the image data frame is: January 25, 2020 12:3:20
  • the time stamp information in the image index information of the image data frame is: January 25, 2020 12:3 20 seconds.
  • the image index information may also include the device identification of the camera device and/or the camera location information.
  • the device ID can be used to indicate the camera device that generates the image data frame.
  • each image data frame corresponds to a unique camera device, and each camera device corresponds to a unique device ID, so each image data frame corresponds to a unique device Logo.
  • the shooting position information can be used to indicate the shooting position corresponding to the image data frame.
  • the camera equipment is provided with a positioning device such as GPS.
  • the positioning device can locate each image data frame in real time to determine the shooting position of each image data frame.
  • the shooting location information can be represented by world coordinates, or can be described by text. For example, the shooting location information is: Chaoyang District, Beijing.
  • each image data frame has image index information including a variety of information such as a timestamp, device identification, and camera position information, which can represent the corresponding image data frame from different dimensions.
  • image index information including a variety of information such as a timestamp, device identification, and camera position information, which can represent the corresponding image data frame from different dimensions.
  • various information corresponding to the image data frame is recorded on the blockchain, so that the information can be used to verify the credibility of the image data frame from different dimensions, and the credibility of the image data frame is improved.
  • the first hash value of the image data frame and the image index information are recorded to the blockchain.
  • the first hash value and image index information belonging to the same image data frame may be packaged into a block and recorded on the blockchain.
  • the camera device serves as a blockchain node of the blockchain network of the blockchain. After obtaining the first hash value and image index information of the image data frame, the imaging device can pack the first hash value and image index information of the image data frame into a block, which includes the image index information and the corresponding first hash value. A hash value.
  • the block is broadcast to the consensus nodes of the blockchain network for consensus processing. After the consensus node reaches a consensus, the block is recorded on the blockchain.
  • FIG. 5 shows a schematic diagram of an example of the consensus process of the embodiment of the present specification.
  • the first hash value and image index information can be considered as transaction data in the blockchain.
  • the blockchain node where the camera device is located serves as the master node of the blockchain network (ie, the accounting node, hereinafter referred to as the master node R 0 ).
  • the master node R 0 broadcasts the packaged block to all consensus nodes in the blockchain network for consensus processing.
  • the master node R 0 broadcasts the packaged block to the backup nodes R 1 , R 2 and R 3 performs consensus processing.
  • the consensus process is shown as including 4 network nodes R 0 , R 1 , R 2 and R 3 for illustration purposes only, and the consensus process can also include any suitable number of network nodes.
  • the consensus process can be implemented using PoW (Proof of Work Algorithm), PoS (Proof of Stake Algorithm), PBFT (Practical Byzantine Fault Tolerance Algorithm), and so on.
  • PoW Proof of Work Algorithm
  • PoS Proof of Stake Algorithm
  • PBFT Practical Byzantine Fault Tolerance Algorithm
  • the process of PBFT consensus processing includes: a pre-prepare phase (Pre-prepare) 510, a preparation phase (Prepare) 520, and a confirmation phase (Commit) 530.
  • Pre-prepare a pre-prepare phase
  • Prepare preparation phase
  • Commit confirmation phase
  • the master node R 0 packages the vehicle data fragments to be recorded in the blockchain into a message m, and then generates a pre-prepare message Pre-prepare, and in a given time interval, the pre-prepare message Pre -prepare to send (for example, broadcast) to the backup nodes R 1 , R 2 and R 3 .
  • the pre-prepare message Pre-prepare indicates that the master node R 0 is starting the consensus process.
  • the format of the pre-prepare message Pre-prepare may be: ⁇ PRE-PREPARE, epoch, seq, D(m), signature-p>, m, j>.
  • PRE-PREPARE represents the protocol identifier of the pre-prepared message
  • epoch represents the era when R 0 is the master node
  • siq represents the proposal of the required consensus (that is, adding the block to the blockchain 216)
  • Proposal number “D(m)” represents the summary of the request message set
  • signature-p represents the signature of R 0
  • “m” represents the specific content of the request message (ie, the specific content of each piece of authentication information in the block)
  • "j” represents the node ID of R 0.
  • D(m) is obtained by hashing each set of authentication information in the block.
  • the pre-prepare message Pre-prepare can be stored In the local log, a preparation message Prepare used to respond to the pre-prepare message Pre-prepare is generated, and then the generated preparation message Prepare is broadcast to other nodes.
  • the preparation message Prepare indicates that the backup node has received the pre-prepare message Pre-prepare from the master node, and is sending a response in response to the pre-prepare message Pre-prepare.
  • each backup node will also receive the pre-prepare message Pre-prepare sent by other backup nodes.
  • the backup nodes R 1 in an example, the backup nodes R 1 R 0 master node receives the prepared Pre-prepare message transmitted will broadcast the resulting preparation message to the master node Prepare R 0, R 2 and backup node R 3.
  • the backup node R 1 will also receive the prepare message Prepare sent by the master node R 0 , the backup nodes R 2 and R 3.
  • the prepare message Prepare broadcast by the backup node may be used to indicate the consensus commitment made by the backup node in the preparation phase 520.
  • the format of the preparation message Prepare may be: ⁇ PREPARE, epoch, seq, D(m), i, signature-i>.
  • PREPARE represents the protocol identifier of the Prepare message
  • i represents the node identifier of the node that sends the Prepare message
  • signature-i represents the signature of the node that sends the Prepare message.
  • the meanings of "epoch”, “seq” and “D(m)" in the preparation message Prepare are the same as the meanings of "epoch”, “seq” and "D(m)” in the above-mentioned pre-prepare message.
  • the network node determines that a consensus has been reached. For example, if the master node R0 or the backup node R1, R2 or R3 receives Quorum (for example, 2f+1, where f represents the number of failed network nodes) preparation message Prepare, it is determined that a consensus is reached between the network nodes. Then, the master node R0 or the backup node R1, R2 or R3 will broadcast a confirmation message Commit to other nodes.
  • Quorum for example, 2f+1, where f represents the number of failed network nodes
  • the format of the confirmation message Commit may be: ⁇ COMMIT, epoch, seq, D(m), p, signature-p>.
  • "COMMIT” represents the protocol identifier of the confirmation message Commit
  • "p” represents the node identifier of the node sending the confirmation message Commit
  • "signature-p” represents the signature of the node sending the confirmation message Commit.
  • the meanings of "epoch”, “seq” and “D(m)” in the confirmation message Commit are the same as the meanings of "epoch”, “seq” and "D(m)” in the above-mentioned pre-prepare message.
  • the node sends a confirmation message Commit and stores the confirmation message Commit in the local log to indicate the consensus commitment made by the node in the confirmation phase 530.
  • the master node After reaching a consensus on the initiated proposal as described above, the master node records the block in the blockchain, thereby completing the recording of the first hash value and image index information in the blockchain.
  • the camera device can be used as a client of the blockchain network of the blockchain, and the camera device is communicatively connected with the blockchain network.
  • the camera device is communicatively connected with at least one blockchain node in the blockchain network.
  • the camera device may provide the first hash value and image index information of the image data frame to the corresponding blockchain node of the blockchain network, and the corresponding blockchain node is in communication connection with the camera device.
  • the corresponding blockchain node After receiving the first hash value and image index information of the image data frame, the corresponding blockchain node can pack the first hash value and image index information into a block, which includes the first hash value and Image index information. Then, the corresponding blockchain node broadcasts the block to all consensus nodes in the blockchain node for consensus processing. After all consensus nodes reach a consensus, the block can be recorded on the blockchain.
  • the blockchain node after the first hash value and image index information of the image data frame are recorded on the blockchain, the blockchain node will feed back the first hash value and image index information of the image data frame.
  • the storage address on the blockchain according to the storage address, the first hash value and image index information can be queried from the blockchain.
  • the image index information in the index relationship may include all or part of the information.
  • the image index information recorded on the blockchain includes time stamp information, device identification, and camera location information, and the image index information in the index relationship includes only time stamp information.
  • the index relationship of each image data frame is the corresponding relationship between the time stamp information and the storage address. Therefore, the first hash value and image index information of the image data frame can be obtained based on the time stamp information of each image data frame
  • the storage address on the blockchain further obtains the first hash value and image index information of the image data frame from the blockchain.
  • the index relationship corresponding to each image data frame is recorded in the index table according to the time stamp sequence.
  • verifying the video to be verified using the first hash value and image index information recorded on the blockchain determine the timestamps corresponding to the first and last frames of the video to be verified, and then query the index table for the first and last frame of the video to be verified.
  • One frame time stamp and the last frame time stamp One frame time stamp and the last frame time stamp.
  • the first frame time stamp and the last frame time stamp and all image data frames in between are used to verify the video to be verified.
  • the number is consistent with the number of image data frames queried in the index table, and when each frame is verified, the integrity of the video can be verified to ensure that the image frames in the video are not deleted or omitted.
  • the integrity of the video can be verified by using the index relationship recorded by the timestamp in the index table, avoiding the loss or deletion of image frames in the video, thereby improving the accuracy and credibility of subsequent video verification .
  • the image data frame, the first hash value of the image data frame, and the image index information can also be recorded to the blockchain.
  • the image data frame and the corresponding first hash value and image index information can be packaged into a block and recorded on the blockchain.
  • the image data acquisition device can acquire the image data frame of the image data from the blockchain.
  • the image data acquisition device is a blockchain node in the blockchain network of the blockchain, and the image data acquisition device stores image data frames locally.
  • FIG. 7 shows a flowchart of an example of a method for acquiring image data based on a blockchain according to an embodiment of the present specification.
  • the image data acquisition device receives an image data acquisition request for the image data shot by the camera device from the image data requester.
  • the image data requester may be a client of the blockchain network, which is connected to the image data acquisition device in communication.
  • the image data acquisition request may include time period information of the image data to be acquired.
  • the time period information may include the time period between the time stamp of the first image data frame and the time stamp of the last image data frame in the image data to be acquired, and the time period information may also include each image data in the image data to be acquired.
  • the time stamp information of the frame may be a client of the blockchain network, which is connected to the image data acquisition device in communication.
  • the image data acquisition request may include time period information of the image data to be acquired.
  • the time period information may include the time period between the time stamp of the first image data frame and the time stamp of the last image data frame in the image data to be acquired, and the time period information may also include each image data in the image data to be acquired.
  • the time stamp information of the frame may be a client of the blockchain network, which is connected to the image data acquisition device in communication.
  • the image data acquisition device queries the blockchain for image data frames with time stamp information that matches the time period information.
  • the matched image data frame is the image data frame in the image data to be acquired.
  • the image data acquisition device sends the queried image data frame to the image data requester for use by the image data requester.
  • the private key of the camera device can also be used to pair the first image data frame with respect to the image data frame.
  • the hash value and the image index information are signed, and then the first hash value of the signed image data frame and the image index information are recorded on the blockchain.
  • the private key signature of the camera device prevents the first hash value and image index information from being tampered with during transmission, and further improves the credibility of the first hash value and image index information stored on the blockchain.
  • the image data acquisition device acquires image data from the blockchain, it needs to use the public key of the camera device to verify the signature of each image data frame of the image data, which improves the credibility of the acquired image data frame.
  • the image data verification device When the image data verification device obtains the first hash value from the blockchain, it needs to use the public key of the camera device to verify the signature of the obtained first hash value to ensure that the first hash value is used by the camera device The generated image data frame is obtained, thereby ensuring the accuracy of image data verification.
  • FIG. 8 shows a flowchart of an example of a method for verifying image data based on a blockchain according to an embodiment of this specification.
  • the image data verification device may be a blockchain node in the blockchain network of the blockchain, and the image data verification device locally stores the first hash value and image index information of the image data frame captured by the camera device.
  • the image data verification device may receive an image data verification request for the image data shot by the camera device from the image data verification party.
  • the image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information.
  • the image data verification device performs a hash calculation on the image data frame of the image data to be verified to obtain a second hash value.
  • the image data verification device queries the blockchain for the first hash value corresponding to the time stamp information of each second hash value.
  • the image data verification device compares each second hash value with the corresponding first hash value.
  • the image data verification device sends notification information indicating whether the image data to be verified has passed the verification to the image data verification party based on the comparison result between each second hash value and the corresponding first hash value.
  • each second hash value is the same as the corresponding first hash value
  • the notification information used to indicate that the image data to be verified is available is sent to the image data verifier.
  • sending notification information for indicating that the image data to be verified is unavailable to the image data verifier.
  • the image data to be verified can be stored in a third-party image data storage party.
  • the image data can be obtained from the third-party image data storage party.
  • the hash value recorded on the blockchain to verify whether the acquired image data is authentic, thereby effectively preventing the image data from being tampered with, and because the image data is not stored on the blockchain, it can save the blockchain. storage.
  • the image index information further includes the device identification and/or camera location information of the camera device
  • the image data verification request further includes the device identification and/or camera location information corresponding to the image data frame.
  • the device identification and/or camera position information of each image data frame in the image data to be verified can also be compared with the corresponding information recorded on the blockchain. The device identification and/or camera location information are compared.
  • the image data frame in the image data to be verified is credible
  • the device identification it can be determined that the image data to be verified is generated by a credible device
  • the image data to be verified can be determined by verifying the camera position information. Verify that the location information of the image data is credible.
  • FIG. 9 shows a block diagram of an example of a block chain-based image data recording device 800 according to the embodiment of this specification.
  • the image data recording device 900 may include a monitoring unit 910, a hash calculation unit 920, and an uplink processing unit 930.
  • the monitoring unit 910 is configured to monitor the image data output of the image sensor in the imaging device.
  • the operation of the monitoring unit 910 may refer to the operation of the block 310 described above with reference to FIG. 3.
  • the hash calculation unit 920 is configured to perform a hash calculation on the output image data frame to obtain the first hash value of the image data frame when the image data frame of the image data output by the image sensor is monitored, and the image data frame has an image index Information, image index information includes time stamp information.
  • the operation of the hash calculation unit 920 may refer to the operation of the block 320 described above with reference to FIG. 3.
  • the uplink processing unit 930 is configured to record the first hash value of the image data frame and the image index information to the blockchain.
  • the operation of the uplink processing unit 930 may refer to the operation of the block 330 described above with reference to FIG. 3.
  • the on-chain processing unit 930 is configured to provide the first hash value of the image data frame and the image index information to the corresponding blockchain of the blockchain network Node to record to the blockchain via the corresponding blockchain node.
  • the upstream processing unit chain 830 may include a block generation module, a consensus processing module, and a block recording module.
  • the block generation module is configured to pack the first hash value and image index information of the image data frame into a block, and the block includes the image index information and the corresponding first hash value.
  • the consensus processing module is configured to broadcast the block to the consensus nodes of the blockchain network for consensus processing.
  • the block recording module is configured to record the block on the blockchain after the consensus node reaches a consensus.
  • the image data recording device 900 may further include a signature unit.
  • the signature unit is configured to use the private key of the camera device to sign the first hash value and the image index information of the image data frame with respect to the image data frame.
  • the uplink processing unit 930 is configured to record the first hash value of the signed image data frame and the image index information to the blockchain.
  • the uplink processing unit 930 may also be configured to record the image data frame, the first hash value of the image data frame, and the image index information to the blockchain.
  • the embodiment of the present specification also provides a camera device, which may include the image data recording device of any one of the examples shown in FIG. 9.
  • FIG. 10 shows a block diagram of an example of a block chain-based image data acquisition device 900 according to an embodiment of the present specification.
  • the image data acquisition device 1000 may include a data acquisition request receiving unit 1010, a data query unit 1020, and a data sending unit 1030.
  • the data acquisition request receiving unit 1010 is configured to receive an image data acquisition request for image data shot by the imaging device from an image data requester, the image data acquisition request including time period information of the image data to be acquired.
  • the operation of the data acquisition request receiving unit 1010 may refer to the operation of block 710 described above with reference to FIG. 7.
  • the data query unit 1020 is configured to query the image data frame with the time stamp information matching the time period information in the blockchain.
  • the operation of the data query unit 1020 may refer to the operation of the block 720 described above with reference to FIG. 7.
  • the data sending unit 1030 is configured to send the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame and the first hash value of the image data frame captured by the imaging device And the image index information is stored in the block of the blockchain according to the image data recording method described above.
  • the operation of the data transmission unit 1030 may refer to the operation of the block 730 described above with reference to FIG. 7.
  • Fig. 11 shows a block diagram of an example of a blockchain-based image data verification device 1100 according to an embodiment of the present specification.
  • the image data verification device 1100 may include a data verification request receiving unit 1110, a hash calculation unit 1120, a hash value query unit 1130, a hash value comparison unit 1140, and a notification unit 1150.
  • the data verification request receiving unit 1110 is configured to receive an image data verification request for image data shot by the imaging device from an image data verification party, the image data verification request including image data frames of the image data to be verified and corresponding time stamp information.
  • the operation of the data verification request receiving unit 1110 may refer to the operation of block 810 described above with reference to FIG. 8.
  • the hash calculation unit 1120 is configured to perform a hash calculation on the image data frame of the image data to be verified to obtain the second hash value.
  • the operation of the hash calculation unit 1120 may refer to the operation of the block 820 described above with reference to FIG. 8.
  • the hash value query unit 1130 is configured to query the first hash value corresponding to the time stamp information of each second hash value in the blockchain.
  • the operation of the hash value query unit 1130 may refer to the operation of the block 830 described above with reference to FIG. 8.
  • the hash value comparison unit 1140 is configured to compare each second hash value with the corresponding first hash value.
  • the operation of the hash value comparison unit 1140 may refer to the operation of the block 840 described above with reference to FIG. 8.
  • the notification unit 1150 is configured to, based on the comparison result between each second hash value and the corresponding first hash value, send notification information for indicating whether the image data to be verified is verified to the image data verifier.
  • the first hash value and image index information of the image data frame captured by the imaging device are stored in a block of the blockchain according to any one of the above-mentioned image data recording methods.
  • the operation of the notification unit 1150 may refer to the operation of the block 850 described above with reference to FIG. 8.
  • FIGS. 1 to 11 the embodiments of the method and device for recording, acquiring, and verifying image data based on the blockchain according to the embodiments of the present specification have been described.
  • the device for recording, acquiring, and verifying image data based on the blockchain in the embodiments of this specification can be implemented by hardware, or by software or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the memory into the memory through the processor of the device where it is located. In the embodiments of the present specification, the image data recording, acquiring, and verifying device based on the blockchain can be implemented by using electronic equipment, for example.
  • FIG. 12 shows a block diagram of an electronic device 1200 for a method for recording image data to a blockchain according to an embodiment of the present specification.
  • the electronic device 1200 may include at least one processor 1210, a memory (for example, a non-volatile memory) 1220, a memory 1230, and a communication interface 1240, and at least one processor 1210, a memory 1220, a memory 1230, and a communication interface.
  • the interfaces 1240 are connected together via a bus 1250.
  • At least one processor 1210 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
  • computer-executable instructions are stored in the memory, which when executed, cause at least one processor 1210 to: monitor the image data output of the image sensor in the camera device; When the output image data frame is hashed to obtain the first hash value of the image data frame, the image data frame has image index information, and the image index information includes time stamp information; and the first hash value of the image data frame The value and image index information are recorded to the blockchain.
  • a program product such as a machine-readable medium.
  • the machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
  • a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
  • FIG. 13 shows a block diagram of an electronic device 1300 for the method for obtaining image data from a blockchain according to an embodiment of the present specification.
  • the electronic device 1300 may include at least one processor 1310, a memory (for example, a non-volatile memory) 1320, a memory 1330, and a communication interface 1340, and at least one processor 1310, a memory 1320, a memory 1330, and a communication interface.
  • the interfaces 1340 are connected together via a bus 1350.
  • At least one processor 1310 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
  • a computer-executable instruction is stored in the memory, which when executed causes at least one processor 1310: to receive an image data acquisition request for image data shot by the imaging device from the image data requester, and the image data acquisition request Including the time period information of the image data to be obtained; querying the image data frame with the time stamp information matching the time period information in the blockchain; and sending the queried image data frame to the image data requester for The image data requester uses the image data frame, the first hash value of the image data frame, and the image index information captured by the camera device in a block of the blockchain according to the above-mentioned image data recording method.
  • a program product such as a machine-readable medium.
  • the machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
  • a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
  • FIG. 14 shows a block diagram of an electronic device 1400 for a method for verifying image data based on a blockchain according to an embodiment of the present specification.
  • the electronic device 1400 may include at least one processor 1410, a memory (for example, a non-volatile memory) 1420, a memory 1430, and a communication interface 1440, and at least one processor 1410, a memory 1420, a memory 1430, and a communication interface.
  • the interfaces 1440 are connected together via a bus 1450.
  • At least one processor 1410 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
  • computer-executable instructions are stored in the memory, which when executed, cause at least one processor 1410 to: receive an image data verification request for image data shot by the camera device from an image data verification party, and the image data verification request The image data frame including the image data to be verified and the corresponding timestamp information; the image data frame of the image data to be verified is hashed to obtain the second hash value; the second hash value is queried in the blockchain The first hash value corresponding to the timestamp information; compare each second hash value with the corresponding first hash value; and based on the comparison result between each second hash value and the corresponding first hash value , Sending notification information to the image data verifier to indicate whether the image data to be verified has passed the verification, wherein the first hash value and the image index information of the image data frame captured by the camera device are in accordance with the image data as described above.
  • the data recording method is stored in the block of the blockchain.
  • a program product such as a machine-readable medium.
  • the machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
  • a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
  • the program code itself read from the readable medium can implement the function of any one of the above embodiments, so the machine readable code and the readable storage medium storing the machine readable code constitute this specification Part of the embodiment.
  • the computer program codes required for the operation of each part of this manual can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB, NET, and Python, etc., conventional programming languages such as C language, Visual Basic 2003, Perl, COBOL 2002, PHP and ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages.
  • the program code can run on the user's computer, or run on the user's computer as an independent software package, or partly run on the user's computer and partly run on the remote computer, or run entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (for example, via the Internet), or in a cloud computing environment, or as Service usage, such as software as a service (SaaS).
  • LAN local area network
  • WAN wide area network
  • SaaS software as a service
  • Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, Volatile memory card and ROM.
  • the program code can be downloaded from the server computer or the cloud via the communication network.
  • the device structure described in the foregoing embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or may be implemented by multiple physical entities. Some components in independent devices are implemented together.

Abstract

Embodiments of the present description provide a block chain-based image data recording method and apparatus, a block chain-based image data obtaining method and apparatus, and a block chain-based image data verifying method and apparatus. In the image data recording method, a camera device monitors image data output of an image sensor, and when monitoring that the image sensor outputs an image data frame of the image data, performs hash calculation on the outputted image data frame to obtain a first hash value of the image data frame, the image data frame having image index information comprising timestamp information; and record the first hash value of the image data frame and the image index information to a block chain.

Description

基于区块链的影像数据记录、获取、验证Image data recording, acquisition and verification based on blockchain 技术领域Technical field
本说明书实施例涉及图像处理技术领域,具体地,涉及基于区块链的影像数据记录、获取、验证。The embodiments of this specification relate to the field of image processing technology, specifically, to the recording, acquisition, and verification of image data based on blockchain.
背景技术Background technique
网络摄像头被广泛应用在各个领域中,区别于传统摄像机,除了图像捕捉功能外,网络摄像头还配置有数字化压缩控制器和基于WEB的操作系统,能够对视频数据进行压缩加密等处理,并通过internet或无线网络发送给终端用户。网络摄像头的图像数据处理能力使得网络摄像头被用作监控摄像头,所生成的视频流经常被用来当作视频监控、视频证据以及所发生事件的证明依据等。Network cameras are widely used in various fields. They are different from traditional cameras. In addition to the image capture function, the network camera is also equipped with a digital compression controller and a WEB-based operating system, which can compress and encrypt video data and pass the internet. Or the wireless network sends it to the end user. The image data processing capability of the webcam makes the webcam be used as a surveillance camera, and the generated video stream is often used as a basis for video surveillance, video evidence, and proof of events that occur.
发明内容Summary of the invention
鉴于上述,本说明书实施例提供了一种基于区块链的影像数据记录、获取、验证方法及装置,其能够检测摄像设备中的图像传感器的影像数据输出,并在监测到图像传感器输出影像数据的图像数据帧时对输出的图像数据帧进行哈希计算以得到该图像数据帧的第一哈希值,从而能够在图像数据帧的产生源头(即图像传感器)处进行哈希计算,避免了图像数据帧被恶意篡改。此外,每个图像数据帧具有图像索引信息,图像索引信息包括时间戳信息,再将该图像数据帧的第一哈希值以及图像索引信息记录在区块链上,从而使得影像数据使用方能够基于图像索引信息从区块链上获取第一哈希值,并基于第一哈希值对影像数据进行校验,以检验影像数据是否可信。In view of the above, the embodiments of this specification provide a blockchain-based image data recording, acquisition, and verification method and device, which can detect the image data output of the image sensor in the camera equipment, and monitor the image sensor output image data When performing a hash calculation on the output image data frame to obtain the first hash value of the image data frame, the hash calculation can be performed at the source of the image data frame (ie, the image sensor), which avoids The image data frame has been maliciously tampered with. In addition, each image data frame has image index information, the image index information includes time stamp information, and the first hash value of the image data frame and the image index information are recorded on the blockchain, so that the user of the image data can The first hash value is obtained from the blockchain based on the image index information, and the image data is verified based on the first hash value to verify whether the image data is credible.
根据本说明书实施例一个方面,提供了一种基于区块链的影像数据记录方法,所述方法由摄像设备来执行,所述方法包括:监测所述摄像设备中的图像传感器的影像数据输出;在监测到所述图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到所述图像数据帧的第一哈希值,所述图像数据帧具有图像索引信息,所述图像索引信息包括时间戳信息;以及将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。According to one aspect of the embodiments of this specification, there is provided a blockchain-based image data recording method, the method is executed by a camera device, and the method includes: monitoring the image data output of an image sensor in the camera device; When the image data frame of the image data output by the image sensor is monitored, a hash calculation is performed on the output image data frame to obtain the first hash value of the image data frame, and the image data frame has image index information, The image index information includes time stamp information; and the first hash value of the image data frame and the image index information are recorded in the blockchain.
可选地,在上述方面的一个示例中,所述摄像设备作为所述区块链的区块链网络的客户端,将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:将 所述图像数据帧的第一哈希值以及图像索引信息提供给所述区块链网络的对应区块链节点,以经由所述对应区块链节点记录至所述区块链。Optionally, in an example of the above aspect, the camera device serves as a client of the blockchain network of the blockchain, and records the first hash value and image index information of the image data frame to the The blockchain includes: providing the first hash value and image index information of the image data frame to the corresponding blockchain node of the blockchain network, so as to record to the corresponding blockchain node via the corresponding blockchain node Blockchain.
可选地,在上述方面的一个示例中,所述摄像设备作为所述区块链的区块链网络的区块链节点,将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:将所述图像数据帧的第一哈希值以及图像索引信息打包成区块,所述区块包括所述图像索引信息以及对应的第一哈希值;将所述区块广播给所述区块链网络的共识节点来进行共识处理;在所述共识节点达成共识后,将所述区块记录在所述区块链上。Optionally, in an example of the above aspect, the camera device serves as a blockchain node of the blockchain network of the blockchain, and records the first hash value and image index information of the image data frame To the blockchain includes: packing the first hash value and image index information of the image data frame into a block, the block including the image index information and the corresponding first hash value; The block is broadcast to the consensus node of the blockchain network for consensus processing; after the consensus node reaches a consensus, the block is recorded on the blockchain.
可选地,在上述方面的一个示例中,还包括:针对所述图像数据帧,使用所述摄像设备的私钥对所述图像数据帧的第一哈希值和图像索引信息进行签名;以及将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:将经过签名的所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。Optionally, in an example of the above aspect, the method further includes: for the image data frame, using the private key of the camera device to sign the first hash value and image index information of the image data frame; and Recording the first hash value and image index information of the image data frame to the blockchain includes: recording the first hash value and image index information of the signed image data frame in the block chain.
可选地,在上述方面的一个示例中,所述图像索引信息还包括所述摄像设备的设备标识和/或摄像位置信息。Optionally, in an example of the foregoing aspect, the image index information further includes the device identifier and/or the camera position information of the camera device.
可选地,在上述方面的一个示例中,所述图像数据帧的图像索引信息与所述图像数据帧的第一哈希值以及图像索引信息在所述区块链上的存储地址之间具有索引关系。Optionally, in an example of the above aspect, the image index information of the image data frame and the first hash value of the image data frame and the image index information are between the storage addresses on the blockchain. Index relationship.
可选地,在上述方面的一个示例中,将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:将所述图像数据帧、所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。Optionally, in an example of the above aspect, recording the first hash value and image index information of the image data frame to the blockchain includes: recording the image data frame and the image data frame The first hash value and image index information are recorded in the blockchain.
可选地,在上述方面的一个示例中,所述影像数据包括视频数据或静态图像数据。Optionally, in an example of the above aspect, the image data includes video data or still image data.
根据本说明书实施例的另一方面,还提供一种基于区块链的影像数据获取方法,所述方法由影像数据获取设备来执行,所述方法包括:从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,所述影像数据获取请求包括待获取影像数据的时间段信息;在所述区块链中查询所具有的时间戳信息与所述时间段信息匹配的图像数据帧;以及将所查询到的图像数据帧发送给所述影像数据请求方,以供所述影像数据请求方使用,其中,所述摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照上述所述的影像数据记录方式存储在所述区块链的区块中。According to another aspect of the embodiments of this specification, there is also provided a blockchain-based image data acquisition method, which is executed by an image data acquisition device, and the method includes: The image data acquisition request of the captured image data, the image data acquisition request includes the time period information of the image data to be acquired; the image data with the time stamp information that matches the time period information is queried in the blockchain And sending the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame shot by the camera device, the first image data frame The hope value and the image index information are stored in the block of the blockchain according to the above-mentioned image data recording method.
根据本说明书实施例的另一方面,还提供一种基于区块链的影像数据验证方法,所述方法由影像数据验证设备来执行,所述方法包括:从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,所述影像数据验证请求包括待验证影像数据 的图像数据帧以及对应时间戳信息;对所述待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值;在所述区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值;将各个第二哈希值与对应的第一哈希值进行比较;以及基于各个第二哈希值与对应的第一哈希值之间的比较结果,向所述影像数据验证方发送用于指示所述待验证影像数据是否验证通过的通知信息,其中,所述摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如上述所述的影像数据记录方式存储在所述区块链的区块中。According to another aspect of the embodiments of the present specification, there is also provided a blockchain-based image data verification method, the method is executed by an image data verification device, and the method includes: The image data verification request of the captured image data, the image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information; the image data frame of the image data to be verified is hashed to obtain the first Two hash values; query the first hash value corresponding to the timestamp information of each second hash value in the blockchain; compare each second hash value with the corresponding first hash value; And based on the comparison result between each second hash value and the corresponding first hash value, sending notification information to the image data verifier for indicating whether the image data to be verified has passed the verification, wherein the The first hash value and image index information of the image data frame captured by the imaging device are stored in the block of the blockchain according to the image data recording method described above.
根据本说明书实施例的另一方面,还提供一种基于区块链的影像数据记录装置,所述装置应用于摄像设备来执行,所述影像数据记录装置包括:监测单元监测所述摄像设备中的图像传感器的影像数据输出;哈希计算单元在监测到所述图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到所述图像数据帧的第一哈希值,所述图像数据帧具有图像索引信息,所述图像索引信息包括时间戳信息;以及上链处理单元将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。According to another aspect of the embodiments of the present specification, there is also provided a block chain-based image data recording device, the device is applied to a camera device to execute, the image data recording device includes: a monitoring unit monitors the camera device The image data output of the image sensor; when the hash calculation unit detects the image data frame of the image data output by the image sensor, it performs a hash calculation on the output image data frame to obtain the first hash of the image data frame Value, the image data frame has image index information, the image index information includes time stamp information; and the uplink processing unit records the first hash value of the image data frame and the image index information to the blockchain .
可选地,在上述方面的一个示例中,所述摄像设备作为所述区块链的区块链网络的客户端,所述上链处理单元将所述图像数据帧的第一哈希值以及图像索引信息提供给所述区块链网络的对应区块链节点,以经由所述对应区块链节点记录至所述区块链。Optionally, in an example of the above aspect, the camera device serves as a client of the blockchain network of the blockchain, and the uplink processing unit converts the first hash value of the image data frame and The image index information is provided to the corresponding blockchain node of the blockchain network to be recorded to the blockchain via the corresponding blockchain node.
可选地,在上述方面的一个示例中,所述摄像设备作为所述区块链的区块链网络的区块链节点,所述上链处理单元链包括:区块生成模块将所述图像数据帧的第一哈希值以及图像索引信息打包成区块,所述区块包括所述图像索引信息以及对应的第一哈希值;共识处理模块将所述区块广播给所述区块链网络的共识节点来进行共识处理;以及区块记录模块在所述共识节点达成共识后,将所述区块记录在所述区块链上。Optionally, in an example of the above aspect, the camera device is used as a blockchain node of the blockchain network of the blockchain, and the chain processing unit chain includes: a block generation module converts the image The first hash value and image index information of the data frame are packaged into a block, the block includes the image index information and the corresponding first hash value; the consensus processing module broadcasts the block to the block The consensus node of the chain network performs consensus processing; and the block recording module records the block on the blockchain after the consensus node reaches a consensus.
可选地,在上述方面的一个示例中,还包括:签名单元针对所述图像数据帧,使用所述摄像设备的私钥对所述图像数据帧的第一哈希值和图像索引信息进行签名;所述上链处理单元将经过签名的所述图像数据帧的第一哈希值及图像索引信息记录至所述区块链。Optionally, in an example of the foregoing aspect, the method further includes: for the image data frame, the signature unit uses the private key of the imaging device to sign the first hash value and the image index information of the image data frame The on-chain processing unit records the first hash value and image index information of the signed image data frame to the blockchain.
可选地,在上述方面的一个示例中,所述上链处理单元将所述图像数据帧、所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。Optionally, in an example of the foregoing aspect, the uplink processing unit records the image data frame, the first hash value of the image data frame, and image index information to the blockchain.
根据本说明书实施例的另一方面,还提供一种基于区块链的影像数据获取装置,包括:数据获取请求接收单元从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,所述影像数据获取请求包括待获取影像数据的时间段信息;数据查询 单元在所述区块链中查询所具有的时间戳信息与所述时间段信息匹配的图像数据帧;以及数据发送单元将所查询到的图像数据帧发送给所述影像数据请求方,以供所述影像数据请求方使用,其中,所述摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照如上述所述的影像数据记录方式存储在所述区块链的区块中。According to another aspect of the embodiments of the present specification, there is also provided a block chain-based image data acquisition device, including: a data acquisition request receiving unit receives an image data acquisition request for image data captured by a camera device from an image data requester The image data acquisition request includes the time period information of the image data to be acquired; the data query unit searches the blockchain for image data frames with time stamp information that matches the time period information; and a data sending unit Send the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame shot by the camera device, the first hash value of the image data frame, and The image index information is stored in the block of the blockchain according to the image data recording method described above.
根据本说明书实施例的另一方面,还提供一种基于区块链的影像数据验证装置,包括:数据验证请求接收单元从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,所述影像数据验证请求包括待验证影像数据的图像数据帧以及对应时间戳信息;哈希计算单元对所述待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值;哈希值查询单元在所述区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值;哈希值比较单元将各个第二哈希值与对应的第一哈希值进行比较;以及通知单元基于各个第二哈希值与对应的第一哈希值之间的比较结果,向所述影像数据验证方发送用于指示所述待验证影像数据是否验证通过的通知信息,其中,所述摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如上述任一所述的影像数据记录方式存储在所述区块链的区块中。According to another aspect of the embodiments of the present specification, there is also provided a blockchain-based image data verification device, including: a data verification request receiving unit receives an image data verification request for image data shot by a camera device from an image data verification party The image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information; the hash calculation unit performs a hash calculation on the image data frame of the image data to be verified to obtain the second hash value; The hash value query unit queries the first hash value corresponding to the time stamp information of each second hash value in the blockchain; the hash value comparison unit compares each second hash value with the corresponding first hash value And the notification unit, based on the comparison result between each second hash value and the corresponding first hash value, sends to the image data verifier an instruction to indicate whether the image data to be verified has passed the verification The notification information, wherein the first hash value and image index information of the image data frame captured by the camera device are stored in the block of the blockchain according to any one of the above-mentioned image data recording methods.
根据本说明书实施例的另一方面,还提供一种摄像设备,包括如上述任一所述的影像数据记录装置。According to another aspect of the embodiments of this specification, there is also provided an imaging device including the image data recording device as described in any one of the above.
根据本说明书实施例的另一方面,还提供一种电子设备,包括至少一个处理器及存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如上所述的影像数据记录方法。According to another aspect of the embodiments of this specification, there is also provided an electronic device, including at least one processor and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one The processor executes the image data recording method as described above.
根据本说明书实施例的另一方面,还提供一种机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如上所述的影像数据记录方法。According to another aspect of the embodiments of the present specification, a machine-readable storage medium is also provided, which stores executable instructions that, when executed, cause the machine to execute the image data recording method described above.
根据本说明书实施例的另一方面,还提供一种电子设备,包括:至少一个处理器;以及存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如上所述的影像数据获取方法或影像数据验证方法。According to another aspect of the embodiments of the present specification, there is also provided an electronic device, including: at least one processor; and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the At least one processor executes the image data acquisition method or the image data verification method as described above.
根据本说明书实施例另一方面,还提供一种机器可读存储介质,其存储有可执行指令,所述指令被执行时使得机器执行如上所述的影像数据获取方法或影像数据验证方法。According to another aspect of the embodiments of the present specification, a machine-readable storage medium is also provided, which stores executable instructions that, when executed, cause the machine to execute the image data acquisition method or the image data verification method described above.
附图说明Description of the drawings
通过参照下面的附图,可以实现对于本说明书内容的本质和优点的进一步理解。在 附图中,类似组件或特征可以具有相同的附图标记。附图是用来提供对本说明书实施例的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本说明书的实施例,但并不构成对本说明书的实施例的限制。在附图中:By referring to the following drawings, a further understanding of the nature and advantages of the contents of this specification can be achieved. In the drawings, similar components or features may have the same reference signs. The accompanying drawings are used to provide a further understanding of the embodiments of the specification, and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the specification, but do not constitute a limitation to the embodiments of the specification. In the attached picture:
图1示出本说明书实施例的示例环境的示意图;Fig. 1 shows a schematic diagram of an example environment of an embodiment of the present specification;
图2示出本说明书实施例的摄像设备与区块链网络构成的网络的示例架构示意图;FIG. 2 shows a schematic diagram of an example architecture of a network formed by a camera device and a blockchain network according to an embodiment of the present specification;
图3示出本说明书实施例的基于区块链的影像数据记录方法的示例性流程图;Fig. 3 shows an exemplary flow chart of a method for recording image data based on a blockchain according to an embodiment of the present specification;
图4示出由光学镜头和图像传感器构成的摄像设备生成图像数据帧的示例性示意图;Fig. 4 shows an exemplary schematic diagram of image data frames generated by a camera device composed of an optical lens and an image sensor;
图5示出本说明书实施例的共识过程的示例性示意图;FIG. 5 shows an exemplary schematic diagram of the consensus process of the embodiment of the present specification;
图6示出本说明书实施例的共识过程中的预准备消息、准备消息以及确认消息的格式的示例性示意图;FIG. 6 shows an exemplary schematic diagram of the format of a pre-preparation message, a preparation message, and a confirmation message in the consensus process of the embodiment of the present specification;
图7示出本说明书实施例的基于区块链的影像数据获取方法的示例性流程图;Fig. 7 shows an exemplary flow chart of a method for acquiring image data based on a blockchain according to an embodiment of the present specification;
图8示出本说明书实施例的基于区块链的影像数据验证方法的示例性流程图;FIG. 8 shows an exemplary flowchart of a method for verifying image data based on a blockchain according to an embodiment of the present specification;
图9示出本说明书实施例的基于区块链的影像数据记录装置800的示例性方框图;FIG. 9 shows an exemplary block diagram of a block chain-based image data recording device 800 according to an embodiment of the present specification;
图10示出本说明书实施例的基于区块链的影像数据获取装置900的示例性方框图;FIG. 10 shows an exemplary block diagram of a block chain-based image data acquisition device 900 according to an embodiment of the present specification;
图11示出本说明书实施例的基于区块链的影像数据验证装置1100的示例性方框图;FIG. 11 shows an exemplary block diagram of a block chain-based image data verification device 1100 according to an embodiment of the present specification;
图12示出本说明书实施例的用于将影像数据记录到区块链的方法的电子设备的示例性方框图;FIG. 12 shows an exemplary block diagram of an electronic device used in a method for recording image data to a blockchain according to an embodiment of the present specification;
图13示出本说明书实施例的用于从区块链获取影像数据的方法的电子设备的示例性方框图;和FIG. 13 shows an exemplary block diagram of an electronic device used in the method for obtaining image data from a blockchain according to an embodiment of the present specification; and
图14示出本说明书实施例的用于基于区块链的影像数据验证的方法的电子设备的示例性方框图。FIG. 14 shows an exemplary block diagram of an electronic device used in a method for verifying image data based on a blockchain according to an embodiment of the present specification.
具体实施方式Detailed ways
以下将参考示例实施方式讨论本文描述的主题。应该理解,讨论这些实施方式只是为了使得本领域技术人员能够更好地理解从而实现本文描述的主题,并非是对权利要求书中所阐述的保护范围、适用性或者示例的限制。可以在不脱离本说明书内容的保护范围的情况下,对所讨论的元素的功能和排列进行改变。各个示例可以根据需要,省略、 替代或者添加各种过程或组件。另外,相对一些示例所描述的特征在其它例子中也可以进行组合。The subject described herein will be discussed below with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and realize the subject described herein, and is not to limit the scope of protection, applicability, or examples set forth in the claims. The function and arrangement of the discussed elements can be changed without departing from the scope of protection of the content of this specification. Various examples can omit, substitute, or add various processes or components as needed. In addition, features described with respect to some examples can also be combined in other examples.
如本文中使用的,术语“包括”及其变型表示开放的术语,含义是“包括但不限于”。术语“基于”表示“至少部分地基于”。术语“一个实施例”和“一实施例”表示“至少一个实施例”。术语“另一个实施例”表示“至少一个其他实施例”。术语“第一”、“第二”等可以指代不同的或相同的对象。下面可以包括其他的定义,无论是明确的还是隐含的。除非上下文中明确地指明,否则一个术语的定义在整个说明书中是一致的。As used herein, the term "including" and its variations mean open terms, meaning "including but not limited to". The term "based on" means "based at least in part on." The terms "one embodiment" and "an embodiment" mean "at least one embodiment." The term "another embodiment" means "at least one other embodiment." The terms "first", "second", etc. may refer to different or the same objects. Other definitions can be included below, whether explicit or implicit. Unless clearly indicated in the context, the definition of a term is consistent throughout the specification.
区块链是一种按照时间顺序来将数据区块顺序相连组合而成的链式数据结构,并且以密码学方式保证数据区块不可篡改和不可伪造。区块链中的每个区块通过包括该区块链中紧接其之前的前一个区块的加密散列而链接到该前一个区块。每个区块还包括时间戳、该区块的加密哈希以及一个或多个交易。对已经被区块链网络的节点验证的交易进行哈希处理并形成Merkle树。在Merkle树中,对叶节点处的数据进行哈希处理,并且针对Merkle树的每个分支,在该分支的根处级联该分支的所有哈希值。针对Merkle树执行上述处理,直到整个Merkle树的根节点。Merkle树的根节点存储代表该Merkle树中的所有数据的哈希值。当一个哈希值声称是Merkle树中存储的交易时,可以通过判断该哈希值是否与Merkle树的结构一致来进行快速验证。Blockchain is a chain data structure that connects and combines data blocks sequentially in chronological order, and cryptographically ensures that the data blocks cannot be tampered with or forged. Each block in the blockchain is linked to the previous block by including the encrypted hash of the immediately preceding block in the blockchain. Each block also includes a timestamp, a cryptographic hash of the block, and one or more transactions. The transaction that has been verified by the nodes of the blockchain network is hashed and a Merkle tree is formed. In the Merkle tree, the data at the leaf nodes is hashed, and for each branch of the Merkle tree, all the hash values of the branch are concatenated at the root of the branch. The above processing is performed on the Merkle tree until the root node of the entire Merkle tree. The root node of the Merkle tree stores hash values representing all data in the Merkle tree. When a hash value claims to be a transaction stored in the Merkle tree, it can be quickly verified by judging whether the hash value is consistent with the structure of the Merkle tree.
区块链网络是用于管理、更新和维护一个或多个区块链结构的计算节点网络。在本说明书中,区块链网络可以包括公有区块链网络、私有区块链网络或联盟区块链网络。The blockchain network is a network of computing nodes used to manage, update and maintain one or more blockchain structures. In this specification, the blockchain network may include a public blockchain network, a private blockchain network, or a consortium blockchain network.
在公有区块链网络中,共识过程由共识网络的节点控制。例如,在公有区块链网络中可以存在成千上万个实体协作处理,每个实体操作该公有区块链网络中的至少一个节点。因此,公有区块链网络可以被认为是参与实体的公有网络。在一些示例中,大多数实体(节点)必须按序对每个区块进行签名,并且将签名后的区块添加到区块链网络的区块链中。公有区块链网络的示例可以包括特定对等支付网络。In the public blockchain network, the consensus process is controlled by the nodes of the consensus network. For example, there may be thousands of entities in a public blockchain network for collaborative processing, and each entity operates at least one node in the public blockchain network. Therefore, the public blockchain network can be considered as a public network of participating entities. In some examples, most entities (nodes) must sign each block in sequence, and add the signed block to the blockchain of the blockchain network. Examples of public blockchain networks may include specific peer-to-peer payment networks.
公有区块链网络支持公有交易。公有交易在公有区块链网络内的所有节点之间共享,并且存储在全局区块链中。全局区块链是指跨所有节点复制的区块链。为了达成共识(例如,同意向区块链添加区块),在公有区块链网络内实现共识协议。共识协议的示例包括但不限于:工作量证明(POW,proof-of-work),权益证明(POS,proof-of-stake)和权威证明(POA,proof-of-authority)。The public blockchain network supports public transactions. Public transactions are shared among all nodes in the public blockchain network and stored in the global blockchain. A global blockchain refers to a blockchain that is replicated across all nodes. In order to reach a consensus (for example, agree to add a block to the blockchain), a consensus agreement is implemented in the public blockchain network. Examples of consensus protocols include but are not limited to: proof-of-work (POW), proof-of-stake (POS), and proof-of-authority (POA).
私有区块链网络被提供来用于特定实体。私有区块链网络中的各个节点的读写权限 被严格控制。因此,私有区块链网络通常也称为许可网络,其对允许谁参与网络以及的网络参与水平(例如,仅在某些交易情形下)进行限制。在私有区块链网络中,可以使用各种类型的访问控制机制(例如,现有参与方对添加新实体进行投票,监管机构控制许可等)。Private blockchain networks are provided for specific entities. The read and write permissions of each node in the private blockchain network are strictly controlled. Therefore, a private blockchain network is usually also called a permissioned network, which restricts who is allowed to participate in the network and the level of network participation (for example, only in certain transaction situations). In a private blockchain network, various types of access control mechanisms can be used (for example, existing participants vote to add new entities, regulatory agencies control permissions, etc.).
联盟区块链网络在参与实体之间是私有的。在联盟区块链网络中,共识过程由授权节点控制。例如,由若干个(例如,10个)实体(例如,金融机构,保险公司)组成的联盟可以操作联盟区块链网络,每个实体操作该联盟区块链网络中的至少一个节点。因此,联盟区块链网络可以被认为是参与实体的私有网络。在一些示例中,每个参与实体(节点)必须按序对每个区块进行签名,并将该区块添加到区块链。在一些示例中,可以由参与实体(节点)的子集(例如,至少7个实体)来对每个区块进行签名,并将该区块添加到区块链。The alliance blockchain network is private among participating entities. In the alliance blockchain network, the consensus process is controlled by authorized nodes. For example, a consortium composed of several (for example, 10) entities (for example, financial institutions, insurance companies) can operate a consortium blockchain network, and each entity operates at least one node in the consortium blockchain network. Therefore, the consortium blockchain network can be considered as a private network of participating entities. In some examples, each participating entity (node) must sign each block in sequence and add the block to the blockchain. In some examples, each block may be signed by a subset of participating entities (nodes) (for example, at least 7 entities), and the block may be added to the blockchain.
图1示出了本说明书实施例的示例环境100的示意图。如图1所示,示例环境100允许实体参与区块链网络102。区块链网络102例如可以是公有链、私有链或联盟链的区块链网络。示例环境100可以包括计算设备104、106、108、110、112和网络114。在一实施例中,网络114可以包括局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)、因特网或其组合,并连接至网站、用户设备(例如计算设备)和后端系统。在一实施例中,计算设备104、106、108、110、112可以通过有线和/或无线通信方式访问网络114。Fig. 1 shows a schematic diagram of an example environment 100 of an embodiment of the present specification. As shown in FIG. 1, the example environment 100 allows entities to participate in the blockchain network 102. The blockchain network 102 may be, for example, a public blockchain, a private blockchain, or a consortium blockchain blockchain network. The example environment 100 may include computing devices 104, 106, 108, 110, 112, and a network 114. In an embodiment, the network 114 may include a local area network (LAN), a wide area network (WAN), the Internet, or a combination thereof, and is connected to a website, a user device (such as a computing device), and a back-end system. In an embodiment, the computing devices 104, 106, 108, 110, 112 may access the network 114 through wired and/or wireless communication.
在某些情况下,计算设备106、108可以是云计算系统的节点(未显示),或者每个计算设备106、108可以是单独的云计算系统,包括由网络互连并作为分布式处理系统工作的多台计算机。In some cases, the computing devices 106, 108 may be nodes of a cloud computing system (not shown), or each computing device 106, 108 may be a separate cloud computing system, including being interconnected by a network and acting as a distributed processing system Multiple computers at work.
在一实施例中,计算设备104~108可以运行任何适当的计算系统,使其能够作为区块链网络102中的节点。例如,计算设备104~108可以包括但不限于服务器、台式计算机、笔记本电脑、平板电脑计算设备和智能手机。在一实施例中,计算设备104~108可以归属于相关实体并用于实现相应的服务,例如,该服务可以用于对某一实体或多个实体之间的交易进行管理。In an embodiment, the computing devices 104-108 can run any appropriate computing system to enable them to serve as nodes in the blockchain network 102. For example, the computing devices 104-108 may include, but are not limited to, servers, desktop computers, notebook computers, tablet computing devices, and smart phones. In an embodiment, the computing devices 104 to 108 may be attributed to related entities and used to implement corresponding services. For example, the service may be used to manage transactions between a certain entity or multiple entities.
在一实施例中,计算设备104~108分别存储有区块链网络102对应的区块链账本。计算设备104可以是(或包含)用于提供浏览器功能的网络服务器,该网络服务器可基于网络114提供与区块链网络102相关的可视化信息。在一些情况下,计算设备104可以不参与区块验证,而是监控区块链网络102以确定其他节点(譬如可以包括计算设备 106-108)何时达成共识,并据此生成相应的区块链可视化用户界面。In an embodiment, the computing devices 104-108 respectively store the blockchain ledger corresponding to the blockchain network 102. The computing device 104 may be (or include) a web server for providing browser functions, and the web server may provide visual information related to the blockchain network 102 based on the network 114. In some cases, the computing device 104 may not participate in block verification, but monitor the blockchain network 102 to determine when other nodes (for example, computing devices 106-108) reach a consensus, and generate corresponding blocks accordingly. Chain visual user interface.
在一实施例中,计算设备110和112可以是与区块链网络102相连的客户端设备。例如,计算设备110可以是医疗机构平台处的终端设备,以及计算设备112可以是广告监管平台处的终端设备。计算设备110和112可以包括但不限于服务器、台式计算机、笔记本电脑、平板电脑计算设备和智能手机。In an embodiment, the computing devices 110 and 112 may be client devices connected to the blockchain network 102. For example, the computing device 110 may be a terminal device at a medical institution platform, and the computing device 112 may be a terminal device at an advertising supervision platform. Computing devices 110 and 112 may include, but are not limited to, servers, desktop computers, notebook computers, tablet computing devices, and smart phones.
在一实施例中,计算设备104可以接收客户端设备(例如计算设备110或计算设备112)针对区块链可视化用户界面发起的请求。在一些情况下,区块链网络102的节点也可以作为客户端设备,比如计算设备108的用户可以使用运行在计算设备108上的浏览器向计算设备104发送上述请求。In an embodiment, the computing device 104 may receive a request initiated by a client device (for example, the computing device 110 or the computing device 112) for the blockchain visualization user interface. In some cases, the nodes of the blockchain network 102 can also serve as client devices. For example, a user of the computing device 108 can use a browser running on the computing device 108 to send the aforementioned request to the computing device 104.
响应于上述请求,计算设备104可以基于存储的区块链账本生成区块链可视化用户界面(如网页),并将生成的区块链可视化用户界面发送给请求的客户端设备。如果区块链网络102是私有类型或联盟类型的区块链网络,对区块链可视化用户界面的请求可以包括用户授权信息,在生成区块链可视化用户界面并发送给请求的客户端设备之前,可以由计算设备104对该用户授权信息进行验证,并在验证通过后返回相应的区块链可视化用户界面。In response to the above request, the computing device 104 may generate a blockchain visual user interface (such as a web page) based on the stored blockchain ledger, and send the generated blockchain visual user interface to the requesting client device. If the blockchain network 102 is a private or consortium blockchain network, the request for the blockchain visualization user interface may include user authorization information, before the blockchain visualization user interface is generated and sent to the requesting client device , The computing device 104 may verify the user authorization information, and return to the corresponding blockchain visual user interface after the verification is passed.
区块链可视化用户界面可以显示在客户端设备上(例如可显示在图1所示的用户界面116中)。当区块链账本发生更新时,用户界面116的显示内容也可以随之发生更新。此外,用户与用户界面116的交互可能导致对其他用户界面的请求,例如显示区块列表、区块详情、交易列表、交易详情、账户列表、账户详情、合约列表、合约详情或者用户对区块链网络实施搜索而产生的搜索结果页面等。The blockchain visual user interface may be displayed on the client device (for example, it may be displayed in the user interface 116 shown in FIG. 1). When the blockchain ledger is updated, the display content of the user interface 116 can also be updated accordingly. In addition, the user's interaction with the user interface 116 may result in requests for other user interfaces, such as displaying block lists, block details, transaction lists, transaction details, account lists, account details, contract lists, contract details, or user requests for blocks The search result page generated by the implementation of the search on the chain network, etc.
图2示出了本说明书实施例的摄像设备与区块链网络构成的网络200的示例架构示意图。如图2所示,摄像设备210作为区块链网络214的客户端,与服务器设备220通信连接,服务器设备220是区块链网络214中的区块链节点或者其组成部分。图2示出的服务器设备220连接摄像设备210仅作为一个示例,服务器设备220还可以与其他多个摄像设备通信连接。FIG. 2 shows a schematic diagram of an exemplary architecture of a network 200 formed by a camera device and a blockchain network in an embodiment of the present specification. As shown in FIG. 2, the camera device 210 serves as a client of the blockchain network 214 and is connected to a server device 220 in communication. The server device 220 is a blockchain node in the blockchain network 214 or a component thereof. The connection of the server device 220 to the camera device 210 shown in FIG. 2 is only an example, and the server device 220 may also be communicatively connected with other multiple camera devices.
摄像设备210进行拍摄并生成影像数据,比如图像或者视频。摄像设备210将所生成的影像数据发送给服务器设备220。例如,写字楼安装有若干摄像设备以用来对写字楼内进行监控,这些摄像设备都与写字楼设置的服务器设备网络连接,摄像设备在拍摄过程中实时生成视频数据,并实时将视频数据发送给服务器设备进行存储。The imaging device 210 shoots and generates image data, such as images or videos. The imaging device 210 transmits the generated image data to the server device 220. For example, office buildings are equipped with several camera equipment to monitor the office building. These camera equipment are connected to the server equipment in the office building. The camera equipment generates video data in real time during the shooting process and sends the video data to the server equipment in real time. Store it.
服务器设备220作为区块链网络214中的区块链节点或其组成部分,可将接收到的影像数据上链至区块链216进行存储,这样可避免已存储的影像数据被删除或者被篡改。The server device 220, as a blockchain node or part of the blockchain network 214, can upload the received image data to the blockchain 216 for storage, which can prevent the stored image data from being deleted or tampered with .
此外,影像数据获取装置230和影像数据验证装置240也可以作为区块链网络214中的区块链节点或其组成部分,影像数据获取装置230可以从区块链216上查询并获取图像数据帧,影像数据验证装置240可以从区块链216上查询对应的第一哈希值,并基于第一哈希值对待验证图像数据的图像数据帧进行验证。In addition, the image data acquisition device 230 and the image data verification device 240 can also be used as a blockchain node or a component part of the blockchain network 214, and the image data acquisition device 230 can query and acquire image data frames from the blockchain 216 The image data verification device 240 can query the corresponding first hash value from the blockchain 216, and verify the image data frame of the image data to be verified based on the first hash value.
在另一示例中,摄像设备可是区块链网络中的区块链节点或其组成部分。在该示例中,摄像设备在生成影像数据后可直接将所生成的影像数据打包上链至区块链进行存储。In another example, the camera device may be a blockchain node or a component part of the blockchain network. In this example, after the camera device generates the image data, the generated image data can be directly packaged and chained to the blockchain for storage.
在另一示例中,摄像设备与服务器设备连接,服务器设备与区块链网络中的区块链节点通信连接。在该示例中,摄像设备可以将生成的影像数据发送给服务器设备,服务器设备再将接收到的影像数据发送给通信连接的区块链节点,再由区块链节点将影像数据打包上链至区块链以进行存储。In another example, the camera device is connected to the server device, and the server device is communicatively connected to the blockchain node in the blockchain network. In this example, the camera device can send the generated image data to the server device, the server device then sends the received image data to the communication connected blockchain node, and then the blockchain node will package the image data and upload it to the chain. Blockchain for storage.
图3示出了本说明书实施例的基于区块链的影像数据记录方法的一个示例的流程图。影像数据记录方法可以由摄像设备来执行,本说明书实施例中的摄像设备可以包括网络摄像机、监控摄像头、可以联网的行车记录仪以及可以联网的相机等中的任一种。下面以网络摄像机为例进行说明。如图3所示,在块310,监测摄像设备中的图像传感器的影像数据输出。FIG. 3 shows a flowchart of an example of a method for recording image data based on a blockchain according to an embodiment of the present specification. The image data recording method can be executed by a camera device. The camera device in the embodiment of this specification can include any one of a network camera, a surveillance camera, a driving recorder that can be networked, and a camera that can be networked. The following takes a network camera as an example for description. As shown in FIG. 3, at block 310, the image data output of the image sensor in the camera device is monitored.
摄像设备至少包括光学镜头和图像传感器,摄像设备的光学镜头可由若干透镜系统组成。The imaging device includes at least an optical lens and an image sensor, and the optical lens of the imaging device can be composed of several lens systems.
图4示出了由光学镜头和图像传感器构成的摄像设备生成图像数据帧的一个示例的示意图。如图4所示,当摄像设备进行拍摄时,被拍摄对象的光线经过光学镜头的折射,在图像传感器的成像面上生成光信号。图像传感器采集生成的光信号,并将采集的光信号转换成电信号,并通过编码方式来输出用于呈现成一帧图像的图像数据,例如,图4所示的依次输出第1帧图像、第2帧图像、第3帧图像和第4帧图像。图像传感器可以包括CCD(charge coupled device,电荷耦合器件)、CMOS(Complementary Metal Oxide Semiconductor,互补金属氧化物半导体)以及胶片等。FIG. 4 shows a schematic diagram of an example of image data frames generated by an imaging device composed of an optical lens and an image sensor. As shown in FIG. 4, when the imaging device is shooting, the light of the subject is refracted by the optical lens, and a light signal is generated on the imaging surface of the image sensor. The image sensor collects the generated light signal, converts the collected light signal into an electrical signal, and outputs image data for rendering into a frame of image through the encoding method. For example, as shown in Figure 4, the first frame image and the 2 frames of image, 3rd frame of image and 4th frame of image. The image sensor may include CCD (charge coupled device, charge coupled device), CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide semiconductor), film, etc.
在本说明书的一个示例中,影像数据可以包括视频数据或静态图像数据,静态图像数据可以是一张图像。当记录的影像数据是静态图像数据时,图像传感器输出的一帧图像数据帧即为所需记录的静态图像数据。当记录的影像数据是视频时,图像传感器输出 的若干图像数据帧构成的视频即为所需记录的视频数据。In an example of this specification, the image data may include video data or still image data, and the still image data may be an image. When the recorded image data is still image data, one frame of image data output by the image sensor is the still image data to be recorded. When the recorded image data is video, the video composed of several image data frames output by the image sensor is the video data to be recorded.
在块320,在监测到图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到图像数据帧的第一哈希值。In block 320, when the image data frame of the image data output by the image sensor is monitored, a hash calculation is performed on the output image data frame to obtain the first hash value of the image data frame.
哈希计算是将(作为字符串数据提供的)图像数据帧转换为固定长度的第一哈希值(也被作为字符串数据提供)的过程。通过对图像数据帧进行哈希计算后,即使图像数据帧出现轻微更改,也会导致得到完全不同的第一哈希值。第一哈希值通常是通过使用哈希函数来对图像数据帧进行哈希计算而生成的。哈希函数的示例包括但不限于安全散列算法(SHA)-256,其输出256比特的第一哈希值。Hash calculation is a process of converting an image data frame (provided as character string data) into a fixed-length first hash value (also provided as character string data). After performing a hash calculation on the image data frame, even if the image data frame is slightly changed, a completely different first hash value will be obtained. The first hash value is usually generated by using a hash function to perform a hash calculation on the image data frame. Examples of hash functions include, but are not limited to, Secure Hash Algorithm (SHA)-256, which outputs a 256-bit first hash value.
当影像数据是视频数据时,视频数据由多帧图像数据帧构成,图像传感器按照拍摄的时间顺序依次输出各个图像数据帧。当图像传感器每输出一帧图像数据帧时,摄像设备对输出的该图像数据帧进行哈希计算以得到该图像数据帧的第一哈希值,直至对构成该视频数据的所有图像数据帧都执行了哈希计算。图像数据帧与第一哈希值是一一对应的,不同的图像数据帧对应的第一哈希值不同。When the image data is video data, the video data is composed of multiple image data frames, and the image sensor sequentially outputs each image data frame according to the time sequence of shooting. When the image sensor outputs a frame of image data each time, the camera device performs a hash calculation on the output image data frame to obtain the first hash value of the image data frame, until all the image data frames constituting the video data are calculated. A hash calculation is performed. The image data frame has a one-to-one correspondence with the first hash value, and different image data frames correspond to different first hash values.
摄像设备生成的每一图像数据帧都是由摄像设备中的图像传感器生成的,所生成的图像数据帧再经由摄像设备中的其他部件进行后续处理,比如,将多帧图像合成为一个视频,或者,将所生成的图像或者视频存储至内存卡或传输给其他设备。因此,影像数据的图像数据帧在生成并由图像传感器输出时就进行哈希计算得到对应的第一哈希值,避免了图像数据帧在后续处理过程中以及传输过程中被删除或被篡改,从而使得生成的影像数据的源头可信。Each image data frame generated by the camera device is generated by the image sensor in the camera device, and the generated image data frame is then processed by other components in the camera device, such as combining multiple frames of images into one video. Or, store the generated image or video to a memory card or transfer it to other devices. Therefore, when the image data frame of the image data is generated and output by the image sensor, a hash calculation is performed to obtain the corresponding first hash value, which prevents the image data frame from being deleted or tampered with during subsequent processing and transmission. This makes the source of the generated image data believable.
在本说明书的一个示例中,图像数据帧具有图像索引信息,图像索引信息与图像数据帧是一一对应的,图像索引信息可以用于在区块链上查询对应的图像数据帧。In an example of this specification, the image data frame has image index information, and the image index information has a one-to-one correspondence with the image data frame, and the image index information can be used to query the corresponding image data frame on the blockchain.
图像索引信息可以包括时间戳信息,每一图像数据帧的图像索引信息所包括的时间戳信息是该图像数据帧对应的时间戳。例如,图像数据帧对应的时间戳是:2020年1月25日12时3分20秒,则该图像数据帧的图像索引信息中的时间戳信息为:2020年1月25日12时3分20秒。The image index information may include time stamp information, and the time stamp information included in the image index information of each image data frame is a time stamp corresponding to the image data frame. For example, the time stamp corresponding to the image data frame is: January 25, 2020 12:3:20, then the time stamp information in the image index information of the image data frame is: January 25, 2020 12:3 20 seconds.
在另一示例中,图像索引信息还可以包括摄像设备的设备标识和/或摄像位置信息。设备标识可以用于指示生成图像数据帧的摄像设备,在一个示例中,每一图像数据帧对应唯一的摄像设备,每个摄像设备对应唯一的设备标识,则每一图像数据帧对应唯一的设备标识。In another example, the image index information may also include the device identification of the camera device and/or the camera location information. The device ID can be used to indicate the camera device that generates the image data frame. In one example, each image data frame corresponds to a unique camera device, and each camera device corresponds to a unique device ID, so each image data frame corresponds to a unique device Logo.
摄像位置信息可以用于指示图像数据帧对应的拍摄位置。在一个示例中,摄像设备设置有GPS等定位装置,当摄像设备进行拍摄时,定位装置可以实时地为每一图像数据帧定位,以确定每一图像数据帧的拍摄位置。在一个示例中,拍摄位置信息可以用世界坐标表示,还可以用文字描述,例如,拍摄位置信息为:北京市朝阳区。The shooting position information can be used to indicate the shooting position corresponding to the image data frame. In an example, the camera equipment is provided with a positioning device such as GPS. When the camera equipment is shooting, the positioning device can locate each image data frame in real time to determine the shooting position of each image data frame. In an example, the shooting location information can be represented by world coordinates, or can be described by text. For example, the shooting location information is: Chaoyang District, Beijing.
在该示例中,每一图像数据帧具有包括有时间戳、设备标识以及摄像位置信息等多种信息的图像索引信息,这些信息可以从不同维度来表征对应的图像数据帧。后续将图像数据帧对应的多种信息记录在区块链上,从而利用这些信息可以从不同维度来验证图像数据帧是否可信,提高了图像数据帧的可信度。In this example, each image data frame has image index information including a variety of information such as a timestamp, device identification, and camera position information, which can represent the corresponding image data frame from different dimensions. Subsequently, various information corresponding to the image data frame is recorded on the blockchain, so that the information can be used to verify the credibility of the image data frame from different dimensions, and the credibility of the image data frame is improved.
在块330,将图像数据帧的第一哈希值以及图像索引信息记录至区块链。In block 330, the first hash value of the image data frame and the image index information are recorded to the blockchain.
在一个示例中,属于同一图像数据帧的第一哈希值和图像索引信息可以被打包成一个区块记录在区块链上。In an example, the first hash value and image index information belonging to the same image data frame may be packaged into a block and recorded on the blockchain.
在一个示例中,摄像设备作为区块链的区块链网络的区块链节点。摄像设备在获得图像数据帧的第一哈希值和图像索引信息后,可以将图像数据帧的第一哈希值以及图像索引信息打包成区块,该区块包括图像索引信息以及对应的第一哈希值。In one example, the camera device serves as a blockchain node of the blockchain network of the blockchain. After obtaining the first hash value and image index information of the image data frame, the imaging device can pack the first hash value and image index information of the image data frame into a block, which includes the image index information and the corresponding first hash value. A hash value.
然后,将区块广播给区块链网络的共识节点来进行共识处理,在共识节点达成共识后,将区块记录在区块链上。Then, the block is broadcast to the consensus nodes of the blockchain network for consensus processing. After the consensus node reaches a consensus, the block is recorded on the blockchain.
图5示出了本说明书实施例的共识过程的示例的示意图。在本说明书中,第一哈希值和图像索引信息可以被认为是区块链中的交易数据。在图5的示例中,摄像设备所在的区块链节点作为区块链网络的主节点(即,记账节点,下文中称为主节点R 0)。 FIG. 5 shows a schematic diagram of an example of the consensus process of the embodiment of the present specification. In this specification, the first hash value and image index information can be considered as transaction data in the blockchain. In the example of FIG. 5, the blockchain node where the camera device is located serves as the master node of the blockchain network (ie, the accounting node, hereinafter referred to as the master node R 0 ).
主节点R 0将打包而成的区块广播给区块链网络中的所有共识节点来进行共识处理,例如,主节点R 0将打包而成的区块广播给备份节点R 1、R 2以及R 3进行共识处理。注意,共识过程被示为包括4个网络节点R 0,R 1,R 2和R 3仅用于说明目的,共识过程也可以包括任何合适数量的网络节点。 The master node R 0 broadcasts the packaged block to all consensus nodes in the blockchain network for consensus processing. For example, the master node R 0 broadcasts the packaged block to the backup nodes R 1 , R 2 and R 3 performs consensus processing. Note that the consensus process is shown as including 4 network nodes R 0 , R 1 , R 2 and R 3 for illustration purposes only, and the consensus process can also include any suitable number of network nodes.
在本说明书的实施例中,共识过程可采用PoW(工作量证明算法)、PoS(权益证明算法)和PBFT(实用拜占庭容错算法)等等实现。下面以PBFT共识过程为例来进行说明。In the embodiments of this specification, the consensus process can be implemented using PoW (Proof of Work Algorithm), PoS (Proof of Stake Algorithm), PBFT (Practical Byzantine Fault Tolerance Algorithm), and so on. The following takes the PBFT consensus process as an example to illustrate.
如图5所示,PBFT共识处理的过程包括:预准备阶段(Pre-prepare)510、准备阶段(Prepare)520以及确认阶段(Commit)530。As shown in FIG. 5, the process of PBFT consensus processing includes: a pre-prepare phase (Pre-prepare) 510, a preparation phase (Prepare) 520, and a confirmation phase (Commit) 530.
具体地,在510,主节点R 0对要记录到区块链中的车辆数据片段打包为消息m, 然后生成预准备消息Pre-prepare,并且在给定的时间间隔内,将预准备消息Pre-prepare发送(例如,广播)给备份节点R 1、R 2和R 3。预准备消息Pre-prepare表明主节点R 0正在启动共识过程。 Specifically, at 510, the master node R 0 packages the vehicle data fragments to be recorded in the blockchain into a message m, and then generates a pre-prepare message Pre-prepare, and in a given time interval, the pre-prepare message Pre -prepare to send (for example, broadcast) to the backup nodes R 1 , R 2 and R 3 . The pre-prepare message Pre-prepare indicates that the master node R 0 is starting the consensus process.
在本说明书的实施例中,如图6所示,预准备消息Pre-prepare的格式可以为:<<PRE-PREPARE,epoch,seq,D(m),signature-p>,m,j>。这里,“PRE-PREPARE”表示预准备消息的协议标识,“epoch”表示R 0作为主节点的时代,“seq”表示所需共识的提议(即,向区块链216增加该区块)的提议编号,“D(m)”表示请求消息集合的摘要,“signature-p”表示R 0的签名,“m”表示请求消息的具体内容(即,区块中的各条认证信息的具体内容),以及“j”表示R 0的节点标识。这里,D(m)通过对区块中的各条认证信息集合进行哈希计算而得到。 In the embodiment of this specification, as shown in FIG. 6, the format of the pre-prepare message Pre-prepare may be: <<PRE-PREPARE, epoch, seq, D(m), signature-p>, m, j>. Here, "PRE-PREPARE" represents the protocol identifier of the pre-prepared message, "epoch" represents the era when R 0 is the master node, and "seq" represents the proposal of the required consensus (that is, adding the block to the blockchain 216) Proposal number, "D(m)" represents the summary of the request message set, "signature-p" represents the signature of R 0 , and "m" represents the specific content of the request message (ie, the specific content of each piece of authentication information in the block) ), and "j" represents the node ID of R 0. Here, D(m) is obtained by hashing each set of authentication information in the block.
在准备阶段520,对于每个备份节点(R 1、R 2或R 3),在接收到预准备消息Pre-prepare并检测预准备消息Pre-prepare合法后,可以将预准备消息Pre-prepare存储在本地日志中,并生成用于响应预准备消息Pre-prepare的准备消息Prepare,再将所生成的准备消息Prepare广播至其他节点。准备消息Prepare指示备份节点已从主节点接收到预准备消息Pre-prepare,并且正在响应预准备消息Pre-prepare发送应答。 In the preparation phase 520, for each backup node (R 1 , R 2 or R 3 ), after receiving the pre-prepare message Pre-prepare and detecting that the pre-prepare message is legal, the pre-prepare message Pre-prepare can be stored In the local log, a preparation message Prepare used to respond to the pre-prepare message Pre-prepare is generated, and then the generated preparation message Prepare is broadcast to other nodes. The preparation message Prepare indicates that the backup node has received the pre-prepare message Pre-prepare from the master node, and is sending a response in response to the pre-prepare message Pre-prepare.
相应地,每个备份节点也会接收到其他备份节点发送的预准备消息Pre-prepare。以备份节点R 1为例,备份节点R 1接收到主节点R 0发送的预准备消息Pre-prepare之后,会将生成的准备消息Prepare广播至主节点R 0、备份节点R 2和R 3。相应地,备份节点R 1也会接收到主节点R 0、备份节点R 2和R 3发送的准备消息Prepare。 Correspondingly, each backup node will also receive the pre-prepare message Pre-prepare sent by other backup nodes. After the backup nodes R 1 in an example, the backup nodes R 1 R 0 master node receives the prepared Pre-prepare message transmitted will broadcast the resulting preparation message to the master node Prepare R 0, R 2 and backup node R 3. Correspondingly, the backup node R 1 will also receive the prepare message Prepare sent by the master node R 0 , the backup nodes R 2 and R 3.
在本说明书中,备份节点广播的准备消息Prepare可以用于表示该备份节点在准备阶段520所做出的共识承诺。In this specification, the prepare message Prepare broadcast by the backup node may be used to indicate the consensus commitment made by the backup node in the preparation phase 520.
在本说明书中,如图6所示,准备消息Prepare的格式可以是:<PREPARE,epoch,seq,D(m),i,signature-i>。这里,“PREPARE”表示准备消息Prepare的协议标识,“i”表示发送准备消息Prepare的节点的节点标识,“signature-i”表示发送准备消息Prepare的节点的签名。准备消息Prepare中的“epoch”、“seq”以及“D(m)”的含义与上述预准备消息Pre-prepare中的“epoch”、“seq”以及“D(m)”的含义相同。In this specification, as shown in Figure 6, the format of the preparation message Prepare may be: <PREPARE, epoch, seq, D(m), i, signature-i>. Here, "PREPARE" represents the protocol identifier of the Prepare message, "i" represents the node identifier of the node that sends the Prepare message, and "signature-i" represents the signature of the node that sends the Prepare message. The meanings of "epoch", "seq" and "D(m)" in the preparation message Prepare are the same as the meanings of "epoch", "seq" and "D(m)" in the above-mentioned pre-prepare message.
在确认阶段530,当网络节点从其他网络节点接收到足够数量的准备消息Prepare时,该网络节点确定已经达成共识。例如,如果主节点R0或备份节点R1,R2或R3接收到Quorum个(例如,2f+1,其中f表示故障网络节点的数目)准备消息Prepare, 则确定在网络节点之间达成共识。然后,主节点R0或备份节点R1,R2或R3会向其他节点广播确认消息Commit。In the confirmation stage 530, when the network node receives a sufficient number of Prepare messages from other network nodes, the network node determines that a consensus has been reached. For example, if the master node R0 or the backup node R1, R2 or R3 receives Quorum (for example, 2f+1, where f represents the number of failed network nodes) preparation message Prepare, it is determined that a consensus is reached between the network nodes. Then, the master node R0 or the backup node R1, R2 or R3 will broadcast a confirmation message Commit to other nodes.
在本说明书中,如图6所示,确认消息Commit的格式可以是:<COMMIT,epoch,seq,D(m),p,signature-p>。其中,“COMMIT”表示确认消息Commit的协议标识,“p”表示发送确认消息Commit的节点的节点标识,“signature-p”表示发送确认消息Commit的节点的签名。确认消息Commit中的“epoch”、“seq”及“D(m)”的含义与上述预准备消息Pre-prepare中的“epoch”、“seq”及“D(m)”的含义相同。In this specification, as shown in Figure 6, the format of the confirmation message Commit may be: <COMMIT, epoch, seq, D(m), p, signature-p>. Among them, "COMMIT" represents the protocol identifier of the confirmation message Commit, "p" represents the node identifier of the node sending the confirmation message Commit, and "signature-p" represents the signature of the node sending the confirmation message Commit. The meanings of "epoch", "seq" and "D(m)" in the confirmation message Commit are the same as the meanings of "epoch", "seq" and "D(m)" in the above-mentioned pre-prepare message.
在本说明书中,节点发送确认消息Commit并将确认消息Commit存储至本地日志中,以表示该节点在确认阶段530所做出的共识承诺。In this specification, the node sends a confirmation message Commit and stores the confirmation message Commit in the local log to indicate the consensus commitment made by the node in the confirmation phase 530.
在如上针对发起的提议达成共识后,主节点将该区块记录到区块链中,由此完成将第一哈希值以及图像索引信息记录到区块链中。After reaching a consensus on the initiated proposal as described above, the master node records the block in the blockchain, thereby completing the recording of the first hash value and image index information in the blockchain.
在另一个示例中,摄像设备可以作为区块链的区块链网络的客户端,摄像设备与该区块链网络通信连接。在一个示例中,摄像设备与区块链网络中的至少一个区块链节点通信连接。In another example, the camera device can be used as a client of the blockchain network of the blockchain, and the camera device is communicatively connected with the blockchain network. In an example, the camera device is communicatively connected with at least one blockchain node in the blockchain network.
摄像设备可以将图像数据帧的第一哈希值和图像索引信息提供给区块链网络的对应区块链节点,该对应区块链节点与摄像设备通信连接。对应区块链节点在接收到图像数据帧的第一哈希值和图像索引信息后,可以将第一哈希值和图像索引信息打包成区块,该区块中包括第一哈希值和图像索引信息。然后,对应区块链节点将区块广播给区块链节点中的所有共识节点来进行共识处理,在所有共识节点达成共识后,可以将区块记录到区块链上。The camera device may provide the first hash value and image index information of the image data frame to the corresponding blockchain node of the blockchain network, and the corresponding blockchain node is in communication connection with the camera device. After receiving the first hash value and image index information of the image data frame, the corresponding blockchain node can pack the first hash value and image index information into a block, which includes the first hash value and Image index information. Then, the corresponding blockchain node broadcasts the block to all consensus nodes in the blockchain node for consensus processing. After all consensus nodes reach a consensus, the block can be recorded on the blockchain.
在本说明书的一个示例中,在图像数据帧的第一哈希值以及图像索引信息记录在区块链上后,区块链节点会反馈图像数据帧的第一哈希值以及图像索引信息在区块链上的存储地址,根据该存储地址可以从区块链上查询到第一哈希值以及图像索引信息。In an example of this specification, after the first hash value and image index information of the image data frame are recorded on the blockchain, the blockchain node will feed back the first hash value and image index information of the image data frame. The storage address on the blockchain, according to the storage address, the first hash value and image index information can be queried from the blockchain.
每一图像数据帧的图像索引信息与该图像数据帧的第一哈希值以及图像索引信息在区块链上的存储地址之间具有索引关系。索引关系中的图像索引信息可以包括全部信息或部分信息。There is an index relationship between the image index information of each image data frame, the first hash value of the image data frame, and the storage address of the image index information on the blockchain. The image index information in the index relationship may include all or part of the information.
例如,区块链上记录的图像索引信息包括时间戳信息、设备标识以及摄像位置信息,索引关系中的图像索引信息仅包括时间戳信息。每一图像数据帧的索引关系是时间戳信息与存储地址之间的对应关系,由此,基于各个图像数据帧的时间戳信息即可以获取该 图像数据帧的第一哈希值以及图像索引信息在区块链上的存储地址,进而从区块链上获取该图像数据帧的第一哈希值以及图像索引信息。For example, the image index information recorded on the blockchain includes time stamp information, device identification, and camera location information, and the image index information in the index relationship includes only time stamp information. The index relationship of each image data frame is the corresponding relationship between the time stamp information and the storage address. Therefore, the first hash value and image index information of the image data frame can be obtained based on the time stamp information of each image data frame The storage address on the blockchain further obtains the first hash value and image index information of the image data frame from the blockchain.
在一个示例中,各个图像数据帧对应的索引关系按照时间戳顺序被记录在索引表中。当利用区块链上记录的第一哈希值和图像索引信息对待验证视频进行校验时,确定该待验证视频的第一帧和最后一帧对应的时间戳,然后从索引表中查询第一帧时间戳和最后一帧时间戳,该第一帧时间戳和最后一帧时间戳以及之间的所有图像数据帧都是用来对待验证视频进行校验的,当待验证视频的图像帧数量与索引表中查询到的图像数据帧的数量一致,且每一帧都验证通过时,可以验证视频的完整性,确保视频中的图像帧没有被删除或遗漏。In an example, the index relationship corresponding to each image data frame is recorded in the index table according to the time stamp sequence. When verifying the video to be verified using the first hash value and image index information recorded on the blockchain, determine the timestamps corresponding to the first and last frames of the video to be verified, and then query the index table for the first and last frame of the video to be verified. One frame time stamp and the last frame time stamp. The first frame time stamp and the last frame time stamp and all image data frames in between are used to verify the video to be verified. When the image frame of the video to be verified The number is consistent with the number of image data frames queried in the index table, and when each frame is verified, the integrity of the video can be verified to ensure that the image frames in the video are not deleted or omitted.
在该示例中,利用索引表中按时间戳记录的索引关系可以验证视频的完整性,避免视频中的图像帧出现丢失或者被删除的情况,从而提高后续针对视频验证的准确度及可信度。In this example, the integrity of the video can be verified by using the index relationship recorded by the timestamp in the index table, avoiding the loss or deletion of image frames in the video, thereby improving the accuracy and credibility of subsequent video verification .
在本说明书的一个示例中,还可以将图像数据帧、图像数据帧的第一哈希值以及图像索引信息记录至区块链。在该示例中,针对同一图像数据帧,该图像数据帧以及对应的第一哈希值和图像索引信息可以打包成一个区块记录在区块链上。In an example of this specification, the image data frame, the first hash value of the image data frame, and the image index information can also be recorded to the blockchain. In this example, for the same image data frame, the image data frame and the corresponding first hash value and image index information can be packaged into a block and recorded on the blockchain.
基于该示例中区块链记录的图像数据帧,影像数据获取设备可以从区块链上获取影像数据的图像数据帧。影像数据获取设备是区块链的区块链网络中的一个区块链节点,影像数据获取设备本地存储有图像数据帧。Based on the image data frame recorded by the blockchain in this example, the image data acquisition device can acquire the image data frame of the image data from the blockchain. The image data acquisition device is a blockchain node in the blockchain network of the blockchain, and the image data acquisition device stores image data frames locally.
图7示出了本说明书实施例的基于区块链的影像数据获取方法的一个示例的流程图。如图7所示,在710,影像数据获取设备从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求。FIG. 7 shows a flowchart of an example of a method for acquiring image data based on a blockchain according to an embodiment of the present specification. As shown in FIG. 7, at 710, the image data acquisition device receives an image data acquisition request for the image data shot by the camera device from the image data requester.
在该示例中,影像数据请求方可以是区块链网络的客户端,与影像数据获取设备通信连接。影像数据获取请求可以包括待获取影像数据的时间段信息。时间段信息可以包括待获取影像数据中的第一图像数据帧的时间戳与最后一图像数据帧的时间戳之间的时间段,时间段信息还可以包括待获取影像数据中的每一图像数据帧的时间戳信息。In this example, the image data requester may be a client of the blockchain network, which is connected to the image data acquisition device in communication. The image data acquisition request may include time period information of the image data to be acquired. The time period information may include the time period between the time stamp of the first image data frame and the time stamp of the last image data frame in the image data to be acquired, and the time period information may also include each image data in the image data to be acquired. The time stamp information of the frame.
在720,影像数据获取设备在区块链中查询所具有的时间戳信息与时间段信息匹配的图像数据帧。所匹配出的图像数据帧即为待获取影像数据中的图像数据帧。At 720, the image data acquisition device queries the blockchain for image data frames with time stamp information that matches the time period information. The matched image data frame is the image data frame in the image data to be acquired.
在730,影像数据获取设备将所查询到的图像数据帧发送给影像数据请求方,以供影像数据请求方使用。In 730, the image data acquisition device sends the queried image data frame to the image data requester for use by the image data requester.
在本说明书的一个示例中,在将图像数据帧的第一哈希值以及图像索引信息记录在区块链之前,还可以针对图像数据帧,使用摄像设备的私钥对图像数据帧的第一哈希值和图像索引信息进行签名,再将经过签名的图像数据帧的第一哈希值以及图像索引信息记录在区块链上。In an example of this specification, before the first hash value of the image data frame and the image index information are recorded on the blockchain, the private key of the camera device can also be used to pair the first image data frame with respect to the image data frame. The hash value and the image index information are signed, and then the first hash value of the signed image data frame and the image index information are recorded on the blockchain.
通过摄像设备的私钥签名从而避免第一哈希值以及图像索引信息在传输过程中被篡改,进一步提高了区块链上所存储的第一哈希值和图像索引信息的可信度。The private key signature of the camera device prevents the first hash value and image index information from being tampered with during transmission, and further improves the credibility of the first hash value and image index information stored on the blockchain.
此外,影像数据获取设备从区块链上获取影像数据时,需要利用摄像设备的公钥对影像数据的各个图像数据帧的签名进行验证,提高了所获取的图像数据帧的可信度。In addition, when the image data acquisition device acquires image data from the blockchain, it needs to use the public key of the camera device to verify the signature of each image data frame of the image data, which improves the credibility of the acquired image data frame.
影像数据验证设备从区块链上获取第一哈希值时,需要利用摄像设备的公钥对所获取的第一哈希值的签名进行验证,以确保该第一哈希值是由摄像设备生成的图像数据帧得到的,从而保证了影像数据验证的准确性。When the image data verification device obtains the first hash value from the blockchain, it needs to use the public key of the camera device to verify the signature of the obtained first hash value to ensure that the first hash value is used by the camera device The generated image data frame is obtained, thereby ensuring the accuracy of image data verification.
图8示出了本说明书实施例的基于区块链的影像数据验证方法的一个示例的流程图。影像数据验证设备可以是区块链的区块链网络中的一个区块链节点,影像数据验证设备本地存储有摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息。FIG. 8 shows a flowchart of an example of a method for verifying image data based on a blockchain according to an embodiment of this specification. The image data verification device may be a blockchain node in the blockchain network of the blockchain, and the image data verification device locally stores the first hash value and image index information of the image data frame captured by the camera device.
如图8所示,在810,影像数据验证设备可以从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求。影像数据验证请求包括待验证影像数据的图像数据帧以及对应的时间戳信息。As shown in FIG. 8, at 810, the image data verification device may receive an image data verification request for the image data shot by the camera device from the image data verification party. The image data verification request includes the image data frame of the image data to be verified and the corresponding time stamp information.
在820,影像数据验证设备对待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值。At 820, the image data verification device performs a hash calculation on the image data frame of the image data to be verified to obtain a second hash value.
在830,影像数据验证设备在区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值。In 830, the image data verification device queries the blockchain for the first hash value corresponding to the time stamp information of each second hash value.
在840,影像数据验证设备将各个第二哈希值与对应的第一哈希值进行比较。At 840, the image data verification device compares each second hash value with the corresponding first hash value.
在850,影像数据验证设备基于各个第二哈希值与对应的第一哈希值之间的比较结果,向影像数据验证方发送用于指示待验证影像数据是否验证通过的通知信息。At 850, the image data verification device sends notification information indicating whether the image data to be verified has passed the verification to the image data verification party based on the comparison result between each second hash value and the corresponding first hash value.
在各个第二哈希值都与对应的第一哈希值相同时,向影像数据验证方发送用于指示待验证影像数据可用的通知信息。在各个第二哈希值中存在至少一个第二哈希值与对应的第一哈希值不同时,向影像数据验证方发送用于指示待验证影像数据不可用的通知信息。When each second hash value is the same as the corresponding first hash value, the notification information used to indicate that the image data to be verified is available is sent to the image data verifier. When there is at least one second hash value in each second hash value that is different from the corresponding first hash value, sending notification information for indicating that the image data to be verified is unavailable to the image data verifier.
在图8中示出的影像数据验证方案中,待验证影像数据可以被存储在第三方影像数据存储方,在需要将影像数据作为证据使用时,可以从第三方影像数据存储方获取影像数据,并且使用区块链上记载的哈希值来验证所获取的影像数据是否真实,从而有效地防止影像数据被篡改,并且由于影像数据没有存储在区块链上,由此可以节省区块链的存储空间。In the image data verification scheme shown in Figure 8, the image data to be verified can be stored in a third-party image data storage party. When the image data needs to be used as evidence, the image data can be obtained from the third-party image data storage party. And use the hash value recorded on the blockchain to verify whether the acquired image data is authentic, thereby effectively preventing the image data from being tampered with, and because the image data is not stored on the blockchain, it can save the blockchain. storage.
在另一示例中,图像索引信息还包括摄像设备的设备标识和/或摄像位置信息,影像数据验证请求还包括图像数据帧对应的设备标识和/或摄像位置信息。除了将各个第二哈希值与对应的第一哈希值进行比较以外,还可以将待验证影像数据中各个图像数据帧的设备标识和/或摄像位置信息与区块链上记录的对应的设备标识和/或摄像位置信息进行比较。In another example, the image index information further includes the device identification and/or camera location information of the camera device, and the image data verification request further includes the device identification and/or camera location information corresponding to the image data frame. In addition to comparing each second hash value with the corresponding first hash value, the device identification and/or camera position information of each image data frame in the image data to be verified can also be compared with the corresponding information recorded on the blockchain. The device identification and/or camera location information are compared.
然后,基于各个第二哈希值与对应的第一哈希值之间的比较结果,以及针对设备标识和/或摄像位置信息的比较结果,向影像数据验证方发送用于指示待验证影像数据是否验证通过的通知信息。Then, based on the comparison result between each second hash value and the corresponding first hash value, and the comparison result for the device identification and/or camera position information, send to the image data verifier indicating the image data to be verified Whether to verify the notification information.
通过验证图像数据帧的哈希值可以确定待验证影像数据中的图像数据帧是可信的,通过验证设备标识可以确定待验证影像数据是可信设备生成的,通过验证摄像位置信息可以确定待验证影像数据的位置信息可信。By verifying the hash value of the image data frame, it can be determined that the image data frame in the image data to be verified is credible, by verifying the device identification, it can be determined that the image data to be verified is generated by a credible device, and the image data to be verified can be determined by verifying the camera position information. Verify that the location information of the image data is credible.
图9示出了本说明书实施例的基于区块链的影像数据记录装置800的一个示例的方框图。如图9所示,影像数据记录装置900可以包括监测单元910、哈希计算单元920和上链处理单元930。FIG. 9 shows a block diagram of an example of a block chain-based image data recording device 800 according to the embodiment of this specification. As shown in FIG. 9, the image data recording device 900 may include a monitoring unit 910, a hash calculation unit 920, and an uplink processing unit 930.
监测单元910被配置为监测摄像设备中的图像传感器的影像数据输出。监测单元910的操作可以参考上面参照图3描述的块310的操作。The monitoring unit 910 is configured to monitor the image data output of the image sensor in the imaging device. The operation of the monitoring unit 910 may refer to the operation of the block 310 described above with reference to FIG. 3.
哈希计算单元920被配置为在监测到图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到图像数据帧的第一哈希值,图像数据帧具有图像索引信息,图像索引信息包括时间戳信息。哈希计算单元920的操作可以参考上面参照图3描述的块320的操作。The hash calculation unit 920 is configured to perform a hash calculation on the output image data frame to obtain the first hash value of the image data frame when the image data frame of the image data output by the image sensor is monitored, and the image data frame has an image index Information, image index information includes time stamp information. The operation of the hash calculation unit 920 may refer to the operation of the block 320 described above with reference to FIG. 3.
上链处理单元930被配置为将图像数据帧的第一哈希值以及图像索引信息记录至区块链。上链处理单元930的操作可以参考上面参照图3描述的块330的操作。The uplink processing unit 930 is configured to record the first hash value of the image data frame and the image index information to the blockchain. The operation of the uplink processing unit 930 may refer to the operation of the block 330 described above with reference to FIG. 3.
当摄像设备作为区块链的区块链网络的客户端时,上链处理单元930被配置为将图像数据帧的第一哈希值以及图像索引信息提供给区块链网络的对应区块链节点,以 经由该对应区块链节点记录至区块链。When the camera device serves as the client of the blockchain network of the blockchain, the on-chain processing unit 930 is configured to provide the first hash value of the image data frame and the image index information to the corresponding blockchain of the blockchain network Node to record to the blockchain via the corresponding blockchain node.
当摄像设备作为区块链的区块链网络的区块链节点时,上链处理单元链830可以包括区块生成模块、共识处理模块和区块记录模块。When the camera device is used as a blockchain node of the blockchain network of the blockchain, the upstream processing unit chain 830 may include a block generation module, a consensus processing module, and a block recording module.
区块生成模块被配置为将图像数据帧的第一哈希值以及图像索引信息打包成区块,区块包括图像索引信息以及对应的第一哈希值。The block generation module is configured to pack the first hash value and image index information of the image data frame into a block, and the block includes the image index information and the corresponding first hash value.
共识处理模块被配置为将所述区块广播给所述区块链网络的共识节点来进行共识处理。The consensus processing module is configured to broadcast the block to the consensus nodes of the blockchain network for consensus processing.
区块记录模块被配置为在共识节点达成共识后,将区块记录在区块链上。The block recording module is configured to record the block on the blockchain after the consensus node reaches a consensus.
影像数据记录装置900还可包括签名单元。签名单元被配置为针对图像数据帧,使用摄像设备的私钥对图像数据帧的第一哈希值和图像索引信息进行签名。上链处理单元930被配置为将经过签名的图像数据帧的第一哈希值以及图像索引信息记录至区块链。The image data recording device 900 may further include a signature unit. The signature unit is configured to use the private key of the camera device to sign the first hash value and the image index information of the image data frame with respect to the image data frame. The uplink processing unit 930 is configured to record the first hash value of the signed image data frame and the image index information to the blockchain.
上链处理单元930还可以被配置为将图像数据帧、图像数据帧的第一哈希值以及图像索引信息记录至区块链。The uplink processing unit 930 may also be configured to record the image data frame, the first hash value of the image data frame, and the image index information to the blockchain.
本说明书实施例还提供一种摄像设备,该摄像设备可以包括上述图9示出的任一示例的影像数据记录装置。The embodiment of the present specification also provides a camera device, which may include the image data recording device of any one of the examples shown in FIG. 9.
图10示出了本说明书实施例的基于区块链的影像数据获取装置900的一个示例的方框图。如图10所示,影像数据获取装置1000可以包括数据获取请求接收单元1010、数据查询单元1020和数据发送单元1030。FIG. 10 shows a block diagram of an example of a block chain-based image data acquisition device 900 according to an embodiment of the present specification. As shown in FIG. 10, the image data acquisition device 1000 may include a data acquisition request receiving unit 1010, a data query unit 1020, and a data sending unit 1030.
数据获取请求接收单元1010被配置为从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,影像数据获取请求包括待获取影像数据的时间段信息。数据获取请求接收单元1010的操作可以参考上面参照图7描述的块710的操作。The data acquisition request receiving unit 1010 is configured to receive an image data acquisition request for image data shot by the imaging device from an image data requester, the image data acquisition request including time period information of the image data to be acquired. The operation of the data acquisition request receiving unit 1010 may refer to the operation of block 710 described above with reference to FIG. 7.
数据查询单元1020被配置为在区块链中查询具有的时间戳信息与时间段信息匹配的图像数据帧。数据查询单元1020的操作可参考上面参照图7描述的块720的操作。The data query unit 1020 is configured to query the image data frame with the time stamp information matching the time period information in the blockchain. The operation of the data query unit 1020 may refer to the operation of the block 720 described above with reference to FIG. 7.
数据发送单元1030被配置为将所查询到的图像数据帧发送给影像数据请求方,以供影像数据请求方使用,其中,摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照如上述所述的影像数据记录方式存储在区块链的区块中。数据发送单元1030的操作可以参考上面参照图7描述的块730的操作。The data sending unit 1030 is configured to send the queried image data frame to the image data requester for use by the image data requester, wherein the image data frame and the first hash value of the image data frame captured by the imaging device And the image index information is stored in the block of the blockchain according to the image data recording method described above. The operation of the data transmission unit 1030 may refer to the operation of the block 730 described above with reference to FIG. 7.
图11示出了本说明书实施例的基于区块链的影像数据验证装置1100的一个示 例的方框图。如图11所示,影像数据验证装置1100可以包括数据验证请求接收单元1110、哈希计算单元1120、哈希值查询单元1130、哈希值比较单元1140和通知单元1150。Fig. 11 shows a block diagram of an example of a blockchain-based image data verification device 1100 according to an embodiment of the present specification. As shown in FIG. 11, the image data verification device 1100 may include a data verification request receiving unit 1110, a hash calculation unit 1120, a hash value query unit 1130, a hash value comparison unit 1140, and a notification unit 1150.
数据验证请求接收单元1110被配置为从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,影像数据验证请求包括待验证影像数据的图像数据帧以及对应时间戳信息。数据验证请求接收单元1110的操作可以参考上面参照图8描述的块810的操作。The data verification request receiving unit 1110 is configured to receive an image data verification request for image data shot by the imaging device from an image data verification party, the image data verification request including image data frames of the image data to be verified and corresponding time stamp information. The operation of the data verification request receiving unit 1110 may refer to the operation of block 810 described above with reference to FIG. 8.
哈希计算单元1120被配置为对待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值。哈希计算单元1120的操作可参考上面参照图8描述的块820的操作。The hash calculation unit 1120 is configured to perform a hash calculation on the image data frame of the image data to be verified to obtain the second hash value. The operation of the hash calculation unit 1120 may refer to the operation of the block 820 described above with reference to FIG. 8.
哈希值查询单元1130被配置为在区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值。哈希值查询单元1130的操作可以参考上面参照图8描述的块830的操作。The hash value query unit 1130 is configured to query the first hash value corresponding to the time stamp information of each second hash value in the blockchain. The operation of the hash value query unit 1130 may refer to the operation of the block 830 described above with reference to FIG. 8.
哈希值比较单元1140被配置为将各个第二哈希值与对应的第一哈希值进行比较。哈希值比较单元1140的操作可以参考上面参照图8描述的块840的操作。The hash value comparison unit 1140 is configured to compare each second hash value with the corresponding first hash value. The operation of the hash value comparison unit 1140 may refer to the operation of the block 840 described above with reference to FIG. 8.
通知单元1150被配置为基于各个第二哈希值与对应的第一哈希值之间的比较结果,向所述影像数据验证方发送用于指示所述待验证影像数据是否验证通过的通知信息,其中,摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如上述任一所述的影像数据记录方式存储在区块链的区块中。通知单元1150的操作可以参考上面参照图8描述的块850的操作。The notification unit 1150 is configured to, based on the comparison result between each second hash value and the corresponding first hash value, send notification information for indicating whether the image data to be verified is verified to the image data verifier. , Wherein the first hash value and image index information of the image data frame captured by the imaging device are stored in a block of the blockchain according to any one of the above-mentioned image data recording methods. The operation of the notification unit 1150 may refer to the operation of the block 850 described above with reference to FIG. 8.
以上参照图1到图11,对根据本说明书实施例的基于区块链的影像数据记录、获取、验证方法及装置的实施例进行了描述。Above, referring to FIGS. 1 to 11, the embodiments of the method and device for recording, acquiring, and verifying image data based on the blockchain according to the embodiments of the present specification have been described.
本说明书实施例的基于区块链的影像数据记录、获取及验证装置可以采用硬件实现,也可以采用软件或者硬件和软件的组合来实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将存储器中对应的计算机程序指令读取到内存中运行形成的。在本说明书实施例中,基于区块链的影像数据记录、获取及验证装置例如可以利用电子设备实现。The device for recording, acquiring, and verifying image data based on the blockchain in the embodiments of this specification can be implemented by hardware, or by software or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the memory into the memory through the processor of the device where it is located. In the embodiments of the present specification, the image data recording, acquiring, and verifying device based on the blockchain can be implemented by using electronic equipment, for example.
图12示出了本说明书实施例的用于将影像数据记录到区块链的方法的电子设备1200的方框图。FIG. 12 shows a block diagram of an electronic device 1200 for a method for recording image data to a blockchain according to an embodiment of the present specification.
如图12所示,电子设备1200可包括至少一个处理器1210、存储器(例如,非易失性存储器)1220、内存1230和通信接口1240,并且至少一个处理器1210、存储器 1220、内存1230和通信接口1240经由总线1250连接在一起。至少一个处理器1210执行在存储器中存储或编码的至少一个计算机可读指令(即,上述以软件形式实现的元素)。As shown in FIG. 12, the electronic device 1200 may include at least one processor 1210, a memory (for example, a non-volatile memory) 1220, a memory 1230, and a communication interface 1240, and at least one processor 1210, a memory 1220, a memory 1230, and a communication interface. The interfaces 1240 are connected together via a bus 1250. At least one processor 1210 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
在一个实施例中,在存储器中存储计算机可执行指令,其当执行时使得至少一个处理器1210:监测摄像设备中的图像传感器的影像数据输出;在监测到图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到图像数据帧的第一哈希值,图像数据帧具有图像索引信息,图像索引信息包括时间戳信息;以及将图像数据帧的第一哈希值以及图像索引信息记录至区块链。In one embodiment, computer-executable instructions are stored in the memory, which when executed, cause at least one processor 1210 to: monitor the image data output of the image sensor in the camera device; When the output image data frame is hashed to obtain the first hash value of the image data frame, the image data frame has image index information, and the image index information includes time stamp information; and the first hash value of the image data frame The value and image index information are recorded to the blockchain.
应该理解,在存储器中存储的计算机可执行指令当执行时使得至少一个处理器1210进行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。It should be understood that the computer-executable instructions stored in the memory, when executed, cause at least one processor 1210 to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification.
根据一个实施例,提供了一种例如机器可读介质的程序产品。机器可读介质可以具有指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
具体地,可以提供配有可读存储介质的系统或者装置,在该可读存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机或处理器读出并执行存储在该可读存储介质中的指令。Specifically, a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
图13示出了本说明书实施例的用于从区块链获取影像数据的方法的电子设备1300的方框图。FIG. 13 shows a block diagram of an electronic device 1300 for the method for obtaining image data from a blockchain according to an embodiment of the present specification.
如图13所示,电子设备1300可包括至少一个处理器1310、存储器(例如,非易失性存储器)1320、内存1330和通信接口1340,并且至少一个处理器1310、存储器1320、内存1330和通信接口1340经由总线1350连接在一起。至少一个处理器1310执行在存储器中存储或编码的至少一个计算机可读指令(即,上述以软件形式实现的元素)。As shown in FIG. 13, the electronic device 1300 may include at least one processor 1310, a memory (for example, a non-volatile memory) 1320, a memory 1330, and a communication interface 1340, and at least one processor 1310, a memory 1320, a memory 1330, and a communication interface. The interfaces 1340 are connected together via a bus 1350. At least one processor 1310 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
在一个实施例中,在存储器中存储计算机可执行指令,其当执行时使得至少一个处理器1310:从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,影像数据获取请求包括待获取影像数据的时间段信息;在区块链中查询所具有的时间戳信息与时间段信息匹配的图像数据帧;以及将所查询到的图像数据帧发送给影像数据请求方,以供影像数据请求方使用,其中,摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照上述所述的影像数据记录方式存储在区块链的区块中。In one embodiment, a computer-executable instruction is stored in the memory, which when executed causes at least one processor 1310: to receive an image data acquisition request for image data shot by the imaging device from the image data requester, and the image data acquisition request Including the time period information of the image data to be obtained; querying the image data frame with the time stamp information matching the time period information in the blockchain; and sending the queried image data frame to the image data requester for The image data requester uses the image data frame, the first hash value of the image data frame, and the image index information captured by the camera device in a block of the blockchain according to the above-mentioned image data recording method.
应该理解,在存储器中存储的计算机可执行指令当执行时使得至少一个处理器 1310进行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。It should be understood that the computer-executable instructions stored in the memory, when executed, cause at least one processor 1310 to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification.
根据一个实施例,提供了一种例如机器可读介质的程序产品。机器可读介质可以具有指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
具体地,可以提供配有可读存储介质的系统或者装置,在该可读存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机或处理器读出并执行存储在该可读存储介质中的指令。Specifically, a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
图14示出了本说明书实施例的用于基于区块链的影像数据验证的方法的电子设备1400的方框图。FIG. 14 shows a block diagram of an electronic device 1400 for a method for verifying image data based on a blockchain according to an embodiment of the present specification.
如图14所示,电子设备1400可包括至少一个处理器1410、存储器(例如,非易失性存储器)1420、内存1430和通信接口1440,并且至少一个处理器1410、存储器1420、内存1430和通信接口1440经由总线1450连接在一起。至少一个处理器1410执行在存储器中存储或编码的至少一个计算机可读指令(即,上述以软件形式实现的元素)。As shown in FIG. 14, the electronic device 1400 may include at least one processor 1410, a memory (for example, a non-volatile memory) 1420, a memory 1430, and a communication interface 1440, and at least one processor 1410, a memory 1420, a memory 1430, and a communication interface. The interfaces 1440 are connected together via a bus 1450. At least one processor 1410 executes at least one computer-readable instruction (ie, the above-mentioned element implemented in the form of software) stored or encoded in the memory.
在一个实施例中,在存储器中存储计算机可执行指令,其当执行时使得至少一个处理器1410:从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,影像数据验证请求包括待验证影像数据的图像数据帧以及对应时间戳信息;对待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值;在区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值;将各个第二哈希值与对应的第一哈希值进行比较;以及基于各个第二哈希值与对应的第一哈希值之间的比较结果,向影像数据验证方发送用于指示待验证影像数据是否验证通过的通知信息,其中,摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如上述任一所述的影像数据记录方式存储在区块链的区块中。In one embodiment, computer-executable instructions are stored in the memory, which when executed, cause at least one processor 1410 to: receive an image data verification request for image data shot by the camera device from an image data verification party, and the image data verification request The image data frame including the image data to be verified and the corresponding timestamp information; the image data frame of the image data to be verified is hashed to obtain the second hash value; the second hash value is queried in the blockchain The first hash value corresponding to the timestamp information; compare each second hash value with the corresponding first hash value; and based on the comparison result between each second hash value and the corresponding first hash value , Sending notification information to the image data verifier to indicate whether the image data to be verified has passed the verification, wherein the first hash value and the image index information of the image data frame captured by the camera device are in accordance with the image data as described above. The data recording method is stored in the block of the blockchain.
应该理解,在存储器中存储的计算机可执行指令当执行时使得至少一个处理器1410进行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。It should be understood that the computer-executable instructions stored in the memory, when executed, cause at least one processor 1410 to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification.
根据一个实施例,提供了一种例如机器可读介质的程序产品。机器可读介质可以具有指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本说明书的各个实施例中以上结合图1-11描述的各种操作和功能。According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (ie, the above-mentioned elements implemented in the form of software), which, when executed by a machine, cause the machine to perform the various operations and functions described above in conjunction with FIGS. 1-11 in the various embodiments of this specification. .
具体地,可以提供配有可读存储介质的系统或者装置,在该可读存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算 机或处理器读出并执行存储在该可读存储介质中的指令。Specifically, a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
在这种情况下,从可读介质读取的程序代码本身可实现上述实施例中任何一项实施例的功能,因此机器可读代码和存储机器可读代码的可读存储介质构成了本说明书实施例的一部分。In this case, the program code itself read from the readable medium can implement the function of any one of the above embodiments, so the machine readable code and the readable storage medium storing the machine readable code constitute this specification Part of the embodiment.
本说明书各部分操作所需的计算机程序代码可以用任意一种或多种程序语言编写,包括面向对象编程语言,如Java、Scala、Smalltalk、Eiffel、JADE、Emerald、C++、C#、VB、NET以及Python等,常规程序化编程语言如C语言、Visual Basic 2003、Perl、COBOL 2002、PHP以及ABAP,动态编程语言如Python、Ruby和Groovy,或者其他编程语言等。该程序编码可以在用户计算机上运行,或者作为独立的软件包在用户计算机上运行,或者部分在用户计算机上运行另一部分在远程计算机运行,或者全部在远程计算机或服务器上运行。在后一种情况下,远程计算机可以通过任何网络形式与用户计算机连接,比如局域网(LAN)或广域网(WAN),或连接至外部计算机(例如通过因特网),或者在云计算环境中,或者作为服务使用,比如软件即服务(SaaS)。The computer program codes required for the operation of each part of this manual can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB, NET, and Python, etc., conventional programming languages such as C language, Visual Basic 2003, Perl, COBOL 2002, PHP and ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages. The program code can run on the user's computer, or run on the user's computer as an independent software package, or partly run on the user's computer and partly run on the remote computer, or run entirely on the remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (for example, via the Internet), or in a cloud computing environment, or as Service usage, such as software as a service (SaaS).
可读存储介质的实施例包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD-RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机上或云上下载程序代码。Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, Volatile memory card and ROM. Alternatively, the program code can be downloaded from the server computer or the cloud via the communication network.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
上述各流程和各系统结构图中不是所有的步骤和单元都是必须的,可以根据实际的需要忽略某些步骤或单元。各步骤的执行顺序不是固定的,可以根据需要进行确定。上述各实施例中描述的装置结构可以是物理结构,也可以是逻辑结构,即,有些单元可能由同一物理实体实现,或者,有些单元可能分由多个物理实体实现,或者,可以由多个独立设备中的某些部件共同实现。Not all steps and units in the above processes and system structure diagrams are necessary, and some steps or units can be omitted according to actual needs. The order of execution of each step is not fixed and can be determined as needed. The device structure described in the foregoing embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or may be implemented by multiple physical entities. Some components in independent devices are implemented together.
在整个本说明书中使用的术语“示例性”意味着“用作示例、实例或例示”,并不意味着比其它实施例“优选”或“具有优势”。出于提供对所描述技术的理解的目的,具体实施方式包括具体细节。然而,可以在没有这些具体细节的情况下实施这些技 术。在一些实例中,为了避免对所描述的实施例的概念造成难以理解,公知的结构和装置以框图形式示出。The term "exemplary" used throughout this specification means "serving as an example, instance, or illustration", and does not mean "preferred" or "advantageous" over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described technology. However, these techniques can be implemented without these specific details. In some instances, in order to avoid incomprehensibility to the concepts of the described embodiments, well-known structures and devices are shown in the form of block diagrams.
以上结合附图详细描述了本说明书的实施例的可选实施方式,但是,本说明书的实施例并不限于上述实施方式中的具体细节,在本说明书的实施例的技术构思范围内,可以对本说明书的实施例的技术方案进行多种简单变型,这些简单变型均属于本说明书的实施例的保护范围。The optional implementation manners of the embodiments of this specification are described in detail above with reference to the accompanying drawings. However, the embodiments of this specification are not limited to the specific details of the above-mentioned embodiments. The technical solutions of the embodiments of the specification are subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the specification.
本说明书内容的上述描述被提供来使得本领域任何普通技术人员能够实现或者使用本说明书内容。对于本领域普通技术人员来说,对本说明书内容进行的各种修改是显而易见的,并且,也可以在不脱离本说明书内容的保护范围的情况下,将本文所定义的一般性原理应用于其它变型。因此,本说明书内容并不限于本文所描述的示例和设计,而是与符合本文公开的原理和新颖性特征的最广范围相一致。The above description of the content of this specification is provided to enable any person of ordinary skill in the art to realize or use the content of this specification. For those of ordinary skill in the art, various modifications to the content of this specification are obvious, and the general principles defined herein can also be applied to other modifications without departing from the scope of protection of the content of this specification. . Therefore, the content of this specification is not limited to the examples and designs described herein, but is consistent with the widest scope that conforms to the principles and novel features disclosed herein.

Claims (22)

  1. 一种基于区块链的影像数据记录方法,所述方法由摄像设备来执行,所述方法包括:A method for recording image data based on a blockchain, the method is executed by a camera device, and the method includes:
    监测所述摄像设备中的图像传感器的影像数据输出;Monitoring the image data output of the image sensor in the camera device;
    在监测到所述图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到所述图像数据帧的第一哈希值,所述图像数据帧具有图像索引信息,所述图像索引信息包括时间戳信息;以及When the image data frame of the image data output by the image sensor is monitored, a hash calculation is performed on the output image data frame to obtain the first hash value of the image data frame, and the image data frame has image index information, The image index information includes time stamp information; and
    将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。Recording the first hash value and image index information of the image data frame to the blockchain.
  2. 如权利要求1所述的方法,其中,所述摄像设备作为所述区块链的区块链网络的客户端,The method of claim 1, wherein the camera device serves as a client of the blockchain network of the blockchain,
    将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:The recording of the first hash value and image index information of the image data frame to the blockchain includes:
    将所述图像数据帧的第一哈希值以及图像索引信息提供给所述区块链网络的对应区块链节点,以经由所述对应区块链节点记录至所述区块链。The first hash value and image index information of the image data frame are provided to the corresponding blockchain node of the blockchain network so as to be recorded to the blockchain via the corresponding blockchain node.
  3. 如权利要求1所述的方法,其中,所述摄像设备作为所述区块链的区块链网络的区块链节点,The method according to claim 1, wherein the camera device serves as a blockchain node of the blockchain network of the blockchain,
    将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:The recording of the first hash value and image index information of the image data frame to the blockchain includes:
    将所述图像数据帧的第一哈希值以及图像索引信息打包成区块,所述区块包括所述图像索引信息以及对应的第一哈希值;Packing the first hash value and image index information of the image data frame into a block, the block including the image index information and the corresponding first hash value;
    将所述区块广播给所述区块链网络的共识节点来进行共识处理;Broadcasting the block to the consensus node of the blockchain network for consensus processing;
    在所述共识节点达成共识后,将所述区块记录在所述区块链上。After the consensus node reaches a consensus, the block is recorded on the blockchain.
  4. 如权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    针对所述图像数据帧,使用所述摄像设备的私钥对所述图像数据帧的第一哈希值和图像索引信息进行签名;以及For the image data frame, use the private key of the imaging device to sign the first hash value and image index information of the image data frame; and
    将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:The recording of the first hash value and image index information of the image data frame to the blockchain includes:
    将经过签名的所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。The first hash value and image index information of the signed image data frame are recorded to the blockchain.
  5. 如权利要求1所述的方法,其中,所述图像索引信息还包括所述摄像设备的设备标识和/或摄像位置信息。The method according to claim 1, wherein the image index information further includes a device identification of the camera device and/or camera location information.
  6. 如权利要求1所述的方法,其中,所述图像数据帧的图像索引信息与所述图像数据帧的第一哈希值以及图像索引信息在所述区块链上的存储地址之间具有索引关系。The method of claim 1, wherein the image index information of the image data frame and the first hash value of the image data frame and the image index information have an index between storage addresses on the blockchain relation.
  7. 如权利要求1到6中任一所述的方法,其中,将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链包括:The method according to any one of claims 1 to 6, wherein recording the first hash value and image index information of the image data frame to the blockchain comprises:
    将所述图像数据帧、所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。The image data frame, the first hash value of the image data frame, and the image index information are recorded to the blockchain.
  8. 如权利要求1所述的方法,其中,所述影像数据包括视频数据或静态图像数据。The method of claim 1, wherein the image data includes video data or still image data.
  9. 一种基于区块链的影像数据获取方法,所述方法由影像数据获取设备来执行,所述方法包括:A block chain-based image data acquisition method, the method is executed by an image data acquisition device, and the method includes:
    从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,所述影像数据获取请求包括待获取影像数据的时间段信息;Receiving an image data acquisition request for image data shot by the imaging device from an image data requester, where the image data acquisition request includes time period information for the image data to be acquired;
    在所述区块链中查询所具有的时间戳信息与所述时间段信息匹配的图像数据帧;以及Query the blockchain for image data frames with time stamp information that matches the time period information; and
    将所查询到的图像数据帧发送给所述影像数据请求方,以供所述影像数据请求方使用,Sending the queried image data frame to the image data requester for use by the image data requester,
    其中,所述摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照如权利要求7所述的方式存储在所述区块链的区块中。Wherein, the image data frame, the first hash value of the image data frame, and the image index information captured by the camera device are stored in the block of the blockchain according to the method of claim 7.
  10. 一种基于区块链的影像数据验证方法,所述方法由影像数据验证设备来执行,所述方法包括:A method for verifying image data based on blockchain, the method is executed by an image data verification device, and the method includes:
    从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,所述影像数据验证请求包括待验证影像数据的图像数据帧以及对应时间戳信息;Receiving an image data verification request for the image data shot by the camera device from the image data verification party, the image data verification request including the image data frame of the image data to be verified and the corresponding time stamp information;
    对所述待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值;Performing a hash calculation on the image data frame of the image data to be verified to obtain a second hash value;
    在所述区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值;Query the first hash value corresponding to the time stamp information of each second hash value in the blockchain;
    将各个第二哈希值与对应的第一哈希值进行比较;以及Comparing each second hash value with the corresponding first hash value; and
    基于各个第二哈希值与对应的第一哈希值之间的比较结果,向所述影像数据验证方发送用于指示所述待验证影像数据是否验证通过的通知信息,Based on the comparison result between each second hash value and the corresponding first hash value, sending to the image data verifier notification information indicating whether the image data to be verified has passed the verification,
    其中,所述摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如权利要求1到6中任一所述的方式存储在所述区块链的区块中。Wherein, the first hash value and image index information of the image data frame captured by the camera device are stored in the block of the blockchain according to any one of claims 1 to 6.
  11. 一种基于区块链的影像数据记录装置,所述装置应用于摄像设备来执行,所述影像数据记录装置包括:A block chain-based image data recording device, the device is applied to a camera device for execution, and the image data recording device includes:
    监测单元,监测所述摄像设备中的图像传感器的影像数据输出;A monitoring unit, which monitors the image data output of the image sensor in the camera equipment;
    哈希计算单元,在监测到所述图像传感器输出影像数据的图像数据帧时,对输出的图像数据帧进行哈希计算以得到所述图像数据帧的第一哈希值,所述图像数据帧具有图像索引信息,所述图像索引信息包括时间戳信息;以及The hash calculation unit, when the image data frame of the image data output by the image sensor is monitored, performs a hash calculation on the output image data frame to obtain the first hash value of the image data frame, and the image data frame Having image index information, the image index information including time stamp information; and
    上链处理单元,将所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块 链。The uplink processing unit records the first hash value and image index information of the image data frame to the blockchain.
  12. 如权利要求11所述的影像数据记录装置,其中,所述摄像设备作为所述区块链的区块链网络的客户端,The image data recording device according to claim 11, wherein the camera device serves as a client of the blockchain network of the blockchain,
    所述上链处理单元将所述图像数据帧的第一哈希值以及图像索引信息提供给所述区块链网络的对应区块链节点,以经由所述对应区块链节点记录至所述区块链。The uplink processing unit provides the first hash value and image index information of the image data frame to the corresponding blockchain node of the blockchain network, so as to record to the corresponding blockchain node via the corresponding blockchain node. Blockchain.
  13. 如权利要求11所述的影像数据记录装置,其中,所述摄像设备作为所述区块链的区块链网络的区块链节点,The image data recording device according to claim 11, wherein the camera device serves as a blockchain node of the blockchain network of the blockchain,
    所述上链处理单元链包括:The upper chain processing unit chain includes:
    区块生成模块,将所述图像数据帧的第一哈希值以及图像索引信息打包成区块,所述区块包括所述图像索引信息以及对应的第一哈希值;A block generation module, which packs the first hash value and image index information of the image data frame into a block, the block including the image index information and the corresponding first hash value;
    共识处理模块,将所述区块广播给所述区块链网络的共识节点来进行共识处理;以及A consensus processing module, which broadcasts the block to the consensus nodes of the blockchain network for consensus processing; and
    区块记录模块,在所述共识节点达成共识后,将所述区块记录在所述区块链上。The block recording module records the block on the blockchain after the consensus node reaches a consensus.
  14. 如权利要求11所述的影像数据记录装置,还包括:The image data recording device of claim 11, further comprising:
    签名单元,针对所述图像数据帧,使用所述摄像设备的私钥对所述图像数据帧的第一哈希值和图像索引信息进行签名;以及A signature unit, for the image data frame, using the private key of the imaging device to sign the first hash value and image index information of the image data frame; and
    所述上链处理单元将经过签名的所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。The on-chain processing unit records the first hash value and image index information of the signed image data frame to the blockchain.
  15. 如权利要求11到14中任一所述的影像数据记录装置,其中,所述上链处理单元将所述图像数据帧、所述图像数据帧的第一哈希值以及图像索引信息记录至所述区块链。The image data recording device according to any one of claims 11 to 14, wherein the uplink processing unit records the image data frame, the first hash value of the image data frame, and the image index information to the The block chain.
  16. 一种基于区块链的影像数据获取装置,包括:A block chain-based image data acquisition device includes:
    数据获取请求接收单元,从影像数据请求方接收针对摄像设备所拍摄的影像数据的影像数据获取请求,所述影像数据获取请求包括待获取影像数据的时间段信息;A data acquisition request receiving unit that receives an image data acquisition request for image data shot by the imaging device from an image data requester, where the image data acquisition request includes time period information for the image data to be acquired;
    数据查询单元,在所述区块链中查询所具有的时间戳信息与所述时间段信息匹配的图像数据帧;以及A data query unit to query the image data frame with time stamp information matching the time period information in the blockchain; and
    数据发送单元,将所查询到的图像数据帧发送给所述影像数据请求方,以供所述影像数据请求方使用,The data sending unit sends the queried image data frame to the image data requester for use by the image data requester,
    其中,所述摄像设备所拍摄的图像数据帧、图像数据帧的第一哈希值以及图像索引信息按照如权利要求7所述的方式存储在所述区块链的区块中。Wherein, the image data frame, the first hash value of the image data frame, and the image index information captured by the camera device are stored in the block of the blockchain according to the method of claim 7.
  17. 一种基于区块链的影像数据验证装置,包括:A block chain-based image data verification device includes:
    数据验证请求接收单元,从影像数据验证方接收针对摄像设备所拍摄的影像数据的影像数据验证请求,所述影像数据验证请求包括待验证影像数据的图像数据帧以及对应时间戳信息;A data verification request receiving unit that receives an image data verification request for image data shot by the camera device from an image data verification party, the image data verification request including image data frames of the image data to be verified and corresponding time stamp information;
    哈希计算单元,对所述待验证影像数据的图像数据帧进行哈希计算,以得到第二哈希值;A hash calculation unit that performs hash calculation on the image data frame of the image data to be verified to obtain a second hash value;
    哈希值查询单元,在所述区块链中查询与各个第二哈希值的时间戳信息对应的第一哈希值;A hash value query unit to query the first hash value corresponding to the time stamp information of each second hash value in the blockchain;
    哈希值比较单元,将各个第二哈希值与对应的第一哈希值进行比较;以及The hash value comparison unit compares each second hash value with the corresponding first hash value; and
    通知单元,基于各个第二哈希值与对应的第一哈希值之间的比较结果,向所述影像数据验证方发送用于指示所述待验证影像数据是否验证通过的通知信息,The notification unit, based on the comparison result between each second hash value and the corresponding first hash value, sends notification information for indicating whether the image data to be verified has passed the verification to the image data verifier,
    其中,所述摄像设备所拍摄的图像数据帧的第一哈希值以及图像索引信息按照如权利要求1到6中任一所述的方式存储在所述区块链的区块中。Wherein, the first hash value and image index information of the image data frame captured by the camera device are stored in the block of the blockchain according to any one of claims 1 to 6.
  18. 一种摄像设备,包括如权利要求11到14中任一所述的影像数据记录装置。An imaging device comprising the image data recording device according to any one of claims 11 to 14.
  19. 一种电子设备,包括:An electronic device including:
    至少一个处理器,以及At least one processor, and
    与所述至少一个处理器耦合的存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如权利要求1到8中任一所述的方法。A memory coupled with the at least one processor, the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor is caused to execute any one of claims 1 to 8 Methods.
  20. 一种机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如权利要求1到8中任一所述的方法。A machine-readable storage medium storing executable instructions, which when executed, cause the machine to execute the method according to any one of claims 1 to 8.
  21. 一种电子设备,包括:An electronic device including:
    至少一个处理器,以及At least one processor, and
    与所述至少一个处理器耦合的存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如权利要求9或10所述的方法。A memory coupled with the at least one processor, and the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the method according to claim 9 or 10.
  22. 一种机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如权利要求9或10所述的方法。A machine-readable storage medium storing executable instructions, which when executed, cause the machine to execute the method according to claim 9 or 10.
PCT/CN2021/087185 2020-04-17 2021-04-14 Block chain-based image data recording, obtaining and verifying WO2021208952A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010304831.3A CN111460526B (en) 2020-04-17 2020-04-17 Image data recording, acquiring and verifying method and device based on block chain
CN202010304831.3 2020-04-17

Publications (1)

Publication Number Publication Date
WO2021208952A1 true WO2021208952A1 (en) 2021-10-21

Family

ID=71685968

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/087185 WO2021208952A1 (en) 2020-04-17 2021-04-14 Block chain-based image data recording, obtaining and verifying

Country Status (2)

Country Link
CN (1) CN111460526B (en)
WO (1) WO2021208952A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672998A (en) * 2021-10-25 2021-11-19 广州智建云信息技术有限公司 Anti-counterfeiting method and system for data in construction process of constructional engineering
CN113872772A (en) * 2021-12-03 2021-12-31 杭州宇链科技有限公司 Video segment shooting device and time recording method and corresponding verification method
CN114338715A (en) * 2021-12-31 2022-04-12 杭州趣链科技有限公司 Data synchronization method, block chain system, terminal device and storage medium
CN114491631A (en) * 2022-01-25 2022-05-13 广东省第二人民医院(广东省卫生应急医院) Nursing sensitive index information interaction method and monitoring device
WO2022184587A1 (en) * 2021-03-05 2022-09-09 Sony Group Corporation Methods and apparatuses for providing a proof of authenticity of image data
US11778167B1 (en) 2022-07-26 2023-10-03 Insight Direct Usa, Inc. Method and system for preprocessing optimization of streaming video data
US11849240B2 (en) 2021-12-29 2023-12-19 Insight Direct Usa, Inc. Dynamically configured processing of a region of interest dependent upon published video data selected by a runtime configuration file
US11961273B2 (en) 2021-12-29 2024-04-16 Insight Direct Usa, Inc. Dynamically configured extraction, preprocessing, and publishing of a region of interest that is a subset of streaming video data

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460526B (en) * 2020-04-17 2021-10-12 支付宝(杭州)信息技术有限公司 Image data recording, acquiring and verifying method and device based on block chain
CN112055173B (en) * 2020-08-24 2023-04-18 深圳区块大陆科技有限公司 Method for preventing monitoring video from being tampered by using block chain
WO2022052042A1 (en) * 2020-09-11 2022-03-17 华为技术有限公司 Data storage method and apparatus, and system
CN112216381B (en) * 2020-10-14 2022-01-25 南通市第一人民医院 Method and system for checking patient in imaging department
CN112383737B (en) * 2020-11-11 2023-05-30 从法信息科技有限公司 Video processing verification method and device for multi-user online content on same screen and electronic equipment
CN112311557B (en) * 2020-11-17 2023-11-07 深圳市人机共识科技有限公司 Block chain architecture-based on-site investigation sharing system and sharing method
CN112613060B (en) * 2021-01-05 2023-11-17 福建中科星泰数据科技有限公司 Multi-node storage system and method based on alliance block chain
CN114374525A (en) * 2021-04-14 2022-04-19 南京质子链科技有限公司 Block chain-based electronic film secure sharing system and method
CN113094747B (en) * 2021-04-16 2024-02-09 深圳前海微众银行股份有限公司 Image searching method, block chain, cloud server and image searching device
CN113315969B (en) * 2021-07-29 2021-11-05 杭州子默网络科技有限公司 Data processing method, system and storage medium suitable for image transmission
CN113784089A (en) * 2021-08-05 2021-12-10 德明尚品科技集团有限公司 Method and device for monitoring video data of monitored area
TWI799950B (en) * 2021-08-17 2023-04-21 鴻海精密工業股份有限公司 Image marking evidence storage method, system, terminal device and storage medium
CN114301599B (en) * 2021-12-17 2023-07-18 苏州浪潮智能科技有限公司 Digital certificate importing method and device of switch and computer equipment
CN114301602B (en) * 2021-12-28 2023-08-15 苏州浪潮智能科技有限公司 Video protection method and device based on block chain
GB2622579A (en) * 2022-09-14 2024-03-27 Continental Automotive Tech Gmbh Method and system to authenticate camera device and camera data from common attacks

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537916A (en) * 2018-04-17 2018-09-14 深圳市元征科技股份有限公司 A kind of driving recording information processing method and device based on block chain
CN109583230A (en) * 2018-10-31 2019-04-05 阿里巴巴集团控股有限公司 Data based on block chain deposit card method and device, electronic equipment
CN110210243A (en) * 2019-04-30 2019-09-06 江苏亿鸿信息工程有限公司 A kind of monitor video evidence-obtaining system and its evidence collecting method based on block chain
US20200097733A1 (en) * 2017-06-01 2020-03-26 Unveiled Labs, Inc. Securely Authenticating a Recording File from Initial Collection Through Post-Production and Distribution
CN111460526A (en) * 2020-04-17 2020-07-28 支付宝(杭州)信息技术有限公司 Image data recording, acquiring and verifying method and device based on block chain

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4470992B2 (en) * 2007-12-05 2010-06-02 セイコーエプソン株式会社 Video management system
CN106503721B (en) * 2016-10-27 2019-07-16 河海大学常州校区 Hash algorithm and authentication method based on cmos image sensor PUF
CN109509095B (en) * 2018-11-14 2023-05-02 成都皓图智能科技有限责任公司 Video active identification method combined with block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200097733A1 (en) * 2017-06-01 2020-03-26 Unveiled Labs, Inc. Securely Authenticating a Recording File from Initial Collection Through Post-Production and Distribution
CN108537916A (en) * 2018-04-17 2018-09-14 深圳市元征科技股份有限公司 A kind of driving recording information processing method and device based on block chain
CN109583230A (en) * 2018-10-31 2019-04-05 阿里巴巴集团控股有限公司 Data based on block chain deposit card method and device, electronic equipment
CN110210243A (en) * 2019-04-30 2019-09-06 江苏亿鸿信息工程有限公司 A kind of monitor video evidence-obtaining system and its evidence collecting method based on block chain
CN111460526A (en) * 2020-04-17 2020-07-28 支付宝(杭州)信息技术有限公司 Image data recording, acquiring and verifying method and device based on block chain

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022184587A1 (en) * 2021-03-05 2022-09-09 Sony Group Corporation Methods and apparatuses for providing a proof of authenticity of image data
CN113672998A (en) * 2021-10-25 2021-11-19 广州智建云信息技术有限公司 Anti-counterfeiting method and system for data in construction process of constructional engineering
CN113872772A (en) * 2021-12-03 2021-12-31 杭州宇链科技有限公司 Video segment shooting device and time recording method and corresponding verification method
US11849240B2 (en) 2021-12-29 2023-12-19 Insight Direct Usa, Inc. Dynamically configured processing of a region of interest dependent upon published video data selected by a runtime configuration file
US11849242B2 (en) 2021-12-29 2023-12-19 Insight Direct Usa, Inc. Dynamically configured processing of a region of interest dependent upon published video data selected by a runtime configuration file
US11849241B2 (en) 2021-12-29 2023-12-19 Insight Direct Usa, Inc. Dynamically configured processing of a region of interest dependent upon published video data selected by a runtime configuration file
US11961273B2 (en) 2021-12-29 2024-04-16 Insight Direct Usa, Inc. Dynamically configured extraction, preprocessing, and publishing of a region of interest that is a subset of streaming video data
CN114338715A (en) * 2021-12-31 2022-04-12 杭州趣链科技有限公司 Data synchronization method, block chain system, terminal device and storage medium
CN114491631A (en) * 2022-01-25 2022-05-13 广东省第二人民医院(广东省卫生应急医院) Nursing sensitive index information interaction method and monitoring device
CN114491631B (en) * 2022-01-25 2024-04-02 广东省第二人民医院(广东省卫生应急医院) Nursing sensitive index information interaction method and monitoring device
US11778167B1 (en) 2022-07-26 2023-10-03 Insight Direct Usa, Inc. Method and system for preprocessing optimization of streaming video data

Also Published As

Publication number Publication date
CN111460526A (en) 2020-07-28
CN111460526B (en) 2021-10-12

Similar Documents

Publication Publication Date Title
WO2021208952A1 (en) Block chain-based image data recording, obtaining and verifying
US11868509B2 (en) Method and arrangement for detecting digital content tampering
US20230006842A1 (en) Blockchain-based data processing method and apparatus, computer device, computer-readable storage medium, and computer program product
US20200159891A1 (en) Chain-of-custody of digital content in a database system
WO2021135757A1 (en) Method and apparatus for executing transaction correctness verification
EP3570549B1 (en) Non-deterministic time systems and methods
US20210344498A1 (en) System, method, and computer program for secure authentication of live video
CN110958319B (en) Method and device for managing infringement and evidence-based block chain
US8312284B1 (en) Verifiable timestamping of data objects, and applications thereof
WO2021208909A1 (en) Blockchain-based warehouse credit rating, and result acquisition and authentication
WO2019233951A1 (en) A software application and a computer server for authenticating the identity of a digital content creator and the integrity of the creator&#39;s published content
TW202103028A (en) Method, device and system for face data acquisition and verification
CN112235323A (en) Evidence obtaining method and device based on block chain, electronic equipment and readable storage medium
WO2021012530A1 (en) Blockchain-based interaction record evidence collecting method and apparatus, and medium and server
CN110830259A (en) Method and system for providing originality and integrity certification for multimedia data
KR101628720B1 (en) Copied image evidence management system for verifying authenticity and integrity
WO2022201411A1 (en) Face authentication application using homomorphic encryption
CN111353893A (en) Transaction data processing method and device based on block chain
US20160119152A1 (en) Non-deterministic time generation and event-association system
JP2022013298A (en) Information processing system
US20240020420A1 (en) Tamper-evident storage and provisioning of media streams
US20220231868A1 (en) Method of binding a digital representation of an actual event with the real time of its occurrence
TW201342869A (en) Digital content cloud storage and authentication method
RU2792876C1 (en) Method for linking digital representation of actual event to its real time
KR102524271B1 (en) System and method for video integrity verification and original recovery based on Blockchain network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21788078

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21788078

Country of ref document: EP

Kind code of ref document: A1