A data processing method based on blockchain
Through blockchain technology, manufacturers equipment obtains and processes product sales data, solving the problem that manufacturers cannot obtain accurate sales data in a timely manner, and real-time data processing and accuracy are achieved.
Patent Information
- Application Number
- CN202210134724.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-02-14
AI Technical Summary
Manufacturers are unable to obtain accurate sales data provided by sellers in a timely manner, resulting in inaccurate data processing results.
Through blockchain technology, the manufacturer's equipment obtains the manufacturer's identification, identity information, product identification and industry information. The blockchain determines and feedbacks commodity sales data based on this information. The blockchain includes the main chain and the slave chain. The main chain has management nodes and connection nodes, and the connection nodes correspond one by one to the slave chain, and is used for identity verification and data storage.
It enables manufacturers to obtain the latest product sales data at any time and process it, solves the problem of passively waiting for the seller to provide data, and improves the accuracy of data processing.
Smart Images

Figure CN114510535B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method based on blockchain. Background Art
[0002] Currently, blockchain is a technology receiving widespread attention and high regard. It is a new type of infrastructure used to achieve universal consensus, shared governance, and shared benefits. It boasts features such as distributed data storage, decentralization, immutability, traceability, and trustworthiness.
[0003] Because product production and sales are two independent processes, manufacturers (including distributors) only have access to production data, while sellers only have access to sales data. To determine the overall status of a product, manufacturers need to obtain both production and sales data and integrate them. To do this, manufacturers need to obtain sales data from sellers.
[0004] Because data processing requires passively waiting for sellers to provide sales data, data processing cannot be carried out in a timely manner. In addition, the sales data is provided by the seller, and its accuracy cannot be verified by the manufacturer, which also makes the data processing results inaccurate. Summary of the Invention
[0005] (1) Technical issues to be resolved
[0006] In order to address the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a data processing method based on blockchain, which solves the technical problem that manufacturers can only passively wait for sellers to provide sales data but cannot obtain sales data at any time.
[0007] (2) Technical solution
[0008] In order to achieve the above objectives, the main technical solutions adopted by the present invention include:
[0009] A data processing method based on blockchain technology, the method comprising:
[0010] S101, a first device obtains a first identifier and identity information of a manufacturer, a second identifier of a product, and a first industry to which the product belongs;
[0011] S102: The first device sends the first identifier, the identity information, the second identifier, and the first industry to a blockchain;
[0012] S103, the blockchain determines commodity sales data based on the first identifier, the identity information, the second identifier, and the first industry, and feeds back the commodity sales data to the first device; the blockchain includes a main chain and at least two slave chains; one of the slave chains is an identity authentication slave chain, which is used for identity authentication, and the other slave chains are data slave chains, each of which is used for storing data; the main chain includes a management node and at least two connection nodes; the number of the connection nodes is the same as the number of the slave chains, and each connection node is connected to a unique slave chain; the management node stores the connection relationship between the connection node and the slave chain; each data slave chain corresponds to the identifier of a seller;
[0013] S104: The first device processes the commodity sales data.
[0014] Optionally, before S101, the step further includes:
[0015] S201: A first device sends a registration message to a management node of a blockchain, where the registration message includes a first identifier, a second identifier, and a first industry.
[0016] S202, the management node confirms a first connection node based on the connection relationship between the connection node and the slave chain; the first connection node is connected to the authentication slave chain;
[0017] S203: The management node sends the registration message to the authentication slave chain through the first connection node. The authentication slave chain includes a verification head node and at least one verification connection node. Each verification connection node is connected to a unique subchain, and each subchain corresponds to an industry. The verification head node stores the connection relationship between the verification connection node and the subchain, as well as the correspondence between the subchain and the industry.
[0018] S204: The verification head node of the identity verification slave chain determines whether there is a first subchain among all subchains based on the correspondence between subchains and industries, and the first subchain corresponds to the first industry;
[0019] S205: If the first subchain does not exist, the verification head node establishes a second subchain corresponding to the first industry; the verification head node feeds back a registration completion message to the management node via the first connection node; the management node feeds back a registration completion message to the first device;
[0020] S206: If the first sub-chain exists, the verification head node responds to the registration message based on the first sub-chain.
[0021] Optionally, the verification head node establishes a second subchain, specifically including:
[0022] The verification head node creates a new verification connection node in the authentication slave chain based on the first smart contract; the first smart contract is used to establish the verification connection node in the authentication slave chain;
[0023] The verification head node creates a new second subchain in the authentication slave chain based on the second smart contract, and connects the second subchain to the newly created verification connection node; the second subchain corresponds to the first industry; and the second smart contract is used to establish a subchain in the authentication slave chain;
[0024] The verification head node records the corresponding relationship between the second sub-chain and the first industry, as well as the connection relationship between the newly created verification connection node and the second sub-chain;
[0025] The verification head node creates a new block in the second sub-chain through the newly created verification connection node based on the third smart contract, and stores the first identifier and the second identifier in the newly created block through the newly created verification connection node; the third smart contract is used to establish a block in the identity authentication slave chain.
[0026] Optionally, the verification head node responds to the registration message based on the first subchain, specifically including:
[0027] The verification head node determines a first verification connection node based on the connection relationship between the verification connection node and the subchain; the first verification connection node is connected to the first subchain;
[0028] The verification head node determines, through the first verification connection node, whether a first block exists in the first subchain, where the first block stores the first identifier;
[0029] If the first block exists and the first block also stores the second identifier, the verification head node feeds back a registration message to the management node through the first connection node; and the management node feeds back a registration message to the first device;
[0030] If the first block exists but the second identifier is not stored in the first block, the verification head node stores the second identifier in the first block through the first verification connection node; the verification head node feeds back a registration completion message to the management node through the first connection node; and the management node feeds back a registration completion message to the first device;
[0031] If the first block does not exist, the verification head node creates a new block in the first sub-chain based on the third smart contract through the first verification connection node; the verification head node stores the first identifier and the second identifier in the newly created block through the first verification connection node; the verification head node feeds back a registration completion message to the management node through the first connection node; the management node feeds back a registration completion message to the first device; the third smart contract is used to establish a block in the authentication slave chain.
[0032] Optionally, before S101, the step further includes:
[0033] S301: The second device sends a data record message to the management node of the blockchain; the data record message includes the third identifier of the seller, the fourth identifier of the product, the second industry to which the product belongs, and product sales data;
[0034] S302, the management node confirms a first connection node based on the connection relationship between the connection node and the slave chain; the first connection node is connected to the authentication slave chain;
[0035] S303: The management node sends the third identifier, the fourth identifier, and the second industry to the identity authentication slave chain through the first connection node;
[0036] S304: The authentication slave chain's verification head node determines whether a third sub-chain exists based on the correspondence between sub-chains and industries; the third sub-chain corresponds to the second industry;
[0037] S305: If the third subchain does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node; and the management node feeds back a data recording failure message to the second device.
[0038] S306: If a third subchain exists, the verification head node determines whether a second block exists in the third subchain, and the second block stores the fourth identifier;
[0039] S307: If the second block does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node; and the management node feeds back a data recording failure message to the second device.
[0040] S308: If the second block exists, the verification head node stores the third identifier in the second block; the verification head node feeds back a data record message to the management node through the first connection node;
[0041] S309: After receiving the data record message, the management node confirms whether there is a second connection node based on the connection relationship between the connection node and the slave chain; the second connection node is connected to the second data slave chain; the second data slave chain corresponds to the third identifier;
[0042] S310. If a second connection node exists, the management node sends the fourth identifier and the product sales data to the second data slave chain through the second connection node. After the second data slave chain stores the product sales data according to the fourth identifier, it feeds back a data recording success message to the management node. The management node feeds back a data recording success message to the second device. Any data slave chain includes a data header node and at least one data linked table. Each data linked table corresponds to a product identifier, and each node in the data linked table stores sales data for the corresponding product. The data header node stores the correspondence between the data linked table and the product identifier.
[0043] S311, if the second connection node does not exist, the management node establishes a data slave chain based on the fourth smart contract, and the established data slave chain includes a data header node; the management node establishes a connection node on the main chain based on the fifth smart contract, and connects the established data slave chain to the established connection node, and records the connection relationship between the established data slave chain and the established connection node; the management node sends the fourth identifier and the commodity sales data to the established data slave chain through the established connection node; after the established data slave chain stores the commodity sales data, it feeds back a data recording success message to the management node; the management node feeds back a data recording success message to the second device; the fourth smart contract is used to establish a data slave chain; the fifth smart contract is used to establish a connection node.
[0044] Optionally, the second data slave chain stores the commodity sales data according to the fourth identifier, specifically including:
[0045] The data head node of the second data slave chain determines whether a first data linked list exists; the first data linked list is located in the second data slave chain, and the first data linked list corresponds to the fourth identifier;
[0046] If the first data linked list exists, then the data head node of the second data chain adds a node at the end of the first data linked list, and stores the commodity sales data record in the added node;
[0047] If the first data linked list does not exist, the data head node of the second data slave chain establishes a data linked list with only one node based on the sixth smart contract, corresponds the established data linked list to the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores the commodity sales data record in the node of the established data linked list; the sixth smart contract is used to establish a data linked list in the data slave chain.
[0048] Optionally, the established data slave chain stores the commodity sales data, specifically including:
[0049] The data header node of the established data slave chain establishes a data linked list with only one node based on the sixth smart contract, corresponds the established data linked list to the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores the commodity sales data record in the node of the established data linked list; the sixth smart contract is used to establish the data linked list in the data slave chain.
[0050] Optionally, the S103 specifically includes:
[0051] S103-1, the management node of the blockchain confirms the first connecting node based on the connection relationship between the connecting node and the slave chain;
[0052] S103-2, the management node sends the first identifier, the second identifier, and the first industry to the identity authentication slave chain through the first connection node;
[0053] S103-3, the verification head node of the identity verification slave chain determines whether a target sub-chain exists based on the correspondence between sub-chains and industries; the target sub-chain corresponds to the first industry;
[0054] S103-3: If the target subchain does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node; the management node feeds back a data acquisition failure message to the first device, and the process ends.
[0055] S103-4, if the target subchain exists, the verification head node determines whether a target block exists in the target subchain, and the target block stores the first identifier and the second identifier;
[0056] S103-5, if the target block does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node; the management node feeds back a data acquisition failure message to the first device, and the process ends;
[0057] S103-6, if the target block exists, the verification head node requests the management node to confirm its identity through the first connection node;
[0058] S103-7, the management node performs identity authentication based on the identity information. If the identity authentication fails, the management node sends a data acquisition failure message to the first device and ends the process. If the identity authentication succeeds, the management node sends an identity confirmation message to the verification head node through the first connection node.
[0059] S103-8, after receiving the identity confirmation message, the verification head node reads a fifth identifier from the target block and feeds the fifth identifier back to the management node via the first connection node; the fifth identifier is a seller identifier;
[0060] S103-9, the management node confirms whether a target connection node exists based on the connection relationship between the connection node and the slave chain; the second connection node connects to the target data slave chain; the target data slave chain corresponds to the fifth identifier;
[0061] S103-10, if the target connection node does not exist, the management node feeds back a data acquisition failure message to the first device, and ends the process;
[0062] S103-11, if the target connection node exists, the management node sends the second identifier to the target data slave chain through the target connection node;
[0063] S103-12, the data head node of the target data slave chain determines whether a target data linked list exists based on the correspondence between the stored data linked list and the commodity identifier; the target data linked list corresponds to the second identifier;
[0064] S103-13, if the target data linked list does not exist, the data head node of the target data slave chain feeds back a data acquisition failure message to the management node through the target connection node, and the management node feeds back a data acquisition failure message to the first device, and the process ends;
[0065] S103-14, if there is a target data linked list, the data head node of the target data slave chain determines the data in the target data linked list as the commodity sales data, and feeds it back to the management node through the target connection node; the management node feeds back the commodity sales data to the first device.
[0066] Optionally, the management node performs identity authentication according to the identity information, specifically including:
[0067] The management node obtains a first value and a second value, where the first value is the last digit of the decimal value of the first identifier; and the second value is the last digit of the decimal value of the second identifier.
[0068] The management node generates a first random decimal, and determines a third value = the first value / (the second value + the first random decimal);
[0069] If the third value is greater than 0 and less than or equal to 1, then The management node randomly determines the fourth value of connection nodes as verification nodes and sends the identity information to the verification node; the verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information from the identity verification server, and feeds back the verification result to the management node; if the verification results fed back by all verification nodes are all passed, the management node determines that the identity authentication is passed; if there is a verification node that feeds back a verification result of not passing the verification, the management node determines that the verification has failed;
[0070] If the third value is greater than 1, the management node generates a second random decimal. If the product of the second random decimal and the third value is not greater than 1, the management node continues with the subsequent steps. Otherwise, the process of generating the second random decimal is repeated until the product of the current second random decimal and the third product is less than or equal to 1. described The management node randomly determines the fifth value connection node as a verification node and sends the identity information to the verification node; the verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information by the identity verification server, and feeds back the verification result to the management node; if the verification results fed back by all verification nodes are all passed, the management node determines that the identity authentication is passed; if there is a verification node that feeds back a verification result that is failed, the management node determines that the verification has failed.
[0071] Optionally, before S104, the step further includes:
[0072] The first device obtains commodity production data according to the second identifier;
[0073] The S104 specifically includes:
[0074] The first device processes the commodity sales data and the commodity production data.
[0075] (3) Beneficial effects
[0076] The present invention has the following beneficial effects: the data processing method based on blockchain provided by the present invention comprises: a first device obtaining a first identifier and identity information of a manufacturer, a second identifier of a product, and a first industry to which the product belongs; the first device sending the first identifier, identity information, second identifier, and first industry to a blockchain; the blockchain determining product sales data based on the first identifier, identity information, second identifier, and first industry, and feeding back the product sales data to the first device; the blockchain comprising a master chain and at least two slave chains; one of the slave chains being an identity authentication slave chain for identity authentication, and the other slave chains being data slave chains, each of which being used to store data; the master chain comprising a management node and at least two connection nodes; the number of connection nodes being the same as the number of slave chains, and each connection node being connected to a unique slave chain; the management node storing the connection relationship between the connection node and the slave chains; each data slave chain corresponding to the identifier of a seller; and the first device processing the product sales data. This enables the first device to obtain the latest product sales data at any time and process it. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 A flowchart of a blockchain-based data processing method provided by one embodiment of the present invention;
[0078] Figure 2 A schematic diagram of an implementation architecture of a blockchain-based data processing method provided by one embodiment of the present invention;
[0079] Figure 3 A schematic diagram of the structure of a blockchain provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0080] Because product production and sales are two independent processes, manufacturers (including distributors) only have access to production data, while sellers only have access to sales data. To determine the overall performance of a product, manufacturers need to obtain both production and sales data and integrate them. To do this, manufacturers must obtain sales data from sellers. However, this passive waiting for sellers to provide sales data hinders timely data processing. Furthermore, since sales data is provided by sellers, manufacturers cannot verify its accuracy, leading to inaccurate data processing results.
[0081] Based on this, the present invention provides a method for manufacturers (including distributors) to obtain product sales data at any time, wherein the first device obtains the manufacturer's first identification, identity information, the product's second identification and the first industry to which the product belongs; the first device sends the first identification, identity information, second identification and first industry to the blockchain; the blockchain determines the product sales data based on the first identification, identity information, second identification and first industry, and feeds back the product sales data to the first device; the blockchain includes a main chain and at least two slave chains; wherein, one slave chain is an identity authentication slave chain, which is used for identity authentication, and the other slave chains are all data slave chains, and any data slave chain is used to store data; the main chain includes a management node and at least two connection nodes; the number of connection nodes is the same as the number of slave chains, and each connection node is connected to a unique slave chain; the management node stores the connection relationship between the connection node and the slave chain; each data slave chain corresponds to the identification of a seller; the first device processes the product sales data.
[0082] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0083] See also Figure 1 The implementation process of a data processing method based on blockchain technology of the present invention is as follows:
[0084] S101, a first device obtains a first identifier and identity information of a manufacturer, a second identifier of a product, and a first industry to which the product belongs.
[0085] The first device may be a product manufacturer, or a product distributor or other seller that is not directly facing consumers.
[0086] S102, the first device sends the first identifier, identity information, the second identifier, and the first industry to the blockchain.
[0087] S103, the blockchain determines the commodity sales data based on the first identifier, the identity information, the second identifier and the first industry, and feeds back the commodity sales data to the first device.
[0088] Among them, the blockchain includes a main chain and at least two slave chains.
[0089] One slave chain is an authentication slave chain, used for identity verification. All other slave chains are data slave chains, each used to store data. The master chain consists of one management node and at least two connection nodes. The number of connection nodes is the same as the number of slave chains, and each connection node is connected to a unique slave chain. The management node stores the connection relationship between the connection node and the slave chain. Each data slave chain corresponds to the identifier of a seller.
[0090] S104: The first device processes the commodity sales data.
[0091] This embodiment provides a blockchain-based data processing method in which a first device obtains a manufacturer's first identifier, identity information, a product's second identifier, and the first industry to which the product belongs; the first device sends the first identifier, identity information, second identifier, and first industry to a blockchain; the blockchain determines product sales data based on the first identifier, identity information, second identifier, and first industry, and feeds the product sales data back to the first device; the blockchain includes a master chain and at least two slave chains; one of the slave chains is an identity verification slave chain, used for identity verification, and the other slave chains are data slave chains, each of which is used to store data; the master chain includes a management node and at least two connection nodes; the number of connection nodes is the same as the number of slave chains, and each connection node is connected to a unique slave chain; the management node stores the connection relationship between the connection node and the slave chain; each data slave chain corresponds to the identifier of a seller; and the first device processes the product sales data. This enables the first device to obtain the latest product sales data at any time and process it.
[0092] The data processing method based on blockchain provided by the present invention involves four parties when executing, namely the first device (such as the product manufacturer, product distributor and other sellers who are not directly facing consumers), the second device (such as the product seller, that is, directly facing consumers), the identity information verification server and the blockchain. The architecture diagram is as follows Figure 2 shown.
[0093] In addition, the structure of the blockchain is as follows Figure 3 shown.
[0094] The blockchain consists of a main chain and at least two slave chains.
[0095] 1. Main Chain
[0096] The main chain consists of a management node and at least two connection nodes.
[0097] 1) Management Node
[0098] The management node stores the connection relationship between the connection node and the slave chain.
[0099] The management node is used to connect with the first device and the second device to perform data interaction.
[0100] 2) Connecting nodes
[0101] The number of connection nodes is the same as the number of slave chains, and each connection node is connected to only one slave chain.
[0102] Connecting nodes are used to exchange data between management nodes and their connected slave chains. In other words, management nodes need to send data, messages, instructions, and control their corresponding slave chains through connecting nodes. Slave chains also need to send data, messages, instructions, and other information to management nodes through connecting nodes connected to them.
[0103] That is, the management node can only interact with the corresponding slave chain through the connection node.
[0104] 2. From the chain
[0105] One slave chain is an identity authentication slave chain, and the other slave chains are data slave chains.
[0106] 1) Authentication from the chain
[0107] Authentication slave chain is used for authentication.
[0108] The authentication slave chain includes a verification head node and at least one verification connection node.
[0109] (1) Verify the head node
[0110] The verification head node stores the connection relationship between the verification connection node and the sub-chain, as well as the corresponding relationship between the sub-chain and the industry.
[0111] The head node is used to exchange data between the authentication slave chain and the connecting nodes connected to the authentication slave chain. In other words, the head node receives data from the connecting node (which is connected to the authentication slave chain) and also sends data from the authentication slave chain to the connecting node (which is connected to the authentication slave chain).
[0112] That is, the connection node of the authentication slave chain can only interact with the authentication slave chain through the verification head node.
[0113] (2) Verify the connection node
[0114] Each verification connection node is connected to a unique sub-chain, and each sub-chain corresponds to an industry.
[0115] A subchain consists of blocks.
[0116] 2) Data from the chain
[0117] Any data slave chain is used to store data.
[0118] Each piece of data in the chain corresponds to the ID of a seller.
[0119] Any data slave chain includes a data head node and at least one data linked list.
[0120] (1) Data header node
[0121] The data header node stores the corresponding relationship between the data linked list and the product identification.
[0122] The verification head node is used to exchange data between the data slave chain and the connecting node connected to the data slave chain. In other words, the verification head node of a data slave chain will obtain data from the connecting node (the connecting node is connected to the data slave chain) and also send data from the data slave chain to the connecting node (the connecting node is connected to the data slave chain).
[0123] That is, the connection node of the data slave chain can only interact with the data slave chain through the data head node.
[0124] (2) Data Link List
[0125] Each data linked list corresponds to the identifier of a product, and each node in the data linked list stores the sales data uploaded once for the corresponding product.
[0126] Below is Figure 2 The architecture shown, Figure 3 Taking the blockchain shown in FIG. 1 as an example, the blockchain-based data processing method provided by the present invention is explained again.
[0127] The method provided by the present invention includes three processes. The first process is the product registration process of the product manufacturer, the second process is the product sales data storage process of the product seller, and the third process is the product sales data acquisition and processing process of the product manufacturer.
[0128] The first process is executed when a product manufacturer completes a new product. The second process is executed whenever a product seller has sales data, or periodically (e.g., daily, every two days, weekly, etc.). The third process is executed whenever the product manufacturer needs to process data to obtain and analyze the latest product sales data.
[0129] The following takes the product manufacturer as the first device and the product seller as the second device as an example to explain the above three processes in detail.
[0130] The first process: product registration process
[0131] S201: The first device sends a registration message to the management node of the blockchain.
[0132] The registration message includes the first identifier of the manufacturer, the second identifier of the product, and the first industry to which the product belongs.
[0133] This product is the product to be registered. That is, every time a manufacturer launches a new product, it must register the product’s identifier on the blockchain so that it can subsequently obtain the product’s sales data in real time.
[0134] S202: The management node confirms the first connection node according to the connection relationship between the connection node and the slave chain.
[0135] The first connection node is connected to the authentication slave chain.
[0136] S203: The management node sends the registration message to the authentication slave chain through the first connection node.
[0137] according to Figure 3 As shown, the authentication chain consists of a verification head node and at least one verification connection node. Each verification connection node is connected to a unique subchain, and each subchain corresponds to an industry. The verification head node stores the connection relationship between the verification connection node and the subchain, as well as the correspondence between the subchain and the industry.
[0138] S204: The verification head node of the identity verification slave chain determines whether the first sub-chain exists in all sub-chains based on the correspondence between the sub-chains and the industry.
[0139] Among them, the first sub-chain corresponds to the first industry.
[0140] S205: If the first subchain does not exist, the verification head node establishes a second subchain corresponding to the first industry. The verification head node sends a registration completion message to the management node via the first connection node. The management node sends a registration completion message to the first device.
[0141] That is, each sub-chain corresponds to an industry. If there is no sub-chain corresponding to the industry to which the product to be registered belongs in the current blockchain, then it is necessary to create a new sub-chain corresponding to the industry and complete the registration of the product.
[0142] The specific process of the verification head node establishing the second sub-chain is as follows:
[0143] A. The verification head node creates a new verification connection node from the chain based on the authentication of the first smart contract.
[0144] Among them, the first smart contract is pre-configured and used to establish a verification connection node in the authentication slave chain.
[0145] B. The verification head node creates a second sub-chain in the authentication slave chain based on the second smart contract, and connects the second sub-chain to the newly created verification connection node.
[0146] Among them, the second sub-chain corresponds to the first industry.
[0147] The second smart contract is pre-configured to establish a child chain from the authentication slave chain.
[0148] C. The verification head node records the corresponding relationship between the second sub-chain and the first industry, as well as the connection relationship between the newly created verification connection node and the second sub-chain.
[0149] D. The verification head node creates a new block in the second subchain through the newly created verification connection node based on the third smart contract, and stores the first identifier and the second identifier in the newly created block through the newly created verification connection node.
[0150] Among them, the third smart contract is pre-configured and used to establish blocks in the authentication slave chain.
[0151] In addition, the specific content of the registration completion message is not specifically limited in this embodiment, as long as it can express that the product has been successfully registered.
[0152] S206: If the first sub-chain exists, the verification head node responds to the registration message based on the first sub-chain.
[0153] That is, each sub-chain corresponds to an industry. If a sub-chain corresponding to the industry to which the product to be registered belongs already exists in the current blockchain, then the product will be registered on the existing sub-chain.
[0154] Specifically, the verification head node responds to the registration message based on the first subchain as follows:
[0155] a. The verification head node determines the first verification connection node based on the connection relationship between the verification connection node and the sub-chain.
[0156] Among them, the first verification connection node is connected to the first sub-chain.
[0157] b. The verification head node determines whether the first block exists in the first subchain through the first verification connection node.
[0158] The first block stores the first identifier.
[0159] c. If the first block exists and the first block also stores the second identifier, the verification head node feeds back a registration message to the management node through the first connection node. The management node feeds back a registration message to the first device.
[0160] The specific content of the registered message is not specifically limited in this embodiment, as long as it can express that the product has been registered.
[0161] d. If the first block exists but the second identifier is not stored in the first block, the verification head node stores the second identifier in the first block through the first verification connection node. The verification head node sends a registration completion message back to the management node through the first connection node. The management node sends a registration completion message back to the first device.
[0162] The specific content of the registration completion message is not specifically limited in this embodiment, as long as it can express that the product has been successfully registered.
[0163] In addition, the specific content of the registration completion message fed back in different situations in this embodiment and other embodiments may be the same or different, as long as it can express that the product has been successfully registered.
[0164] e. If the first block does not exist, the head verification node, based on the third smart contract and through the first verification connection node, creates a new block in the first child chain. The head verification node, through the first verification connection node, stores the first identifier and the second identifier in the newly created block. The head verification node, through the first connection node, sends a registration completion message to the management node. The management node sends a registration completion message to the first device. The third smart contract is used to create a block in the authentication slave chain.
[0165] That is, at this point, the registration information of products in an industry is stored in a slave chain. A node in each slave chain corresponds to a product of a manufacturer, that is, each node in the slave chain stores the manufacturer identifier (such as the first identifier) and the product identifier (such as the second identifier).
[0166] In addition, the industry classification standard is not limited in this embodiment, and can be divided according to trademark classification standards, industry classification according to classification conventions, etc.
[0167] The second process: commodity sales data storage process
[0168] S301: The second device sends a data record message to the management node of the blockchain.
[0169] The data record message includes the third identifier of the seller, the fourth identifier of the product, the second industry to which the product belongs, and product sales data.
[0170] S302: The management node confirms the first connection node according to the connection relationship between the connection node and the slave chain.
[0171] The first connection node is connected to the authentication slave chain.
[0172] S303: The management node sends the third identifier, the fourth identifier, and the second industry to the identity authentication slave chain through the first connection node.
[0173] S304: The verification head node of the identity verification slave chain determines whether there is a third sub-chain based on the correspondence between the sub-chain and the industry.
[0174] Among them, the third sub-chain corresponds to the second industry.
[0175] S305: If the third subchain does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node. The management node feeds back a data recording failure message to the second device.
[0176] The specific content of the data recording failure message is not specifically limited in this embodiment, as long as it can express that the data is not recorded.
[0177] In other words, only products registered by the manufacturer can have their sales data stored. Once a trademark is registered, a subchain corresponding to the product industry will be created. If there is no mainchain (i.e., a third subchain) corresponding to the product industry, the product is determined to be unregistered, and its sales data will not be stored on the blockchain.
[0178] S306: If a third sub-chain exists, the verification head node determines whether the second block exists in the third sub-chain.
[0179] The second block stores a fourth identifier.
[0180] S307: If the second block does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node. The management node feeds back a data recording failure message to the second device.
[0181] In other words, only products registered by the manufacturer can have their sales data stored. Once a trademark is registered, a subchain corresponding to the product industry will be created, and within that subchain, there will be a block (the second block) containing the product's identifier (the fourth identifier). If there is no second block, the product is determined to be unregistered, and its sales data will not be stored on the blockchain.
[0182] In addition, the specific content of the data recording failure message is not specifically limited in this embodiment, as long as it can express the meaning that the data is not recorded.
[0183] It should be noted that the specific content of the data recording failure message fed back in different situations in this embodiment and other embodiments may be the same or different, as long as it can express that the commodity sales data will not be recorded.
[0184] S308: If the second block exists, the verification head node stores the third identifier in the second block. The verification head node feeds back a data record message to the management node through the first connection node.
[0185] At this point, each node in the chain stores not only the manufacturer identifier (such as the first identifier) and the product identifier (such as the second identifier), but also the information of the product seller, that is, the product seller identifier (such as the third identifier). In other words, a block stores product manufacturer information, product information, and product seller information.
[0186] In addition, manufacturers will produce a variety of goods, and each product corresponds to a unique block. If the manufacturer produces goods in different industries, the blocks in different sub-chains will store the manufacturer's information, but the product information stored in different blocks is different.
[0187] Furthermore, the same product can have multiple sellers, and each seller's information is stored in the block corresponding to the manufacturer and product. In other words, a block has one manufacturer ID and one product ID, but can have multiple seller IDs. Any seller selling the product produced by that manufacturer must be added to the block.
[0188] In the above process, if the product corresponding to the product sales data has not been registered, the product sales data will not be stored. If the corresponding product has been registered, the product sales data storage process will begin. The process is as follows:
[0189] S309: After receiving the data record message, the management node confirms whether there is a second connection node based on the connection relationship between the connection node and the slave chain.
[0190] The second connection node is connected to the second data slave chain, and the second data slave chain corresponds to the third identifier.
[0191] S310: If a second connection node exists, the management node sends the fourth identifier and the product sales data to the second data slave chain via the second connection node. After the second data slave chain stores the product sales data based on the fourth identifier, it sends a data recording success message back to the management node. The management node sends a data recording success message back to the second device.
[0192] See also Figure 3 Each data chain consists of a data header node and at least one data linked list. Each data linked list corresponds to a product identifier, and each node in the data linked list stores sales data for the corresponding product. The data header node stores the correspondence between the data linked list and the product identifier.
[0193] Product sales data uploaded by the same seller will be recorded in the same data slave chain. Product sales records for the same product sold by the same seller will be recorded in a single data chain table. If a data slave chain (i.e., the second data slave chain) corresponding to the seller (i.e., the third identifier) already exists in the blockchain, then the product sales data only needs to be stored in the corresponding data chain table in the second data slave chain. In other words, the second data slave chain stores product sales data based on the fourth identifier.
[0194] The process of storing commodity sales data in the second data slave chain according to the fourth identifier is as follows:
[0195] I. The second data determines whether the first data linked list exists from the data head node of the chain.
[0196] The first data linked list is located in the second data slave chain, and the first data linked list corresponds to the fourth identifier.
[0197] II. If the first data linked list exists, the data head node of the second data chain adds a node at the end of the first data linked list, and stores the commodity sales data record in the added node.
[0198] III. If the first data linked list does not exist, the data head node of the second data slave chain establishes a data linked list with only one node based on the sixth smart contract, associates the established data linked list with the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores the product sales data record in the node of the established data linked list.
[0199] Among them, the sixth smart contract is pre-configured and used to establish a data linked list in the data slave chain.
[0200] That is, if the second data chain has already stored the product sales data corresponding to the product (for example, the product sales data for the product has already been stored in the first data chain), then the current product sales data will also be stored in the first data chain. If the second data chain has not stored the product sales data corresponding to the product, and this is the first time that product sales data has been stored for the product, then a new data chain will be created in the second data chain and the product sales data will be stored in the data chain.
[0201] In addition, the specific content of the data recording success message is not specifically limited in this embodiment, as long as it can express that the product sales data is successfully stored.
[0202] It should be noted that the specific content of the data recording success message fed back in different situations in this embodiment and other embodiments may be the same or different, as long as it can express that the product sales data is successfully stored.
[0203] S311: If the second connection node does not exist, the management node establishes a data slave chain based on the fourth smart contract, with the established data slave chain including a data header node. The management node establishes a connection node on the main chain based on the fifth smart contract, connects the established data slave chain to the established connection node, and records the connection relationship between the established data slave chain and the established connection node. The management node sends the fourth identifier and product sales data to the established data slave chain via the established connection node. After storing the product sales data, the established data slave chain sends a successful data recording message to the management node. The management node sends a successful data recording message to the second device. The fourth smart contract is used to establish the data slave chain.
[0204] Among them, the fifth smart contract is pre-configured and used to establish a connection node.
[0205] Product sales data uploaded by the same seller will be recorded in the same data slave chain. Sales records of the same product sold by the same seller will be recorded in a single data linked table. If a data slave chain corresponding to the seller (i.e., the third identifier) does not currently exist in the blockchain, a new slave chain corresponding to the third identifier will need to be created, and a new data linked table will be created in the newly created slave chain to store the product sales data.
[0206] The process of storing commodity sales data in the established data slave chain is as follows: the data head node of the newly created data slave chain establishes a data linked list with only one node based on the sixth smart contract, corresponds the established data linked list to the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores commodity sales data records in the nodes of the established data linked list.
[0207] The third process: Product sales data acquisition and processing process
[0208] When a manufacturer wants to process product sales data, the third process is executed. In other words, the method provided in this embodiment changes the manufacturer's passive wait for the seller to provide product sales data to a situation where the manufacturer actively obtains the data. This improves the initiative and real-time nature of data processing.
[0209] Specifically, the implementation process of this process is:
[0210] S101, a first device obtains a first identifier and identity information of a manufacturer, a second identifier of a product, and a first industry to which the product belongs.
[0211] S102, the first device sends the first identifier, identity information, the second identifier, and the first industry to the blockchain.
[0212] S103, the blockchain determines the commodity sales data based on the first identifier, the identity information, the second identifier and the first industry, and feeds back the commodity sales data to the first device.
[0213] according to Figure 3 As shown, the blockchain includes a main chain and at least two slave chains.
[0214] One slave chain is an authentication slave chain, used for identity verification. All other slave chains are data slave chains, each used to store data. The master chain consists of one management node and at least two connection nodes. The number of connection nodes is the same as the number of slave chains, and each connection node is connected to a unique slave chain. The management node stores the connection relationship between the connection node and the slave chain. Each data slave chain corresponds to the identifier of a seller.
[0215] Specifically, the implementation process of this step is as follows:
[0216] S103-1, the management node of the blockchain confirms the first connection node based on the connection relationship between the connection node and the slave chain.
[0217] The first connection node is connected to the authentication slave chain.
[0218] S103-2, the management node sends the first identifier, the second identifier and the first industry to the authentication slave chain through the first connection node.
[0219] S103-3, identity verification The verification head node of the slave chain determines whether the target sub-chain exists based on the correspondence between the sub-chain and the industry.
[0220] Among them, the target sub-chain corresponds to the first industry in S103-2.
[0221] S103-3: If the target subchain does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node. The management node feeds back a data acquisition failure message to the first device and ends the process.
[0222] Only registered products can store their sales data. In other words, only registered products can obtain sales data. If the sub-chain corresponding to the product industry (i.e., the target sub-chain) does not exist, then there are definitely no registered products in that industry. Therefore, if the target sub-chain does not exist, a data acquisition failure message will be directly fed back, and the process will end.
[0223] The specific content of the data acquisition failure message is not specifically limited in this embodiment, as long as it can express that the product sales data cannot be acquired.
[0224] In addition, the specific content of the data acquisition failure message fed back in different situations in this embodiment and other embodiments can be the same or different, as long as it can express that the product sales data cannot be obtained.
[0225] S103-4, if the target sub-chain exists, the verification head node determines whether the target block exists in the target sub-chain.
[0226] The target block stores a first identifier and a second identifier.
[0227] S103-5: If the target block does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node. The management node feeds back a data acquisition failure message to the first device, and the process ends.
[0228] Only registered products can store their sales data. In other words, only registered products can obtain sales data. If there is a subchain corresponding to the product industry (i.e., the target subchain), but no block in the subchain stores the product's identifier (i.e., there is no target block), it means that the product has not been successfully registered. In this case, a data acquisition failure message will be directly fed back, and the process ends.
[0229] S103-6: If the target block exists, the verification head node requests the management node to confirm its identity through the first connection node.
[0230] If the product has been registered, the identity of the current applicant must be verified and the data can be read only after passing the verification. The identity verification process is S103-7.
[0231] S103-7: The management node performs identity authentication based on the identity information. If the identity authentication fails, the management node sends a data acquisition failure message to the first device and ends the process. If the identity authentication succeeds, the management node sends an identity confirmation message to the verification head node through the first connection node.
[0232] The implementation process of the management node for identity authentication based on identity information is as follows:
[0233] i. The management node obtains the first value and the second value.
[0234] The first value is the last digit of the decimal value of the first identifier, that is, the first value is a number from 0 to 9.
[0235] The second value is the last digit of the decimal value of the second identifier, that is, the second value is a number from 0 to 9.
[0236] ii. The management node generates a first random decimal and determines the third value = first value / (second value + first random decimal).
[0237] The first random decimal is used to prevent the denominator from being 0.
[0238] If the third value is greater than 0 and less than or equal to 1, then
[0239] (1)
[0240] (2) The management node randomly determines the fourth connection node as the verification node and sends the identity information to the verification node.
[0241] (3) The verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information from the identity verification server, and feeds the verification result back to the management node.
[0242] (4) If all verification nodes report a positive result, the management node determines that the identity verification has passed. If one verification node reports a negative result, the management node determines that the verification has failed.
[0243] If the third value is greater than 1, then
[0244] (1) The management node generates a second random decimal. If the product of the second random decimal and the third value is not greater than 1, the subsequent steps are continued. Otherwise, the process of generating the second random decimal is re-executed until the product of the current second random decimal and the third product is less than or equal to 1.
[0245] (2)
[0246] (3) The management node randomly determines the fifth connected node as the verification node and sends the identity information to the verification node.
[0247] (4) The verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information from the identity verification server, and feeds the verification result back to the management node.
[0248] (5) If all verification nodes report a positive result, the management node determines that the identity verification has passed. If one verification node reports a negative result, the management node determines that the authentication has failed.
[0249] S103-8, after the verification head node obtains the identity confirmation message, it reads the fifth identifier from the target block and feeds the fifth identifier back to the management node through the first connection node.
[0250] Among them, the fifth identification is the seller identification (ie the third identification).
[0251] If there are multiple sellers, there will be multiple fifth identifiers.
[0252] According to the fifth identifier, the data chain storing the seller's data can be found, and then the product sales data uploaded by all sellers of the product can be obtained.
[0253] S103-9, the management node confirms whether the target connection node exists based on the connection relationship between the connection node and the slave chain.
[0254] The second connection node is connected to the target data slave chain, and the target data slave chain corresponds to the fifth identifier.
[0255] S103-10: If the target connection node does not exist, the management node feeds back a data acquisition failure message to the first device and ends the process.
[0256] If the data slave chain corresponding to the fifth identifier is not stored on the blockchain (i.e., the target data slave chain), then it is determined that the product sales data is not stored in the blockchain, and a message related to data acquisition failure is fed back.
[0257] S103-11, if the target connection node exists, the management node sends the second identifier to the target data slave chain through the target connection node.
[0258] S103-12, the data head node of the target data slave chain determines whether the target data linked list exists based on the correspondence between the stored data linked list and the commodity identifier.
[0259] Among them, the target data linked list corresponds to the second identifier.
[0260] S103-13, if the target data linked list does not exist, the target data from the data head node of the chain feeds back a data acquisition failure message to the management node through the target connection node, and the management node feeds back a data acquisition failure message to the first device, and ends the process.
[0261] If the blockchain does not store the required linked list of commodity sales data (i.e., the target data linked list), then it is determined that the commodity sales data is not stored in the blockchain, and a message related to data acquisition failure is fed back.
[0262] S103-14: If the target data linked list exists, the data head node of the target data slave chain determines the data in the target data linked list as commodity sales data, and feeds it back to the management node through the target connection node. The management node feeds back the commodity sales data to the first device.
[0263] S104: The first device processes the commodity sales data.
[0264] In this step, only the product sales data can be processed, such as determining the total sales volume, analyzing sales trends, etc.
[0265] You can also compare sales data with production data for the same product to see inventory backlogs, for example.
[0266] If comparative analysis is to be performed, the first device will obtain the commodity production data according to the second identifier before executing S104. When executing step S104, the first device processes the commodity sales data and the commodity production data.
[0267] For example, comparing production and sales volumes, determining inventory status, etc.
[0268] This embodiment provides a blockchain-based data processing method. A first device obtains a manufacturer's first identifier, identity information, a product's second identifier, and the first industry to which the product belongs. The first device sends the first identifier, identity information, second identifier, and first industry to a blockchain. The blockchain determines product sales data based on the first identifier, identity information, second identifier, and first industry, and feeds the product sales data back to the first device. The blockchain includes a master chain and at least two slave chains. One slave chain is an identity authentication slave chain, used for identity authentication, and the other slave chains are data slave chains, each of which is used to store data. The master chain includes a management node and at least two connection nodes. The number of connection nodes is the same as the number of slave chains, and each connection node is connected to a unique slave chain. The management node stores the connection relationship between the connection node and the slave chain. Each data slave chain corresponds to the identifier of a seller. The first device processes the product sales data. This enables the first device to obtain the latest product sales data at any time and process it.
[0269] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0270] In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "connect," "fixed," etc. should be understood broadly. For example, they may refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; and internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0271] In the present invention, unless otherwise expressly specified or limited, when a first feature is "above" or "below" a second feature, it may mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Furthermore, when a first feature is "above," "above," or "above" a second feature, it may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is at a higher level than the second feature. When a first feature is "below," "below," or "below" a second feature, it may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is at a lower level than the second feature.
[0272] In the description of this specification, the terms "one embodiment", "some embodiments", "embodiments", "examples", "specific examples" or "some examples" refer to the specific features, structures, materials or characteristics described in conjunction with the embodiment or example and included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and features of different embodiments or examples, unless they are mutually inconsistent.
[0273] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A data processing method based on blockchain technology, characterized in that: The method comprises: S101, a first device obtains a first identifier and identity information of a manufacturer, a second identifier of a product, and a first industry to which the product belongs; S102: The first device sends the first identifier, the identity information, the second identifier, and the first industry to a blockchain; S103, the blockchain determines the commodity sales data according to the first identifier, the identity information, the second identifier and the first industry, and feeds back the commodity sales data to the first device; the blockchain includes a main chain and at least two slave chains; wherein, one slave chain is an identity authentication slave chain, and the identity authentication slave chain is used for identity authentication, and the other slave chains are all data slave chains, and any data slave chain is used for storing data; the main chain includes a management node and at least two connection nodes; the number of the connection nodes is the same as the number of the slave chains, and each connection node is connected to a unique slave chain; the management node stores the connection relationship between the connection node and the slave chain; each data slave chain corresponds to the identifier of a seller Identification; the identity authentication slave chain includes a verification head node and at least one verification connection node, each verification connection node is connected to a unique sub-chain, each sub-chain corresponds to an industry, and the sub-chain is composed of blocks; the verification head node stores the connection relationship between the verification connection node and the sub-chain, as well as the correspondence between the sub-chain and the industry; any data slave chain includes a data header node and at least one data linked table, the data header node stores the correspondence between the data linked table and the commodity identification, each data linked table corresponds to the identification of a commodity, each node in the data linked table stores the sales data uploaded by the corresponding commodity, and the connection node connected to the data slave chain interacts with the data slave chain through the data header node; The first device obtains commodity production data according to the second identifier; S104: The first device processes the commodity sales data and the commodity production data.
2. The method according to claim 1, characterized in that The S101 also includes: S201: A first device sends a registration message to a management node of a blockchain, where the registration message includes a first identifier, a second identifier, and a first industry. S202, the management node confirms a first connection node based on the connection relationship between the connection node and the slave chain; the first connection node is connected to the authentication slave chain; S203, the management node sends the registration message to the identity authentication slave chain through the first connection node; S204: The verification head node of the identity verification slave chain determines whether there is a first subchain among all subchains based on the correspondence between subchains and industries, and the first subchain corresponds to the first industry; S205: If the first subchain does not exist, the verification head node establishes a second subchain corresponding to the first industry; the verification head node feeds back a registration completion message to the management node via the first connection node; the management node feeds back a registration completion message to the first device; S206: If the first sub-chain exists, the verification head node responds to the registration message based on the first sub-chain.
3. The method according to claim 2, characterized in that The verification head node establishes the second sub-chain, specifically including: The verification head node creates a new verification connection node in the authentication slave chain based on the first smart contract; the first smart contract is used to establish the verification connection node in the authentication slave chain; The verification head node creates a new second subchain in the authentication slave chain based on the second smart contract, and connects the second subchain to the newly created verification connection node; the second subchain corresponds to the first industry; and the second smart contract is used to establish a subchain in the authentication slave chain; The verification head node records the corresponding relationship between the second sub-chain and the first industry, as well as the connection relationship between the newly created verification connection node and the second sub-chain; The verification head node creates a new block in the second sub-chain through the newly created verification connection node based on the third smart contract, and stores the first identifier and the second identifier in the newly created block through the newly created verification connection node; the third smart contract is used to establish a block in the identity authentication slave chain.
4. The method according to claim 2, characterized in that The verification head node responds to the registration message based on the first subchain, specifically including: The verification head node determines a first verification connection node based on the connection relationship between the verification connection node and the sub-chain; the first verification connection node is connected to the first sub-chain; The verification head node determines, through the first verification connection node, whether a first block exists in the first subchain, where the first block stores the first identifier; If the first block exists and the first block also stores the second identifier, the verification head node feeds back a registration message to the management node through the first connection node; and the management node feeds back a registration message to the first device; If the first block exists but the second identifier is not stored in the first block, the verification head node stores the second identifier in the first block through the first verification connection node; the verification head node feeds back a registration completion message to the management node through the first connection node; and the management node feeds back a registration completion message to the first device; If the first block does not exist, the verification head node creates a new block in the first sub-chain based on the third smart contract through the first verification connection node; the verification head node stores the first identifier and the second identifier in the newly created block through the first verification connection node; the verification head node feeds back a registration completion message to the management node through the first connection node; the management node feeds back a registration completion message to the first device; the third smart contract is used to establish a block in the authentication slave chain.
5. The method according to claim 2, characterized in that The S101 also includes: S301: The second device sends a data record message to the management node of the blockchain; the data record message includes the third identifier of the seller, the fourth identifier of the product, the second industry to which the product belongs, and product sales data; S302, the management node confirms a first connection node based on the connection relationship between the connection node and the slave chain; the first connection node is connected to the authentication slave chain; S303: The management node sends the third identifier, the fourth identifier, and the second industry to the identity authentication slave chain through the first connection node; S304: The authentication slave chain's verification head node determines whether a third sub-chain exists based on the correspondence between sub-chains and industries; the third sub-chain corresponds to the second industry; S305: If the third subchain does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node; and the management node feeds back a data recording failure message to the second device. S306: If a third subchain exists, the verification head node determines whether a second block exists in the third subchain, and the second block stores the fourth identifier; S307: If the second block does not exist, the verification head node feeds back a data recording failure message to the management node through the first connection node; and the management node feeds back a data recording failure message to the second device. S308: If the second block exists, the verification head node stores the third identifier in the second block; the verification head node feeds back a data record message to the management node through the first connection node; S309: After receiving the data record message, the management node confirms whether there is a second connection node based on the connection relationship between the connection node and the slave chain; the second connection node is connected to the second data slave chain; the second data slave chain corresponds to the third identifier; S310: If a second connection node exists, the management node sends the fourth identifier and the product sales data to the second data slave chain through the second connection node; the second data slave chain stores the product sales data according to the fourth identifier and then feeds back a data recording success message to the management node; the management node feeds back a data recording success message to the second device; S311, if the second connection node does not exist, the management node establishes a data slave chain based on the fourth smart contract, and the established data slave chain includes a data header node; the management node establishes a connection node on the main chain based on the fifth smart contract, and connects the established data slave chain to the established connection node, and records the connection relationship between the established data slave chain and the established connection node; the management node sends the fourth identifier and the commodity sales data to the established data slave chain through the established connection node; after the established data slave chain stores the commodity sales data, it feeds back a data recording success message to the management node; the management node feeds back a data recording success message to the second device; the fourth smart contract is used to establish a data slave chain; the fifth smart contract is used to establish a connection node.
6. The method according to claim 5, characterized in that The second data slave chain stores the commodity sales data according to the fourth identifier, specifically including: The data head node of the second data slave chain determines whether a first data linked list exists; the first data linked list is located in the second data slave chain, and the first data linked list corresponds to the fourth identifier; If the first data linked list exists, then the data head node of the second data chain adds a node at the end of the first data linked list, and stores the commodity sales data record in the added node; If the first data linked list does not exist, the data head node of the second data slave chain establishes a data linked list with only one node based on the sixth smart contract, corresponds the established data linked list to the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores the commodity sales data record in the node of the established data linked list; the sixth smart contract is used to establish a data linked list in the data slave chain.
7. The method according to claim 5, characterized in that The data slave chain established to store the commodity sales data specifically includes: The data header node of the established data slave chain establishes a data linked list with only one node based on the sixth smart contract, corresponds the established data linked list to the fourth identifier, stores the correspondence between the established data linked list and the fourth identifier, and stores the commodity sales data record in the node of the established data linked list; the sixth smart contract is used to establish the data linked list in the data slave chain.
8. The method according to claim 5, characterized in that The S103 specifically includes: S103-1, the management node of the blockchain confirms the first connecting node based on the connection relationship between the connecting node and the slave chain; S103-2, the management node sends the first identifier, the second identifier, and the first industry to the identity authentication slave chain through the first connection node; S103-3, the verification head node of the identity verification slave chain determines whether a target sub-chain exists based on the correspondence between sub-chains and industries; the target sub-chain corresponds to the first industry; S103-3: If the target subchain does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node; the management node feeds back a data acquisition failure message to the first device, and the process ends. S103-4, if the target subchain exists, the verification head node determines whether a target block exists in the target subchain, and the target block stores the first identifier and the second identifier; S103-5, if the target block does not exist, the verification head node feeds back a data acquisition failure message to the management node through the first connection node; the management node feeds back a data acquisition failure message to the first device, and the process ends; S103-6, if the target block exists, the verification head node requests the management node to confirm its identity through the first connection node; S103-7, the management node performs identity authentication based on the identity information. If the identity authentication fails, the management node sends a data acquisition failure message to the first device and ends the process. If the identity authentication succeeds, the management node sends an identity confirmation message to the verification head node through the first connection node. S103-8, after receiving the identity confirmation message, the verification head node reads a fifth identifier from the target block and feeds the fifth identifier back to the management node via the first connection node; the fifth identifier is a seller identifier; S103-9, the management node confirms whether a target connection node exists based on the connection relationship between the connection node and the slave chain; the second connection node connects to the target data slave chain; the target data slave chain corresponds to the fifth identifier; S103-10, if the target connection node does not exist, the management node feeds back a data acquisition failure message to the first device, and ends the process; S103-11, if the target connection node exists, the management node sends the second identifier to the target data slave chain through the target connection node; S103-12, the data head node of the target data slave chain determines whether a target data linked list exists based on the correspondence between the stored data linked list and the commodity identifier; the target data linked list corresponds to the second identifier; S103-13, if the target data linked list does not exist, the data head node of the target data slave chain feeds back a data acquisition failure message to the management node through the target connection node, and the management node feeds back a data acquisition failure message to the first device, and the process ends; S103-14, if there is a target data linked list, the data head node of the target data slave chain determines the data in the target data linked list as the commodity sales data, and feeds it back to the management node through the target connection node; the management node feeds back the commodity sales data to the first device.
9. The method according to claim 8, characterized in that The management node performs identity authentication according to the identity information, specifically including: The management node obtains a first value and a second value, where the first value is the last digit of the decimal value of the first identifier; and the second value is the last digit of the decimal value of the second identifier. The management node generates a first random decimal, and determines a third value = the first value / (the second value + the first random decimal); If the third value is greater than 0 and less than or equal to 1, the management node determines The management node randomly determines the fourth value of connection nodes as verification nodes and sends the identity information to the verification node; the verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information from the identity verification server, and feeds back the verification result to the management node; if the verification results fed back by all verification nodes are all passed, the management node determines that the identity authentication is passed; if there is a verification node that feeds back a verification result of not passing the verification, the management node determines that the verification has failed; If the third value is greater than 1, the management node generates a second random decimal. If the product of the second random decimal and the third value is not greater than 1, the subsequent steps are continued. Otherwise, the process of generating the second random decimal is re-executed until the product of the current second random decimal and the third product is less than or equal to 1. The management node determines The management node randomly determines the fifth value connection node as a verification node and sends the identity information to the verification node; the verification node communicates with the identity information verification server based on the identity information, obtains the verification result of the identity information by the identity verification server, and feeds back the verification result to the management node; if the verification results fed back by all verification nodes are all passed, the management node determines that the identity authentication is passed; if there is a verification node that feeds back a verification result that is failed, the management node determines that the verification has failed.
Citation Information
Patent Citations
Commodity production and circulation logistics information tracing data processing device and method
CN106548355A
Commodity source-tracing method and device based on block chain, and electronic equipment
CN108694594A
Distribution inventory information provision system, method, and program
JP2021082365A