Disclosure of Invention
The technical problems to be solved by the invention are as follows: a blockchain-based product sales method and a system thereof are provided, which ensure that all operations of a product sales process are transparent, safe and reliable.
In order to solve the technical problems, the invention adopts the following technical scheme:
A blockchain-based product marketing method, comprising:
the resource platform writes the order identification description of the original factory order into the blockchain; the order identification instruction comprises basic information of a factory and order information of the factory; the original factory basic information comprises supplier information and corresponding product information and product certificate information;
the resource platform receives an order identification instruction and the selling quantity of the residual products, which are submitted by a user and correspond to the residual products in an original factory order;
after the resource platform verifies that the sales quantity of the residual products passes the verification, releasing the residual products;
the resource platform receives a verification request of an order identification instruction corresponding to a allowance product;
the resource platform initiates verification of the order identification instruction to a blockchain according to the original factory order information corresponding to the allowance product;
the resource platform displays the verification result returned by the block chain.
Further, the method further comprises:
the resource platform generates a provider id according to the provider information and writes the provider information and the corresponding provider id into a block chain;
the resource platform receives a manufacturer certificate and a product certificate corresponding to the supplier id, and respectively generates a manufacturer certificate id and a product certificate id;
The resource platform writes the manufacturer certificate and the manufacturer certificate id into a blockchain, and writes the product certificate and the product certificate id into the blockchain;
the resource platform receives product information corresponding to a provider id and a product certificate selected from a product certificate list corresponding to the provider id;
the resource platform generates a corresponding product id according to the received product information and the product certificate;
the resource platform writes the product information, the product certificate and the product id into a blockchain;
and the user selects a product by browsing the product list, and verifies the authenticity of one or more items of information including product information, product certificate, manufacturer certificate and supplier information corresponding to the product to the blockchain according to the product id and the supplier id of the product through the resource platform.
Further, the method further comprises:
the resource platform creates a corresponding order according to the buyer order, generates a corresponding electronic file and calculates the hash of the electronic file;
the resource platform records the confirmation time of the buyer and the seller corresponding to the electronic file;
and the resource platform writes the order id, the electronic file hash and the buyer-seller confirmation time of the order into the blockchain.
Further, the resource platform receives an order identification instruction and a sales quantity of a residual product in a corresponding original factory order submitted by a user, and the method comprises the following steps:
the resource platform receives an order identification instruction, submitted by a user, of a residual product in a primary factory order, an order id of the primary factory order and the selling quantity of the residual product;
the resource platform verifies the sales quantity of the allowance product, and comprises:
the resource platform acquires the purchase quantity of the allowance product in the order according to the order id, and verifies the rationality of the selling quantity of the allowance product;
the resource platform initiates verification of the order identification instruction to a blockchain according to the original factory order information corresponding to the allowance product, and the resource platform comprises the following steps:
the resource platform initiates verification to the blockchain according to the order id of the allowance product and the hash value of the order identification specification;
the block chain acquires the hash value of the corresponding order identification instruction according to the order id of the allowance product, and judges whether the received hash value is consistent with the acquired hash value; and if the verification results are consistent, returning the verification results of verification passing.
Further, the product information in the original factory basic information comprises a product id, a product name and a batch id;
The original factory order information comprises an order id, an order name, an order identification id, an order identification instruction hash value, a contract id, a contract attachment hash value, a buyer and seller id, a buyer and seller nickname, a transaction date, a delivery date and an arrival date;
the product certificate information includes a certificate id and a certificate attachment hash value.
The other technical scheme provided by the invention is as follows:
a blockchain-based product sales system including a resource platform and a blockchain network;
the resource platform is used for writing order identification instructions of the original factory order into the blockchain; the order identification instruction comprises basic information of a factory and order information of the factory; the original factory basic information comprises supplier information and corresponding product information and product certificate information; and
the method comprises the steps of receiving order identification instructions and the selling quantity of the residual products, which are submitted by a user and correspond to the residual products in a factory order; and
receiving a verification request corresponding to an order identification specification of a remaining quantity of the product; and
the method comprises the steps of issuing a balance product after the balance product selling quantity verification is passed; and
receiving a verification request corresponding to an order identification specification of a remaining quantity of the product; and
The system is used for initiating verification of the order identification instruction to a blockchain according to the original factory order information corresponding to the allowance product; and
and the verification result returned by the block chain is displayed.
Further, the resource platform is further configured to generate a vendor id according to vendor information, and write the vendor information and the corresponding vendor id into a blockchain; and
the method comprises the steps of receiving a manufacturer certificate and a product certificate corresponding to a supplier id, and respectively generating a manufacturer certificate id and a product certificate id; and
the method comprises the steps of writing the manufacturer certificate and the manufacturer certificate id into a blockchain, and writing the product certificate and the product certificate id into the blockchain; and
for receiving product information corresponding to a vendor id and a selected product certificate from a list of product certificates corresponding to the vendor id; and
the product id generation module is used for generating a corresponding product id according to the received product information and the product certificate; and
for writing the product information, product certificate and product id to a blockchain; and
the method is used for receiving a product selected by a user through browsing the product list, and verifying the authenticity of one or more items of information including product information, product certificates, manufacturer certificates and provider information corresponding to the product to the blockchain according to the product id and the provider id of the product.
Further, the method further comprises:
the resource platform creates a corresponding order according to the buyer order, generates a corresponding electronic file and calculates the hash of the electronic file;
the resource platform records the confirmation time of the buyer and the seller corresponding to the electronic file;
and the resource platform writes the order id, the electronic file hash and the buyer-seller confirmation time of the order into the blockchain.
Further, when the resource platform receives the order identification instruction and the selling quantity of the allowance product in the corresponding one factory order submitted by the user, the executing includes:
receiving order identification instruction of a residual product in a corresponding original factory order submitted by a user, order id of the original factory order and the selling quantity of the residual product;
when the resource platform initiates verification of the order identification instruction to a blockchain according to the original factory order information corresponding to the allowance product, the execution comprises the following steps:
the resource platform initiates verification to the blockchain according to the order id of the allowance product and the hash value of the order identification specification;
the block chain acquires the hash value of the corresponding order identification instruction according to the order id of the allowance product, and judges whether the received hash value is consistent with the acquired hash value; and if the verification results are consistent, returning the verification results of verification passing.
Further, the product information in the original factory basic information comprises a product id, a product name and a batch id;
the original factory order information comprises an order id, an order name, an order identification id, an order identification instruction hash value, a contract id, a contract attachment hash value, a buyer and seller id, a buyer and seller nickname, a transaction date, a delivery date and an arrival date;
the product certificate information includes a certificate id and a certificate attachment hash value.
The invention has the beneficial effects that: the invention realizes product sales based on the block chain technology. By fully utilizing the idea of block chain decentralization, the transparent, safe, neutral and reliable operation of the sales process is ensured. Particularly, the method can realize the resale of the surplus inventory based on the authentication idea of the blockchain, and support the traceability anti-counterfeiting function for the surplus product. Not only provides a channel for the allowance sales to become, but also ensures the legal rights and interests of the users who purchase the allowance products. Therefore, based on the product sales scheme, the authenticity of the product and the transaction can be reliably ensured.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Example 1
The embodiment provides a product selling method based on a block chain, which is based on interactive realization of a resource platform and a block chain network. The method specifically comprises the following three business scenes:
1. product tracing
Verification of the source authenticity of a product is supported by writing vendor related information and its product information into the blockchain. Wherein, the uplink information is written into the blockchain through the resource platform.
In a specific example, the implementation process may include:
1. the basic information is uplink;
the basic information includes: vendor information and certificate information;
the uplink provider information includes: vendor id, vendor name, responsible person, contact; the uplink certificate information includes: product certificate and its certificate id and certificate attachment hash value, vendor certificate and its certificate id and certificate attachment hash value.
1.1 vendor information chaining;
alternatively, the vendor account number system may be divided into two levels: a first-stage B-end account; each manufacturer and each purchaser can register the B-terminal account; a secondary account, a sub-account under the B-side account; the B-side account distinguishes the buying and selling rights through newly-built sub-accounts with different rights under the account. The application authority registration is required to be approved by a resource platform, and a provider can be a manufacturer or a branch company of the manufacturer (subjected to task assignment of the manufacturer) as the provider to meet different product series purchasing requirements.
In this example, the process of linking vendor information includes:
the provider registers account numbers in the resource information platform, fills in information such as provider names, responsible persons, contact modes and the like, and generates corresponding provider ids according to the information; the resource platform stores the information, and invokes a blockchain platform API interface connected with the resource platform, and after the resource platform manager passes the verification of the registration information, the information is written into the blockchain.
1.2 certificate information is uplink;
after registering the account number, the provider can upload the certificate attachment in an attachment form by adding a certificate function, and fill in the key information of the certificate for the resource platform to audit. The certificate attachments may be vendor certificate attachments and/or product certificate attachments, the specific number being not limited.
Preferably, the certificate name is not repeatable for facilitating the vendor's selection of the certificate to which the product corresponds. When the verification passes, the resource platform generates a certificate id, calculates a certificate hash value through an MD5 algorithm, calls an API (application program interface) of the resource platform, and writes the certificate id and the hash value into the blockchain.
2. Tracing the source of the product;
optionally, two product libraries are provided in the resource platform, one is a standard database for storing product data agreed upon and standardized by the provider and the resource platform; the other is a vendor-marketable store of goods.
The resource platform processes product information of a corresponding product uploaded to the resource platform by the provider. The treatment process specifically comprises the following steps: labeling and formatting the product description file (preferably in pdf format) provided by the provider, and converting the product description file into structured data to obtain product information. And then submitting the obtained product information to a supplier for verification, wherein after the supplier confirms that the verification is passed, the resource platform and the supplier agree on the product information of the product, and the resource platform stores the product information in a standard database. Meanwhile, the product information has consensus after both sides are identified, so that the product information can be stored in a blockchain platform by calling a blockchain platform API interface connected with a resource platform, and the original product description file is subjected to MD5 calculation and then is linked with the obtained verification information.
In addition, a certificate associated with the product information is also included.
In a specific example, the implementation process may include:
2.1 product information is uplink;
after registering the account number, the provider can upload a product description pdf file by adding a product function as original data, and fill in basic product information such as corresponding product names, product models, product series and the like; through the multi-choice list menu provided by the resource platform, the provider can select the certificate corresponding to the product, and can select more; generating a corresponding product id by the resource platform and associating the provider id; storing the product description pdf file, generating verification information (MD 5) of the pdf file; the resource platform stores the product information (product id and its supplier id, product description pdf file and its verification information, and the filled basic product information) of the product; and calling the API interface of the blockchain platform to write the product information except the pdf source file into the blockchain.
In another embodiment, updating of the above-described product information is supported. The process comprises the following steps: some product information may be updated after a period of time. After updating, for the same product id, the related content of the standard database of the resource platform is covered, the blockchain platform uplinks a new record corresponding to the same product id, and when query verification is performed, the latest record on the blockchain is provided.
2.2 verification of product information;
the buyer can search the product related information of the product through the blockchain platform API interface by browsing the product list item issued by the resource platform and clicking a certain product item, wherein the product related information comprises the information of the supplier, the information of the product and the related certificate information of the product.
The query result page of the resource platform can display the provider information corresponding to the product id, and comprises the provider id, the provider name, the responsible person and the contact way; corresponding product information including product name and product model; corresponding block chain information including block number information; the corresponding product description pdf file, product-associated credential information (if any), and blockchain verification or blockinformation for such information. And for the case that the product file has a historical version, the query result is the information corresponding to the latest product description pdf file.
Therefore, the block chain can be combined, the authenticity of the source of the sold product can be verified through the resource platform, and the safety and reliability of the source and quality of the product are ensured.
2. Original factory order tracing
The verification of the authenticity of the original factory order is supported by writing relevant information of the original factory order into the blockchain.
In a specific example, the implementation process may include:
1. relevant information of the original factory order is uplink;
corresponding to the scene with order information, the transaction information can be traced by carrying out bidirectional confirmation on the order identification instruction in the process and linking.
The buyer directly places an order to the supplier to generate an order; extracting, by the resource platform, from the transaction data of the order includes: a. product information: product id and product name of the original factory order; b. logistics information (optional): c. order information: order id, order name, lot number, order identification id, order identification specification hash value, contract id, contract attachment hash value, seller id, seller nickname, buyer id, buyer nickname, transaction date, delivery date, order identification specification content of arrival date, then calling a blockchain API interface, writing the extracted information into a blockchain.
Optionally, information such as a logistics company code, a logistics company name, a logistics list number, a logistics process and the like in the transaction data triggers writing into the blockchain when the state changes in the flow.
2. Standardized transaction flow based on intelligent contracts:
blockchain exposes transparent intelligent contracts that enable the writing of non-modifiable (updateable) business logic. The method has very good correspondence with a standardized transaction flow, and can enter the next flow according to the standard flow and the published rule by the information triggered by the outside, such as the information triggered by the logistics state and the like. At present, the overall flow of this embodiment is as follows: order contract (order), contract update-shipping-receiving (buyer) -seller confirmation of receipt (order complete); after the process is run for a fixed period of time, smart contracts are used to make it a publicly transparent, standardized control process. The input and output of the intelligent contract interacts with the resource platform.
3. Block chain realization of electronic file consensus confirmation;
the resource platform is used as a neutral third party and can record the signing state of the electronic contracts of factories and buyers. After the buyer and the seller sign the contract offline, scanning to generate pdf electronic contract and uploading the pdf electronic contract to a resource platform; the buyer and seller make signing status confirmation on the pdf file. The resource platform records the signing state of the electronic contract in the system, calculates the hash value of the electronic contract, and writes the hash of the electronic contract into the blockchain to ensure that the electronic contract cannot be tampered later.
4. Verifying an original factory order;
the provider or buyer related to the factory order can click the order list through the display page related to the factory order classification on the resource platform, and then inquire the content of the order identification instruction corresponding to the order through the blockchain API interface, and can display the verification information corresponding to the order identification instruction by the blockchain. The content of the order identification instruction book comprises a product id, a product name, an order id, an order name, a batch number, an order identification id, an order identification book hash value, a contract id, a contract attachment hash value, a seller id, a seller nickname, a buyer id, a buyer nickname, a transaction date, a delivery date and an arrival date information. The blockchain information corresponding to the order id which can be displayed on the query result page comprises the time and contract attachment files of the electronic files of the order identification instruction book confirmed by the buyer and the seller.
The resource platform is used as a witness of the transaction, and can inquire and verify all the original factory order information through the original factory order classification.
3. Margin inventory transaction
The margin stock transaction is implemented on an order-up basis for the original factory order. The balance inventory transaction may be multi-level, i.e., buyers purchasing genuine products, performing primary buying and selling as balance inventory outlet sellers; after the primary purchase and sale is completed, a situation may occur in which the primary buyer has additional inventory to trade, which may initiate a secondary purchase and sale transaction. And so on, multiple levels of margin inventory transactions may occur.
For the balance inventory transaction, the verified information mainly contains two parts:
the first part is product information, and the information of the first part is used as verification objects by corresponding order identification specifications and the like in the original factory order, regardless of the number of the steps.
The second part is the sales quantity of the allowance product, which is unique to the allowance inventory transaction, and because the credibility of the transaction is very important, the information of the allowance inventory transaction needs to be checked through a resource platform when being issued, and is recorded in the blockchain after the checking is passed so as to support verification.
The order information uplink and trade after the allowance stock trade is achieved is identical to the original order trade (except the uplink process when the sales information is released, the order number total of the upper order is not required to be saved when the trade is achieved, because the order is verified when the sales information is checked).
In one embodiment, the whole process of the balance transaction includes:
1. issuing allowance vending information;
the method specifically comprises the following steps:
1.1 uploading allowance vending information;
after a user submits balance inventory sales information to a resource platform, before formally publishing, tracing verification is needed. The stock sales information of the surplus comprises the original factory order information corresponding to the surplus products and an order identification instruction book thereof so as to trace back the original factory order information; the total amount of the previous order is also required to be included; the information can be released after being checked by the resource platform.
The resource platform needs to inquire the purchase quantity of the residual products in the previous order according to the uploaded order id and the product batch id, so as to judge whether the uploaded sales quantity of the residual products is suspicious; if the verification is passed, the selling information of the allowance product is issued; meanwhile, the resource platform records the selling information (including order id, batch id and the selling quantity) of the residual products into the block chain.
1.2 verifying the balance selling information;
the resource platform initiates a verification request to the blockchain according to the original factory order information in the allowance sales information and the hash value of the order identification instruction; the block chain acquires a hash value of an order identification instruction stored in a block chain node according to an order id in original factory order information; then verifying the consistency of the obtained hash value of the order identification specification and the hash value of the received order identification specification; if the verification is consistent, the verification is passed; the resource platform displays the verification result returned by the block chain. Preferably, the verification result can further comprise an order identification instruction corresponding to the order id stored in the blockchain for further confirmation by the buyer.
In a specific scenario, a buyer clicks a certain product by browsing a balance inventory sales information list of the resource platform, and enters a verification page. The verification page display content comprises an order identification specification source file (pdf) of a factory order of the product, verification information inquired through a block chain and the vending number of the vending information, and information stored in the block chain is displayed.
1.3 balance inventory sales transactions;
the buyer confirms that the order information exists, places an order for purchase, and the resource platform uses the order identification instruction of the upper order of the residual product to generate a new trade order and links the new trade order.
Example two
Referring to fig. 2, the embodiment corresponds to "1.2 certificate information uplink" under "one, product tracing" in the first embodiment, and provides a specific interaction flow.
1. Product certificate chaining flow:
1.1, uploading a product certificate file to a resource platform by a provider;
1.2, the platform calculates md5 according to the uploaded certificate file to obtain a certificate hash; inquiring whether the certificate hash exists in a local database (check duplicate); if not, saving the file to the platform, and recording the certificate hash to a database and associating with the vendor id;
1.3, calling an uplink contract, and transmitting a provider id and a certificate hash;
1.4 get blockchain txid, save association of vendor id, certificate id and blockchain txid (transaction hash) at the platform;
1.5 returning the identification of the certificate hash on the platform side.
2. Vendor certificate verification flow:
2.1 the purchaser queries the platform for vendor credentials;
2.2 the platform inquires the list of all certificate files of the provider and the verification link corresponding to each file;
2.3 the user checks the list of all certificate files of the provider and the verification link corresponding to each file;
2.4 the user clicks the verification link of a certificate;
2.5 the platform uses md5 of the certificate file as a parameter to call a certificate inquiry contract;
2.6 the blockchain returns the vendor id to which the certificate belongs, and the platform can find the corresponding vendor name according to the vendor id; if not found on the blockchain, the description certificate is invalid.
And 2.7, the platform returns a verification result to the buyer client.
Example III
Referring to fig. 3, in a first embodiment, a process of uplink and tracing product lot information is provided.
1. The batch information uplink flow includes:
1.1, a supplier submits a product batch number and a supplier id to a platform;
1.2 the platform stores batch information and vendor id;
1.3 the platform submits batch information and vendor id records to the blockchain;
1.4 return blockchain txid;
1.5 saving an association of the blockchain txid with the data of step 1.2, the blockchain txid can be found in the local database, and which block to record into the blockchain is looked up according to the blockchain txid onto the blockchain;
1.6 return the uplink result.
2. The batch information tracing flow comprises the following steps:
2.1 tracing according to the product batch id;
2.2 invoking a query batch contract on the blockchain;
2.3, returning a query result;
2.4 returning the query result.
Wherein, different products of a plurality of factories can be searched according to a single product batch number, and information of the plurality of factories can be listed for a purchaser to confirm.
Example IV
Referring to fig. 4, in a corresponding embodiment of the present invention, a specific flow of publishing and linking inventory information is provided:
1. issuing balance inventory sales information;
1.1, submitting product order id, product batch id and product allowance information to a resource platform by a allowance inventory seller;
1.2 the platform backstage examines the information, specifically, the platform can inquire the purchase quantity of the corresponding products in the order according to the provided product order number and the product batch number, thereby judging whether the residual information is suspicious to determine whether the examination passes.
1.3 if the verification is passed, the information is released to a page visible to the buyer;
1.4 the system automatically records the inventory sales information (including order number, batch number and the sales allowance) of the allowance passing the verification to the block chain;
1.5 return blockchain txid;
1.6 the platform informs the message publisher of the passage of the audit through some channels (optional);
2. checking balance inventory sales information;
2.1, the buyer inquires the information of the rest inventory commodity according to the order number and batch number issued by the seller;
2.2, the platform inquires the information of the rest inventory commodity according to the order number, the batch number and the blockchain;
2.3 the blockchain returns inventory commodity information;
and 2.4, displaying the information of the inventory goods by the platform.
Example five
Referring to fig. 5, the electronic document consensus confirming process according to the first embodiment of the present embodiment provides the following specific procedures:
1. the buyer places an order on the platform.
2. And creating an order by the platform, generating an electronic file, and recording a file hash.
3. The platform displays the electronic file for the buyer to view.
4. The buyer confirms the file contents.
5. The platform records the buyer validation time.
6. The platform returns a buyer confirmation of success.
7. The platform informs the buyer that a new order file needs to be confirmed.
8. The vendor logs in to the platform to view the electronic file.
9. The platform displays the electronic file for viewing by the vendor.
10. The seller confirms the file contents.
11. The platform records vendor validation time.
12. The platform returns a seller confirmation of success.
13. The platform writes the order number, electronic file hash and buyer-seller validation time to the chain.
14. The blockchain platform returns the blockchain TxID, which is saved by the platform.
In addition, referring to fig. 6, the blockchain general information query procedure is as follows:
1.1, the transaction platform inquires corresponding block information according to a block chain txid;
1.2 the blockchain service returns blockinformation.
Example six
The present embodiment provides corresponding embodiments one through five, and provides a blockchain-based product sales system including a resource platform and a blockchain network.
Referring to fig. 7, the overall architecture of the blockchain network in the system is as follows:
the core part of the overall architecture consists of three parts, namely member management (Membership Services), consensus service (Consensus Services) and intelligent contracts (Chain-code Services), and a security and encryption service (Security and Crypto Services) penetrates through other components, and an application end calls information such as IDENTITY (IDENTITY), account book (LEDGER), transaction (transaction), intelligent contracts and the like through an interface (APIs, events, SDKs).
Wherein, member management (Membership services): including identity and credential services in the figure; providing member service functions including registration, application certificate and the like; considering the requirements of business application on security, privacy, supervision, audit and performance, nodes and members can only be added into the blockchain network if obtaining certificates; or may be handled by pluggable Fabric CA components alone.
Consensus service (Consensus services): including ledger, transaction, and blockchain services in the figures; is responsible for the calculation and storage (Idstributed Ledger) of the distributed account book, the consensus Service (Ordering Service) among nodes, the endorsement verification management (Endorsement Validation) and the realization of the Network Protocol (NetworkProtocol) function among nodes. Is the core component of the blockchain, providing the underlying support for the main functions of the blockchain.
Intelligent contracts (Chain-code Services): including smart contracts and chain code services in the figures; the SMART CONTRACT (SMART CONTRACT) is called a chain code (chaincode), and is a piece of code based on standards, and specific business logic is implemented. The chain code and the bottom account book are decoupled, and the original data is not affected by the updating of the chain code. The chain code can be written by GO, java and node. Js at present, the chaincode is run through a Docker container, and the chain code is connected with the Peer node in the same channel through gRPC after being installed and instantiated.
Security and encryption service (Security and Crypto Services): the nodes or members must be licensed to enter the network, the security is ensured by means of certificates, encryption, signature and the like, and only the nodes participating in the transaction can access the data by the multi-channel isolation function, and other nodes cannot see the data, so that the separation of logic and the data is truly realized.
Interfaces (APIs, events, SDKs): providing an API mode for third party application call, facilitating secondary development, and providing two language interfaces of node. Js and Java SDK at present; the system can be used for installing and testing chain codes in an SDK or CLI mode, can also be used for inquiring transaction states, data and other functions, and meanwhile monitors Events found in a blockchain network through Events, so that the third application system can be conveniently called and processed.
The implementation scheme of the system based on the embodiment is as follows:
the platform side provides information uplink interface service and provides the factory with information of reporting product batch information, product certificate abstract hash and allowance inventory transaction information;
the platform side provides a product traceability interface based on the block chain and provides a merchant with inquiring traceability according to the batch information to verify the authenticity of the product;
certificate verification for the uplink product can be achieved by uploading a certificate file to the platform through a provider; the platform stores the certificate file, provides the certificate file for a buyer to download, extracts abstract information hash from the certificate file according to a certain algorithm and serves as one attribute of product uplink information, and verifies the authenticity of the certificate through the tamper-proof hash stored on the chain.
The platform provides a balance inventory transaction function, and for orders purchased through the platform, the buyer finally generates balance inventory, so that the buyer can act as a balance inventory seller and issue balance inventory sales information through the platform. The sales information needs to contain the information of the original purchase order number, the product batch number, the quantity and the like. The platform business manager searches the original transaction record through the single number, and checks whether the allowance transaction information has problems or not through quantity comparison. And publishing the information on the front-end page of the platform and linking the related information through the audited information. The user clicks the transaction information, the related information of the blockchain stored in the transaction information can be displayed, and the information authenticity is proved.
In one embodiment, please refer to fig. 8, a description is given for a data consensus flow based on the above system:
the processing process of the blockchain node is logically decomposed into different roles, each role bears different functions, and when each transaction is processed, authority verification is required to be carried out on transaction information on each link. Nodes (Peers) are decomposed into endorsement nodes (Endorser peers) and commit nodes (Committer peers), and in order to achieve processing sequency, an ordering (Orderer) role is refined.
When the blockchain node processes each transaction, authority verification is required to be carried out on transaction information in each link.
The data consensus process, namely the transaction process of the blockchain, comprises the following steps:
1) The application program client calls certificate service (CA) service through a blockchain SDK, registers and registers, and acquires an identity certificate;
2) The application program client initiates a transaction Proposal (Proposal) to the blockchain network through the blockchain SDK, and the transaction Proposal sends information such as contract identification, contract method and parameter information to be called in the transaction, client signature and the like to an endorsement (Endorser) node;
3) After receiving a transaction Proposal (Propos), an endorsement (Endorser) node verifies the signature and determines whether a submitter has the right to execute the operation, and simultaneously simulates and executes an intelligent contract according to an endorsement policy, and sends the result and the respective CA certificate signature thereof to an application program client;
4) After receiving information returned by an endorsement (endocorder) node, the application program client judges whether the proposal results are consistent or not and whether the proposal results are executed by referring to a designated endorsement policy or not, and if not, the processing is stopped; otherwise, the application program client packages the data together to form a transaction and signs the transaction and sends the transaction to Orderer;
5) Orderer performs consensus ordering on received transactions, packages a batch of transactions together according to a block generation strategy, generates a new block, and sends the new block to all commit (Committer) nodes in the same channel through gossip protocol (inter-node communication protocol);
6) After receiving the block, the commit (Committer) node checks each transaction in the block (re-uses logic in the intelligent contract to calculate locally according to the input condition), checks whether the input and output of the transaction dependence accords with the state of the current blockchain, and adds the block to the local blockchain ledger after completion. The local account book of the node uses a LevelDB database, and each transaction which is subjected to consensus is written into the local database of each node.
In an embodiment, please refer to fig. 9, which is a schematic diagram of a system module of the present embodiment, it can be seen that the system of the present embodiment can be further divided into three layers: an application layer, a base service layer, and a base framework layer. Wherein the external service is provided with a block chain uplink and a query interface. The operation and maintenance support system is mainly used for carrying out corresponding user account management, authority control, system configuration, system service monitoring and the like aiming at the query interface. The basic service layer is used for packaging and providing unified internal services on the infrastructure of the bottom layer block chain, the database, the cache component and the like. The base framework layer runs the underlying databases, caching middleware, and blockchain networks.
Example seven
The present embodiment corresponds to the first to sixth embodiments, and provides a specific application scenario:
some relay factories have qualification certificates of electronic files to be linked on a platform side so as to ensure that file data are approved by multiple parties and cannot be tampered unilaterally. The digest information hash of the document needs to be extracted according to a fixed digest algorithm for the document file.
Specifically, the manufacturer uploads the electronic certificate file, then the resource platform calculates the abstract information hash of the certificate file, and the abstract information hash is written into the blockchain by calling the intelligent contract writing interface on the blockchain node. After the information is written into the block chain nodes, the information is transmitted in the block chain network, is agreed through the consensus nodes, and is broadcast to all the block chain nodes. After each node receives the block information of the consensus node, calculation verification is carried out locally according to intelligent contract logic deployed in advance, and after the data is confirmed to be legal, the data is written into a local NoSQL database.
If the purchaser needs to know whether the certificate file of the manufacturer currently seen by the resource platform is uploaded by the source manufacturer. The certificate files listed by the platform side can be selected on the platform, the abstract information hash of the corresponding certificate files is queried through the platform, then the corresponding intelligent contract query interface on the blockchain node is called, and if the corresponding certificate file information stored on the blockchain is queried to be consistent with the current manufacturer certificate file, the certificate is considered to be true and effective.
In summary, the blockchain-based product sales method and the blockchain-based product sales system provided by the invention can ensure that the sales process is transparent, safe, neutral and reliable in operation. The method comprises the steps of verifying the authenticity and the reliability of a seller and a product thereof online; the order can be verified on line, and the reality and the reliability of the order can be verified; particularly, the resale of the surplus inventory can be realized, the traceability anti-counterfeiting function for the surplus products is supported, a channel for surplus sales is provided, and the legal rights and interests of users buying the surplus products are ensured. Therefore, based on the product sales scheme, the authenticity of the product and the transaction can be reliably ensured, and the method is applicable to various product types and has the characteristics of wide application range, strong practicability and the like.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.