CN111884807B - Article reservation method, apparatus, device and medium based on block chain - Google Patents
Article reservation method, apparatus, device and medium based on block chain Download PDFInfo
- Publication number
- CN111884807B CN111884807B CN202010670261.XA CN202010670261A CN111884807B CN 111884807 B CN111884807 B CN 111884807B CN 202010670261 A CN202010670261 A CN 202010670261A CN 111884807 B CN111884807 B CN 111884807B
- Authority
- CN
- China
- Prior art keywords
- reservation
- user
- block chain
- identification
- result
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3263—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Computer Security & Cryptography (AREA)
- Marketing (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Development Economics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the application provides an article reservation method, device, equipment and medium based on a block chain, wherein the method comprises the following steps: the reservation equipment encapsulates the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the reservation equipment sends reservation transaction data to the block chain node; if the block link node detects that the reserved transaction data meets the legitimacy condition according to the user reservation identification and the certification data, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number; the block chain link point determines a reservation result associated with the user reservation identification according to the drawing probability, and returns the reservation result to reservation equipment; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification. By adopting the embodiment of the application, the fairness and the effectiveness of article reservation can be improved.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a medium for article reservation based on a blockchain.
Background
With the rapid development of information technology, a user can transact daily business on the Internet without going out, and if the user can make mask appointment in Internet application software, the user does not need to go out and queue, and the user can be prevented from gathering.
In the existing mask appointment system, a user can fill personal information into the mask appointment system in advance to prepare appointment, and then an authority can generate the number shaking of the user participating in the appointment by using number shaking software at a specified time. However, since the serial number shaking software is managed by a centralized organization, there are unfair behaviors such as cheating and data falsification, and it is difficult to ensure the validity of the reservation result.
Disclosure of Invention
The embodiment of the application provides an article reservation method, device, equipment and medium based on a block chain, which can improve the fairness and effectiveness of article reservation results.
An embodiment of the present application provides an article reservation method based on a block chain, including:
the reservation equipment encapsulates the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
the reservation equipment sends reservation transaction data to the block chain node;
if the block link node detects that the reserved transaction data meets the legitimacy condition according to the user reservation identification and the certification data, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number;
the block chain link point determines a reservation result associated with the user reservation identification according to the drawing probability, and returns the reservation result to reservation equipment; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
An embodiment of the present application provides an article reservation method based on a block chain, including:
the reservation equipment encapsulates the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
the reservation equipment sends the reservation transaction data to the block chain node so that the block chain node determines a reservation result associated with the user reservation identification according to the drawing probability when detecting that the reservation transaction data meets the legitimacy condition according to the user reservation identification and the certification data; the probability of a draw is determined from the verifiable random number;
the reservation equipment receives a reservation result returned by the block link point; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
An embodiment of the present application provides an article reservation method based on a block chain, including:
the block chain link point receives reservation transaction data sent by reservation equipment; the reservation transaction data comprises a user reservation identifier, a verifiable random number and certification data, the verifiable random number and the certification data are generated according to the user reservation identifier and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
if the block link node detects that the reserved transaction data meets the legitimacy condition according to the user reservation identification and the certification data, the block link node determines the drawing probability corresponding to the user reservation identification according to the verifiable random number;
the block chain link point determines a reservation result associated with the user reservation identification according to the drawing probability, and returns the reservation result to reservation equipment; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
An aspect of an embodiment of the present application provides an article reservation apparatus based on a block chain, including:
the first packaging module is used for packaging the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
the first sending module is used for sending the reserved transaction data to the block link node;
the probability determining module is used for determining the drawing probability corresponding to the user reservation identification according to the verifiable random number if the reservation transaction data is detected to meet the legitimacy condition according to the user reservation identification and the certification data;
the result determining module is used for determining a reservation result associated with the user reservation identification according to the drawing probability and returning the reservation result to the reservation equipment; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
Wherein, the device still includes:
the second encapsulation module is used for acquiring the article reservation intelligent contract and encapsulating the article reservation intelligent contract, the platform certificate hash and the platform public key into contract transaction data; the article reservation intelligent contract comprises article reservation rules corresponding to users passing reservation auditing in the block chain network, the platform certificate hash refers to a hash value corresponding to a platform certificate stored in the block chain network, and the platform public key is used for verifying contract transaction data by the block chain link points;
the second sending module is used for sending the contract transaction data to the block chain node;
the contract deployment module is used for deploying the intelligent contract for article reservation in the block chain network to obtain a contract address corresponding to the intelligent contract for article reservation if the contract transaction data is detected to meet the legitimacy condition according to the platform certificate hash and the platform public key;
the reservation identifier determining module is used for receiving the contract address returned by the block link point and determining a user reservation identifier according to the contract address, the audit rule information and the user information; the audit rule information is rule information provided by the prevention and control organization for auditing the user information.
Wherein, the reservation identification determining module comprises:
the rule packaging unit is used for acquiring audit rule information issued by a prevention and control mechanism and packaging the audit rule information, the contract address and the mechanism information into rule transaction data; the mechanism information comprises mechanism identification information, mechanism certificate hash and a mechanism public key corresponding to the prevention and control mechanism, wherein the mechanism certificate hash is a hash value corresponding to a mechanism certificate stored in the block chain network, and the mechanism public key is used for verifying and signing the regular transaction data by the block chain link point;
the rule sending unit is used for sending the rule transaction data to the block chain nodes so that the block chain nodes issue audit rule information in the block chain network when detecting that the rule transaction data meet the validity condition according to the contract address, the agency certificate hash and the agency public key, and the rule abstract hash corresponding to the audit rule information is obtained;
and the identification determining unit is used for receiving the regular abstract hash returned by the block link point and determining the user reservation identification according to the contract address, the regular abstract hash and the user information.
Wherein the identification determination unit includes:
the user information sending subunit is used for acquiring user information associated with a target user and packaging the user information, the rule abstract hash and the contract address into user transaction data; the user information comprises user identification information, user certificate hash, a user public key and user basic information, wherein the user certificate hash is a hash value corresponding to a user certificate stored in the block chain network;
the user information sending subunit is used for sending the user transaction data to the block chain node so that the block chain node generates a user reservation identifier matched with a target user when detecting that the user transaction data meets a legality condition according to the rule abstract hash, the contract address, the user certificate hash and the user public key;
and the reservation identifier receiving subunit is used for receiving the user reservation identifier returned by the block link point and storing the user reservation identifier, the rule abstract hash and the contract address in the platform database in a correlation manner.
Wherein, the device still includes:
the certificate application module is used for acquiring the platform identity information and the platform quality information, locally generating a platform key pair, and signing the platform identity information and the platform quality information according to a platform private key in the platform key pair to obtain certificate application information;
the request sending module is used for sending a certificate application request carrying certificate application information to the certificate authorization node so that the certificate authorization node issues a platform certificate for the reservation platform according to the certificate application information and performs uplink processing on the platform certificate to obtain a platform certificate hash;
and the certificate receiving module is used for receiving the platform certificate and the platform certificate hash returned by the certificate authorization node.
Wherein, the device still includes:
the signature verification module is used for verifying the signature of the user transaction data according to the user public key to obtain a signature verification result corresponding to the user transaction data;
the auditing module is used for determining the auditing result of the basic information of the user according to the auditing rule information if the auditing rule information matched with the rule abstract hash is inquired in the block chain network;
and the first transaction verification module is used for determining that the user transaction data meets the validity condition if the block chain network is detected to contain the contract address and the user certificate hash and the signature verification result and the verification result are both pass results.
Wherein, the device still includes:
the traversal module is used for generating a to-be-verified result corresponding to the certification data according to the Hash operation and performing traversal query on the block chain data in the block chain network according to the user reservation identification;
the second transaction verification module is used for determining that the reserved transaction data meets the validity condition if the result to be verified is the same as the verifiable random number and the block chain data contains the user reservation identification;
the second transaction verification module is further configured to determine that the reserved transaction data does not meet the validity condition if it is detected that the to-be-verified result is different from the verifiable random number or the block chain data does not include the user reservation identifier.
Wherein the probability determination module comprises:
the contract acquisition unit is used for acquiring an article reservation intelligent contract related to the user reservation identification if the reservation transaction data is detected to meet the legitimacy condition according to the user reservation identification and the certification data;
the Hash operation unit is used for carrying out Hash operation on the verifiable random number according to the article reservation intelligent contract to obtain a candidate Hash value corresponding to the verifiable random number;
and the probability calculation unit is used for determining the ratio between the candidate hash value and the drawing parameter as a candidate random number, and determining the drawing probability corresponding to the user reservation identifier according to the candidate random number and the right parameter.
Wherein the result determination module comprises:
the probability acquisition unit is used for acquiring the drawing probability corresponding to at least two reservation identifications in the block height range; the at least two reservation identifications comprise user reservation identifications;
the ordering unit is used for ordering the at least two reservation identifications according to the drawing probability respectively corresponding to the at least two reservation identifications to obtain an identification ordered list;
and the result uplink unit is used for determining the reservation result associated with the user reservation identifier according to the identifier sorted list and performing uplink processing on the reservation result and the drawing probability corresponding to at least two reservation identifiers respectively.
Wherein, the result uplink unit includes:
the drawing result determining subunit is used for determining drawing results corresponding to the at least two reservation identifications respectively according to the identification sorting list;
the distribution information acquisition subunit is used for acquiring the number of the protected articles provided by the prevention and control mechanism and acquiring article distribution information from the article reservation intelligent contract associated with the user reservation identifier;
the unit quantity determining subunit is used for distributing the quantity of the protected articles according to the article distribution information and the drawing and signing result to obtain the quantity of the unit protected articles corresponding to the user reservation identification;
and the reservation result determining subunit is used for determining the drawing result and the unit protective article number corresponding to the user reservation identifier as the reservation result.
Wherein, the device still includes:
the verification request receiving module is used for acquiring reservation transaction data and drawing probability corresponding to a user reservation identifier from block chain data of a block chain network according to the user reservation identifier carried in a result verification request when the result verification request aiming at a target user and sent by the reservation equipment is received;
and the verification result generation module is used for generating a verification result corresponding to the target user by the block link node according to the reservation transaction data and the drawing probability and returning the verification result to the reservation equipment.
An aspect of an embodiment of the present application provides an article reservation apparatus based on a block chain, including:
the reservation data packaging module is used for packaging the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
the reservation data sending module is used for sending the reservation transaction data to the block link node so that the block link node determines a reservation result associated with the user reservation identifier according to the drawing probability when detecting that the reservation transaction data meets the legitimacy condition according to the user reservation identifier and the certification data; the probability of a draw is determined from the verifiable random number;
the reservation result receiving module is used for receiving the reservation result returned by the block chain link point; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
An aspect of an embodiment of the present application provides an article reservation apparatus based on a block chain, including:
the reservation data receiving module is used for receiving reservation transaction data sent by reservation equipment; the reservation transaction data comprises a user reservation identifier, a verifiable random number and certification data, the verifiable random number and the certification data are generated according to the user reservation identifier and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the drawing probability determining module is used for determining the drawing probability corresponding to the user reservation identification according to the verifiable random number if the reservation transaction data is detected to meet the legitimacy condition according to the user reservation identification and the certification data;
the reservation result determining module is used for determining a reservation result associated with the user reservation identification according to the drawing probability and returning the reservation result to the reservation equipment; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
An aspect of the embodiments of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the method in the aspect of the embodiments of the present application.
An aspect of the embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions that, when executed by a processor, perform the steps of the method as in an aspect of the embodiments of the present application.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the method provided in the various alternatives of the above aspect.
The embodiment of the application can package verifiable random numbers and certification data generated according to the user reservation identification and the user private key into reservation transaction data together with the user reservation identification through the reservation equipment, and send the reservation transaction data to the block chain node; the block link point can verify the legality of the reserved transaction data based on the user reservation identification and the certification data, when the reserved transaction data is legal, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number, then a reservation result associated with the user reservation identification is determined according to the drawing probability, the reservation result is returned to the reservation equipment, and the reservation result can be used for instructing a prevention and control mechanism to deliver the protective article matched with the reservation result to a target user corresponding to the user reservation identification. Due to the decentralization and the non-tamper property of the block chain, the reservation process of the protective article in the reservation equipment is public and transparent for the reservation user, and the reservation process and the reservation result of the protective article reserved in the reservation equipment can be recorded in the block chain, so that the reliability, the fairness and the effectiveness of the article reservation result are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of a system architecture provided by an embodiment of the present application;
fig. 2 is a schematic diagram of an item reservation scenario based on a block chain according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an article reservation method based on a block chain according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an intelligent contract for deploying an item reservation provided by an embodiment of the present application;
fig. 5 is a schematic diagram for determining a user reservation result according to an embodiment of the present application;
fig. 6 is a schematic diagram of a verification reservation result according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
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 only a part of the embodiments of the present application, and not all of the 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.
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), a consensus mechanism, an encryption algorithm and the like. The blockchain is essentially a decentralized database, which is a string of data blocks associated by using cryptography, each data block contains information of a batch of network transactions, and the information is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises public and private key generation maintenance (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorization condition, the user management module supervises and audits the transaction condition of certain real identities and provides rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node equipment and used for verifying the validity of the service request, recording the service request to storage after consensus on the valid request is completed, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the service information to a shared account (network communication) completely and consistently after encryption, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of upgrading and canceling the contracts; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
An intelligent contract may be understood as a computer program that runs on a distributed ledger (i.e., blockchain) that presets rules, has status, conditional responses, can encapsulate, validate, execute complex behaviors of distributed nodes, and performs information exchange, value transfer, and asset management. Based on a distributed architecture, a consensus algorithm and the like of a block chain, the intelligent contracts allow users who are not trusted to finish transactions without any trusted intermediary or authority of a third party, and meanwhile, the digital intelligent contracts can be flexibly embedded into various tangible or intangible assets, transactions and data, so that active or passive assets, information management and control are realized, and programmable intelligent assets, systems and the like are gradually constructed.
Referring to fig. 1, fig. 1 is a system architecture diagram according to an embodiment of the present disclosure. As shown in fig. 1, the system architecture may include a subscription device 10a, a user terminal 10b, a certificate authority node 10c, and a blockchain network. The reservation device 10a may be a device for reserving a secure item, the user terminal 10b may be a terminal device corresponding to a user who needs to reserve the secure item in the reservation device 10a, the Certificate Authority node 10c may be a Certificate Authority (CA), the Certificate Authority serves as a trusted third party in an e-commerce transaction and may assume responsibility for verifying validity of a public key in a public key system, the Certificate Authority node 10c may perform real-name authentication on the reservation device 10a and the user (i.e., the user who needs to reserve the secure item), issue a platform Certificate for the reservation device 10a after the real-name authentication, and package the platform Certificate into a transaction and upload the transaction to a block chain network; similarly, the certificate authority node 10c may issue a user certificate for the user after real-name authentication, and package the user certificate into a transaction and upload the transaction to the blockchain network, so that the blockchain node in the blockchain network writes both the platform certificate and the user certificate into the blockchain.
The user can fill user information in the reservation equipment 10a, the reservation equipment 10a uploads the user information to the block chain network, the block chain node in the block chain network audits the user information, the audited user information is written into the block chain, a user reservation identifier is generated for the audited user, the block chain node can return the user reservation identifier to the reservation equipment 10a, and the reservation equipment 10a can inform the user of the user reservation identifier. The user terminal 10b corresponding to the user may use the user subscription identifier and the private key of the user as input, run a Verifiable Random Function (VRF) to generate a Verifiable Random number and certification data, the user terminal 10b may package the user subscription identifier, the Verifiable Random number, and the certification data into transaction data and upload the transaction data to the block chain network, the block chain node performs a draw-out check on the Verifiable Random number included in the transaction data to obtain a subscription result associated with the user subscription identifier, and returns the subscription result to the user terminal 10b and an authority (such as a prevention and control mechanism), and the authority may allocate a protective article matching the subscription result to the user. Optionally, the user terminal 10b may package the user subscription identifier, the verifiable random number, and the certification data into transaction data via the fishery device 10a for uploading to the blockchain network.
The reservation device 10a may be a terminal device, or a server, or a computer program (including a program code) in a computer device, where the terminal device may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a palmtop computer, a Mobile Internet Device (MID), a wearable device (e.g., a smart watch, a smart band, etc.), and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
Wherein, cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to acquiring required resources in an on-demand and easily-extensible manner through a network; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud Computing is a product of development and fusion of traditional computers and Network Technologies, such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), Parallel Computing (Parallel Computing), Utility Computing (Utility Computing), Network Storage (Network Storage Technologies), Virtualization (Virtualization), Load balancing (Load Balance), and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
Referring to fig. 2, fig. 2 is a schematic view of an item reservation scenario based on a block chain according to an embodiment of the present disclosure. As shown in fig. 2, before the user 1 and the user 2 participate in the security article reservation shaking number, the reservation device 20c may upload user information filled by the user 1 and user information filled by the user 2 to the blockchain network, respectively, and when the user information corresponding to the user 1 and the user 2 passes the audit, the blockchain network may return the reservation identifier 1 for the user 1 and the reservation identifier 2 for the user 2 to the reservation device 20c, and then the reservation device 20c may notify the reservation identifier 1 to the user 1 and notify the reservation identifier 2 to the user 2. In other words, all users who want to participate in the security article reservation shaking number need to fill user information in the reservation device 20c in advance, and the block chain network verifies the user information corresponding to each user, and only the user who passes the verification will have a reservation identifier, which can be used for the subsequent user to participate in the security article reservation shaking number.
The user terminal 20a (i.e., the local terminal corresponding to the user 1) may use the subscription identifier 1 and the private key 1 of the user 1 as inputs of a verifiable random function, obtain the random number 1 corresponding to the user 1 through VRF _ Hash (private key 1, subscription identifier 1), obtain the certification 1 corresponding to the user 1 through VRF _ Proof (private key 1, subscription identifier 1), and send the random number 1, the certification 1, and the subscription identifier 1 to the subscription device 20 c. Similarly, the user terminal 20b (i.e., the local terminal corresponding to the user 2) may use the subscription identifier 2 and the private key 2 of the user 2 as inputs of the verifiable random function, obtain the random number 2 corresponding to the user 2 through VRF _ Hash (private key 2, subscription identifier 2), obtain the certificate 2 corresponding to the user 2 through VRF _ Proof (private key 2, subscription identifier 2), and send the random number 2, the certificate 2, and the subscription identifier 2 to the subscription device 20 c. Wherein VRF _ Hash () is used to represent a function for generating a random number in the verifiable random function, and VRF _ Proof () is used to represent a function for generating a Proof in the verifiable random function; after the user 1 and the user 2 perform real-name authentication in the reservation device 20c, the reservation device 20c may locally generate asymmetric key pairs for the user 1 and the user 2, where the asymmetric key pair corresponding to the user 1 includes a public key 1 and a private key 1, the asymmetric key pair corresponding to the user 2 includes a public key 2 and a private key 2, and the reservation device 20c may return the asymmetric key pair corresponding to the user 1 to the user terminal 20a and return the asymmetric key pair corresponding to the user 2 to the user terminal 20 b; optionally, the asymmetric key pair corresponding to each user may be generated by a corresponding user terminal, for example, the user terminal 20a may locally generate an asymmetric key pair (including the public key 1 and the private key 1) for the user 1, and the user terminal 20b may locally generate an asymmetric key pair (including the public key 2 and the private key 2) for the user 2, which is not limited in this embodiment.
After receiving the random number 1, the certificate 1 and the reservation identifier 1 sent by the user terminal 20a, the reservation device 20c may package the random number 1, the certificate 1 and the reservation identifier 1 into reservation transaction data 20d, digitally sign the reservation transaction data 20d using the private key 1 to obtain the reservation transaction data 20d carrying the digital signature 1, and send the reservation transaction data 20d carrying the digital signature 1 to the block link point 20f in the block chain network by the reservation device 20 c. Similarly, after receiving the random number 2, the certificate 2 and the reservation identifier 2 sent by the user terminal 20b, the reservation device 20c may package the random number 2, the certificate 2 and the reservation identifier 2 into reservation transaction data 20e, digitally sign the reservation transaction data 20e using the private key 2 to obtain the reservation transaction data 20e carrying the digital signature 2, and send the reservation transaction data 20e carrying the digital signature 2 to the block link point 20f in the block chain network by the reservation device 20 c.
After receiving the reserved transaction data 20d, the blockchain node 20f may verify the validity of the digital signature 1 carried in the reserved transaction data 20d according to the public key 1 corresponding to the user 1, and when the digital signature 1 is illegal, the blockchain node 20f may determine that the reserved transaction data 20d is invalid data, and may return an error result to the reserved device 20 c; when the digital signature 1 is legal, the correctness of the random number 1 can be continuously checked according to the certification 1 in the reserved transaction data 20d, if the random number 1 is successfully checked, the reserved transaction data 20d can be stored, and when the reserved identifier 1 is detected to be a valid identifier, that is, the reserved identifier 1 is already stored in the block chain, the random number 1 can be used as the input of a drawing algorithm, and drawing is performed through the drawing algorithm, so that the drawing probability corresponding to the user 1 is a 1. Similarly, after receiving the reserved transaction data 20e, the tile link point 20f may also verify the validity of the digital signature 2 carried in the reserved transaction data 20e according to the public key 2 corresponding to the user 2, when the data signature 2 is illegal, may continue to verify the correctness of the random number 2 according to the certificate 2 in the reserved transaction data 20e, if the random number 2 is successfully verified, the reserved transaction data 20e may be stored, and when detecting that the reserved identifier 2 is already stored in the tile chain, the random number 2 may be used as an input of a drawing algorithm, and a drawing probability corresponding to the user 2 is obtained by drawing through the drawing algorithm, where a2 is the drawing probability. In other words, when receiving the reservation transaction data associated with the user direction, the block link point 20f may perform validity verification on the received reservation transaction data, and after the reservation transaction data passes the validity verification, further use the random number included in the reservation transaction data as an input of a drawing algorithm, and obtain a drawing probability corresponding to each user through the drawing algorithm; the block chain node 20f may add the drawing probability corresponding to each user to the drawing probability set 20g, pack all the drawing probabilities included in the drawing probability set 20g into a new block 20h, and write the new block 20h into the block chain 20i after the new block 20h agrees.
The block chain node 20f may sort the drawing probabilities included in the drawing probability set 20g in descending order, and determine the reservation result corresponding to each user according to the article distribution information, the total number of the protected articles, and the drawing probability sorting result in the article reservation intelligent contract, where the reservation result corresponding to the user 1 is, for example: successfully, the security articles (e.g. 5 security articles, etc.) can be issued, and the reservation result corresponding to the user 2 is: and if the protection article fails, the protection article cannot be issued, and the drawing probability a1 corresponding to the user 1 is greater than the drawing probability a2 corresponding to the user 2. In the reserved shaking number scene of the protected article, the reserved protected article is realized through a verifiable random function and a drawing algorithm in a block chain, and the fairness and the effectiveness of article reservation can be improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating an article reservation method based on a block chain according to an embodiment of the present application. As shown in fig. 3, the block chain-based item reservation method may include the steps of:
step S101, packaging the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the attestation data are generated based on the user subscription identification and the user private key.
Specifically, the reservation device (e.g., the reservation device 20c in the embodiment corresponding to fig. 2) may obtain a user reservation identifier (e.g., the reservation identifier 1 in the embodiment corresponding to fig. 2), a verifiable random number (e.g., the random number 1 in the embodiment corresponding to fig. 2), and certification data (e.g., the certification 1 in the embodiment corresponding to fig. 2) sent by a user terminal corresponding to a user, encapsulate the user reservation identifier, the verifiable random number, and the certification data into reservation transaction data (e.g., the reservation transaction data 20d in the embodiment corresponding to fig. 2), and digitally sign the reservation transaction data based on a user private key corresponding to the user. The user subscription identifier is used to represent that the user has passed the information audit in the blockchain network, and both the verifiable random number and the certification data can be obtained by the user terminal through calculation by using a verifiable random function according to the user private key and the user subscription identifier, where the specific calculation manner of the verifiable random number and the certification data can refer to the description of the random number 1 and the certification 1 in the embodiment corresponding to fig. 2, and is not described here again.
Before the reservation equipment encapsulates the user reservation identifier, the verifiable random number and the certification data into reservation transaction data and uploads the reservation transaction data to the block chain network, the reservation equipment needs to complete preparation work before protection article reservation and shaking, for example, the reservation equipment applies a platform certificate to a certificate authorization node for real-name authentication, deploys an article reservation intelligent contract in the block chain network, applies an organization certificate to the certificate authorization node for real-name authentication, uploads auditing rule information issued by an anti-control organization to the block chain, applies a user certificate to the certificate authorization node for real-name authentication, uploads user information of a real-name authentication user to the block chain network for identity auditing to obtain the user reservation identifier (namely, obtain the authority participating in protection article shaking), and the like.
The preparation of the security article reservation rocker will be described in detail below. The reservation device may locally generate an asymmetric key pair (which may include a platform public key and a platform private key), where the platform private key of the asymmetric key pair may be managed by the reservation device itself, and the platform private key may be used to generate a digital signature of the reservation device; the platform public key in the asymmetric key pair can be notified to the certificate authority node, and the platform public key can be used for the certificate authority node to check and sign message data sent by the reservation equipment. The reservation equipment can acquire platform identity information and platform quality information, a platform private key is used for signing the platform identity information and the platform quality information to obtain certificate application information, a certificate application request carrying the certificate application information can be sent to the certificate authorization node, so that the certificate authorization node issues a platform certificate for a reservation platform according to the certificate application information, the platform certificate is subjected to chain link processing to acquire platform certificate hash, and the reservation equipment receives the platform certificate and the platform certificate hash returned by the certificate authorization node.
The platform identity information refers to information for representing the identity of the reserved equipment, the platform qualification information refers to platform service qualification information issued by the reserved equipment after the platform service of the reserved equipment is approved by the prevention and control organization, and the certificate authorization node may refer to a certificate authorization organization. After the reservation equipment carries out digital signature on the platform identity information and the platform qualification information through the platform private key, the platform public key, the platform identity information, the platform qualification information and the digital signature can be sent to a certificate authorization node to apply for a platform certificate; the certificate authority node performs validity verification on the received digital signature through the platform public key, when the digital signature of the reservation equipment is legal and the platform identity information and the platform quality information are judged to be valid, the certificate authority node can perform real-name authentication on the reservation equipment, binds the platform public key and the identity information of the reservation equipment and signs the platform public key and generates a platform certificate for the reservation equipment, the platform certificate is essentially the authentication of the platform public key of the reservation equipment signed by the certificate authority node, and the content of the platform certificate can comprise: the information of the certificate authorization node, the identity information of the reservation equipment, the platform public key, the certificate serial number (the serial number of each certificate has uniqueness), the validity period and the like. The certificate authorization node can pack the platform certificate into the certificate transaction data, and upload the certificate transaction data to the blockchain network after digitally signing the certificate transaction data by using a private key of the certificate authorization node, after receiving the certificate transaction data, the blockchain node in the blockchain network can carry out validity check on the digital signature carried by the certificate transaction data according to a public key of the certificate authorization node, if the validity check of the digital signature of the certificate authorization node is passed, a virtual machine (an Ethengfang virtual machine which can be used for explaining and executing byte codes in an intelligent contract) can be called to execute the certificate transaction data, in the execution process of the certificate transaction data, an intelligent contract (the intelligent contract here refers to a contract for storing the digital certificate) can be called to start certificate storage, the platform certificate contained in the certificate transaction data is subjected to digest calculation, namely the platform certificate is subjected to hash calculation by using a hash algorithm, obtaining a platform certificate hash corresponding to the platform certificate, inquiring according to the platform certificate hash, if the platform certificate hash exists in the block chain network, indicating that the certificate transaction data is invalid data, and outputting a transaction execution failure result; if the platform certificate hash is not stored in the block chain network, the platform certificate hash can be used as a keyword (key), the platform certificate can be used as a Value (Value) to be written into the intelligent contract, and after the intelligent contract added with the platform certificate and the platform certificate hash achieves consensus in the block chain network, the intelligent contract added with the platform certificate and the platform certificate hash can be written into the block chain; the block chain node can return the chaining result of the platform certificate (including a successful chaining result and a failed chaining result, when the intelligent contract added with the platform certificate and the platform certificate hash reaches a common identity and is written into the block chain, the chaining result of the platform certificate is the successful chaining result, when the intelligent contract added with the platform certificate and the platform certificate hash does not reach the common identity, the chaining result of the platform certificate is the failed chaining result) and the platform certificate hash to the certificate authorization node, and then the certificate authorization node can return the platform certificate and the platform certificate hash to the reservation equipment, and the reservation equipment can store the platform certificate and the platform certificate hash in the platform database. The hash algorithm may compress data or messages into digests, not only fix the format of the data, but also reduce the amount of the data, and the hash algorithm may include, but is not limited to, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. Taking the SHA-256 algorithm as an example, the SHA-256 algorithm can generate a 256-bit hash value for any size of data, and can generate different hash values for different data.
Similarly, the prevention and control organization (also called as an authority) can input organization identity information into the reservation equipment for real-name authentication, after the prevention and control organization passes the real-name authentication of the reservation equipment, the reservation equipment can generate an asymmetric key pair (which can comprise an organization public key and an organization private key) for the prevention and control organization, further can carry out digital signature on the organization identity information through the organization private key, and then sends the organization public key, the organization identity information and the digital signature of the prevention and control organization to the certificate authorization node to apply for an organization certificate; after receiving the public key of the organization, the identity information of the organization and the digital signature of the prevention and control organization, the certificate authorization node can perform real-name authentication on the prevention and control organization and issue an organization certificate for the prevention and control organization after the real-name authentication, the certificate authorization node can pack the organization certificate into transaction data and upload the transaction data to the block chain network, so that the block chain node in the block chain network returns an organization certificate hash to the certificate authorization node, and the certificate authorization node can return the organization certificate hash and the organization certificate hash to the reservation equipment; the reservation device may store the mechanism certificate and the mechanism certificate hash returned by the certificate authority node in the platform database, and of course, the reservation device may also notify the prevention and control organization of the mechanism certificate and the mechanism certificate hash. After the user passes real-name authentication in the reservation equipment, the reservation equipment can also generate an asymmetric key pair (comprising a user private key and a user public key) for the user, digitally sign user identity information through the user private key, and then send the user public key, the user identity information and the digital signature of the user to a certificate authorization node to apply for a user certificate, so that a user certificate and a user certificate hash corresponding to the user can be obtained from the certificate authorization node; the reservation device may store the user certificate and the user certificate hash returned by the certificate authority node in the platform database, and of course, the reservation device may also notify the user of the user certificate and the user certificate hash. The process of returning the authority certificate and the authority certificate hash to the reservation equipment and the process of returning the user certificate and the user certificate hash to the reservation equipment may refer to the above description of the process of obtaining the platform certificate and the platform certificate hash, and are not described herein again.
Optionally, the user may directly apply for the user certificate to the certificate authority node to obtain the user certificate and the hash of the user certificate from the certificate authority node, and the prevention and control authority may also directly apply for the authority certificate to the certificate authority node to obtain the authority certificate and the hash of the authority certificate from the certificate authority node.
After the reservation equipment obtains the platform certificate and the platform certificate hash, an article reservation intelligent contract can be obtained, and the article reservation intelligent contract, the platform certificate hash and the platform public key are packaged into contract transaction data, wherein the article reservation intelligent contract comprises article reservation rules (which can comprise reservation flows, reservation conditions and the like in the reservation equipment) corresponding to users passing reservation and verification in a block chain network, namely computer program codes written by developers after the reservation equipment and a prevention and control mechanism reach a consensus on the article reservation rules, the computer program codes can comprise service logic associated with a protection article reservation shaking number, the platform certificate hash refers to a hash value corresponding to the platform certificate stored in the block chain network, and the platform public key is used for verifying and signing the block chain link contract transaction data; the reservation equipment can send contract transaction data to the block chain nodes, the block chain nodes can verify the legality of the contract transaction data after receiving the contract transaction data sent by the reservation equipment, if the contract transaction data meet the legality condition according to the platform certificate hash and the platform public key, the block chain nodes can deploy the article reservation intelligent contract in the block chain network to obtain a contract address corresponding to the article reservation intelligent contract, and the contract address is returned to the reservation equipment; the reservation equipment receives a contract address returned by the block chain node, and determines a user reservation identifier associated with user information according to the contract address, audit rule information and the user information, wherein the contract address can be a hash value of an intelligent contract reserved for goods calculated by a hash algorithm, and the audit rule information is rule information provided by a prevention and control mechanism and used for auditing the user information.
The specific process of deploying the article reservation intelligent contract in the blockchain network by the reservation equipment may include: the reservation equipment can upload the article reservation intelligent contract to the blockchain network in a transaction form, the transaction can also be called contract transaction data, and the contract transaction data can comprise the article reservation intelligent contract, the platform certificate hash and the platform public key; it will be appreciated that the reservation device may also digitally sign the contract transaction data using the platform private key prior to uploading the contract transaction data to the blockchain network, uploading the digital signature and the contract transaction data together to the blockchain network. After the block chain network receives the contract transaction data and the corresponding digital signature, the block chain nodes in the block chain network can check and sign the digital signature corresponding to the contract transaction data according to the platform public key to check the validity of the digital signature, a check failure result can be returned to the reservation equipment when the digital signature check fails (namely the digital signature is illegal), and the contract transaction data can be packaged into blocks when the digital signature check succeeds (namely the digital signature is legal) and the contract transaction data contained in the blocks is executed.
In the execution process of the contract transaction data, the block link points can use a hash algorithm to generate a contract hash value corresponding to the article reservation intelligent contract, and the contract hash value is used as a contract address corresponding to the article reservation intelligent contract; the block chain node may check whether the intelligent contract for article reservation has been deployed in the block chain according to the contract address, and if the contract address is queried from the block chain, it indicates that the intelligent contract for article reservation has been deployed in the block chain, and may determine that the execution result of the contract transaction data is a transaction execution failure result; if the contract address is not inquired from the block chain, the article reservation intelligent contract is not deployed in the block chain, the block chain link point can continuously inquire whether a platform certificate is stored in the block chain according to the hash of the platform certificate, if the platform certificate matched with the hash of the platform certificate is not inquired from the block chain, the block chain does not store the platform certificate, namely the reservation equipment does not perform identity storage in the block chain and does not have the authority of deploying the article reservation intelligent contract, and the execution result of the contract transaction data is determined to be a transaction execution failure result; if the platform certificate matched with the platform certificate hash is inquired from the blockchain, the blockchain is represented to store the platform certificate, namely the reservation equipment performs identity storage in the blockchain, has the authority of deploying the article reservation intelligent contract, can continuously verify whether a platform public key contained in the platform certificate is consistent with a platform public key contained in contract transaction data or not, if the platform public key contained in the platform certificate is inconsistent with the platform public key contained in the contract transaction data, the identity of the reservation equipment is still to be verified, and the execution result of the contract transaction data can be determined to be a transaction execution failure result; if the platform public key contained in the platform certificate is consistent with the platform public key contained in the contract transaction data, the contract transaction data meets the legality condition, the execution result of the contract transaction data can be determined to be a successful transaction execution result, the contract address is used as a keyword, and the intelligent article reservation contract is cached as a value; the block chain node can identify the execution result of the contract transaction data together, and write the block containing the article reservation intelligent contract and the execution result achieving the identification into the block chain, and the block chain node can return the execution result of the contract transaction data and the contract address corresponding to the article reservation intelligent contract to the reservation equipment. The reservation device may store the contract transaction data, the contract address, and the execution result in a platform database.
It should be noted that the article reservation intelligent contract is a computer program code, a developer may use a high-level language of the intelligent contract to compile, and a compiler may compile the contract compiled in the high-level language into a bytecode in an ethernet virtual machine of a block chain node, and the ethernet virtual machine may be configured to interpret and execute the bytecode in the intelligent contract. The intelligent contract high-level languages include, but are not limited to, identity (an intelligent contract programming language), Serpent (an intelligent contract programming language), LLL (an intelligent contract programming language).
Referring to fig. 4 together, fig. 4 is a schematic diagram of an intelligent contract for deploying an item reservation according to an embodiment of the present application. As shown in fig. 4, after acquiring the article reservation intelligent contract 30d, the reservation device may deploy the article reservation intelligent contract 30d in the blockchain by initiating a transaction, that is, the reservation device may upload contract transaction data carrying the article reservation intelligent contract 30d to a blockchain network, a block link point 30b in the blockchain network may receive the contract transaction data, and check the contract transaction data based on a platform public key corresponding to the reservation device 30a, after the check passes, the block link point 30b may execute the contract transaction data in the ethernet virtual machine, that is, execute the contract code in the article reservation intelligent contract 30d, the contract code may automatically determine whether the current scene meets the contract triggering condition, strictly execute the contract response rule, and determine whether the contract transaction data is valid according to the contract code execution result, when the contract transaction data is validated, the contract transaction data may be packaged into a new data block (i.e. block 30c), the block link point 30b may broadcast the block 30c in the blockchain network, so that the rest nodes in the blockchain network perform consensus validation on the block 30c according to a consensus algorithm, when the block 30c passes the consensus, the block 30c may be formally uplinked, that is, after the block 30c passes the consensus, the block height of the block 30c may be updated according to the maximum block height in the blockchain stored by the blockchain node 30b, the updated block 30c is stored in the local database of the blockchain node 30b, and at this time, the updated block 30c is the block N + i, N + i in the local database of the blockchain node 30b for representing the block order of the updated block 30c in the blockchain, n and i are each an integer greater than or equal to 0. At this point, the deployment and winding process of the intelligent contract for goods reservation 30d is completed in the blockchain.
Optionally, after acquiring the contract address returned by the blockchain node, the reservation device may acquire audit rule information issued by the prevention and control mechanism, and encapsulate the audit rule information, the contract address, and the mechanism information into regular transaction data, where the mechanism information may include mechanism identification information, mechanism certificate hash, and a mechanism public key corresponding to the prevention and control mechanism, the mechanism certificate hash may be a hash value corresponding to a mechanism certificate stored in the blockchain network, and the mechanism public key may be used for verifying and signing the regular transaction data by using the blockchain node; the reservation equipment can send the rule transaction data to the block chain nodes, so that the block chain nodes issue audit rule information in the block chain network when detecting that the rule transaction data meets the validity condition according to the contract address, the agency certificate hash and the agency public key, and obtain the rule abstract hash corresponding to the audit rule information; the reservation equipment can receive the rule abstract hash returned by the block chain node, the rule abstract hash refers to a hash value which is calculated according to a hash algorithm and aims at auditing rule information, and the reservation equipment can determine a user reservation identifier according to a contract address, the rule abstract hash and user information.
The specific process of chaining the audit rule information issued by the prevention and control mechanism by the reservation equipment may include: the reservation equipment can upload audit rule information to the blockchain network in a transaction form, the transaction can also be called rule transaction data, and the rule transaction data can include audit rule information, organization identification information (such as organization number), a contract address, organization certificate hash and an organization public key; it will be appreciated that the subscribing device may also digitally sign the regular transaction data using the institution private key before uploading the regular transaction data to the blockchain network, uploading the digital signature and the regular transaction data together to the blockchain network. After the regular transaction data and the corresponding digital signature are received by the blockchain network, the blockchain nodes in the blockchain network can check and sign the digital signature corresponding to the regular transaction data according to the mechanism public key to check the validity of the digital signature, a check failure result can be returned to the reservation equipment when the check of the digital signature fails, and the regular transaction data can be packaged into a new block and the regular transaction data contained in the new block can be executed when the check of the digital signature succeeds.
In the execution process of the regular transaction data, the block chain nodes can check whether an article reservation intelligent contract is deployed according to a contract address, and if the article reservation intelligent contract matched with the contract address cannot be inquired in the block chain, the execution result of the regular transaction data can be determined to be a transaction execution failure result; if the intelligent contract of article appointment matched with the contract address can be inquired in the block chain, the intelligent contract of article appointment is called, a hash value corresponding to the audit rule information is generated by using a hash algorithm in the intelligent contract of article appointment, and the hash value is used as a rule abstract hash corresponding to the audit rule information; the block chain node may check whether the audit rule information has been deployed in the block chain according to the rule digest hash, and if the rule digest hash is queried from the block chain, it indicates that the audit rule information has been deployed in the block chain, and may determine that the execution result of the rule transaction data is a transaction execution failure result; if the rule abstract hash is not inquired from the block chain, the audit rule information is not deployed in the block chain, the block chain link point can continuously inquire whether the block chain stores a mechanism certificate according to the mechanism certificate hash, if the block chain does not inquire the mechanism certificate matched with the mechanism certificate hash, the block chain does not store the mechanism certificate, namely, the prevention and control mechanism does not store the identity card in the block chain, and the execution result of the rule transaction data is determined to be a transaction execution failure result; if the agency certificate matched with the agency certificate hash is inquired from the blockchain, the blockchain is indicated to store the agency certificate, namely, the prevention and control mechanism stores the identity in the blockchain, the block chain already has the authority of deploying and verifying rule information, whether the agency public key contained in the agency certificate is consistent with the agency public key contained in the rule transaction data can be continuously verified, if the agency public key contained in the agency certificate is inconsistent with the agency public key contained in the rule transaction data, the identity of the prevention and control mechanism is still to be verified, and the execution result of the rule transaction data can be determined to be a transaction execution failure result; if the organization public key contained in the organization certificate is consistent with the organization public key contained in the regular transaction data, the regular transaction data meets the legality condition, the execution result of the regular transaction data can be determined to be a successful transaction execution result, the hash of the rule abstract is used as a keyword, audit rule information and organization identification information are used as values to be written into an intelligent contract, the hash of the rule abstract is used as the keyword, the hash value corresponding to the regular transaction data is used as a value to be written into the intelligent contract, and the intelligent contract can refer to the article reservation intelligent contract or an intelligent contract having a calling relationship with the article reservation intelligent contract; the block chain node can perform consensus on the new block containing the rule transaction data and the execution result of the rule transaction data, and write the block containing the audit rule information and the execution result achieving the consensus into the block chain, which indicates that the audit rule information is successfully issued on the block chain; the block link node may return the rule digest hash of the audit rule information, the chain release result, and the transaction hash value corresponding to the rule transaction data to the reservation device. The reservation equipment can store the audit rule information and the information returned by the block chain nodes in the platform database, and inform the prevention and control mechanism of the information returned by the block chain nodes.
Optionally, the user may input the basic user information in the reservation device, or input the basic user information in a user terminal to which the user belongs, and the user terminal transmits the basic user information to the reservation device, and the reservation device may obtain the basic user information corresponding to each user. The reservation equipment deploys an article reservation intelligent contract in a block chain, and after linking audit rule information issued by a prevention and control mechanism, user information associated with a target user can be acquired, and the user information, rule abstract hash and contract address are encapsulated into user transaction data, wherein the user information can comprise user identification information (such as user number, identity number and other identifications used for representing identities), user certificate hash, a user public key and user basic information, and the user certificate hash can refer to a hash value corresponding to a user certificate stored in the block chain network; the reservation equipment can send the user transaction data to the blockchain node so that the blockchain node generates a user reservation identifier matched with a target user when detecting that the user transaction data meets a legality condition according to the rule abstract hash, the contract address, the user certificate hash and the user public key; the reservation device can receive the user reservation identification returned by the block chain node and store the user reservation identification, the rule digest hash and the contract address in the platform database in an associated manner.
The specific process of the subscribing device uplink the basic user information may include: the reservation equipment can upload the basic information of the user to the blockchain network in a transaction form, the transaction can also be called user transaction data, and the user transaction data can comprise the basic information of the user, user identification information, a contract address, rule digest hash, user certificate hash and a user public key; it will be appreciated that the subscribing device may also digitally sign the user transaction data using the user private key before uploading the user transaction data to the blockchain network, and upload the digital signature with the user transaction data to the blockchain network.
After the block chain network receives the user transaction data and the corresponding digital signature, the user transaction data can be checked and signed according to the user public key to obtain a sign checking result corresponding to the user transaction data, if auditing rule information matched with the rule abstract hash is inquired in the block chain network, an auditing result of basic information of the user is determined according to the auditing rule information, and if the block chain network is detected to contain a contract address and a user certificate hash, and the signing checking result and the auditing result are both passing results, the user transaction data are determined to meet the validity condition. In other words, the block link point in the block chain network may check the digital signature corresponding to the user transaction data according to the user public key to verify the validity of the digital signature, and when the digital signature fails to be verified, it may be determined that the result of checking the digital signature corresponding to the user transaction data is: if the signature is not passed, the block link point can return a signature failure result to the reservation equipment; when the digital signature is verified successfully, the signature verification result corresponding to the user transaction data can be determined as follows: and if the verification passes, packaging the user transaction data into a new block, and executing the user transaction data contained in the new block.
In the execution process of user transaction data, the block chain nodes can check whether an article reservation intelligent contract is deployed according to a contract address, and if the article reservation intelligent contract matched with the contract address cannot be inquired in the block chain, the execution result of the user transaction data can be determined to be a transaction execution failure result; if the intelligent contract for article reservation matched with the contract address can be inquired in the block chain, calling the intelligent contract for article reservation, inquiring whether a user certificate is stored in the block chain according to user certificate hash, if the user certificate matched with the user certificate hash is not inquired in the block chain, indicating that the user certificate is not stored in the block chain, and determining that the execution result of the user transaction data is a transaction execution failure result; if the user certificate matched with the user certificate hash is inquired from the blockchain, the blockchain indicates that the user certificate is stored, whether a user public key contained in the user certificate is consistent with a user public key contained in the user transaction data can be continuously verified, and if the user public key contained in the user certificate is inconsistent with the user public key contained in the user transaction data, the execution result of the user transaction data can be determined to be a transaction execution failure result; if the user public key contained in the user certificate is consistent with the user public key contained in the user transaction data, whether audit rule information matched with the rule digest hash is stored in the block chain can be inquired according to the rule digest hash, and if the audit rule information matched with the rule digest hash is not inquired in the block chain, the execution result of the user transaction data can be determined to be a transaction execution failure result; if the audit rule information matched with the rule abstract hash is inquired in the block chain, the basic information of the user can be audited according to the audit rule information to obtain the audit result corresponding to the basic information of the user, and if the target user is known to be a resident living in the range of the jurisdiction according to the basic information of the user, the geographic position of the target user is in the range of the jurisdiction when the target user performs reservation registration and the delivery address in the basic information of the user is an effective address in the range of the jurisdiction, the audit result of the basic information of the user can be determined as follows: the audit is passed; when the user basic information indicates that the target user is not a resident living in the jurisdiction range, or the geographic location of the target user is in the jurisdiction range when the target user performs reservation registration, or the delivery address in the user basic information is an effective address in the jurisdiction range, the auditing result of the user basic information can be determined as follows: the audit is not passed; when the auditing result of the user basic information is that the auditing is not passed, the execution result of the user transaction data can be determined to be a transaction execution failure result; when the auditing result of the user basic information is that the auditing is passed, the user transaction data can be determined to meet the validity condition. The block link point may generate a user reservation identifier for the target user, and write the user reservation identifier into an intelligent contract, where the intelligent contract may refer to the article reservation intelligent contract or an intelligent contract having a call relationship with the article reservation intelligent contract.
The block chain node can identify the new block containing the user transaction data and the execution result of the user transaction data, and write the block containing the user basic information and the execution result achieving the identification into the block chain; the block link point may return the user reservation identification of the target user and the transaction hash value corresponding to the user transaction data to the reservation device. The reservation equipment can store the basic information of the user and the user reservation identification and the transaction hash value returned by the block chain node in the platform database, and inform the target user of the user reservation identification and the transaction hash value returned by the block chain node, and the target user can participate in the reservation and number shaking process of the protected article by using the user reservation identification. It will be appreciated that in the platform database, associations may be established for stored user identification information, contract addresses, and rule digest hashes.
Step S102, the reserved transaction data is sent.
Specifically, the reservation device may upload the encapsulated reservation transaction data to a blockchain network, and any blockchain link point in the blockchain network may acquire the reservation transaction data.
And step S103, if the reserved transaction data is detected to meet the legitimacy condition according to the user reservation identification and the certification data, determining the drawing probability corresponding to the user reservation identification according to the verifiable random number.
Specifically, after receiving the reserved transaction data sent by the reservation device, the block link node in the block link network may perform validity verification on the reserved transaction data, where the validity verification process may include: the validity verification of the digital signature carried in the reserved transaction data, the correctness verification of the verifiable random number in the reserved transaction data, the validity verification of the user reserved identification and the like. The block link point can check the reserved transaction data according to the user public key of the target user, and if the digital signature is an illegal digital signature, the check result of the reserved transaction data can be determined as follows: the signature verification fails; if the digital signature is a legal digital signature, the correctness of the verifiable random number can be checked according to the certification data, and the validity of the user reservation identifier is checked, namely, the block chain nodes can generate a to-be-verified result corresponding to the certification data according to the Hash operation, meanwhile, the block chain data (namely, the block chain) in the block chain network can be subjected to traversal query according to the user reservation identifier, and if the block chain nodes detect that the to-be-verified result is the same as the verifiable random number and the block chain data contains the user reservation identifier, the reserved transaction data is determined to meet the validity condition; and if the block chain node detects that the result to be verified is different from the verifiable random number or the block chain data does not contain the user reservation identification, determining that the reservation transaction data does not meet the validity condition. In other words, when the block link point detects that the to-be-verified result is the same as the verifiable random number, the verifiable random number is correct, that is, in the process of verifying the correctness of the verifiable random number by the block link point, certification data can be generated through the user reservation identifier, the verifiable random number is obtained through the certification data calculation, and then the verifiable random number and the user reservation identifier can be deduced to be matched with each other, so that the verification result of the verifiable random number is correct; if the block link point detects that the result to be verified is different from the verifiable random number, the verifiable random number cannot be obtained through the calculation of the proof data, and the verification random number is wrong. When the block chain node inquires the user reservation identification from the block chain, the user reservation identification is represented as an effective identification; and when the user reservation identification is not inquired, the user reservation identification is represented as an invalid identification. The block chain node can determine that the reserved transaction data meets the legality condition only when detecting that the digital signature carried in the reserved transaction data passes the signature verification and the random number is correct, and the user reservation identification is valid, and can determine that the reserved transaction data does not meet the legality condition when any one of the conditions is not met in the verification process.
When the block link point determines that the reservation transaction data meets the legitimacy condition, an article reservation intelligent contract associated with the user reservation identification can be obtained, Hash operation is carried out on the verifiable random number according to the article reservation intelligent contract to obtain a candidate Hash value corresponding to the verifiable random number, the ratio between the candidate Hash value and the drawing parameter is determined as the candidate random number, and the drawing probability corresponding to the user reservation identification can be determined according to the candidate random number and the rights parameter. In other words, the block link point may obtain the article reservation intelligent contract according to the user reservation identifier, and perform a drawing operation on the reservation transaction data by invoking a drawing operation algorithm in the article reservation intelligent contract, where the drawing operation algorithm may take a verifiable random number in the reservation transaction data as an input, and output a drawing probability corresponding to the user reservation identifier, and the specific calculation formula is as follows: candidate hash value float64(hash (verifiable random number)), and the drawing parameter may refer to 32-bit maximum integer (MaxUint32), candidate random number candidate hash value/MaxUint 32, and drawing probability candidate random number(1.0/float64 (total number of people involved). 1000000000)Where, float64 is used to represent 64-bit floating-point data, and hash () is used to represent a hash function, (1.0/float64 (total number of participants) × 1000000000) represents a rights parameter.
It should be noted that each protection article reservation shaking number can have an expiration date, the user sends reservation transaction data to the block link point within the expiration date, the block link node will receive the reservation data and perform a draw-off on the reservation transaction data meeting the legitimacy condition, the block link point can refuse to receive the reservation transaction data sent outside the expiration date, therefore, within the expiration date, the block link point can count the total number of people participating in the protection article reservation shaking number, i.e. the total number of people participating in the benefit parameter, the expiration date can refer to a time period (e.g. 8:00-8:30), and also can refer to a block height range (since the reservation transaction data uploaded to the block link network and the calculated draw-off probability can be packaged into a block by the block link point and written into the block link chain, the expiration date can be the block height range such as the block height 1000-block height 2000, etc.), and each user participating in the protection article reservation shaking number can send reservation transaction data to the block chain link points, and the block chain link points calculate and obtain the drawing probability corresponding to each user based on the consensus.
And step S104, determining a reservation result associated with the user reservation identification according to the drawing probability.
Specifically, the block link point may determine the subscription result associated with the user subscription identifier according to the drawing probability corresponding to each user within the validity period. Taking the validity period as the block height range as an example, the block link point may obtain the draw-out probabilities corresponding to at least two reservation identifiers in the block height range, where the at least two reservation identifiers may include the user reservation identifier, sort the at least two reservation identifiers according to the draw-out probabilities corresponding to the at least two reservation identifiers, obtain an identifier sorted list, and then determine the reservation result associated with the user reservation identifier according to the identifier sorted list, and perform uplink processing on the reservation result and the draw-out probabilities corresponding to the at least two reservation identifiers. The block chain node can sort the drawing probability corresponding to at least two reservation identifications respectively according to the drawing probability to obtain a sorted drawing probability list, each drawing probability corresponds to one reservation identification, therefore, the sorted drawing probability list can be represented as an identification sorted list corresponding to at least two reservation identifications, and reservation results corresponding to the user reservation identifications can be determined according to the identification sorted list.
For example, the total number of persons participating in the security article reservation shaking number in the block height range is 5, each user in the 5 users corresponds to one reservation identifier, that is, 5 users correspond to 5 reservation identifiers, and the 5 reservation identifiers are respectively represented as: reservation label 1, reservation label 2, … …, reservation label 5, the lottery probability that obtains reservation label 1 through lottery algorithm calculation is: 0.2, the drawing probability corresponding to the reservation label 2 is as follows: 0.4, the drawing probability corresponding to the reservation identifier 3 is as follows: 0.3, the drawing probability corresponding to the reservation label 4 is as follows: 0.7, the drawing probability corresponding to the reservation label 5 is as follows: 0.1, according to the sequence of the drawing probability from big to small, 5 drawing probabilities are sequenced, and the obtained identification sequence list is as follows: the drawing probability of the reservation label 4 is 0.7, the drawing probability of the reservation label 2 is 0.4, the drawing probability of the reservation label 3 is 0.3, the drawing probability of the reservation label 1 is 0.2, and the drawing probability of the reservation label 5 is 0.1.
Optionally, the block link point may determine, according to the identifier sorted list, draw-off results corresponding to at least two reservation identifiers respectively, and further may obtain the number of the protected articles provided by the prevention and control mechanism, obtain article distribution information from an article reservation intelligent contract associated with the user reservation identifier, and may distribute the number of the protected articles according to the article distribution information and the draw-off results to obtain the number of unit protected articles corresponding to the user reservation identifier, and the block link point may determine, as the reservation result of the target user, the draw-off result and the number of unit protected articles corresponding to the user reservation identifier. It can be understood that the article reservation intelligent contract may include the total number of the protective articles sent by each protective article reservation shaking number, the total number of people who successfully shake the number in each protective article reservation shaking number (a number threshold may be set, a probability threshold may also be set, the number of people who successfully reserve in each protective article reservation shaking number is determined by the probability threshold), the number of the protective articles (which may also be referred to as a unit protective article number) that can be allocated by each user who successfully reserves the shaking number, the number of the protective articles allocated by each user who successfully reserves the shaking number may be the same or different, for example, the number of the protective articles may be allocated to the user according to the geographic location of the user, for example, the article reservation intelligent contract may specify that the region scope in jurisdiction is Shenzhen, 10 protection articles may be allocated after the user in the south mountain area makes a successful reservation, and 7 protection articles may be allocated after the user in the light area makes a successful reservation. The block chain node can determine users who make an appointment successfully and users who make an appointment unsuccessfully (namely, the drawing and signing results of the users) from the identification sorting list according to the number of successful number shaking numbers specified in the intelligent contract for article appointment, obtain the number of protective articles distributed by each user who makes an appointment successfully according to the article distribution information specified in the intelligent contract for article appointment and the total number of the protective articles provided by the prevention and control mechanism, and determine the drawing and signing results of the users and the number of the protective articles as the appointment results of the users, wherein the number of the protective articles distributed by the users who make an appointment unsuccessfully cannot be distributed, namely, the number of the protective articles distributed by the users who make an appointment unsuccessfully is 0.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a determination of a user reservation result according to an embodiment of the present application. As shown in fig. 5, in the protected-article subscription and serial-number generation process, the reservation device 40a may pack the user subscription identifier, verifiable random number, and certification data corresponding to each user participating in the protected-article subscription and serial-number generation into reservation transaction data, which is sent to the block chain node 40b, where if the reservation device 40a receives a subscription and serial-number generation application from n (n is a positive integer) users within the validity period of the protected-article subscription and serial-number generation application, the reservation device 40a may pack the user subscription identifier, verifiable random number, and certification data corresponding to n users into reservation transaction data, and if the subscription transaction data corresponding to n users all satisfy the validity condition, the block chain node 40b may invoke the drawing algorithm in the article intelligent contract to calculate the drawing probability corresponding to each user, so as to obtain a drawing probability set 40c, the specific calculation method of the drawing probability may refer to the description in step S103, and is not described herein again. The drawing probability set 40c may include drawing probabilities respectively corresponding to each user, and for example, the drawing probability corresponding to the user 1 is: b1, the corresponding probability of drawing of the user 2 is: b2, the corresponding probability of drawing of the user 3 is: b3, … …, the probability of the corresponding draw of the user n is: bn.
The block chain node 40b may rank the drawing probabilities included in the drawing probability set 40c in the order from high to low according to the drawing probabilities to obtain an ordered list 40d, where if the drawing probability b4 corresponding to the user 4 is the highest, the drawing probability b4 corresponding to the user 4 is located at the first position in the ordered list 40d, the drawing probability b5 corresponding to the user 5 is only lower than the drawing probability b4 corresponding to the user 4, the drawing probability b5 corresponding to the user 5 is located at the second position in the ordered list 40d, … …, the drawing probability b2 corresponding to the user 2 is the lowest, and the drawing probability b2 corresponding to the user 2 is located at the end of the ordered list 40 d.
The blockchain node 40b may obtain item allocation information 40e from the item reservation intelligent contract, where the item allocation information 40e may include: in the reserved number shaking process of the protective articles, the total number of the protective articles is as follows: x, the total number of successful reservation persons is: y, the distribution quantity after the reservation of the user of the area a is successful is as follows: c, the distribution quantity of the users in the other areas after successful reservation is as follows: d, and the like, wherein when c is greater than d, the total number of the protective articles x can be equal to y × c. According to the item distribution information 40e, the first y users can be selected from the ordered list 40d and determined as users who make a reservation successfully, the remaining users in the ordered list 40d are users who make a reservation unsuccessfully, and then according to the location of the area where each user is located, the reservation result corresponding to each user is determined, so that a reservation result set 40e is obtained. When the area position where the user 4 is located is the area a, the reservation result of the user 4 can be obtained as follows: reserving successfully and distributing c protective articles; when the area position where the user 5 is located is the area b, the reservation result of the user 5 can be obtained as follows: d protective articles are allocated after the reservation is successful; when the area position where the user 1 is located is the area a, the reservation result of the user 1 can be obtained as follows: the reservation is successful and c security articles are distributed, … …, the reservation of the user 2 is not successful, and the reservation result of the user 4 can be: the reservation failed and 0 security items were dispensed.
Step S105, the reservation result is returned.
Specifically, the block link node may return a reservation result associated with the user reservation identifier to the reservation device, and after receiving the reservation result returned by the block link node, the reservation device may notify the prevention and control mechanism and the target user of the reservation result, where the reservation result may be used to instruct the prevention and control mechanism to allocate the protective article matched with the reservation result to the target user corresponding to the user reservation identifier. For example, if the reservation result is that the target user has successfully reserved, and 10 protective articles (such as masks, goggles, gloves, etc.) are dispensed, the prevention and control mechanism may dispense 10 protective articles to the target user through the logistics company according to the delivery address input by the target user in the reservation equipment.
Optionally, when the block link node receives a result verification request for a target user sent by the reservation equipment, acquiring reservation transaction data and a drawing probability corresponding to the user reservation identifier from block link data of the block link network according to the user reservation identifier carried in the result verification request; and the block link node generates a verification result corresponding to the target user according to the reservation transaction data and the drawing probability, and returns the verification result to the reservation equipment. In other words, if the user has a doubt about the reservation result of the user, the user may send a result verification request carrying the user reservation identifier to the block link point through the reservation equipment, and after receiving the result verification request carrying the user reservation identifier, the block link point may query, according to the user reservation identifier, a complete reservation flow associated with the user reservation identifier from the block chain, such as reservation transaction data and a drawing probability associated with the user reservation identifier, and further according to the reservation result returned to the user, and the reservation transaction data and the drawing probability queried from the block chain network, and when the reservation result re-determined according to the queried reservation transaction data and the drawing probability is the same as the reservation result previously returned to the user, it may be determined that the corresponding verification result of the user is: verifying a normal result; when the reservation result re-determined according to the inquired reservation transaction data and the drawing probability is different from the reservation result returned to the user before, the corresponding verification result of the user can be determined as follows: and verifying the abnormal result.
Optionally, the block link point may return the reservation transaction data of each user associated with the user reservation identifier in the guard object reservation and shaking process and the drawing probability respectively corresponding to each user to the reservation equipment, and the user may check the drawing probability respectively corresponding to each user in the reservation equipment to further verify whether the reservation result of the user has a problem.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating a result of a verification reservation according to an embodiment of the present application. As shown in fig. 6, if the user has a question about the result of his reservation, the user can input the relevant information of the user into the reservation device to query the complete process information in the reservation number shaking process, so as to verify the reservation result. If the user 1 inputs the reservation identifier 1 in the reservation equipment to verify the reservation result, the reservation equipment may generate a result verification request for the user 1, and the result verification request may carry the reservation identifier 1.
After receiving the result verification request, the blockchain node may query, according to the subscription identifier 1, a draw probability set 50d and subscription transaction data 50e associated with the subscription identifier 1 from the blockchain 50c, where the draw probability set 50d includes draw probabilities respectively corresponding to all users participating in the contemporaneous subscription shaking number of the user corresponding to the subscription identifier 1, and the subscription transaction data 50e may refer to subscription transaction data of the user corresponding to the subscription identifier 1, or may include subscription transaction data respectively corresponding to all users. The blockchain node may return the set of draw probabilities 50d and the reservation transaction data 50e to the reservation device 50 a. Since the platform database of the reservation equipment 50a stores the intelligent contract for article reservation, the reservation result corresponding to the user 1 can be re-determined according to the article allocation rule in the intelligent contract for article reservation and the returned draw probability set 50d, if the re-determined reservation result is the same as the previous reservation result, it indicates that there is no problem with the previous reservation result, and if the re-determined reservation result is not the same as the previous reservation result, it indicates that there is a problem with the previous reservation result, and the prevention and control organization can apply for allocating the protective articles according to the new reservation result.
The embodiment of the application can package verifiable random numbers and certification data generated according to the user reservation identification and the user private key into reservation transaction data together with the user reservation identification through the reservation equipment, and send the reservation transaction data to the block chain node; the block link point can verify the legality of the reserved transaction data based on the user reservation identification and the certification data, when the reserved transaction data is legal, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number, then a reservation result associated with the user reservation identification is determined according to the drawing probability, the reservation result is returned to the reservation equipment, and the reservation result can be used for instructing a prevention and control mechanism to deliver the protective article matched with the reservation result to a target user corresponding to the user reservation identification. Due to the decentralization and the non-tamper property of the block chain, the reservation process of the protective article in the reservation equipment is public and transparent for the reservation user, and the reservation process and the reservation result of the protective article reserved in the reservation equipment can be recorded in the block chain, so that the reliability, the fairness and the effectiveness of the article reservation result are improved; because the block chain has public transparency, each user participating in the reservation of the protective article can inquire the complete reservation flow through the reservation equipment, so that the whole reservation flow is disclosed, and the verifiability of the reservation result is improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application. The blockchain-based item reservation apparatus may be a computer program (including program code) running in a computer device, for example, the blockchain-based item reservation apparatus is an application software; the article reservation device based on the block chain may be configured to perform the corresponding steps in the embodiment corresponding to fig. 3, as shown in fig. 7, the article reservation device 1 based on the block chain may include: a first encapsulation module 101, a first sending module 102, a probability determination module 103, and a result determination module 104;
a first encapsulation module 101, configured to encapsulate the user subscription identifier, the verifiable random number, and the certification data into subscription transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
a first sending module 102, configured to send the reservation transaction data to a blockchain node;
a probability determination module 103, configured to determine, according to the user subscription identifier and the certification data, a drawing probability corresponding to the user subscription identifier according to the verifiable random number if it is detected that the subscription transaction data meets the legitimacy condition;
a result determining module 104, configured to determine, according to the drawing probability, a reservation result associated with the user reservation identifier, and return the reservation result to the reservation device; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
Specific functional implementation manners of the first encapsulation module 101, the first sending module 102, the probability determination module 103, and the result determination module 104 may refer to steps S101 to S105 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 7, the block chain-based article reservation apparatus 1 may further include: a certificate application module 105, a request sending module 106, a certificate receiving module 107, a second packaging module 108, a second sending module 109, a contract deployment module 110, and a reservation identifier determining module 111;
the certificate application module 105 is configured to obtain platform identity information and platform quality information, locally generate a platform key pair, and sign the platform identity information and the platform quality information according to a platform private key in the platform key pair to obtain certificate application information;
a request sending module 106, configured to send a certificate application request carrying certificate application information to a certificate authority node, so that the certificate authority node issues a platform certificate for an appointment platform according to the certificate application information, and performs uplink processing on the platform certificate to obtain a platform certificate hash;
and the certificate receiving module 107 is configured to receive the platform certificate and the platform certificate hash returned by the certificate authority node.
The second encapsulation module 108 is used for acquiring the article reservation intelligent contract and encapsulating the article reservation intelligent contract, the platform certificate hash and the platform public key into contract transaction data; the article reservation intelligent contract comprises article reservation rules corresponding to users passing reservation auditing in the block chain network, the platform certificate hash refers to a hash value corresponding to a platform certificate stored in the block chain network, and the platform public key is used for verifying contract transaction data by the block chain link points;
a second sending module 109, configured to send the contract transaction data to the blockchain node;
the contract deployment module 110 is configured to deploy the article reservation intelligent contract in the block link network to obtain a contract address corresponding to the article reservation intelligent contract if it is detected that the contract transaction data meets the legitimacy condition according to the platform certificate hash and the platform public key;
the reservation identifier determining module 111 is configured to receive a contract address returned by the block link point, and determine a user reservation identifier according to the contract address, the audit rule information, and the user information; the audit rule information is rule information provided by the prevention and control organization for auditing the user information.
The specific functional implementation manners of the certificate application module 105, the request sending module 106, the certificate receiving module 107, the second encapsulation module 108, the second sending module 109, the contract deployment module 110, and the reservation identifier determining module 111 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring also to fig. 7, the reservation identification determining module 111 may include: a rule encapsulation unit 1111, a rule transmission unit 1112, an identification determination unit 1113;
the rule encapsulation unit 1111 is configured to obtain audit rule information issued by a prevention and control organization, and encapsulate the audit rule information, a contract address, and organization information into rule transaction data; the mechanism information comprises mechanism identification information, mechanism certificate hash and a mechanism public key corresponding to the prevention and control mechanism, wherein the mechanism certificate hash is a hash value corresponding to a mechanism certificate stored in the block chain network, and the mechanism public key is used for verifying and signing the regular transaction data by the block chain link point;
a rule sending unit 1112, configured to send the rule transaction data to the blockchain node, so that when the blockchain node detects that the rule transaction data meets a validity condition according to the contract address, the agency certificate hash, and the agency public key, the blockchain node issues audit rule information in the blockchain network to obtain a rule digest hash corresponding to the audit rule information;
and the identifier determining unit 1113 is configured to receive the rule digest hash returned by the block link point, and determine the user reservation identifier according to the contract address, the rule digest hash, and the user information.
The specific functional implementation manners of the rule encapsulation unit 1111, the rule sending unit 1112, and the identifier determination unit 1113 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 7 together, the identification determination unit 1113 may include: a user information transmitting sub-unit 11131, a user information transmitting sub-unit 11132, a reservation label receiving sub-unit 11133;
a user information sending sub-unit 11131, configured to obtain user information associated with a target user, and package the user information, the rule digest hash, and the contract address into user transaction data; the user information comprises user identification information, user certificate hash, a user public key and user basic information, wherein the user certificate hash is a hash value corresponding to a user certificate stored in the block chain network;
a user information sending subunit 11132, configured to send the user transaction data to the blockchain node, so that the blockchain node generates a user reservation identifier matching the target user when detecting that the user transaction data meets the validity condition according to the rule digest hash, the contract address, the user certificate hash, and the user public key;
and a reservation identifier receiving subunit 11133, configured to receive the user reservation identifier returned by the block link point, and store the user reservation identifier, the rule digest hash, and the contract address in the platform database in an associated manner.
The specific functional implementation manners of the user information sending sub-unit 11131, the user information sending sub-unit 11132, and the reservation identifier receiving sub-unit 11133 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 7, the block chain-based article reservation apparatus 1 may further include: a signature verification module 112, an audit module 113, a first transaction verification module 114;
the signature verification module 112 is configured to verify the signature of the user transaction data according to the user public key to obtain a signature verification result corresponding to the user transaction data;
the auditing module 113 is configured to determine an auditing result of the user basic information according to the auditing rule information if the auditing rule information matching the rule digest hash is queried in the block chain network;
and the first transaction verification module 114 is configured to determine that the user transaction data meets the validity condition if it is detected that the blockchain network includes the contract address and the user certificate hash, and both the signature verification result and the verification result are pass results.
The specific functional implementation manners of the signature verification module 112, the auditing module 113, and the first transaction verification module 114 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 7, the block chain-based article reservation apparatus 1 may further include: traversal module 115, second transaction verification module 116;
the traversal module 115 is configured to generate a to-be-verified result corresponding to the certification data according to the hash operation, and perform traversal query on the blockchain data in the blockchain network according to the user reservation identifier;
a second transaction verification module 116, configured to determine that the reserved transaction data meets the validity condition if it is detected that the to-be-verified result is the same as the verifiable random number and the blockchain data includes the user reservation identifier;
the second transaction verification module 116 is further configured to determine that the reserved transaction data does not satisfy the validity condition if it is detected that the to-be-verified result is different from the verifiable random number or the blockchain data does not include the user reservation identifier.
The specific functional implementation manner of the traversal module 115 and the second transaction verification module 116 may refer to step S103 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring also to fig. 7, the probability determination module 103 may include: a contract acquisition unit 1031, a hash operation unit 1032, a probability calculation unit 1033;
a contract obtaining unit 1031, configured to obtain an article reservation intelligent contract associated with the user reservation identification if it is detected that the reservation transaction data satisfies a legitimacy condition according to the user reservation identification and the certification data;
the hash operation unit 1032 is used for performing hash operation on the verifiable random number according to the article reservation intelligent contract to obtain a candidate hash value corresponding to the verifiable random number;
and a probability calculation unit 1033, configured to determine a ratio between the candidate hash value and the drawing parameter as a candidate random number, and determine a drawing probability corresponding to the user subscription identifier according to the candidate random number and the right parameter.
The specific functional implementation manners of the contract obtaining unit 1031, the hash operation unit 1032, and the probability calculation unit 1033 may refer to step S103 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring also to fig. 7, the result determination module 104 may include: a probability obtaining unit 1041, a sorting unit 1042, a result uplink unit 1043;
a probability obtaining unit 1041, configured to obtain drawing probabilities corresponding to at least two reservation identifiers in the block height range; the at least two reservation identifications comprise user reservation identifications;
the sorting unit 1042 is configured to sort the at least two subscription identifiers according to the drawing probabilities respectively corresponding to the at least two subscription identifiers, so as to obtain an identifier sorted list;
a result uplink unit 1043, configured to determine, according to the identifier sorted list, a reservation result associated with the user reservation identifier, and perform uplink processing on the reservation result and the draw probability corresponding to each of the at least two reservation identifiers.
The specific function implementation manners of the probability obtaining unit 1041, the sorting unit 1042 and the result uplink unit 1043 may refer to step S103 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring also to fig. 7, as a result, the uplink unit 1043 may include: a drawing result determining subunit 10431, a distribution information acquiring subunit 10432, a unit number determining subunit 10433, and a reservation result determining subunit 10434;
a drawing result determining subunit 10431, configured to determine, according to the identifier ordered list, drawing results corresponding to the at least two reservation identifiers, respectively;
a distribution information obtaining subunit 10432, configured to obtain the number of protected articles provided by the prevention and control mechanism, and obtain article distribution information from an article reservation intelligent contract associated with the user reservation identifier;
the unit quantity determining subunit 10433 is configured to allocate the quantity of the protected articles according to the article allocation information and the drawing result, so as to obtain the quantity of the unit protected articles corresponding to the user reservation identifier;
a reservation result determining subunit 10434, configured to determine, as a reservation result, the drawing result and the number of unit security articles corresponding to the user reservation identifier.
The specific functional implementation manners of the drawing result determining subunit 10431, the distribution information obtaining subunit 10432, the unit quantity determining subunit 10433, and the reservation result determining subunit 10434 may refer to step S104 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 7, the article reservation apparatus based on the block chain may further include: a verification request receiving module 117, a verification result generating module 118;
the verification request receiving module 117 is configured to, when receiving a result verification request for a target user sent by a reservation device, obtain reservation transaction data and a drawing probability corresponding to a user reservation identifier from block chain data of a block chain network according to the user reservation identifier carried in the result verification request;
and the verification result generation module 118 is configured to generate a verification result corresponding to the target user by the blockchain node according to the reservation transaction data and the drawing probability, and return the verification result to the reservation equipment.
The specific functional implementation manners of the verification request receiving module 117 and the verification result generating module 118 may refer to step S104 in the embodiment corresponding to fig. 3, which is not described herein again.
The embodiment of the application can package verifiable random numbers and certification data generated according to the user reservation identification and the user private key into reservation transaction data together with the user reservation identification through the reservation equipment, and send the reservation transaction data to the block chain node; the block link point can verify the legality of the reserved transaction data based on the user reservation identification and the certification data, when the reserved transaction data is legal, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number, then a reservation result associated with the user reservation identification is determined according to the drawing probability, the reservation result is returned to the reservation equipment, and the reservation result can be used for instructing a prevention and control mechanism to deliver the protective article matched with the reservation result to a target user corresponding to the user reservation identification. Due to the decentralization and the non-tamper property of the block chain, the reservation process of the protective article in the reservation equipment is public and transparent for the reservation user, and the reservation process and the reservation result of the protective article reserved in the reservation equipment can be recorded in the block chain, so that the reliability, the fairness and the effectiveness of the article reservation result are improved; because the block chain has public transparency, each user participating in the reservation of the protective article can inquire the complete reservation flow through the reservation equipment, so that the whole reservation flow is disclosed, and the verifiability of the reservation result is improved.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application. As shown in fig. 8, the block chain-based item reservation apparatus 2 may include: a reservation data packaging module 21, a reservation data transmitting module 22, a reservation result receiving module 23;
an appointment data packaging module 21 for packaging the user appointment identifier, the verifiable random number and the certification data into appointment transaction data; the verifiable random number and the proof data are generated according to the user reservation identification and the user private key, and the proof data is used for representing the correctness of the verifiable random number;
the reservation data sending module 22 is configured to send the reservation transaction data to the blockchain node, so that when the blockchain node detects that the reservation transaction data meets the legitimacy condition according to the user reservation identifier and the certification data, the block chain node determines a reservation result associated with the user reservation identifier according to the draw probability; the probability of a draw is determined from the verifiable random number;
a reservation result receiving module 23, configured to receive a reservation result returned by a block link point; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
The specific implementation functions of the reservation data packaging module 21, the reservation data sending module 22, and the reservation result receiving module 23 may refer to step S101, step S102, and step S105 in the embodiment corresponding to fig. 3, which is not described herein again.
The embodiment of the application can package verifiable random numbers and certification data generated according to the user reservation identification and the user private key into reservation transaction data together with the user reservation identification through the reservation equipment, and send the reservation transaction data to the block chain node; the block link point can verify the legality of the reserved transaction data based on the user reservation identification and the certification data, when the reserved transaction data is legal, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number, then a reservation result associated with the user reservation identification is determined according to the drawing probability, the reservation result is returned to the reservation equipment, and the reservation result can be used for instructing a prevention and control mechanism to deliver the protective article matched with the reservation result to a target user corresponding to the user reservation identification. Due to the decentralization and the non-tamper property of the block chain, the reservation process of the protective article in the reservation equipment is public and transparent for the reservation user, and the reservation process and the reservation result of the protective article reserved in the reservation equipment can be recorded in the block chain, so that the reliability, the fairness and the effectiveness of the article reservation result are improved.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an article reservation apparatus based on a block chain according to an embodiment of the present application. As shown in fig. 9, the block chain-based item reservation apparatus 3 may include: a reservation data receiving module 31, a drawing probability determining module 32, a reservation result determining module 33;
an appointment data receiving module 31, configured to receive appointment transaction data sent by an appointment device; the reservation transaction data comprises a user reservation identifier, a verifiable random number and certification data, the verifiable random number and the certification data are generated according to the user reservation identifier and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
a drawing probability determining module 32, configured to determine, according to the verifiable random number, a drawing probability corresponding to the user subscription identifier if it is detected that the subscription transaction data meets the legitimacy condition according to the user subscription identifier and the certification data;
a reservation result determining module 33, configured to determine, according to the drawing probability, a reservation result associated with the user reservation identifier, and return the reservation result to the reservation device; and the reservation result is used for instructing the prevention and control mechanism to deliver the protective articles matched with the reservation result to the target user corresponding to the user reservation identification.
The specific implementation functions of the reservation data receiving module 31, the drawing probability determining module 32, and the reservation result determining module 33 may refer to steps S102 to S105 in the embodiment corresponding to fig. 3, which is not described herein again.
The embodiment of the application can package verifiable random numbers and certification data generated according to the user reservation identification and the user private key into reservation transaction data together with the user reservation identification through the reservation equipment, and send the reservation transaction data to the block chain node; the block link point can verify the legality of the reserved transaction data based on the user reservation identification and the certification data, when the reserved transaction data is legal, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number, then a reservation result associated with the user reservation identification is determined according to the drawing probability, the reservation result is returned to the reservation equipment, and the reservation result can be used for instructing a prevention and control mechanism to deliver the protective article matched with the reservation result to a target user corresponding to the user reservation identification. Due to the decentralization and the non-tamper property of the block chain, the reservation process of the protective article in the reservation equipment is public and transparent for the reservation user, and the reservation process and the reservation result of the protective article reserved in the reservation equipment can be recorded in the block chain, so that the reliability, the fairness and the effectiveness of the article reservation result are improved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 10, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. Optionally, the network interface 1004 may include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). Optionally, the memory 1005 may also be at least one memory device located remotely from the processor 1001. As shown in fig. 10, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 10, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and processor 1001 may be configured to invoke a device control application stored in memory 1005 to implement the description of the blockchain-based item reservation method in the embodiment corresponding to fig. 3 above.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the article reservation method based on the block chain in the embodiment corresponding to fig. 3, and may also perform the description of the article reservation device 1 based on the block chain in the embodiment corresponding to fig. 7, the description of the article reservation device 2 based on the block chain in the embodiment corresponding to fig. 8, and the description of the article reservation device 3 based on the block chain in the embodiment corresponding to fig. 9, which are not repeated herein. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores therein the aforementioned computer programs executed by the article reservation apparatus 1 based on the block chain, the article reservation apparatus 2 based on the block chain, and the article reservation apparatus 3 based on the block chain, and the computer programs include program instructions, and when the processor executes the program instructions, the description of the article reservation method based on the block chain in the embodiment corresponding to fig. 3 can be performed, and therefore, the description thereof will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application. As an example, the program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network, which may constitute a block chain system.
Further, it should be noted that: embodiments of the present application also provide a computer program product or a computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor can execute the computer instruction, so that the computer device executes the description of the article reservation method based on the block chain in the embodiment corresponding to fig. 3, which is described above, and therefore, details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product or the computer program referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.
Claims (16)
1. An item reservation method based on a blockchain, comprising:
the reservation equipment encapsulates the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the certification data are generated according to the user reservation identification and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the reservation equipment sends the reservation transaction data to a block chain node;
the block chain nodes generate a to-be-verified result corresponding to the certification data according to Hash operation, and traverse query is carried out on the block chain data in the block chain network according to the user reservation identification;
if the blockchain node detects that the to-be-verified result is the same as the verifiable random number and the blockchain data contains the user reservation identification, determining that the reservation transaction data meets the validity condition;
if the block link node detects that the reservation transaction data meets the validity condition, the drawing probability corresponding to the user reservation identification is determined according to the verifiable random number; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification;
the block chain link point acquires drawing probability corresponding to at least two reservation identifications in a block height range, and the at least two reservation identifications are sequenced according to the drawing probability corresponding to the at least two reservation identifications respectively to obtain an identification sequencing list; the at least two subscription identifications comprise the user subscription identification;
the block chain node determines a reservation result associated with the user reservation identification according to the identification sorted list and returns the reservation result to the reservation equipment; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
2. The method of claim 1, further comprising:
the reservation equipment acquires an article reservation intelligent contract and encapsulates the article reservation intelligent contract, the platform certificate hash and the platform public key into contract transaction data; the article reservation intelligent contract comprises an article reservation rule corresponding to a user passing reservation auditing in a block chain network, the platform certificate hash refers to a hash value corresponding to a platform certificate stored in the block chain network, and the platform public key is used for verifying and signing the contract transaction data by the block chain link point;
the reservation equipment sends the contract transaction data to the block chain node;
if the block chain node detects that the contract transaction data meets the legitimacy condition according to the platform certificate hash and the platform public key, deploying the article reservation intelligent contract in the block chain network to obtain a contract address corresponding to the article reservation intelligent contract;
the reservation equipment receives the contract address returned by the block chain node, and determines the user reservation identification according to the contract address, the audit rule information and the user information; the audit rule information is rule information provided by the prevention and control organization and used for auditing the user information.
3. The method of claim 2, wherein determining the subscriber subscription identity based on the contract address, audit rule information, and subscriber information comprises:
the reservation equipment acquires the audit rule information issued by the prevention and control mechanism and encapsulates the audit rule information, the contract address and the mechanism information into rule transaction data; the mechanism information comprises mechanism identification information, mechanism certificate hash and a mechanism public key corresponding to the prevention and control mechanism, wherein the mechanism certificate hash is a hash value corresponding to a mechanism certificate stored in the block chain network, and the mechanism public key is used for verifying and signing the regular transaction data by the block chain link point;
the reservation equipment sends the rule transaction data to the block chain node, so that the block chain node issues the audit rule information in the block chain network when detecting that the rule transaction data meets the validity condition according to the contract address, the agency certificate hash and the agency public key, and obtains the rule abstract hash corresponding to the audit rule information;
and the reservation equipment receives the rule abstract hash returned by the block chain node, and determines the user reservation identification according to the contract address, the rule abstract hash and the user information.
4. The method of claim 3, wherein said determining the subscriber subscription identity based on the contract address, the rule digest hash, and the subscriber information comprises:
the reservation equipment acquires user information associated with the target user and encapsulates the user information, the rule abstract hash and the contract address into user transaction data; the user information comprises user identification information, user certificate hash, the user public key and user basic information, wherein the user certificate hash is a hash value corresponding to a user certificate stored in a block chain network;
the reservation equipment sends the user transaction data to the blockchain node so that the blockchain node generates the user reservation identification matched with the target user when detecting that the user transaction data meets a legality condition according to the rule abstract hash, the contract address, the user certificate hash and the user public key;
and the reservation equipment receives the user reservation identification returned by the block chain node and stores the user reservation identification, the rule abstract hash and the contract address in a platform database in a correlation manner.
5. The method of claim 2, further comprising:
the reservation equipment acquires platform identity information and platform qualification information, locally generates a platform key pair, and signs the platform identity information and the platform qualification information according to a platform private key in the platform key pair to obtain certificate application information;
the reservation equipment sends a certificate application request carrying the certificate application information to a certificate authorization node so that the certificate authorization node issues the platform certificate for a reservation platform according to the certificate application information and carries out uplink processing on the platform certificate to obtain the hash of the platform certificate;
and the reservation equipment receives the platform certificate and the platform certificate hash returned by the certificate authorization node.
6. The method of claim 4, further comprising:
the block link point checks the user transaction data according to the user public key to obtain a check result corresponding to the user transaction data;
if the block chain node inquires the auditing rule information matched with the rule abstract hash in the block chain network, determining an auditing result of the user basic information according to the auditing rule information;
and if the blockchain node detects that the blockchain network comprises the contract address and the user certificate hash, and the signature verification result and the verification result are both pass results, determining that the user transaction data meets the legality condition.
7. The method of claim 1, further comprising:
and if the block chain node detects that the to-be-verified result is different from the verifiable random number or the block chain data does not contain the user reservation identification, determining that the reservation transaction data does not meet the validity condition.
8. The method of claim 1, wherein determining, by the blockchain node, a reservation result associated with the user reservation identity from the ordered list of identities comprises:
the block chain node determines drawing and signing results corresponding to at least two reservation identifications respectively according to the identification sorting list;
the block chain node acquires the quantity of the protected articles provided by the prevention and control mechanism, and acquires article distribution information from an article reservation intelligent contract associated with the user reservation identification;
the block chain link points distribute the number of the protective articles according to the article distribution information and the drawing and signing result to obtain the number of unit protective articles corresponding to the user reservation identification;
and the block chain link point determines the drawing and signing result corresponding to the user reservation identification and the unit protective article quantity as the reservation result.
9. The method of claim 1, further comprising:
when the block chain node receives a result verification request aiming at the target user and sent by the reservation equipment, acquiring the reservation transaction data and the drawing probability corresponding to the user reservation identification from block chain data of the block chain network according to the user reservation identification carried in the result verification request;
and the block chain link point generates a verification result corresponding to the target user according to the reserved transaction data and the drawing probability, and returns the verification result to the reservation equipment.
10. An item reservation method based on a blockchain, comprising:
the reservation equipment encapsulates the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the certification data are generated according to the user reservation identification and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the reservation equipment sends the reservation transaction data to a block link node so that when the block link node detects that the reservation transaction data meets a validity condition, a reservation result associated with the user reservation identification is determined according to an identification sorting list containing at least two reservation identifications; the identifier sorting list is obtained by sorting at least two reservation identifiers according to drawing probabilities respectively corresponding to the at least two reservation identifiers in a block height range, wherein the at least two reservation identifiers comprise the user reservation identifiers; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification; the reservation transaction data meeting the validity condition means that a to-be-verified result corresponding to the certification data is the same as the verifiable random number, and block chain data in a block chain network comprises the user reservation identification;
the reservation equipment receives the reservation result returned by the block chain node; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
11. An item reservation method based on a blockchain, comprising:
the block chain link point receives reservation transaction data sent by reservation equipment; the subscription transaction data comprises a user subscription identifier, a verifiable random number and certification data, the verifiable random number and the certification data are generated according to the user subscription identifier and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the block chain nodes generate a to-be-verified result corresponding to the certification data according to Hash operation, and traverse query is carried out on the block chain data in the block chain network according to the user reservation identification;
if the blockchain node detects that the to-be-verified result is the same as the verifiable random number and the blockchain data contains the user reservation identification, determining that the reservation transaction data meets the validity condition;
if the block link node detects that the reservation transaction data meets the validity condition, determining the drawing probability corresponding to the user reservation identification according to the verifiable random number; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification;
the block chain link point acquires drawing probability corresponding to at least two reservation identifications in a block height range, and the at least two reservation identifications are sequenced according to the drawing probability corresponding to the at least two reservation identifications respectively to obtain an identification sequencing list; the at least two subscription identifications comprise the user subscription identification;
the block chain node determines a reservation result associated with the user reservation identification according to the identification sorted list and returns the reservation result to the reservation equipment; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
12. An article reservation apparatus based on a blockchain, comprising:
the first packaging module is used for packaging the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the certification data are generated according to the user reservation identification and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the first sending module is used for sending the reserved transaction data to a block link node;
the traversal module is used for generating a to-be-verified result corresponding to the certification data according to Hash operation, and performing traversal query on the block chain data in the block chain network according to the user reservation identification;
the second transaction verification module is used for determining that the reserved transaction data meets the validity condition if the to-be-verified result is detected to be the same as the verifiable random number and the block chain data contains the user reservation identification;
a probability determining module, configured to determine, according to the verifiable random number, a drawing probability corresponding to the user subscription identifier if it is detected that the subscription transaction data meets a validity condition; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification;
the result determining module is used for acquiring the drawing probability corresponding to at least two reservation identifications in the block height range respectively, and sequencing the at least two reservation identifications according to the drawing probability corresponding to the at least two reservation identifications respectively to obtain an identification sequencing list; the at least two subscription identifications comprise the user subscription identification;
the result determining module is further configured to determine, by the blockchain node, a reservation result associated with the user reservation identifier according to the identifier ordered list, and return the reservation result to the reservation device; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
13. An article reservation device based on a block chain is characterized in that the device is applied to reservation equipment and comprises:
the reservation data packaging module is used for packaging the user reservation identification, the verifiable random number and the certification data into reservation transaction data; the verifiable random number and the certification data are generated according to the user reservation identification and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the reservation data sending module is used for sending the reservation transaction data to a block link node so as to determine a reservation result associated with the user reservation identification according to an identification sorting list containing at least two reservation identifications when the block link node detects that the reservation transaction data meets a validity condition; the identifier sorting list is obtained by sorting at least two reservation identifiers according to drawing probabilities respectively corresponding to the at least two reservation identifiers in a block height range, wherein the at least two reservation identifiers comprise the user reservation identifiers; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification; the reservation transaction data meeting the validity condition means that a to-be-verified result corresponding to the certification data is the same as the verifiable random number, and block chain data in a block chain network comprises the user reservation identification;
a reservation result receiving module, configured to receive the reservation result returned by the block chain node; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
14. An article reservation device based on a block chain is characterized in that, applied to a block chain node, the device comprises:
the reservation data receiving module is used for receiving reservation transaction data sent by reservation equipment; the subscription transaction data comprises a user subscription identifier, a verifiable random number and certification data, the verifiable random number and the certification data are generated according to the user subscription identifier and a user private key, and the certification data is used for representing the correctness of the verifiable random number;
the reservation data receiving module is further configured to generate a to-be-verified result corresponding to the certification data according to hash operation, and perform traversal query on the block chain data in the block chain network according to the user reservation identifier;
the reservation data receiving module is further configured to determine that the reservation transaction data meets a validity condition if it is detected that the to-be-verified result is the same as the verifiable random number and the block chain data contains the user reservation identifier;
a drawing probability determining module, configured to determine, according to the verifiable random number, a drawing probability corresponding to the user subscription identifier if it is detected that the subscription transaction data meets a legitimacy condition; the drawing probability corresponding to the user reservation identification is determined according to the ratio between the candidate hash value and the drawing parameter and the right parameter, wherein the candidate hash value is obtained by carrying out hash operation on the verifiable random number according to the intelligent contract of the article associated with the user reservation identification;
the reservation result determining module is used for acquiring the drawing probability corresponding to at least two reservation identifications in the block height range respectively, and sequencing the at least two reservation identifications according to the drawing probability corresponding to the at least two reservation identifications respectively to obtain an identification sequencing list; the at least two subscription identifications comprise the user subscription identification;
the reservation result determining module is further configured to determine a reservation result associated with the user reservation identifier according to the identifier sorted list, and return the reservation result to the reservation device; and the reservation result is used for instructing a prevention and control mechanism to deliver the protective articles matched with the reservation result to a target user corresponding to the user reservation identification.
15. A computer arrangement comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, performs the steps of the method of any one of claims 1 to 11.
16. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the steps of the method of any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010670261.XA CN111884807B (en) | 2020-07-13 | 2020-07-13 | Article reservation method, apparatus, device and medium based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010670261.XA CN111884807B (en) | 2020-07-13 | 2020-07-13 | Article reservation method, apparatus, device and medium based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111884807A CN111884807A (en) | 2020-11-03 |
CN111884807B true CN111884807B (en) | 2021-10-26 |
Family
ID=73150729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010670261.XA Active CN111884807B (en) | 2020-07-13 | 2020-07-13 | Article reservation method, apparatus, device and medium based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111884807B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112559599B (en) * | 2020-12-18 | 2023-05-26 | 杭州趣链科技有限公司 | Block chain-based data query method, system and block chain processing device |
CN112988893B (en) * | 2021-03-15 | 2023-05-12 | 中国联合网络通信集团有限公司 | Information management method, system, block chain node and medium based on block chain |
CN112948866B (en) * | 2021-03-29 | 2024-05-10 | iCALC控股有限公司 | Data processing method, device, equipment and readable storage medium |
CN112949798B (en) * | 2021-05-17 | 2021-09-24 | 北京楠昊鹏物联网科技有限公司 | Laboratory equipment management method and system based on RFID technology |
CN113572620B (en) * | 2021-09-27 | 2021-12-24 | 中邮消费金融有限公司 | On-line voting method and system based on block chain |
CN114091061B (en) * | 2021-11-12 | 2024-05-03 | 天津理工大学 | Multi-cloud collaborative data security storage and audit method based on VRF and blockchain |
CN113822974A (en) * | 2021-11-24 | 2021-12-21 | 支付宝(杭州)信息技术有限公司 | Method, apparatus, electronic device, medium, and program for generating avatar |
CN115907593B (en) * | 2023-02-14 | 2023-06-02 | 湖南炅旭生物科技有限公司 | Drug transportation management method, system, equipment and storage medium based on blockchain |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107103097A (en) * | 2017-05-22 | 2017-08-29 | 中链科技有限公司 | Drawing method and terminal device based on block chain technology |
CN107742352A (en) * | 2017-09-20 | 2018-02-27 | 黄玉宇 | Decentralization lot/queuing strategy and system based on block chain and intelligent contract |
CN109584432A (en) * | 2018-10-26 | 2019-04-05 | 阿里巴巴集团控股有限公司 | Object select method and device, electronic equipment |
CN109886750A (en) * | 2019-02-25 | 2019-06-14 | 浪潮软件集团有限公司 | A kind of transparent random prize drawing implementation method based on block chain |
CN110247918A (en) * | 2019-06-24 | 2019-09-17 | 北京艾摩瑞策科技有限公司 | Number cochain method and its equipment are shaken applied to block chain |
CN110310097A (en) * | 2019-07-05 | 2019-10-08 | 匿名科技(重庆)集团有限公司 | A kind of public affairs of intelligence contract are rented a house the credible number of shaking method |
CN110599173A (en) * | 2019-09-20 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Block chain consensus node determination method, device, equipment and storage medium |
CN110990790A (en) * | 2019-11-29 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Data processing method and equipment |
CN111008863A (en) * | 2019-11-28 | 2020-04-14 | 湖南天河国云科技有限公司 | Lottery drawing method and system based on block chain |
CN111314069A (en) * | 2020-02-13 | 2020-06-19 | 苏州同济区块链研究院有限公司 | Block chain-based shaking system and method, electronic device and storage medium |
EP3678346A1 (en) * | 2018-09-20 | 2020-07-08 | Baidu Online Network Technology (Beijing) Co., Ltd. | Blockchain smart contract verification method and apparatus, and storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10102526B1 (en) * | 2017-03-31 | 2018-10-16 | Vijay K. Madisetti | Method and system for blockchain-based combined identity, ownership, integrity and custody management |
CN110968644A (en) * | 2019-11-29 | 2020-04-07 | 腾讯科技(深圳)有限公司 | Data processing method and equipment |
CN110933183A (en) * | 2019-12-16 | 2020-03-27 | 杭州羿贝科技有限公司 | Block chain-based number shaking method and system |
-
2020
- 2020-07-13 CN CN202010670261.XA patent/CN111884807B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107103097A (en) * | 2017-05-22 | 2017-08-29 | 中链科技有限公司 | Drawing method and terminal device based on block chain technology |
CN107742352A (en) * | 2017-09-20 | 2018-02-27 | 黄玉宇 | Decentralization lot/queuing strategy and system based on block chain and intelligent contract |
EP3678346A1 (en) * | 2018-09-20 | 2020-07-08 | Baidu Online Network Technology (Beijing) Co., Ltd. | Blockchain smart contract verification method and apparatus, and storage medium |
CN109584432A (en) * | 2018-10-26 | 2019-04-05 | 阿里巴巴集团控股有限公司 | Object select method and device, electronic equipment |
CN109886750A (en) * | 2019-02-25 | 2019-06-14 | 浪潮软件集团有限公司 | A kind of transparent random prize drawing implementation method based on block chain |
CN110247918A (en) * | 2019-06-24 | 2019-09-17 | 北京艾摩瑞策科技有限公司 | Number cochain method and its equipment are shaken applied to block chain |
CN110310097A (en) * | 2019-07-05 | 2019-10-08 | 匿名科技(重庆)集团有限公司 | A kind of public affairs of intelligence contract are rented a house the credible number of shaking method |
CN110599173A (en) * | 2019-09-20 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Block chain consensus node determination method, device, equipment and storage medium |
CN111008863A (en) * | 2019-11-28 | 2020-04-14 | 湖南天河国云科技有限公司 | Lottery drawing method and system based on block chain |
CN110990790A (en) * | 2019-11-29 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Data processing method and equipment |
CN111314069A (en) * | 2020-02-13 | 2020-06-19 | 苏州同济区块链研究院有限公司 | Block chain-based shaking system and method, electronic device and storage medium |
Non-Patent Citations (2)
Title |
---|
"BanFEL: A Blockchain Based Smart Contract for Fair and Efficient Lottery Scheme";Jiasheng Li; Zijian Zhang;《2019 IEEE Conference on Dependable and Secure Computing (DSC)》;20191223;全文 * |
"基于区块链的公开可验证随机数生成方法研究";佟铮;《中国优秀硕士学位论文全文数据库 信息科技辑》;20190715;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111884807A (en) | 2020-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111884807B (en) | Article reservation method, apparatus, device and medium based on block chain | |
CN110933163B (en) | Block chain contract deployment method, device, equipment and storage medium | |
CN111445333B (en) | Block generation method, device, computer equipment and storage medium | |
CN111427957B (en) | Block chain voting information verification method, device, equipment and storage medium | |
CN110443075A (en) | A kind of method and device of block chain intelligence contract verifying deployment | |
CN112700246B (en) | Block chain-based data processing method, device, equipment and readable storage medium | |
CN111027028A (en) | Copyright data processing method and device based on intelligent contract | |
CN112632629B (en) | Voting management method, device, medium and electronic equipment based on block chain | |
CN110601896B (en) | Data processing method and equipment based on block chain nodes | |
Tkachuk et al. | A survey on blockchain-based telecommunication services marketplaces | |
CN111934870B (en) | Method, apparatus, device and medium for updating root certificate in block chain network | |
CN111311211A (en) | Data processing method and device based on block chain | |
CN111222841A (en) | Block chain-based data distribution method and equipment and storage medium thereof | |
CN111488372A (en) | Data processing method, device and storage medium | |
CN112907244A (en) | Data processing method, device and equipment based on block chain and readable storage medium | |
CN115701078A (en) | Cross-chain transaction processing method and device, electronic equipment and storage medium | |
CN111274597B (en) | Data processing method and device | |
CN111008900A (en) | Data distribution method and device based on intelligent contract | |
CN115913734A (en) | User authority management method, device and equipment applied to alliance chain | |
CN118353628A (en) | Block chain data processing method, device, computer equipment, medium and product | |
CN117061089B (en) | Voting management method, device, equipment and storage medium | |
CN117040930B (en) | Resource processing method, device, product, equipment and medium of block chain network | |
CN115601091A (en) | Bill management method based on block chain and related equipment | |
CN118333288A (en) | Block chain-based data processing method, device, equipment and medium | |
CN117474676A (en) | Block chain-based data processing method, device, equipment and medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |