CN114821380A - Block chain based evidence storing method, device, system, equipment and storage medium - Google Patents

Block chain based evidence storing method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN114821380A
CN114821380A CN202110125571.8A CN202110125571A CN114821380A CN 114821380 A CN114821380 A CN 114821380A CN 202110125571 A CN202110125571 A CN 202110125571A CN 114821380 A CN114821380 A CN 114821380A
Authority
CN
China
Prior art keywords
target
video sequence
video
hash value
resource
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110125571.8A
Other languages
Chinese (zh)
Inventor
苟喜霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Holding Co Ltd
Jingdong Technology Information Technology Co Ltd
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 Jingdong Technology Holding Co Ltd, Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202110125571.8A priority Critical patent/CN114821380A/en
Publication of CN114821380A publication Critical patent/CN114821380A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]

Abstract

The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a system, a device, and a storage medium for storing a certificate based on a blockchain. The method comprises the following steps: acquiring a video sequence to be stored with a record of the operation of logistics transportation of the target resource; extracting image characteristics of each frame in a video sequence; and under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-controlled resource, uploading the video sequence, the target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data storage. The method and the device solve the problem of how to store data in the field of e-commerce logistics.

Description

Block chain based evidence storing method, device, system, equipment and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a system, a device, and a storage medium for storing a certificate based on a blockchain.
Background
Along with the development of the block chain technology, the landing scheme for anti-counterfeiting evidence storage by applying the block chain technology is more and more common, especially in the era of internet and e-commerce, a user can reach the user only after ordering, merchant delivery and logistics transportation, and the block chain tracing is performed in each link of user shopping by applying the block chain technology, so that the user commodity is not changed in the shopping link, if the user commodity is damaged, or the user needs to maintain the right of the received commodity unsatisfied, the position and responsible person of the problem can be traced by using the block chain technology, and the situation of difficulty in obtaining the evidence is avoided.
At present, in the related art, a user prints an anti-counterfeiting code on a commodity after placing an order, and information, a position, a transportation path and the like of the commodity are uploaded to a block chain for storage by scanning the anti-counterfeiting code by personnel participating in each link of delivery and logistics transportation, so that the storage of the information in the commodity circulation process is completed, and meanwhile, the tracking is convenient. However, the block chain evidence preservation only by the anti-counterfeit code has a counterfeit risk, and a lawbreaker can still smoothly carry out a freight transportation process after carrying out illegal operation on the goods after separating the object codes and then binding the object codes, so how to carry out data evidence preservation in the field of e-commerce logistics still remains a problem which needs to be solved urgently.
Aiming at the problem of how to perform data storage in the field of e-commerce logistics, no effective solution is provided at present.
Disclosure of Invention
The application provides a block chain-based evidence storing method, device, system, equipment and storage medium, which are used for solving the technical problem of how to store data in the field of e-commerce logistics mentioned in the background art.
According to an aspect of an embodiment of the present application, there is provided a block chain-based evidence storing method, including:
acquiring a video sequence to be stored with a record of the operation of logistics transportation of the target resource;
extracting image characteristics of each frame in a video sequence;
and under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-controlled resource, uploading the video sequence, the target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data storage.
Optionally, before uploading the video sequence, the target hash value of the video sequence, and the resource exchange identifier associated with the video sequence to the blockchain network, the method further includes determining the target hash value of the video sequence as follows:
under the condition that a first confirmation operation on a first video is received, determining a first hash value of the first video, wherein the first video and the first confirmation operation are uploaded by a resource sending object of a target resource, a video sequence comprises the first video, and the target hash value comprises the first hash value;
under the condition that a second confirmation operation on a second video is received, determining a second hash value of the second video, wherein the second video and the second confirmation operation are uploaded by a resource transport object of a target resource, a video sequence comprises the second video, and the target hash value comprises the second hash value;
and under the condition that a third confirmation operation on the third video is received, determining a third hash value of the third video, wherein the third video and the third confirmation operation are uploaded by a resource receiving object of the target resource, the video sequence comprises the third video, and the target hash value comprises the third hash value.
Optionally, after determining the target hash value of the video sequence, the method further comprises determining whether the video sequence already exists in the blockchain network as follows:
traversing hash values stored in a material library of the storage and certification system, and carrying out XOR operation on each hash value and a target hash value to determine the Hamming distance between the target hash value and each hash value stored in the material library of the storage and certification system, wherein the data stored in the material library of the storage and certification system is the data which has been stored in the block chain network;
in the case that the value of the Hamming distance is within the target value range, it is determined that the video sequence already exists in the blockchain network.
Optionally, determining whether a video sequence already exists in the blockchain network further comprises:
determining a first perceptual hash value of a video sequence on a frame-by-frame basis, comprising: reducing a first target frame to a first size, wherein the first target frame is an image frame in a video sequence; converting the first target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the first target frame with the simplified colors; extracting a first transformation result with a second size from the transformation results, and determining a first average value of the first transformation result; replacing the numerical value which is larger than or equal to the first average value in the first transformation result with a first numerical value, and replacing the numerical value which is smaller than the first average value with a second numerical value; arranging the first conversion results after replacing the numerical values according to a target sequence to obtain a first perception hash value;
extracting the certified video stored in the material library of the certified system, and determining a second perceptual hash value of the certified video frame by frame, wherein the steps comprise: reducing a second target frame to a first size, wherein the second target frame is an image frame in the certified video; converting the second target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the second target frame with the simplified colors; extracting a second transformation result of a second size from the transformation results, and determining a second average value of the second transformation result; replacing the numerical value which is larger than or equal to the second average value in the second transformation result with a first numerical value, and replacing the numerical value which is smaller than the second average value with a second numerical value; arranging the second conversion results after replacing the numerical values according to a target sequence to obtain a second perception hash value;
determining the number of the same numerical value of corresponding bits between the first perception hash value and the second perception hash value;
and determining that the video sequence exists in the block chain network under the condition that the number of the same numerical values of the corresponding bits is greater than or equal to the target number.
Optionally, determining whether a video sequence already exists in the blockchain network further comprises:
determining the mean and variance of a first target frame in a video sequence, determining the mean and variance of a second target frame in a certified video, and determining the covariance between the first target frame and the second target frame;
determining the brightness similarity between the first target frame and the second target frame by using the average value of the first target frame and the average value of the second target frame;
determining contrast similarity between the first target frame and the second target frame by using the variance of the first target frame and the variance of the second target frame;
determining a structural similarity between the first target frame and the second target frame using a covariance between the first target frame and the second target frame;
determining global similarity between the first target frame and the second target frame by using the brightness similarity, the contrast similarity and the structural similarity;
and when the global similarity is larger than or equal to the target threshold, determining that the video sequence exists in the block chain network.
Optionally, after the data storage is completed, the method further includes:
under the condition that a right-maintaining request for a target resource is received, a resource exchange identifier associated with the target resource is obtained;
extracting a third video matched with the resource exchange identifier from the blockchain network as first evidence storage data, and extracting at least one of the first video and the second video matched with the resource exchange identifier from the blockchain network as second evidence storage data;
determining the similarity between the first evidence storing data and the second evidence storing data;
and determining that the right passes under the condition that the similarity meets the target condition.
According to another aspect of the embodiments of the present application, there is provided a block chain-based evidence storing device, including:
the data acquisition module is used for acquiring a video sequence to be stored with a record of the operation of logistics transportation of the target resource;
the characteristic extraction module is used for extracting the image characteristic of each frame in the video sequence;
and the characteristic comparison and evidence storage module is used for uploading the video sequence, the target hash value of the video sequence and the resource exchange identifier associated with the video sequence to a block chain network under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-controlled resource, so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to finish data evidence storage.
According to another aspect of the embodiments of the present application, there is provided a block chain-based deposit certificate system, including:
at least one data acquisition device for acquiring a video sequence operating on a target resource;
the server is used for extracting the image characteristics of each frame in the video sequence, uploading the video sequence, the target hash value of the video sequence and the resource exchange identification associated with the video sequence to a block chain network for evidence storage under the condition that the image characteristics of all the frames in the video sequence indicate that the target resource is a non-regulated resource, and extracting evidence storage data associated with the target resource from the block chain network to determine whether the right maintenance request passes or not when the right maintenance request for the target resource is received;
and the block chain network is used for generating a data block to store the video sequence and the resource exchange identifier, and the data block stores a hash value obtained by performing hash calculation on the video sequence.
According to another aspect of the embodiments of the present application, there is provided an electronic device, including a memory, a processor, a communication interface, and a communication bus, where the memory stores a computer program executable on the processor, and the memory and the processor communicate with each other through the communication bus and the communication interface, and the processor implements the steps of the method when executing the computer program.
According to yet another aspect of the embodiments of the present application, there is also provided a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the above-mentioned method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the technical scheme includes that a video sequence to be stored is obtained, and operation records for logistics transportation of target resources are stored in the video sequence; extracting image characteristics of each frame in a video sequence; and under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-controlled resource, uploading the video sequence, the target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data storage. The video is recorded by the operation recording of the target resource, the characteristic identification is carried out on the video, and the video is uploaded to the block chain for evidence storage under the condition that the video does not comprise the control content, so that the evidence is effectively stored in the real condition of commodities in the E-commerce logistics, and the problem of how to store data in the E-commerce logistics field is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of an alternative block chain application system according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an alternative block chain structure according to an embodiment of the present application;
fig. 3 is a functional block diagram of an alternative blockchain network according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an alternative block chain-based deposit evidence system according to an embodiment of the present application;
fig. 5 is a schematic flowchart of an optional verification method based on a blockchain according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an alternative evidence storing device based on a blockchain according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the following description, reference is made to "one embodiment" which describes a subset of all possible embodiments, but it is understood that "one embodiment" describes the same subset or a different subset of all possible embodiments, and may be combined with each other without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be applied to the following explanations.
(1) Transactions (transactions), equivalent to the computer term "Transaction," include operations that need to be committed to a blockchain network for execution and do not refer solely to transactions in the context of commerce, which embodiments of the present application follow in view of the convention colloquially used in blockchain technology.
For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking the smart contract and to perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).
(2) A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks).
(3) A Blockchain Network (Blockchain Network) incorporates new blocks into a set of nodes of a Blockchain in a consensus manner.
(4) Ledger (legger) is a general term for blockchains (also called Ledger data) and state databases synchronized with blockchains. Wherein, the blockchain records the transaction in the form of a file in a file system; the state database records the transaction in the blockchain in the form of different types of Key (Key) Value pairs for supporting quick query of the transaction in the blockchain.
(5) Intelligent Contracts (Smart Contracts), also known as chain codes (chaincodes) or application codes, are programs deployed in nodes of a blockchain network, and the nodes execute the intelligent Contracts called in received transactions to update or query key-value data of a state database.
(6) Consensus (Consensus), a process in a blockchain network, is used to agree on transactions in a block among a plurality of nodes involved, the agreed block is to be appended to the end of the blockchain, and the mechanisms for achieving Consensus include Proof of workload (PoW, Proof of Work), Proof of rights and interests (PoS, Proof of equity (DPoS), Proof of right of stock (DPoS), Proof of Elapsed Time (PoET, Proof of Elapsed Time), and so on.
An exemplary application of the blockchain network provided by the embodiment of the present application is described below, as shown in fig. 1, fig. 1 is a schematic diagram of a blockchain application system provided by the embodiment of the present application, and includes a blockchain network 101, a consensus node 102, an authentication center 103, a service agent 104, a client node 104-1, a service agent 105, and a client node 105-1, which are described below respectively:
the type of blockchain network 101 is flexible and may be any of a public chain, a private chain, or a federation chain, for example. Taking a public link as an example, electronic devices such as a user terminal and a server of any service agent can access the blockchain network 101 without authorization; taking a federation chain as an example, an electronic device (e.g., a terminal/server) under the jurisdiction of a service entity after obtaining authorization may access the blockchain network 101, and at this time, become a client node in the blockchain network 101.
In some embodiments, client node 104-1 may act as the sole watcher of blockchain network 101, i.e., provides functionality to support a business entity initiating a transaction (e.g., for uplink storage of data or querying of data on a chain), and may be implemented by default or selectively (e.g., depending on the specific business needs of the business entity) with respect to the functions of consensus nodes 102 of blockchain network 101, such as ranking functions, consensus services, and ledger functions, etc. Therefore, the data and the service processing logic of the service subject can be migrated to the blockchain network 101 to the maximum extent, and the credibility and traceability of the data and service processing process are realized through the blockchain network 101.
Consensus nodes in blockchain network 101 receive transactions submitted from different business entities, such as client node 104-1 of business entity 104 shown in fig. 1, perform the transactions to update the ledger or query the ledger, and various intermediate or final results of performing the transactions may be returned for display in client node 104-1 of business entity 104.
For example, client node 104-1 may subscribe to events of interest in blockchain network 101, such as transactions occurring in a particular organization/channel in blockchain network 101, and corresponding transaction notifications are pushed by consensus node 102 to client node 104-1, thereby triggering corresponding business logic in client node 104-1.
As an example of a block chain, as shown in fig. 2, fig. 2 is a schematic structural diagram of a block chain in a block chain network 101 provided in this embodiment of the present application, where a header of each block may include hash values of all transactions in the block and also include hash values of all transactions in a previous block, a record of a newly generated transaction is filled in the block and is added to a tail of the block chain after passing through a consensus of nodes in the block chain network, so as to form a chain growth, and a chain structure based on hash values between blocks ensures tamper resistance and forgery resistance of transactions in the block.
An exemplary functional architecture of the blockchain network provided in the embodiment of the present application is described below, as shown in fig. 3, fig. 3 is a schematic functional architecture diagram of the blockchain network 101 provided in the embodiment of the present application, and includes an application layer 301, a consensus layer 302, a network layer 303, a data layer 304, and a resource layer 305, which are described below:
the application layer 301 encapsulates various services that the blockchain network can implement, including tracing, crediting, and verifying transactions.
The consensus layer 302 encapsulates the functions of the mechanism by which the nodes 102 in the blockchain network 101 agree on a block (i.e., a consensus mechanism), transaction management, and ledger management. The consensus mechanism comprises consensus algorithms such as POS, POW and DPOS, and the pluggable consensus algorithm is supported. The transaction management is used for verifying the digital signature carried in the transaction received by the node 101, verifying the identity information of the service body 104, and determining whether the service body has the authority to perform the transaction (reading the relevant information from the service body identity management) according to the identity information; for the service agents authorized to access the blockchain network 101, the service agents all have digital certificates issued by the certificate authority, and the service agents sign the submitted transactions by using private keys in the digital certificates of the service agents, so that the legal identities of the service agents are declared. The ledger administration is used to maintain blockchains and state databases. For the block with the consensus, adding the block to the tail of the block chain; executing the transaction in the acquired consensus block, updating the key-value pairs in the state database when the transaction comprises an update operation, querying the key-value pairs in the state database when the transaction comprises a query operation and returning a query result to the client node of the business entity. Supporting query operations for multiple dimensions of a state database, comprising: querying the chunk based on the chunk sequence number (e.g., hash value of the transaction); inquiring the block according to the block hash value; inquiring a block according to the transaction serial number; inquiring the transaction according to the transaction serial number; inquiring account data of a business main body according to an account (serial number) of the business main body; and inquiring the block chain in the channel according to the channel name.
The network layer 303 encapsulates the functions of a point-to-point (P2P, point) network protocol, a data propagation mechanism and a data verification mechanism, an access authentication mechanism, and service agent identity management.
The P2P network protocol implements communication between nodes 102 in the blockchain network 101, the data propagation mechanism ensures propagation of transactions in the blockchain network 101, and the data verification mechanism implements reliability of data transmission between the nodes 102 based on cryptography methods (e.g., digital certificates, digital signatures, public/private key pairs); the access authentication mechanism is used for authenticating the identity of a service subject added to the block chain network 101 according to an actual service scene, and endowing the service subject with the authority of accessing the block chain network 101 when the authentication is passed; the business entity 104 identity management is used to store the identity of the business entity 104 that is allowed to access the blockchain network 101, as well as the permissions (e.g., the types of transactions that can be initiated).
Data layer 304 encapsulates various data structures that implement ledgers, including blockchains implemented in files in a file system, key-value type state databases, and presence certificates (e.g., hash trees for transactions in blocks).
The resource layer 305 encapsulates the computing, storage, and communication resources that implement each node 102 in the blockchain network 101.
For a clearer explanation of the present application, the working principle of the intelligent contract is briefly described:
constructing an intelligent contract: the intelligent contract is made by a plurality of users in the block chain, and can be used for any transaction between any users. The agreement defines the rights and obligations of the parties to the transaction, which are programmed electronically by the developer, the code containing conditions that trigger the automatic execution of the contract.
Storing the intelligent contract: once the encoding is completed, the intelligent contract is uploaded to the blockchain network, that is, each node of the whole network can receive the intelligent contract.
Executing the intelligent contract: the intelligent contract can regularly check whether related events and trigger conditions exist or not, the events meeting the conditions are pushed to a queue to be verified, the verification nodes on the block chain firstly carry out signature verification on the events to ensure the validity of the events, most verification nodes agree with the events, the intelligent contract is successfully executed, and a user is informed of the successful execution.
Based on the above architecture, the embodiments of the present application propose the following implementation.
In the related technology, a user prints an anti-counterfeiting code on a commodity after placing an order, and information, positions, transportation paths and the like of the commodity are uploaded to a block chain for storage by scanning the anti-counterfeiting code by participants such as merchants, couriers and the like in each link of delivery and logistics transportation, so that the information is stored in the commodity circulation process, and meanwhile, the information is conveniently traced. However, the block chain evidence storage only by the anti-counterfeiting code has a fake-certificate risk, and even after a lawbreaker separates the object codes, the illegal operation is carried out on the commodities and then the object codes are bound, the freight flow can still be smoothly carried out, so that the system (e-commerce platform) is difficult to determine the authenticity of the evidence provided by merchants, logistics and users when the users maintain the rights.
In order to solve the technical problems mentioned in the background art, according to an aspect of the embodiments of the present application, an embodiment of a block chain-based evidence storing method is provided.
Optionally, in this embodiment of the present application, the above verification method based on a blockchain may be applied to a blockchain-based verification system composed of at least one data acquisition device 401, a server 403, and a blockchain network 405 as shown in fig. 4. The data acquisition equipment can be terminal equipment provided with a video shooting device, and the server is a server of the e-commerce platform.
The data acquisition device 401 is configured to acquire a video sequence for operating a commodity (target resource) purchased by a user, such as operations of merchant boxing and shipping, courier collecting, logistics transportation, and user receiving and unpacking.
The server 403 is configured to extract image features of each frame in the video sequence, upload the video sequence, a target hash value of the video sequence, and a resource exchange identifier associated with the video sequence to a blockchain network for storing a certificate when the image features of all frames of the video sequence indicate that a target resource is an unregulated resource, and extract certificate storage data associated with a commodity from the blockchain network when a request for a right to maintain the commodity is received, so as to determine whether the request for the right to maintain passes through.
In the embodiment of the application, the control resource is commodities related to yellow, sensitive, terrorist, toxic and the like, and the resource exchange identifier can be an order number, a logistics number, a transaction logistics number and the like.
The block chain network 405 is configured to generate a data block to store the video, the order number, and the logistics number, and the data block stores a hash value obtained by performing hash calculation on the video.
As shown in fig. 4, the server 403 is connected to the data acquisition device 401 and the blockchain network 405 through a network, and may be configured to provide a service for the data acquisition device or a client installed on the data acquisition device. Such networks include, but are not limited to: wide area network, metropolitan area network, or local area network, and the terminal 101 includes but is not limited to a PC, a cell phone, a tablet computer, and the like.
A block chain-based evidence storing method in this embodiment may be executed by the server 403, and as shown in fig. 5, the method may include the following steps:
and step S502, acquiring a video sequence to be stored with an operation record for carrying out logistics transportation on the target resource.
In the embodiment of the application, since the video has coherence, all operations of recording the target resource can be considered really, and the target resource can be a commodity in the field of e-commerce logistics. Multimedia can also be used as an information carrier. Multimedia (Multimedia) is a combination of various media including various media forms such as text, sound and image, and in a computer system, Multimedia refers to a man-machine interactive information exchange and transmission medium combining two or more media. The media used include text, pictures, photos, sounds, animations and movies, and the interactive functions provided by the programs.
The evidence storing method based on the block chain can be applied to e-commerce shopping scenes, and particularly relates to a series of commodity transaction and logistics transportation processes such as user online ordering, merchant packing and delivery, courier confirmation acceptance, logistics transportation, user collection and unpacking and the like.
The operation records of the merchant for packing and delivering goods, the courier for confirming and receiving, the logistics transportation, the user for receiving and opening the goods and the like are stored through the video sequence, and the operation records can be video images, pictures, texts, voice or the combination of one or more of the video images, the pictures, the texts and the voice.
Step S504, an image feature of each frame in the video sequence is extracted.
Step S506, when the image features of all frames of the video sequence indicate that the target resource is a non-regulated resource, uploading the video sequence, the target hash value of the video sequence, and the resource exchange identifier associated with the video sequence to a block chain network, so as to generate a data block in the block chain network, store the video sequence, the target hash value, and the resource exchange identifier, and perform consensus in at least one block chain node, so as to complete data storage.
In the embodiment of the application, whether the physically transported commodities contain the controlled commodities can be found out by performing feature extraction and identification on the video sequence. The controlled goods are the goods related to yellow, sensitive, terrorist, virus and the like, and the resource exchange identification can be an order number, a logistics number, a transaction logistics number and the like. A convolutional neural network may be employed to perform feature extraction and recognition of the video sequence for each frame of image in the video sequence.
Optionally, before uploading the video sequence, the target hash value of the video sequence, and the resource exchange identifier associated with the video sequence to the blockchain network, the method further includes determining the target hash value of the video sequence as follows:
under the condition that a first confirmation operation on a first video is received, determining a first hash value of the first video, wherein the first video and the first confirmation operation are uploaded by a resource sending object of a target resource, a video sequence comprises the first video, and the target hash value comprises the first hash value;
under the condition that a second confirmation operation on a second video is received, determining a second hash value of the second video, wherein the second video and the second confirmation operation are uploaded by a resource transport object of a target resource, a video sequence comprises the second video, and the target hash value comprises the second hash value;
and under the condition that a third confirmation operation on the third video is received, determining a third hash value of the third video, wherein the third video and the third confirmation operation are uploaded by a resource receiving object of the target resource, the video sequence comprises the third video, and the target hash value comprises the third hash value.
In the embodiment of the application, the resource sending object of the target resource is a merchant, the first video is a boxing and shipping video, and the first confirming operation is that the merchant clicks the 'confirm shipping' operation. The resource transportation object of the target resource is a courier, the second video is a courier confirmation collection video, and the second confirmation operation is that the courier clicks a 'confirmation collection' operation. The resource receiving object of the target resource is a user, the third video is a goods receiving and box opening video, and the third confirmation operation is that the user clicks the 'confirmation of goods receiving' operation.
In the embodiment of the application, a merchant can upload videos of the goods packing and delivery to an e-commerce platform and click 'confirm delivery', namely, the confirmation operation of the videos of the packing and delivery can be triggered. The confirmation operation is triggered to determine that the goods are packaged and shipped and a responsible person who records the operation is a merchant, after the goods are confirmed to be correct, the e-commerce platform can call the hash operation module to calculate the hash value of the packaged and shipped video, the video sequence comprises the packaged and shipped video uploaded by the merchant, and the target hash value comprises the hash value of the packaged and shipped video. When the courier receives the commodities, the courier can upload the videos of the commodities to the e-commerce platform and click 'receiving confirmation', and then the operation of confirming the receiving of the commodities can be triggered. The confirmation operation is triggered to determine that the commodity collection and the responsible person recording the operation are couriers, after the commodity collection and the recording operation are confirmed to be correct, the e-commerce platform can call a Hash operation module to calculate a Hash value of a collection-confirmed video, the video sequence comprises a collection-confirmed video frequency uploaded by the couriers, and the target Hash value comprises the Hash value of the collection-confirmed video. When receiving goods, the user can upload videos of receiving and unpacking goods to the E-commerce platform and click 'confirm receiving', namely, the confirmation operation of the videos of receiving and unpacking goods can be triggered. The confirmation operation is triggered to confirm that the goods are received and unpacked and the responsible person who is operated is the user, after the goods are confirmed to be correct, the E-commerce platform can call a Hash operation module to calculate the Hash value of the goods receiving and unpacking video, the video sequence comprises the goods receiving and unpacking video uploaded by the user, and the target Hash value comprises the Hash value of the goods receiving and unpacking video.
In the embodiment of the application, in order to store evidence, the boxing and delivery video and the hash value thereof uploaded by a merchant, the confirmation receiving and delivery video and the hash value thereof uploaded by a courier, the receiving and delivery video and the hash value thereof uploaded by a user can be uploaded to the block chain network for storing evidence, and an order number generated when the user purchases the commodity, a logistics number generated when the courier receives the commodity for logistics transportation, and the like can be uploaded to the block chain network together with the serial number related to the commodity for storing evidence. The resource exchange identification may include an order number, a stream number, etc. associated with the item. The blockchain network generates data blocks to store the video, hash value, order number, stream number, etc. When the data block is generated, the video, the hash value, the order number and the logistics number are identified in a plurality of block chain nodes in a common identification layer of a block chain network, and a new data block is additionally generated at the tail part of the current block chain network after the common identification is completed, so that the data uplink is completed. Mechanisms to achieve consensus include Proof of workload (PoW, Proof of Work), Proof of rights of interest (PoS, Proof of stamp), Proof of equity authority (DPoS, Delegatd Proof of stamp), Proof of Elapsed Time (PoET, Proof of Elapsed Time), and so on.
By adopting the technical scheme, a series of commodity circulation programs such as commodity packing and delivery from a merchant, receipt confirmation by a courier, logistics transportation, user collection and delivery opening and the like can be recorded through videos, the characteristics of the videos are identified, and the videos are uploaded to a block chain for evidence storage under the condition that the videos do not comprise control contents, so that the true conditions of commodities in E-commerce logistics are effectively stored, and the problem of how to store data in the E-commerce logistics field is solved.
The embodiment of the present application further provides a method for checking whether the video sequence already exists in the block chain before uploading the video sequence stored with the operation record to the block chain, so as to improve the evidence storage efficiency and save the space of the block chain.
Optionally, after determining the target hash value of the video sequence, the method further comprises determining whether the video sequence already exists in the blockchain network as follows:
step 11, traversing the hash values stored in the material library of the evidence storage system, and performing exclusive or operation on each hash value and the target hash value to determine the hamming distance between the target hash value and each hash value stored in the material library of the evidence storage system, wherein the data stored in the material library of the evidence storage system is the data which has been stored in the block chain network;
and step 12, determining that the video sequence exists in the block chain network under the condition that the Hamming distance value is in the target numerical range.
In the embodiment of the application, the material library of the evidence storage system is a database for storing the evidence storage data in advance, after the e-commerce platform uploads the data to the block chain network for evidence storage, the evidence storage data is synchronously stored in the material library of the evidence storage system and serves as local storage, and the material library of the evidence storage system can also be directly used as the block chain database, so that when the uploaded data are stored in the block chain, whether the same data exist in the block chain can be directly searched.
In the embodiment of the application, the target hash value may be data to be stored, that is, a hash value of a video sequence, where the video sequence includes the above-mentioned merchant boxing delivery video, courier confirmation receipt video, user collection and unpacking video, and the like. The hash value of the data to be stored and the hash value of the data already stored are subjected to exclusive OR operation, the data to be stored and the data already stored can be compared, and the result of the exclusive OR operation is the Hamming distance between the hash value of the data to be stored and the hash value of the data already stored. For example, there are codes 10001001 and 10110001, and after the xor operation, 00111000 is obtained, that is, the number of different bit values in two codes is 3, that is, it means that the hamming distance between the two codes is 3. And if the Hamming distance between the hash value of the data to be stored and the hash value of the data already stored is within the target value range, determining that the data to be stored exists in the block chain, and not uploading the data to be stored. The target numerical range can be set according to actual needs, can be set according to experimental results, and can also be set according to experience. The floating range of the hamming distance is set so that the data to be certified is still judged to be the same data if the data to be certified and the certified data are mostly the same. For example, the same video file is stored in different coding formats.
The method and the system can judge whether a merchant boxing and delivery video, a courier confirms a receiving video, a user receiving and unpacking video and the like exist in the block chain network by adopting the Hamming distance, and can also realize the detection by adopting a perceptual Hash algorithm.
Optionally, determining whether a video sequence already exists in the blockchain network further comprises:
step 21, determining a first perceptual hash value of the video sequence frame by frame, including: reducing a first target frame to a first size, wherein the first target frame is an image frame in a video sequence; converting the first target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the first target frame with the simplified colors; extracting a first transformation result with a second size from the transformation results, and determining a first average value of the first transformation result; replacing the numerical value which is larger than or equal to the first average value in the first transformation result with a first numerical value, and replacing the numerical value which is smaller than the first average value with a second numerical value; and arranging the first conversion results after replacing the numerical values according to a target sequence to obtain a first perception hash value.
In the embodiment of the application, the video sequence is a boxing and delivery video uploaded by a merchant, a courier confirms to receive a video, a user receives and unpacks a video and the like, and the first target frame is each image frame in the video sequence.
Step 22, extracting the certified video stored in the material library of the certification system, and determining the second perceptual hash value of the certified video frame by frame, including: reducing a second target frame to a first size, wherein the second target frame is an image frame in the certified video; converting the second target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the second target frame with the simplified colors; extracting a second transformation result of a second size from the transformation results, and determining a second average value of the second transformation result; replacing the numerical value which is larger than or equal to the second average value in the second transformation result with a first numerical value, and replacing the numerical value which is smaller than the second average value with a second numerical value; and arranging the second conversion results after replacing the numerical values according to a target sequence to obtain a second perception hash value.
And step 23, determining the number of the same numerical values of corresponding bits between the first perception hash value and the second perception hash value.
And 24, determining that the video sequence exists in the block chain network under the condition that the number of the same numerical value of the corresponding bit is greater than or equal to the target number.
The perceptual hash algorithm is a type of hash algorithm and is mainly used for searching similar pictures. In the embodiment of the application, data to be stored, namely a merchant boxing delivery video, a courier confirms to receive a video, a user boxing delivery video and the like, a first perception hash value is calculated frame by frame, a second perception hash value is calculated frame by frame for the certified video in a block chain, the first perception hash value and the second perception hash value are subjected to corresponding bit numerical analysis, the number of corresponding bits with the same numerical value is counted, and whether the data to be stored and the certified data are the same is judged.
The perceptual hash is different from the original hash of the data, the perceptual hash is a hash value obtained by performing optimization calculation on the structure of the data, and a group of fingerprints can be generated by the characteristics contained in each frame of picture, so that fingerprint comparison is performed.
In the embodiment of the application, the number of the same numerical values of the corresponding bits can be calculated frame by frame, and the video sequence existing in the block chain network is determined under the condition that the number is larger than or equal to the target number. The target number can be set according to actual needs, can be set according to experimental results, and can also be set according to experience. And determining the number of similar frames in the data to be stored and the data to be stored by frame through the frame-by-frame comparison result. And determining that the data to be stored is existed in the block chain network under the condition that the number of the similar frames is greater than the preset threshold value.
In an embodiment of the present application, the method for calculating the first perceptual hash value and the second perceptual hash value specifically includes:
first, the size is reduced. High frequency and details can be removed at the fastest speed through reducing the size, only the structure brightness is kept, the first size that specifically reduces can be set according to actual need, can set according to the experimental result, can also set according to experience. For example, the image frame is reduced to a size of 8x8 for a total of 64 pixels. The picture difference caused by different sizes and proportions is abandoned.
And secondly, simplifying colors. And converting the reduced image frame into 64-level gray. That is, all the pixels have 64 colors in total. The preset gray level may be 64 gray levels, or may be other gray levels such as 128 and 32 gray levels.
Third, DCT (discrete cosine transform) is calculated. DCT is to decompose image frames into frequency aggregation and ladder shapes, and 8 × 8 DCT transform or 32 × 32 DCT transform may be used.
Fourthly, the DCT is reduced. Taking the DCT transformation of 32 x 32 as an example, although the DCT results in a matrix of 32 x 32 size, the present application may retain only the 8x8 matrix in the upper left corner, which part represents the lowest frequency in the picture. The size of 8 × 8 is the second size, and other sizes such as 4 × 4, 16 × 16, and the like may be used.
And fifthly, calculating an average value. The average of all 64 values was calculated.
Sixth, the DCT is further reduced. In the 8-by-8 DCT matrix, a 64-bit hash value of 1 (the first numerical value) or 0 (the second numerical value) is set, and a value equal to or greater than the DCT mean value is set to "1" and a value smaller than the DCT mean value is set to "0".
And seventhly, calculating a perception hash value. And combining the DCT conversion results after replacing the numerical values according to the arrangement sequence of the pixel points to obtain a perceptual hash value.
In the embodiment of the application, a Structural SIMilarity (SSIM) algorithm can be used for calculating the SIMilarity between the merchant boxing and shipping video, the courier confirms the receiving video and the user receiving and unpacking video and the certified video, so as to judge whether the merchant boxing and shipping video, the courier confirms the receiving video and the user receiving and unpacking video and the like exist in the block chain network according to the video SIMilarity.
Optionally, determining whether a video sequence already exists in the blockchain network further comprises:
step 31, determining the mean and variance of the first target frame in the video sequence, determining the mean and variance of the second target frame in the certified video, and determining the covariance between the first target frame and the second target frame.
In the embodiment of the present application, if x represents a first target frame in a video sequence and y represents a second target frame in a certified video, all pixels in the first target frame are passedThe values can be calculated as mean values mu x Variance, variance
Figure BDA0002923901460000211
The average value mu can be calculated from all pixel values in the second target frame y Variance, variance
Figure BDA0002923901460000212
The covariance σ can be calculated from all pixel values of the first target frame and the second target frame xy
And step 32, determining the brightness similarity between the first target frame and the second target frame by using the average value of the first target frame and the average value of the second target frame.
In the embodiment of the present application, the brightness (luminance) similarity may be expressed as:
Figure BDA0002923901460000213
wherein, c 1 =(k 1 L) 2 Is constant, avoids dividing by zero, k 1 L is the range of pixel values, 0.01.
And step 33, determining the contrast similarity between the first target frame and the second target frame by using the variance of the first target frame and the variance of the second target frame.
In the embodiment of the present application, the contrast (contrast) similarity may be expressed as:
Figure BDA0002923901460000214
wherein, c 2 =(k 2 L) 2 Is constant, avoids dividing by zero, k 2 L is a range of pixel values 0.03.
And step 34, determining the structural similarity between the first target frame and the second target frame by using the covariance between the first target frame and the second target frame.
In the embodiment of the present application, the structure similarity may be expressed as:
Figure BDA0002923901460000215
wherein, c 3 Is constant, avoids dividing by zero, can take c 3 =c 2 /2。
And step 35, determining the global similarity between the first target frame and the second target frame by using the brightness similarity, the contrast similarity and the structure similarity.
In this embodiment of the present application, the global similarity may be expressed as:
SSIM(x,y)=[l(x,y) α ·c(x,y) β ·s(x,y) γ ]
when α, β, γ are set to 1, the following can be obtained:
Figure BDA0002923901460000221
and step 36, when the global similarity is greater than or equal to the target threshold, determining that the video sequence exists in the blockchain network.
SSIM (x, y) is the similarity of each frame between the video to be certified and the certified video, whether data are certified or not can be judged by utilizing the similarity of each frame, the weighted average value of all the frames can be obtained after the similarity of the frames is calculated, and the overall similarity of the video can be obtained, so that whether a merchant boxing and shipping video exists in a block chain network or not can be judged according to the overall similarity of the video, and a courier confirms to take in and receive the video, a user to take in and send out the box video and the like.
The embodiment of the application also provides a right maintaining method based on video evidence.
Optionally, after the data storage is completed, the method further includes:
step 41, under the condition of receiving a right-maintaining request for a target resource, acquiring a resource exchange identifier associated with the target resource;
step 42, extracting a third video matched with the resource exchange identifier from the blockchain network as first evidence storage data, and extracting at least one of the first video and the second video matched with the resource exchange identifier from the blockchain network as second evidence storage data;
step 43, determining the similarity between the first certificate storing data and the second certificate storing data;
and step 44, determining that the right passes under the condition that the similarity meets the target condition.
In the embodiment of the application, a user initiates a right maintenance request, the e-commerce platform determines dispute goods according to the right maintenance request of the user, and then obtains an order number, a logistics number and the like associated with the goods. According to the order number and the logistics number, the e-commerce platform extracts all related videos of the commodity from the block chain network, and then calculates the similarity between the user receiving and opening video and the merchant packing and delivering video, the similarity between the user receiving and opening video and the receiving video confirmed by the courier, and the similarity between the receiving video confirmed by the courier and the merchant packing and delivering video, so that whether the commodity received by the user, the commodity confirmed by the courier and the commodity delivered by the merchant are consistent or not is judged, and the right maintenance judgment is carried out. When the similarity indicates that the commodities received by the user are inconsistent with the commodities sent by the merchant or the commodities received by the user are inconsistent with the commodities received by the courier, the right-maintaining request of the user is determined to pass, and electronic evidence is further collected from the block chain and can be synchronized into evidence-storing databases of judicial departments and internet courts.
By adopting the technical scheme, a series of commodity circulation programs such as commodity packing and delivery from a merchant, receipt confirmation by a courier, logistics transportation, user collection and delivery opening and the like can be recorded through videos, the characteristics of the videos are identified, and the videos are uploaded to a block chain for evidence storage under the condition that the videos do not comprise control contents, so that the true conditions of commodities in E-commerce logistics are effectively stored, and the problem of how to store data in the E-commerce logistics field is solved. Moreover, because the videos have coherence and are difficult to forge and tamper, when disputes occur, all videos related to disputed commodities can be obtained from the block chain network, and the videos of persons responsible for binding are compared, so that the responsibility can be traced, and the difficulty in obtaining evidence and the counterfeiting of evidence are avoided.
According to another aspect of the embodiments of the present application, as shown in fig. 6, there is provided a blockchain-based evidence storing apparatus, including:
the data acquisition module 601 is configured to acquire a video sequence to be certified, where the video sequence stores an operation record for performing logistics transportation on a target resource;
a feature extraction module 603, configured to extract an image feature of each frame in a video sequence;
the feature comparison and evidence storage module 605 is configured to, when the image features of all frames of the video sequence indicate that the target resource is an unregulated resource, upload the video sequence, the target hash value of the video sequence, and the resource exchange identifier associated with the video sequence to a block chain network, generate a data block in the block chain network, store the video sequence, the target hash value, and the resource exchange identifier, and perform consensus in at least one block chain node to complete data evidence storage.
It should be noted that the data obtaining module 601 in this embodiment may be configured to execute step S502 in this embodiment, the feature extracting module 603 in this embodiment may be configured to execute step S504 in this embodiment, and the feature comparing and verifying module 605 in this embodiment may be configured to execute step S506 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Optionally, the evidence storing apparatus based on the blockchain further includes a hash calculation module, configured to:
under the condition that a first confirmation operation on a first video is received, determining a first hash value of the first video, wherein the first video and the first confirmation operation are uploaded by a resource sending object of a target resource, a video sequence comprises the first video, and the target hash value comprises the first hash value;
under the condition that a second confirmation operation on a second video is received, determining a second hash value of the second video, wherein the second video and the second confirmation operation are uploaded by a resource transport object of a target resource, a video sequence comprises the second video, and the target hash value comprises the second hash value;
and under the condition that a third confirmation operation on the third video is received, determining a third hash value of the third video, wherein the third video and the third confirmation operation are uploaded by a resource receiving object of the target resource, the video sequence comprises the third video, and the target hash value comprises the third hash value.
Optionally, the evidence storing device based on the block chain further includes a data repeatability judging module, configured to:
traversing hash values stored in a material library of the storage and certification system, and carrying out XOR operation on each hash value and a target hash value to determine the Hamming distance between the target hash value and each hash value stored in the material library of the storage and certification system, wherein the data stored in the material library of the storage and certification system is the data which has been stored in the block chain network;
in the case that the value of the Hamming distance is within the target value range, it is determined that the video sequence already exists in the blockchain network.
Optionally, the data repeatability judging module further includes a perceptual hash discriminating unit, configured to:
determining a first perceptual hash value of a video sequence on a frame-by-frame basis, comprising: reducing a first target frame to a first size, wherein the first target frame is an image frame in a video sequence; converting the first target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the first target frame with the simplified colors; extracting a first transformation result with a second size from the transformation results, and determining a first average value of the first transformation result; replacing the numerical value which is larger than or equal to the first average value in the first transformation result with a first numerical value, and replacing the numerical value which is smaller than the first average value with a second numerical value; arranging the first conversion results after replacing the numerical values according to a target sequence to obtain a first perception hash value;
extracting the certified video stored in the material library of the certified system, and determining a second perceptual hash value of the certified video frame by frame, wherein the steps comprise: reducing a second target frame to a first size, wherein the second target frame is an image frame in the certified video; converting the second target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the second target frame with the simplified colors; extracting a second transformation result of a second size from the transformation results, and determining a second average value of the second transformation result; replacing the numerical value which is larger than or equal to the second average value in the second transformation result with a first numerical value, and replacing the numerical value which is smaller than the second average value with a second numerical value; arranging the second conversion results after replacing the numerical values according to a target sequence to obtain a second perception hash value;
determining the number of the same numerical value of corresponding bits between the first perception hash value and the second perception hash value;
and determining that the video sequence exists in the block chain network under the condition that the number of the same numerical values of the corresponding bits is greater than or equal to the target number.
Optionally, the data repeatability judging module further includes a video similarity determining unit, configured to:
determining the mean and variance of a first target frame in a video sequence, determining the mean and variance of a second target frame in a certified video, and determining the covariance between the first target frame and the second target frame;
determining the brightness similarity between the first target frame and the second target frame by using the average value of the first target frame and the average value of the second target frame;
determining contrast similarity between the first target frame and the second target frame by using the variance of the first target frame and the variance of the second target frame;
determining a structural similarity between the first target frame and the second target frame using a covariance between the first target frame and the second target frame;
determining global similarity between the first target frame and the second target frame by using the brightness similarity, the contrast similarity and the structural similarity;
and when the global similarity is larger than or equal to the target threshold, determining that the video sequence exists in the block chain network.
Optionally, the evidence storing apparatus based on the block chain further includes a right maintaining module, configured to:
under the condition that a right-maintaining request for a target resource is received, a resource exchange identifier associated with the target resource is obtained;
extracting a third video matched with the resource exchange identifier from the blockchain network as first evidence storage data, and extracting at least one of the first video and the second video matched with the resource exchange identifier from the blockchain network as second evidence storage data;
determining the similarity between the first evidence storing data and the second evidence storing data;
and determining that the right passes under the condition that the similarity meets the target condition.
According to another aspect of the embodiments of the present application, an electronic device is provided, as shown in fig. 7, and includes a memory 701, a processor 703, a communication interface 705, and a communication bus 707, where the memory 701 stores a computer program that is executable on the processor 703, the memory 701 and the processor 703 communicate with each other through the communication interface 705 and the communication bus 707, and the processor 703 implements the steps of the method when executing the computer program.
The memory and the processor in the electronic equipment are communicated with the communication interface through a communication bus. The communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
There is also provided, in accordance with yet another aspect of an embodiment of the present application, a computer-readable medium having non-volatile program code executable by a processor.
Optionally, in an embodiment of the present application, a computer readable medium is configured to store program code for the processor to perform the following steps:
acquiring a video sequence to be stored with a record of the operation of logistics transportation of the target resource;
extracting image characteristics of each frame in a video sequence;
and under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-controlled resource, uploading the video sequence, the target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data storage.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
When the embodiments of the present application are specifically implemented, reference may be made to the above embodiments, and corresponding technical effects are achieved.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk. It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A block chain-based evidence storing method is characterized by comprising the following steps:
acquiring a video sequence to be stored with a certificate, wherein the video sequence stores an operation record for carrying out logistics transportation on a target resource;
extracting image characteristics of each frame in the video sequence;
and under the condition that the image characteristics of all frames of the video sequence indicate that the target resource is a non-regulated resource, uploading the video sequence, the target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network, so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data storage.
2. The method of claim 1, wherein prior to uploading the video sequence, the target hash value for the video sequence, and the resource exchange identifier associated with the video sequence to a blockchain network, the method further comprises determining the target hash value for the video sequence as follows:
under the condition that a first confirmation operation on a first video is received, determining a first hash value of the first video, wherein the first video and the first confirmation operation are uploaded by a resource sending object of the target resource, the video sequence comprises the first video, and the target hash value comprises the first hash value;
determining a second hash value of a second video in the case of receiving a second confirmation operation on the second video, wherein the second video and the second confirmation operation are uploaded by a resource transport object of the target resource, the video sequence includes the second video, and the target hash value includes the second hash value;
determining a third hash value of a third video in the case of receiving a third confirmation operation on the third video, wherein the third video and the third confirmation operation are uploaded by a resource receiving object of the target resource, the video sequence includes the third video, and the target hash value includes the third hash value.
3. The method of claim 2, wherein after determining the target hash value for the video sequence, the method further comprises determining whether the video sequence already exists in the blockchain network as follows:
traversing hash values stored in a material library of the evidence storage system, and performing XOR operation on each hash value and the target hash value to determine a Hamming distance between the target hash value and each hash value stored in the material library of the evidence storage system, wherein the data stored in the material library of the evidence storage system is the data which has been stored in the block chain network;
determining that the video sequence already exists in the blockchain network if the hamming distance has a value within a target range of values.
4. The method of claim 3, wherein determining whether the video sequence already exists in the blockchain network further comprises:
determining, on a frame-by-frame basis, a first perceptual hash value of the video sequence, comprising: reducing a first target frame to a first size, wherein the first target frame is an image frame in the video sequence; converting the first target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the first target frame with the simplified colors; extracting a first transformation result with a second size from the transformation results, and determining a first average value of the first transformation result; replacing values which are greater than or equal to the first average value in the first transformation result with a first value, and replacing values which are smaller than the first average value with a second value; arranging the first conversion results after numerical value replacement according to a target sequence to obtain the first perception hash value;
extracting the certified video stored in the material library of the certified system, and determining a second perceptual hash value of the certified video frame by frame, comprising: reducing a second target frame to the first size, wherein the second target frame is an image frame in the certified video; converting the second target frame with the reduced size into an image frame with a preset gray level to simplify colors; performing discrete cosine transform on the second target frame with the simplified colors; extracting a second transformation result of the second size from the transformation results and determining a second average value of the second transformation result; replacing values of the second transformation result, which are greater than or equal to the second average value, with the first value, and replacing values which are smaller than the second average value with the second value; arranging the second conversion results after numerical value replacement according to the target sequence to obtain a second perception hash value;
determining the number of the same numerical value of the corresponding bit between the first perception hash value and the second perception hash value;
and determining that the video sequence exists in the block chain network under the condition that the number of the same numerical value of the corresponding bits is larger than or equal to the target number.
5. The method of claim 4, wherein determining whether the video sequence already exists in the blockchain network further comprises:
determining a mean, a variance of the first target frame in the video sequence, determining a mean, a variance of the second target frame in the certified video, and determining a covariance between the first target frame and the second target frame;
determining the brightness similarity between the first target frame and the second target frame by using the average value of the first target frame and the average value of the second target frame;
determining contrast similarity between the first target frame and the second target frame by using the variance of the first target frame and the variance of the second target frame;
determining a structural similarity between the first target frame and the second target frame using a covariance between the first target frame and the second target frame;
determining a global similarity between the first target frame and the second target frame using the brightness similarity, the contrast similarity, and the structural similarity;
determining that the video sequence already exists in the blockchain network when the global similarity is greater than or equal to a target threshold.
6. The method of any of claims 2 to 5, wherein after the data is validated, the method further comprises:
under the condition that a right-maintaining request for the target resource is received, acquiring a resource exchange identifier associated with the target resource;
extracting the third video matched with the resource exchange identifier from the blockchain network as first evidence storage data, and extracting at least one of the first video and the second video matched with the resource exchange identifier from the blockchain network as second evidence storage data;
determining similarity between the first evidence storing data and the second evidence storing data;
and determining that the right passes under the condition that the similarity meets the target condition.
7. A block chain-based evidence storing device is characterized by comprising:
the data acquisition module is used for acquiring a video sequence to be stored with evidence, wherein the video sequence stores operation records for logistics transportation of target resources;
the characteristic extraction module is used for extracting the image characteristic of each frame in the video sequence;
the feature comparison and evidence storage module is used for uploading the video sequence, a target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network under the condition that the image features of all frames of the video sequence indicate that the target resource is a non-regulated resource, so as to generate a data block in the block chain network, store the video sequence, the target hash value and the resource exchange identifier, and perform consensus in at least one block chain node to complete data evidence storage.
8. A block-chain-based deposit certificate system, comprising:
at least one data acquisition device for acquiring a video sequence operating on a target resource;
the server is used for extracting image features of each frame in the video sequence, uploading the video sequence, a target hash value of the video sequence and a resource exchange identifier associated with the video sequence to a block chain network for evidence storage under the condition that the image features of all the frames of the video sequence indicate that the target resource is an unregulated resource, and extracting evidence storage data associated with the target resource from the block chain network when a right maintenance request for the target resource is received so as to determine whether the right maintenance request passes;
and the block chain network is used for generating a data block to store the video sequence and the resource exchange identifier, and the data block stores a hash value obtained by performing hash calculation on the video sequence.
9. An electronic device comprising a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program operable on the processor, and the memory and the processor communicate via the communication bus and the communication interface, wherein the processor implements the steps of the method according to any of the claims 1 to 6 when executing the computer program.
10. A computer-readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of any of claims 1 to 6.
CN202110125571.8A 2021-01-29 2021-01-29 Block chain based evidence storing method, device, system, equipment and storage medium Pending CN114821380A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110125571.8A CN114821380A (en) 2021-01-29 2021-01-29 Block chain based evidence storing method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110125571.8A CN114821380A (en) 2021-01-29 2021-01-29 Block chain based evidence storing method, device, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114821380A true CN114821380A (en) 2022-07-29

Family

ID=82526801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110125571.8A Pending CN114821380A (en) 2021-01-29 2021-01-29 Block chain based evidence storing method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114821380A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115147627A (en) * 2022-09-01 2022-10-04 深流微智能科技(深圳)有限公司 Visual print processing method, device, terminal and storage medium for verifying credibility of video

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115147627A (en) * 2022-09-01 2022-10-04 深流微智能科技(深圳)有限公司 Visual print processing method, device, terminal and storage medium for verifying credibility of video
CN115147627B (en) * 2022-09-01 2022-11-18 深流微智能科技(深圳)有限公司 Visual print processing method, device, terminal and storage medium for verifying credibility of video

Similar Documents

Publication Publication Date Title
CN109067541B (en) Data verification method and device based on block chain and electronic equipment
US11621847B2 (en) Consensus layer architecture for maintaining security with reduced processing power dependency in untrusted decentralized computing platforms
US10972255B2 (en) Blockchain validation system
CN107637015A (en) Digital identity system
US11764974B2 (en) Method and system for certification and authentication of objects
US11075766B1 (en) Method and system for certification and authentication of objects
US20220337439A1 (en) Rights-enabled tokens for blockchain applications
CN112437922A (en) Distributed data recording
US20220215382A1 (en) Blockchain-based product authentication system
US11182873B2 (en) Multiple source watermarking for surveillance
CN115829559A (en) Adding added value to NFT
US11756047B2 (en) Fingerprinting physical items to mint NFT's
JP6928209B2 (en) A method for verifying the reliability and validity of crowdsourcing users
CN115730277A (en) Supplemental digital content access control using non-homogeneous token NFT
CN112418851A (en) Digital copyright registration, transaction and protection method and system
CN114821380A (en) Block chain based evidence storing method, device, system, equipment and storage medium
CN112699799A (en) Face recognition method, device, equipment and storage medium based on block chain
US20230055835A1 (en) Systems and Methods for Using a Non-Fungible Digital Asset to Facilitate Accessing an Access-Restricted Resource
KR102442796B1 (en) Online used market based verify transaction service using offline check
WO2023015312A1 (en) Methods for securely adding data to a blockchain using dynamic time quanta and version authentication
CN112559863A (en) Information pushing method, device, equipment and storage medium based on block chain
Kerr et al. A non-invasive method for the cataloguing and authentication of surveillance video using on-camera blockchain participation, machine learning and signal analysis
US20230368293A1 (en) Fiat payment based on a cryptocurrency blockchain transaction
US20230368292A1 (en) Cryptocurrency payment based on a canceled fiat transaction
US20230089680A1 (en) Systems and Methods Using Cameras on Smartphones to Provide Provably Trusted and Authentic Photographs of Persons, Locations, Items, and Property

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination