A blockchain-based information traceability method, device and system

By setting chip components and displays on items, and using smart contracts on a blockchain network to verify and update identification codes, the issues of authenticity and privacy of item information are resolved, ensuring the reliability and security of item information.

CN114329597BActive Publication Date: 2026-02-24ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111646713.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2026-02-24
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In existing technologies, the authenticity and reliability of item information are difficult to guarantee, and the privacy of item information is difficult to protect, especially when item information is arbitrarily queried, it is easy to be leaked.

Method used

By setting chip components and displays on items, and using smart contracts in the blockchain network to verify and update the code identifier, the identifier is updated after each scan, preventing malicious queries.

Benefits of technology

This ensures the authenticity and reliability of item information, prevents arbitrary queries and privacy leaks, and enhances the privacy of item information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329597B_ABST
    Figure CN114329597B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a kind of information tracing method, device and system based on block chain. Wherein, any one node device in block chain network is communicated and connected with chip component set on article, and display screen is also set on article. Terminal device can scan the identification code on display screen, obtain article identification and the code identification of identification code, and submit the first transaction for calling smart contract to block chain network, its input parameter is first article identification and first code identification. Block chain network executes the operation logic of smart contract based on the first transaction, to query the article information corresponding to first article identification after the first code identification is verified, and first code identification is updated to second code identification. Then, block chain network is interacted with chip component based on second code identification, so that chip component obtains the update identification code containing second code identification, and it is displayed on the display screen, realizes the update of identification code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of computer technology, and in particular to a blockchain-based information traceability method, apparatus and system. Background Technology

[0002] With social and technological development, people are paying increasing attention to the traceability of product information. For example, when purchasing agricultural products, food, medicine, and other items, people hope to obtain authentic and reliable information related to the items, such as the item's attributes, production time, place of origin, purchase time, and sales region. However, while tracing the origin of products is important, there are also concerns about the arbitrary access to product information and the leakage of private information related to the products, such as the buyer's privacy.

[0003] Therefore, we hope to find an improved solution that can both ensure the authenticity and reliability of item information and prevent unauthorized access to such information, thereby enhancing the privacy of the item information. Summary of the Invention

[0004] This specification describes one or more embodiments of a blockchain-based information traceability method, apparatus, and system, which can ensure the authenticity and reliability of item information while preventing arbitrary querying of item information, thereby improving the privacy of item information. The specific technical solution is as follows.

[0005] In a first aspect, an embodiment provides a blockchain-based information traceability method, executed by any node device in a blockchain network, wherein the node device is communicatively connected to a chip component disposed on an item, and the item is also provided with a display screen; the method includes:

[0006] The terminal device receives a first transaction for invoking a smart contract, the input parameters of which include a first item identifier and a first code identifier. The first item identifier and the first code identifier are obtained by the terminal device scanning the identifier code on the display screen.

[0007] Based on the first transaction, the execution logic of the smart contract is executed to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier.

[0008] Based on the second code identifier, the chip component interacts with the chip component, enabling the chip component to obtain an update identifier code containing the second code identifier and display it on the display screen.

[0009] In one embodiment, the method further includes sending the retrieved item information to the terminal device.

[0010] In one implementation, the first code identifier is verified in the following manner:

[0011] Determine whether the first code identifier exists in the generated records and whether the first code identifier does not exist in the queried records. If both are true, the verification is successful.

[0012] In one implementation, the operating logic further includes adding the second code identifier to the generated record and adding the first code identifier to the queried record.

[0013] In one implementation, the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier; the step of interacting with the chip component based on the second code identifier includes:

[0014] The update identifier code is sent to the chip component, so that the chip component receives the update identifier code and displays it on the display screen.

[0015] In one implementation, the step of interacting with the chip component based on the second code identifier includes:

[0016] The second code identifier is sent to the chip component, which then generates an updated identifier code based on the first item identifier and the second code identifier, and displays it on the display screen.

[0017] In one implementation, the method further includes:

[0018] The chip component submits a second transaction for invoking the smart contract, the input parameters of which include the item information corresponding to the first item identifier.

[0019] The smart contract is executed based on the second transaction to record the item information corresponding to the first item identifier.

[0020] In one implementation, the operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when the item information is detected to be abnormal, recording the abnormal status information corresponding to the first item identifier.

[0021] The method further includes:

[0022] Based on the abnormal status information, the chip component is interacted with, causing the chip component to display the abnormal status on the display screen.

[0023] Secondly, the embodiment provides a blockchain-based information traceability method, executed through a chip component installed on an item, which also has a display screen; the chip component is communicatively connected to any node device in the blockchain network, and the method includes:

[0024] By interacting with the node device, an updated identifier code containing the second identifier is obtained; wherein, the second identifier code is obtained by the node device through the execution logic of a smart contract, the smart contract being invoked based on a first transaction submitted by the terminal device, the first transaction being submitted based on the terminal device scanning the identifier code on the display screen, the execution logic including: after the first identifier code is verified, querying the item information corresponding to the first item identifier, and updating the first identifier code to the second identifier code;

[0025] The updated identifier code is displayed on the screen.

[0026] In one implementation, the step of obtaining the update identifier code containing the second code identifier includes:

[0027] The system receives an update identifier code sent by the node device; wherein the update identifier code is obtained by executing the operating logic, and the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier.

[0028] In one implementation, the step of obtaining the update identifier code containing the second code identifier includes:

[0029] Receive the second code identifier sent by the node device;

[0030] An update identifier code is generated based on the first item identifier and the second code identifier.

[0031] In one implementation, the method further includes:

[0032] Obtain the item information corresponding to the first item identifier;

[0033] A second transaction is submitted to the node device to invoke the smart contract, so that the blockchain network records the item information corresponding to the first item identifier by running the smart contract; the input parameters of the second transaction include the item information corresponding to the first item identifier.

[0034] In one implementation, the method further includes:

[0035] By interacting with the node device regarding abnormal status information, the abnormal status is displayed on the screen; the abnormal status information is obtained by the node device through executing the running logic of the smart contract;

[0036] The operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when an abnormality is detected in the item information, recording the abnormal status information corresponding to the first item identifier.

[0037] Thirdly, the embodiment provides a blockchain-based information traceability device, deployed in any node device of a blockchain network. The node device is communicatively connected to a chip component installed on an item, and the item also has a display screen. The device includes:

[0038] The transaction receiving module is configured to receive a first transaction submitted by a terminal device for invoking a smart contract. Its input parameters include a first item identifier and a first code identifier, which are obtained by the terminal device scanning the identifier code on the display screen.

[0039] The transaction execution module is configured to execute the running logic of the smart contract based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier.

[0040] The device interaction module is configured to interact with the chip component based on the second code identifier, so that the chip component obtains an update identifier code containing the second code identifier and displays it on the display screen.

[0041] Fourthly, the embodiment provides a blockchain-based information traceability device, deployed in a chip component installed on an item, the item also having a display screen; the chip component is communicatively connected to any node device in the blockchain network, and the device includes:

[0042] The identifier acquisition module is configured to acquire an updated identifier code containing the second identifier by interacting with the node device; wherein the second identifier is obtained by the node device through the execution logic of a smart contract, the smart contract being invoked based on a first transaction submitted by the terminal device, the first transaction being submitted based on the terminal device scanning the identifier code on the display screen, and the execution logic including: after the first identifier is verified, querying the item information corresponding to the first item identifier, and updating the first identifier to the second identifier;

[0043] The identifier display module is configured to display the updated identifier code on the display screen.

[0044] Fifthly, the embodiment provides a blockchain-based information traceability system, including a blockchain network and a chip component and display screen disposed on an item; the terminal device is communicatively connected to the blockchain network;

[0045] The terminal device is used to scan the identification code on the display screen to obtain the first item identifier and the first code identifier; and to submit a first transaction to the blockchain network for calling the smart contract, the input parameters of which include the first item identifier and the first code identifier.

[0046] The blockchain network is used to execute the smart contract's operating logic based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier.

[0047] The blockchain network is used to interact with the chip component based on the second code identifier;

[0048] The chip component is used to obtain an update identifier code containing the second code identifier through interaction with the blockchain network, and to display it on the display screen.

[0049] In a sixth aspect, an embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in any one of the first and second aspects.

[0050] In a seventh aspect, an embodiment provides a computing device including a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of the first and second aspects.

[0051] In the methods and apparatus provided in the embodiments of this specification, an identification code is displayed on a screen on the item for scanning by a terminal device. The terminal device queries the blockchain network for item information by scanning the identification code, thereby ensuring the authenticity and reliability of the item information. When querying item information from the blockchain network, the smart contract verifies the code identifier. After successful verification, the item information is queried, and the code identifier is updated. The blockchain network interacts with the chip component on the item, enabling the chip component to obtain the updated identification code. In other words, each time the identification code on the item is scanned, the blockchain network verifies the code identifier to ensure the legitimate scanning behavior of the terminal device. Simultaneously, after the identification code on the item is scanned, the identification code on the display screen is updated to prevent malicious scanning that may result from the QR code being copied, thereby ensuring that the item information is not arbitrarily queried and improving the privacy of the item information. Attached Figure Description

[0052] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0053] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0054] Figure 2 A flowchart illustrating an information traceability method based on blockchain, provided as an example;

[0055] Figure 3 A schematic diagram illustrating an interaction process between a chip component and a blockchain network, provided as an example.

[0056] Figure 4 A schematic block diagram of a blockchain-based information traceability device provided for an embodiment;

[0057] Figure 5 A schematic block diagram of a blockchain-based information traceability device provided for an embodiment;

[0058] Figure 6 This is a schematic block diagram of a blockchain-based information traceability system provided for an embodiment. Detailed Implementation

[0059] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0060] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. The item includes a display screen and a chip component. The display screen can show an identification code, such as a QR code or a barcode, for scanning by a terminal device. When the terminal device ① scans the identification code on the display screen, it can ② submit a transaction to the blockchain network based on the information obtained from the identification code. The blockchain network, based on the transaction submitted by the terminal device, queries the item information and sends it back to the terminal device. Then, ③ the blockchain network updates the identification code on the display screen by interacting with the chip component, thereby updating the identification code after each scan.

[0061] The aforementioned items can be any objects requiring traceability, such as food, medicine, agricultural products, daily necessities, and household goods. In practical applications, some high-value items, such as wine, bags, or medicines, can be traced using the method described in this embodiment.

[0062] To enable item traceability, paper QR codes can be affixed to items such as wine bottles. Users can scan the QR code to obtain information about the wine. For real-time monitoring of item status, IoT technology can be used, such as attaching a Narrow Band Internet of Things (NB-IoT) module to the item. This module actively reports the item's location and other status data to a server.

[0063] Paper QR codes are easily copied. If an item's QR code is maliciously published on the internet, the item's information may be freely accessed, leading to the leakage of item information and the privacy of the item's owner. Therefore, to ensure both the traceability, authenticity, and reliability of item information, and to prevent unauthorized access to this information while enhancing its privacy, this specification provides a blockchain-based information traceability method.

[0064] In this method, the item is equipped with a chip component and a display screen, and the chip component can communicate with a blockchain network. In step S210, the terminal device scans the identification code on the item's display screen to obtain a first item identifier and a first code identifier. In step S220, the terminal device submits a first transaction to the blockchain network to invoke a smart contract, with the first item identifier and the first code identifier as input parameters. In step S230, the blockchain network executes the smart contract's operating logic based on the first transaction, querying the item information corresponding to the first item identifier after verifying the first code identifier, and updating the first code identifier to a second code identifier. In step S240, the blockchain network interacts with the chip component based on the second code identifier, enabling the chip component to obtain an updated identifier code containing the second code identifier through interaction with the blockchain network, and displaying it on the display screen.

[0065] In this embodiment, the item information is stored on the blockchain. The data uploaded to the blockchain cannot be tampered with, thus ensuring the traceability, authenticity, and reliability of the item information. Simultaneously, after the terminal device submits a transaction to the blockchain network, the smart contract's execution logic verifies the first identifier in the transaction to prevent abnormal scanning behavior and unauthorized terminal devices from obtaining item information. Furthermore, after querying item information, the identifier code on the display screen is updated through the interaction between the blockchain and the chip component, ensuring that the identifier code on the item is updated after each scan. Thus, even if an identifier code is copied and scanned by someone who cannot access the item (this is an abnormal scanning behavior), the corresponding identifier code cannot pass the smart contract verification, and therefore the item information cannot be queried. However, people who can normally access the item can query the item information once or multiple times through the terminal device without being affected. Therefore, this embodiment ensures that item information can be queried normally, avoids abnormal queries, and improves the privacy of item information. The following is a combination of... Figure 2 This embodiment will be described in detail.

[0066] Figure 2 This is a flowchart illustrating a blockchain-based information traceability method provided in this embodiment. The method involves a blockchain network, terminal devices, a chip component mounted on an item, and a display screen. Any node device in the blockchain network can be implemented using any device, equipment, platform, or device cluster with computing and processing capabilities. The terminal device can be any device capable of scanning identification codes and possessing computing and processing capabilities, including smart terminals such as mobile phones and tablets. The chip component can be an NB-IoT module or a chip component containing a microcontroller unit (MCU); theoretically, a chip component containing a CPU can also be used. The display screen can be an e-ink screen, which consumes power only when updating the identification code, thus saving power. The item also has a micro-battery for powering the chip component and the display screen. A physical wiring connection is established between the chip component and the display screen.

[0067] To make the description clearer, it will be explained from the perspective of different devices or components below. The method of this embodiment includes the following steps S210 to S240.

[0068] Step S210: The terminal device scans the identification code on the display screen to obtain the first item identification and the first code identification.

[0069] The identification code can be a two-dimensional code or a one-dimensional code. A two-dimensional code, also known as a two-dimensional barcode, is a graphic that uses specific geometric shapes distributed on a plane according to certain rules. It is a black and white graphic that records data symbols and information. Simply put, it is a specific format graphic that can store information.

[0070] After scanning the identification code, the terminal device obtains a large number of code values ​​containing 0s and 1s. These code values ​​are then parsed to obtain the identification code information contained within. The identification code information may include a first item identifier and a first code identifier used to identify the identification code, and may also include the address of the smart contract in the blockchain network. The first item identifier can be implemented using a module identifier of a chip component; the module identifier uniquely identifies the chip component and also uniquely identifies the item. The first code identifier is used to identify the identification code, and different identification codes have different code identifiers.

[0071] In step S220, the terminal device submits a first transaction Tx1 to the blockchain network for invoking the smart contract. The input parameters include a first item identifier and a first code identifier. The first item identifier and the first code identifier are obtained by the terminal device scanning the identifier code on the display screen.

[0072] Here, we first describe the blockchain network. In the embodiments of this specification, the blockchain can be a consortium blockchain or a public blockchain. As those skilled in the art will know, a blockchain network is a distributed storage and recording system that includes multiple node devices. See also Figure 1 The blockchain network shown allows nodes to send and sign transactions. A transaction (Tx) is the basic unit of processing in the blockchain. Various data stored on the blockchain network, and the data processing performed through it, are generally carried out in the form of transactions. A node receives multiple transactions (Tx) over a period of time. Through broadcasting, consensus, and verification, these transactions are packaged into blocks and recorded on the blockchain, completing the block upload. Consensus mechanisms include Proof-of-Work (PoW), Proof-of-Stake (PoS), and Byzantine Fault Tolerance (BFT). In one implementation, BFT can be used as the consensus mechanism in a consortium blockchain. In current mainstream blockchain networks, a block can store hundreds of transactions. After the block is uploaded to the blockchain, each node executes the transactions (Tx) in the order they appear in the block. In the blockchain technology field, the node that performs the above process is called a full node or ledger node; it is a computing device that can generate new blocks based on transactions (Tx) and upload them to the blockchain. Figure 1The circles in the diagram represent nodes. The number of node devices and the connections between them shown are just examples. In practice, a blockchain network can have more or fewer node devices.

[0073] Terminal devices can establish connections to the blockchain network through their installed clients. The client can connect to any node device in the blockchain network based on a Software Development Kit (SDK). Once a connection is established between the terminal device and a node device, it can submit a transaction (Tx) to the blockchain network, implementing the functionality corresponding to that transaction.

[0074] The terminal device can generate a first transaction Tx1 based on the first item identifier and the first code identifier; specifically, it can generate the first transaction Tx1 based on the first item identifier, the first code identifier, and the smart contract's contract address. The transaction content can include an initiator's `from` field, a receiver's `to` field, and a data field. When generating the first transaction Tx1, its `from` field can be set to the terminal device's address, its `to` field can be set to the contract address, and the input parameters of the first transaction Tx1, namely the first item identifier and the first code identifier, can be added to the `data` field.

[0075] When submitting the first transaction Tx1 to the blockchain network, the terminal device can also submit its digital signature, which can be generated by the client in the terminal device and used to verify the identity of the terminal device.

[0076] The aforementioned smart contract can be pre-deployed in the blockchain network. Its operational logic includes: after successful verification of the code identifier, querying the item information corresponding to the item identifier and updating the code identifier. Each smart contract corresponds to a unique contract address. This smart contract can be pre-deployed in the blockchain network through transactions or directly deployed on the node devices of the blockchain network.

[0077] In step S230, any node device in the blockchain network receives the first transaction Tx1 submitted by the terminal device, executes the running logic of the smart contract based on the first transaction Tx1, and queries the item information corresponding to the first item identifier after the first code identifier is verified, and updates the first code identifier to the second code identifier.

[0078] In a blockchain network, any node device, upon receiving the first transaction Tx1 submitted by a terminal device, verifies the digital signature of the first transaction Tx1. If verification is successful, the first transaction Tx1 is broadcast to all node devices in the blockchain network, ensuring that multiple node devices receive it. These multiple node devices then add the first transaction Tx1 to the blockchain through a consensus mechanism, completing the on-chain process. The multiple node devices execute transactions in the order they appear in the on-chain blocks, including executing the first transaction Tx1. When executing the first transaction Tx1, the multiple node devices execute the smart contract's execution logic through their virtual machines.

[0079] When any node device executes the first transaction Tx1, it executes the smart contract's operating logic, which verifies the first code identifier in the input parameters. After the verification is successful, it queries the item information corresponding to the first item identifier and updates the first code identifier to the second code identifier.

[0080] Specifically, the above operational logic can verify the first-code identifier in the following way:

[0081] The system checks whether the first-code identifier exists in the generated records and whether the first-code identifier does not exist in the queried records. If both checks result in "yes," the verification passes. If at least one check result in "no," the verification fails, and no further operations are performed.

[0082] If the first-code identifier exists in the generated records but not in the queried records, it means that the first-code identifier in this query was legally generated and has not been queried before, thus constituting a legitimate query operation, and the verification passes. Otherwise, the query is considered illegitimate.

[0083] The above operational logic may further include: adding the second code identifier to the generated record and adding the first code identifier to the queried record. This operational logic ensures that the verification operation for subsequent queries proceeds smoothly.

[0084] Verification of the first identifier can also be carried out using other methods. As long as it can be confirmed that the first identifier is legally generated and has not been queried, the verification of the first identifier will pass.

[0085] In one implementation, the input parameters of the first transaction Tx1 may further include the terminal identifier of the terminal device. The smart contract's operating logic may further include adding the terminal identifier to the queried terminal record. And / or, the input parameters of the first transaction Tx1 may further include the query time, and the smart contract's operating logic may further include adding the query time to the queried terminal record.

[0086] In the aforementioned smart contract's operational logic, when querying the item information corresponding to the first item identifier, the query can be performed from the already recorded item information corresponding to the item identifier. The operation of updating the first identifier to the second identifier can include selecting a new value as the second identifier within a preset range. The second identifier is different from the first identifier.

[0087] In step S240, any node device in the blockchain network interacts with the chip component based on the second code identifier; the chip component, through interaction with the node device, obtains an update identifier code containing the second code identifier and displays it on the display screen.

[0088] The chip component can establish a connection with the blockchain network through its client. The client can also include a pre-installed SDK toolkit, which allows for submitting transactions to the blockchain network and interacting with it for data exchange.

[0089] After the smart contract's execution logic is executed, all node devices in the blockchain network can obtain the query results from the smart contract's return value, namely, the item information corresponding to the first item identifier found. Node devices that have established a connection with the terminal device can send the retrieved item information to the terminal device, enabling the terminal device to display the item information to the user.

[0090] After the smart contract's execution logic is executed, all node devices in the blockchain network can obtain the second key identifier from the smart contract's return value. One of these node devices can obtain this second key identifier and interact with the chip component based on it. This node device used to interact with the chip component can be pre-selected or randomly determined.

[0091] The operation of node devices interacting with chip components based on the second code identifier can include various implementation methods.

[0092] For example, in one implementation, the operating logic of the smart contract may further include: generating an update identifier code based on a first item identifier and a second code identifier. Then, the node device sends the update identifier code to the chip component. The chip component receives the update identifier code containing the second code identifier sent by the node device and displays it on a display screen, thereby refreshing the identifier code. In this implementation, the update identifier code is obtained by executing the smart contract's operating logic; that is, the smart contract directly generates the update identifier code. This reduces the computational requirements on the chip component, making it more energy-efficient and requiring less computing power.

[0093] In one implementation, the smart contract does not generate an update identifier code, but instead sends the second identifier code directly to the chip component via the node device. The chip component receives the second identifier code sent by the node device, generates an update identifier code based on the first item identifier and the second identifier code, and displays it on the display screen.

[0094] When performing the operation of generating an update identifier code based on the first item identifier and the second code identifier, encoding technology can be used to encode the first item identifier and the second code identifier into code values, and then convert the code values ​​into QR codes or one-dimensional codes. Specifically, the smart contract's contract address can also be encoded in the update identifier code, that is, the update identifier code is generated based on the contract address, the first item identifier, and the second code identifier.

[0095] In another embodiment of this specification, the chip component can proactively report item information and store the item information in a blockchain network to achieve real-time monitoring of the items. Figure 3 This is a schematic diagram of an interaction process between a chip component and a blockchain network provided for an embodiment, including the following steps.

[0096] In step S310, the chip component obtains the item information corresponding to the first item identifier.

[0097] The item information can include attribute information such as the item's name, type, origin, production time, concentration, weight, and composition. Item information can also include status data such as the item's location, environmental temperature and humidity, and contaminant information.

[0098] The chip components may include a positioning module and / or an environmental sensing module. Environmental sensing modules include, but are not limited to, temperature sensors, humidity sensors, and pollutant sensors.

[0099] The chip component can periodically collect the status data of the item. Each time status data is collected, subsequent steps S320 and S330 of this embodiment can be executed to report the status data of the item in real time. For the attribute information of the item, only one reporting is required.

[0100] In step S320, the chip component submits a second transaction Tx2 to any node device in the blockchain network, invoking a smart contract. The input parameters of this second transaction Tx2 include the item information corresponding to the first item identifier. The smart contract's execution logic includes recording the item information corresponding to the item identifier. The smart contract in this embodiment can be used with... Figure 2 The smart contracts in the illustrated embodiments are the same smart contract, meaning the smart contract's execution logic includes... Figure 2 The content shown in the embodiments also includes the content in this embodiment.

[0101] The chip component can generate a second transaction Tx2 based on the item information corresponding to the first item identifier. Specifically, the second transaction Tx2 can be generated based on the item information corresponding to the first item identifier and the contract address of the smart contract. When generating the second transaction Tx2, its from field can be set to the address of the chip component, its to field can be set to the contract address, and the input parameter of the second transaction Tx2, namely the item information corresponding to the first item identifier, can be added to the data field.

[0102] When submitting the second transaction Tx2 to the blockchain network, the chip component can also submit its digital signature, which can be generated by a client within the chip component and used to verify the chip component's identity.

[0103] In step S330, the node device in the blockchain network receives the second transaction Tx2 submitted by the chip component, and executes the smart contract based on the second transaction Tx2 to record the item information corresponding to the first item identifier.

[0104] After receiving the second transaction Tx2 submitted by the chip component, the node devices in the blockchain network verify the digital signature of the second transaction Tx2. Once verified, the second transaction Tx2 is broadcast to all node devices in the blockchain network, and multiple node devices can receive it. Multiple node devices add the second transaction Tx2 to the blockchain through a consensus mechanism, completing the on-chain process. Multiple node devices execute transactions in the order of the on-chain blocks, including executing the second transaction Tx2. When executing the second transaction Tx2, multiple node devices execute the operations corresponding to the smart contract's execution logic through the virtual machine within the node device.

[0105] In another embodiment of this specification, the smart contract's operating logic may further include, when recording item information corresponding to an item identifier, detecting whether the item information is abnormal, and when an abnormality is detected, recording the abnormal status information corresponding to the item identifier. This embodiment also includes step S340, where a node device in the blockchain network interacts with the chip component based on the abnormal status information, thereby displaying the abnormal status on a screen.

[0106] In step S330, when the node device executes the smart contract based on the second transaction Tx2, it records the item information corresponding to the first item identifier. While recording this information, it checks for any anomalies. If an anomaly is detected, it records the anomaly status information corresponding to the first item identifier. This anomaly status information is obtained by the node device through executing the smart contract's execution logic.

[0107] For example, when the item information is the item's status data, the smart contract's operating logic can detect whether the status data is abnormal based on preset detection rules. For instance, it can detect whether the temperature in the status data exceeds a preset temperature range; if so, it determines that the temperature is abnormal. It can also detect whether the humidity in the status data exceeds a preset humidity range; if so, it determines that the humidity is abnormal. Furthermore, it can detect whether the pollutant concentration in the status data exceeds a preset concentration value; if so, it determines that the pollutant concentration exceeds the standard.

[0108] In step S340, the node device in the blockchain network interacts with the chip component based on the abnormal state information; the chip component displays the abnormal state on the display screen by interacting with the node device regarding the abnormal state information.

[0109] When performing operations that interact with chip components based on anomaly information, various implementation methods can be adopted. For example, the node device can directly send anomaly status information to the chip component, which then receives the anomaly status information sent by the node device and displays it on a display screen.

[0110] Alternatively, the node device can generate an exception code based on the abnormal status information to indicate the type of exception, send the exception code to the chip component, and the chip component receives the exception code sent by the node device and displays the exception code on the display screen.

[0111] Alternatively, the chip components can generate an exception code to indicate the type of exception based on the exception status information and display the exception code on the display screen.

[0112] In one embodiment of this specification, the item may also be provided with a trigger line for detecting when the item is opened, and this trigger line is connected to a chip component. When the item is opened, the trigger line is triggered, and a trigger signal is sent to the chip component. The chip component can receive the trigger signal. The chip component can use the trigger signal as item information. When the item information contains the trigger signal, by executing the above steps S320 to S340, the smart contract's operating logic can determine that the item has been opened when the trigger signal is detected, record this abnormal state information of the item being opened, and display the opened state of the item on the display screen. This allows the person who comes into contact with the item to know that the item has been opened through the display screen, improving the real-time nature of information display and allowing users to know the information that the item has been opened in a timely and accurate manner, thus improving the user experience.

[0113] In one embodiment of this specification, the blockchain can also send abnormal status information of items to subscribing devices via node devices to proactively notify the holders of the subscribing devices. This enables critical information to be delivered to holders (such as consumers) in a timely manner, thereby improving the user experience.

[0114] In the embodiments of this specification, the operating logic of the smart contract can be implemented through different functions. For example, function 1 is used to implement the following operating logic 1: determine whether the first code identifier exists in the generated records and whether the first code identifier does not exist in the queried records. If both are true, the verification is successful. After the first code identifier is verified, query the item information corresponding to the first item identifier, update the first code identifier to the second code identifier, add the second code identifier to the generated records, and add the first code identifier to the queried records.

[0115] Function 2 is used to implement the following operating logic 2: record the item information corresponding to the first item identifier; or implement the following operating logic: record the item information corresponding to the first item identifier, and detect whether there is any abnormality in the item information. When an abnormality is detected in the item information, record the abnormal status information corresponding to the first item identifier.

[0116] When calling different execution logics in a smart contract through a transaction, such as calling execution logic 1 and execution logic 2, the function name corresponding to the execution logic can be added to the data field of the transaction, thereby enabling the calling of different execution logics.

[0117] In this specification, the terms "first" in "first transaction," "first item identifier," and "first code identifier," as well as the corresponding "second" in the text, are used merely for the convenience of distinction and description, and do not have any limiting meaning.

[0118] The foregoing description describes specific embodiments of this specification; other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than those shown in the embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the drawings do not necessarily need to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0119] Figure 4 This is a schematic block diagram of a blockchain-based information traceability device provided for an embodiment. The device 400 is deployed in any node device in the blockchain network. This node device is communicatively connected to a chip component installed on an item, and the item also has a display screen. This device embodiment is similar to... Figure 2 and Figure 3 The method described in the embodiment corresponds to the method executed by the node device. The apparatus 400 includes:

[0120] The transaction receiving module 410 is configured to receive a first transaction submitted by a terminal device for calling a smart contract. Its input parameters include a first item identifier and a first code identifier, which are obtained by the terminal device scanning the identifier code on the display screen.

[0121] The transaction execution module 420 is configured to execute the running logic of the smart contract based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier.

[0122] The device interaction module 430 is configured to interact with the chip component based on the second code identifier, so that the chip component obtains an update identifier code containing the second code identifier and displays it on the display screen.

[0123] In one embodiment, the device 400 further includes:

[0124] The information sending module (not shown in the figure) is configured to send the queried item information to the terminal device.

[0125] In one embodiment, the device 400 further includes an identifier verification module (not shown in the figure), configured to verify the first code identifier by the following operations:

[0126] Determine whether the first code identifier exists in the generated records and whether the first code identifier does not exist in the queried records. If both are true, the verification is successful.

[0127] In one implementation, the operational logic further includes:

[0128] Add the second code identifier to the generated record, and add the first code identifier to the queried record.

[0129] In one implementation, the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier;

[0130] The specific configuration of the device interaction module 430 is as follows:

[0131] The update identifier code is sent to the chip component, so that the chip component receives the update identifier code and displays it on the display screen.

[0132] In one implementation, the device interaction module 430 is specifically configured as follows:

[0133] The second code identifier is sent to the chip component, which then generates an updated identifier code based on the first item identifier and the second code identifier, and displays it on the display screen.

[0134] In one embodiment, the transaction receiving module 410 is further configured to receive a second transaction submitted by the chip component for invoking the smart contract, the input parameters of which include item information corresponding to the first item identifier;

[0135] The transaction execution module 420 is also configured to execute the smart contract based on the second transaction to record the item information corresponding to the first item identifier.

[0136] In one implementation, the operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when the item information is detected to be abnormal, recording the abnormal status information corresponding to the first item identifier.

[0137] The device interaction module 430 is also configured to interact with the chip component based on the abnormal status information, so that the chip component displays the abnormal status on the display screen.

[0138] Figure 5 This is a schematic block diagram of a blockchain-based information traceability device provided for an embodiment. The device 500 is deployed in a chip component mounted on an item, which also has a display screen; the chip component is communicatively connected to any node device in the blockchain network. This device embodiment is similar to... Figure 2 and Figure 3 The method embodiment shown corresponds to the method performed by the chip component. The apparatus 500 includes:

[0139] The identifier acquisition module 510 is configured to acquire an updated identifier code containing the second identifier by interacting with the node device; wherein the second identifier is obtained by the node device through the execution logic of a smart contract, the smart contract being invoked based on a first transaction submitted by the terminal device, the first transaction being submitted based on the terminal device scanning the identifier code on the display screen, and the execution logic including: after the first identifier is verified, querying the item information corresponding to the first item identifier, and updating the first identifier to the second identifier;

[0140] The identification display module 520 is configured to display the updated identification code on the display screen.

[0141] In one implementation, the identifier acquisition module 510 is specifically configured as follows:

[0142] The system receives an update identifier code sent by the node device; wherein the update identifier code is obtained by executing the operating logic, and the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier.

[0143] In one implementation, the identifier acquisition module 510 is specifically configured as follows:

[0144] Receive the second code identifier sent by the node device;

[0145] An update identifier code is generated based on the first item identifier and the second code identifier.

[0146] In one embodiment, the device 500 further includes:

[0147] The information acquisition module (not shown in the figure) is configured to acquire the item information corresponding to the first item identifier;

[0148] The transaction submission module (not shown in the figure) is configured to submit a second transaction to the node device to invoke the smart contract, so that the blockchain network records the item information corresponding to the first item identifier by running the smart contract; the input parameters of the second transaction include the item information corresponding to the first item identifier.

[0149] In one embodiment, the device 500 further includes:

[0150] An anomaly display module (not shown in the figure) is configured to display an anomaly status on the display screen by interacting with the node device regarding anomaly status information; the anomaly status information is obtained by the node device through executing the execution logic of a smart contract.

[0151] The operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when an abnormality is detected in the item information, recording the abnormal status information corresponding to the first item identifier.

[0152] The above-described apparatus embodiments correspond to the method embodiments, and detailed descriptions can be found in the description of the method embodiments section, which will not be repeated here. The apparatus embodiments are derived based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments; detailed descriptions can be found in the corresponding method embodiments.

[0153] Figure 6This is a schematic block diagram of a blockchain-based information traceability system provided for an embodiment. The information traceability system 600 includes: a blockchain network 610, a chip component 620, and a display screen 630; wherein the chip component 620 and the display screen 630 are disposed on an item. Terminal devices can communicate and connect with the blockchain network. This system embodiment is similar to... Figure 2 and Figure 3 The method embodiments shown correspond to those described.

[0154] The terminal device is used to scan the identification code on the display screen 630 to obtain the first item identifier and the first code identifier; and to submit a first transaction to the blockchain network 610 for calling the smart contract, the input parameters of which include the first item identifier and the first code identifier.

[0155] Blockchain network 610 is used to execute the running logic of the smart contract based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier.

[0156] The blockchain network 610 is used to interact with the chip component 620 based on the second code identifier;

[0157] The chip component 620 is used to obtain an update identifier code containing the second code identifier through interaction with the blockchain network 610, and display it on the display screen 630.

[0158] In one embodiment, the blockchain network 610 is further configured to send the retrieved item information to the terminal device;

[0159] The terminal device is also used to receive item information sent by the blockchain network 610.

[0160] In one implementation, the first code identifier is verified using the following operation:

[0161] Determine whether the first code identifier exists in the generated records and whether the first code identifier does not exist in the queried records. If both are true, the verification is successful.

[0162] In one implementation, the operational logic further includes:

[0163] Add the second code identifier to the generated record, and add the first code identifier to the queried record.

[0164] In one implementation, the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier;

[0165] The blockchain network 610 is specifically used to send the update identifier code to the chip component 620;

[0166] The chip component 620 is specifically used to receive the update identifier code and display it on the display screen 630.

[0167] In one embodiment, the blockchain network 610 is specifically used to send the second code identifier to the chip component 620;

[0168] The chip component 620 is specifically used to receive the second code identifier, generate an update identifier code based on the second code identifier, and display it on the display screen 630.

[0169] In one embodiment, the chip component 620 is further configured to acquire item information corresponding to the first item identifier, and submit a second transaction to the blockchain network 610 for invoking the smart contract, the input parameters of which include the item information corresponding to the first item identifier; the operating logic of the smart contract further includes: recording the item information corresponding to the item identifier;

[0170] The blockchain network 610 is also used to execute the running logic of the smart contract based on the second transaction, so as to record the item information corresponding to the first item identifier.

[0171] In one implementation, the operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when the item information is detected to be abnormal, recording the abnormal status information corresponding to the first item identifier.

[0172] The blockchain network 610 is also used to interact with the chip component 620 based on the abnormal state information;

[0173] The chip component 620 is also used to display the abnormal status on the display screen 630 by interacting with the blockchain network 610 regarding the abnormal status information.

[0174] The above system embodiments correspond to the method embodiments, and detailed descriptions can be found in the description of the method embodiments section, which will not be repeated here. The system embodiments are derived based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments; detailed descriptions can be found in the corresponding method embodiments.

[0175] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform... Figures 1 to 3 Any one of the methods described.

[0176] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement... Figures 1 to 3 Any one of the methods described.

[0177] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for storage media and computing devices are basically similar to the method embodiments, so they are described more simply; relevant parts can be referred to the descriptions of the method embodiments.

[0178] Those skilled in the art will recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0179] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, or improvements made based on the technical solutions of the present invention should be included within the scope of protection of the present invention.

Claims

1. A blockchain-based information traceability method, executed by any node device in a blockchain network, wherein the node device is communicatively connected to a chip component installed on an item, and the item is also equipped with a display screen; the method includes: The terminal device receives a first transaction for invoking a smart contract, the input parameters of which include a first item identifier and a first code identifier. The first item identifier and the first code identifier are obtained by the terminal device scanning the identifier code on the display screen. Based on the first transaction, the execution logic of the smart contract is executed to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier. Based on the second code identifier, the chip component interacts with the chip component, enabling the chip component to obtain an update identifier code containing the second code identifier and display it on the display screen.

2. The method according to claim 1, further comprising: The retrieved item information is sent to the terminal device.

3. The method according to claim 1, wherein the first code identifier is verified in the following manner: Determine whether the first code identifier exists in the generated records and whether the first code identifier does not exist in the queried records. If both are true, the verification is successful.

4. The method according to claim 3, wherein the operating logic further includes: Add the second code identifier to the generated record, and add the first code identifier to the queried record.

5. The method according to claim 1, wherein the operating logic further includes: Based on the first item identifier and the second code identifier, an update identifier code is generated; The step of interacting with the chip component based on the second code identifier includes: The update identifier code is sent to the chip component, so that the chip component receives the update identifier code and displays it on the display screen.

6. The method according to claim 1, wherein the step of interacting with the chip component based on the second code identifier includes: The second code identifier is sent to the chip component, which then generates an updated identifier code based on the first item identifier and the second code identifier, and displays it on the display screen.

7. The method of claim 1, further comprising: The chip component submits a second transaction for invoking the smart contract, the input parameters of which include the item information corresponding to the first item identifier. The smart contract is executed based on the second transaction to record the item information corresponding to the first item identifier.

8. The method according to claim 7, wherein the operating logic further comprises: When recording the item information corresponding to the first item identifier, it is detected whether the item information is abnormal. When the item information is detected to be abnormal, the abnormal status information corresponding to the first item identifier is recorded. The method further includes: Based on the abnormal status information, the chip component is interacted with, causing the chip component to display the abnormal status on the display screen.

9. A blockchain-based information traceability method, executed through a chip component installed on an item, the item also having a display screen; the chip component is communicatively connected to any node device in the blockchain network, the method comprising: By interacting with the node device, an updated identifier code containing a second identifier is obtained; wherein, the second identifier code is obtained by the node device through the execution logic of a smart contract, the smart contract being invoked based on a first transaction submitted by the terminal device, the first transaction being submitted based on the terminal device scanning the identifier code on the display screen, the execution logic including: after the first identifier code is verified, querying the item information corresponding to the first item identifier, and updating the first identifier code to the second identifier code; The updated identifier code is displayed on the screen.

10. The method according to claim 9, wherein the step of obtaining the update identifier code containing the second code identifier comprises: The system receives an update identifier code sent by the node device; wherein the update identifier code is obtained by executing the operating logic, and the operating logic further includes: generating an update identifier code based on the first item identifier and the second code identifier.

11. The method according to claim 9, wherein the step of obtaining the update identifier code containing the second code identifier comprises: Receive the second code identifier sent by the node device; An update identifier code is generated based on the first item identifier and the second code identifier.

12. The method of claim 9, further comprising: Obtain the item information corresponding to the first item identifier; A second transaction is submitted to the node device to invoke the smart contract, so that the blockchain network records the item information corresponding to the first item identifier by running the smart contract; the input parameters of the second transaction include the item information corresponding to the first item identifier.

13. The method of claim 12, further comprising: The abnormal status is displayed on the screen by interacting with the node device for abnormal status information. The abnormal status information is obtained by the node device through executing the running logic of the smart contract; The operating logic further includes: when recording the item information corresponding to the first item identifier, detecting whether the item information is abnormal; when an abnormality is detected in the item information, recording the abnormal status information corresponding to the first item identifier.

14. A blockchain-based information traceability device, deployed in any node device in a blockchain network, wherein the node device is communicatively connected to a chip component disposed on an item, and the item is further provided with a display screen; the device comprises: The transaction receiving module is configured to receive a first transaction submitted by a terminal device for invoking a smart contract. Its input parameters include a first item identifier and a first code identifier, which are obtained by the terminal device scanning the identifier code on the display screen. The transaction execution module is configured to execute the running logic of the smart contract based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier. The device interaction module is configured to interact with the chip component based on the second code identifier, so that the chip component obtains an update identifier code containing the second code identifier and displays it on the display screen.

15. A blockchain-based information traceability device, deployed in a chip component on an item, the item also having a display screen; the chip component is communicatively connected to any node device in a blockchain network, the device comprising: The identifier acquisition module is configured to acquire an updated identifier code containing a second identifier by interacting with the node device; wherein the second identifier code is obtained by the node device through the execution logic of a smart contract, the smart contract being invoked based on a first transaction submitted by the terminal device, the first transaction being submitted based on the terminal device scanning the identifier code on the display screen, and the execution logic including: after the first identifier code is verified, querying the item information corresponding to the first item identifier, and updating the first identifier code to the second identifier code; The identifier display module is configured to display the updated identifier code on the display screen.

16. A blockchain-based information traceability system, comprising a blockchain network and a chip component and display screen disposed on an item; a terminal device is communicatively connected to the blockchain network; The terminal device is used to scan the identification code on the display screen to obtain the first item identifier and the first code identifier; and to submit a first transaction to the blockchain network for calling the smart contract, the input parameters of which include the first item identifier and the first code identifier. The blockchain network is used to execute the smart contract's operating logic based on the first transaction, so as to query the item information corresponding to the first item identifier after the first code identifier is verified, and update the first code identifier to the second code identifier. The blockchain network is used to interact with the chip component based on the second code identifier; The chip component is used to obtain an update identifier code containing the second code identifier through interaction with the blockchain network, and to display it on the display screen.

17. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-13.

18. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-13.

Citation Information

Patent Citations

  • Traceablility code generation and verification method and device

    CN111740841A

  • Anti-counterfeiting identification method and device for preventing identification code from being repeatedly used, and electronic equipment

    CN113269565A