A method, device, equipment and medium for implementing a trusted data link
By setting up the device digital identity for each link on the blockchain and performing signature verification, the problem of insufficient authenticity and reliability before data upload is solved, and efficient and reliable data upload is achieved.
Patent Information
- Application Number
- CN202011585946.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-12-28
AI Technical Summary
Before data is uploaded to the blockchain, the authenticity and reliability of the data are not guaranteed.
By deploying the server on the blockchain, setting a unique device digital identity for the client in each link, the client collects relevant information and signs through the device digital identity, obtains the device digital signature, and then sends the data and signature to verification Smart contract, determine whether to write to the blockchain.
It realizes improving the authenticity and reliability of data before data is uploaded to the blockchain, ensuring the correctness and traceability of data.
Smart Images

Figure CN114692158B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the technical field of blockchain, and in particular to a method, device, equipment and medium for implementing a trusted data chain. Background Art
[0002] Blockchain is a shared database, and the data or information stored in it has the characteristics of "unforgeable", "full traceability", "traceability", "openness and transparency", and "collective maintenance". Based on these characteristics, blockchain technology has laid a solid "trust" foundation, created a reliable "cooperation" mechanism, and has broad application prospects.
[0003] However, the authenticity and reliability of data cannot be guaranteed before it is uploaded to the blockchain.
[0004] Therefore, an effective solution is needed to improve the authenticity and reliability of data as much as possible before uploading it to the blockchain. Summary of the invention
[0005] One or more embodiments of this specification provide a method, apparatus, device and medium for implementing a trusted data chain, which are used to solve the following technical problems: before uploading the data to the blockchain, the authenticity and reliability of the data are improved as much as possible.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] One or more embodiments of this specification provide a method for implementing a trusted data link, including:
[0008] The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain;
[0009] The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0010] The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0011] The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0012] One or more embodiments of this specification provide a device for implementing a trusted data link, the device comprising:
[0013] A setting unit, used for the server to set a unique device digital identity for the client in each link, wherein the server is deployed and runs on the blockchain;
[0014] A collection unit, configured for the client of each link to collect relevant information of the corresponding link, and to sign the relevant information of the corresponding link through the device digital identity to obtain a device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0015] A sending unit, used for the client of each link to send the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0016] The determination unit is used for the verification smart contract to determine whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain according to the relevant information of the corresponding link and the digital signature of the device, so as to realize a trusted data chain.
[0017] One or more embodiments of this specification provide a device for implementing a trusted data link, including:
[0018] at least one processor; and,
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0021] The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain;
[0022] The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0023] The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0024] The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0025] One or more embodiments of this specification provide a trusted data link implementation medium, storing computer executable instructions, wherein the computer executable instructions are configured to:
[0026] The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain;
[0027] The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0028] The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0029] The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0030] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: the embodiments of this specification determine whether the data of each link is correct by verifying the relevant information of the corresponding link and the digital signature of the device, and finally determine whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain, so as to improve the authenticity and reliability of the data as much as possible before uploading the data to the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0032] Figure 1 A flowchart of a method for implementing a trusted data link provided in one or more embodiments of this specification;
[0033] Figure 2 A system architecture diagram of a trusted data link provided for one or more embodiments of this specification;
[0034] Figure 3 A business flow chart of a trusted data link provided for one or more embodiments of this specification;
[0035] Figure 4A schematic diagram of the structure of a device for implementing a trusted data link provided in one or more embodiments of this specification;
[0036] Figure 5 A schematic diagram of the structure of a trusted data link implementation device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0037] The embodiments of this specification provide a method, apparatus, device and medium for implementing a trusted data link.
[0038] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0039] In the existing technology, the authenticity and reliability of data cannot be guaranteed before it is uploaded to the blockchain. Drawing on the principle of "signature handover" commonly found in daily life and work, with the help of the trust mechanism of blockchain, and the comprehensive use of technical means such as cryptographic algorithms and identity authentication mechanisms, the handover means of "interlocking digital signatures" can be adopted in all links of the commodity circulation field to ensure the credibility and traceability of data.
[0040] For example, the tea supply chain system involves processing, wholesale, retail, logistics and distribution, and the information flow of each link involves the issue of integrity. On the server side, a unique digital identity can be issued to the client of each link. The client collects the necessary information and signs the information on the chain using the device digital identity. Between links, the trust value is transmitted through the handover method of "interlocking digital signatures", and ultimately the credible information is linked together to form a credible data chain.
[0041] It should be noted that, as can be seen from the above examples, the formation of a trusted data chain requires a series of links. Before the tea leaves are processed and packaged, the "tea face" data is collected through the terminal device, the "tea face" data is locked using the digital identity of the terminal device, and written into the blockchain. Among them, the "tea face" data can be the image data of the tea leaves.
[0042] When the processing link is transferred to the wholesale link, the terminal device in the processing link needs to sign the "tea face" data and authorize it to the wholesale terminal receiving device in the next link. The wholesale terminal receiving device signs and receives and uploads the data to the chain to complete seamless transfer. By analogy, both parties of each data link must sign and complete seamless connection. Before receiving the goods, the recipient needs to check the quality of the goods, such as whether the goods are incomplete or deteriorated, etc., be responsible for the quality data of the received goods, and make a signed commitment.
[0043] After the trusted data chain is formed, the final consumer can scan the "tea face" code and trace it back from the retailer to the manufacturer, and then further to the raw material manufacturer, thus completing the complete product traceability and distinguishing the authenticity. When an accident occurs, the signature data can be used as evidence to identify the responsible party and hold them accountable according to law.
[0044] All participants in a trusted data chain should be upright, courageous, and trustworthy, and constantly accumulate credibility. Otherwise, their credibility will be lost, their products will become worthless, and they will ultimately harm others as well as themselves.
[0045] The embodiments of this specification implement a trusted data chain through a data link method based on the digital identity of the Internet of Things device and the digital signature of the device in the corresponding link, so as to achieve the purpose of data traceability and responsibility locking. Before the data is uploaded to the blockchain, the authenticity and reliability of the data can be improved. The technical solution provided by this specification is described in detail below.
[0046] Figure 1 A flowchart of a method for implementing a trusted data link provided for one or more embodiments of this specification, the method comprising:
[0047] S101: The server sets a unique device digital identity for the client in each link, wherein the server is deployed and runs on the blockchain.
[0048] S102: The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data.
[0049] S103: The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server.
[0050] S104: Verify that the smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to achieve a trusted data chain.
[0051] It should be noted that the server may be a trusted data link server, and the client may be a trusted data link client. Figure 2 The system architecture diagram of the trusted data chain is shown. The system of the trusted data chain includes a trusted data chain server and a trusted data chain client. The trusted data chain server can be deployed and run on the blockchain platform, including a device digital identity smart contract and a data link smart contract. The trusted data chain client can be deployed and run on a smart terminal device. The device digital identity stored in the device digital identity smart contract may include data items such as device identification, public key, and whether it is invalid. The trusted data stored in the data link smart contract includes link data, link data, and link control data, wherein the link data includes one or more of the business type, item ID, serial number, and item detailed data; the link data includes one or more of the defect mark, the previous link device identification, the current link device identification, and the next link device identification; the link control data includes one or more of the current link device digital signature and the previous link device digital signature.
[0052] Furthermore, each trusted data chain client is assigned a unique device identity, public key, and private key. The device identity and public key need to be registered and filed in the device digital identity smart contract; the private key is stored in the trusted data chain client and is protected by a security protection mechanism.
[0053] At the same time, in one or more embodiments of this specification, the serial numbers of the same business type and item ID are generated in sequence and are globally unique. When the data link smart contract uploads the link data to the chain, it checks whether the serial number meets the requirements according to the above rules and rejects the link data that does not meet the rules.
[0054] In one or more embodiments of this specification, when in the first stage, the method further includes:
[0055] The server sets the current link device identifier to the first link device identifier, and sets the previous link device identifier to a null value;
[0056] The client digitally signs the link data and the link data to obtain a first link device digital signature, wherein the link data includes a defect flag, a first link device identifier, and a next link device identifier;
[0057] The client sends the link data, the link data and the first link device digital signature to the data link smart contract;
[0058] The data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the digital signature of the first link device to realize a trusted data chain.
[0059] Further, the data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the digital signature of the first link device, specifically including:
[0060] The data link smart contract queries the next link device identifier of the last saved data based on the business type and item ID in the link data. If the next link device identifier can be queried and the next link device identifier is the same as the first link device identifier of the data to be saved this time, it is determined to be a legal data link, otherwise it is determined to be an illegal device; and / or,
[0061] The data link smart contract queries the device digital identity corresponding to the first link device identifier from the device digital identity smart contract based on the first link device identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the whether invalidation field in the device digital identity is no, it is determined to be a legal device, otherwise it is determined to be an illegal device; and / or,
[0062] The data link smart contract uses the public key to verify the digital signature of the first link device. If the digital signature of the first link device is successfully verified, it is determined to be a legal device, otherwise it is determined to be an illegal device;
[0063] Based on the judgment result, it will be determined whether the link data, link data and device digital signature of the first link will be written into the blockchain.
[0064] In one or more embodiments of this specification, when the current link device identifier of the last data saved by the data link smart contract is different from the next link device identifier, the data link smart contract automatically enters the next link, that is, enters the second link. When in the second link, the method also includes:
[0065] Set the current link device ID to the second link device ID;
[0066] The client digitally signs the link data and the link data to obtain a second link device digital signature, wherein the link data includes a defect mark, a previous link device identifier, a second link device identifier, and a next link device identifier.
[0067] The client sends the link data, the link data, the digital signature of the second link device, and the digital signature of the previous link device to the data link smart contract;
[0068] The data link smart contract determines whether to write the link data, link data and device digital signature of the second link into the blockchain based on the link data, and / or link data, and / or the digital signature of the device in the previous link, and / or the digital signature of the device in the second link to realize a trusted data chain.
[0069] Furthermore, the data link smart contract determines whether to write the link data, link data and device digital signature of the second link into the blockchain based on the link data, and / or link data, and / or the digital signature of the device of the previous link, and / or the digital signature of the device of the second link, specifically including:
[0070] The data link smart contract queries the device digital identity corresponding to the second link device identifier from the device digital identity smart contract based on the second link device identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the whether invalidation field in the device digital identity is no, it is determined to be a legal device, otherwise it is determined to be an illegal device; and / or,
[0071] The data link smart contract uses the public key to verify the digital signature of the second link device. If the digital signature of the second link device is successfully verified, it is determined to be a legal device, otherwise it is determined to be an illegal device; and / or,
[0072] The data link smart contract queries the device digital identity corresponding to the previous link equipment identifier from the device digital identity smart contract based on the previous link equipment identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the whether invalidation field in the device digital identity is no, it is determined to be a legal device, otherwise it is determined to be an illegal device; and / or,
[0073] The data link smart contract uses the public key to verify the digital signature of the device in the previous link. If the digital signature of the device in the previous link is successfully verified, it is determined to be a legitimate device;
[0074] Based on the judgment result, it will be determined whether the link data, link data and device digital signature of the second link and the device digital signature of the previous link will be written into the blockchain.
[0075] It should be noted that Figure 3The business process diagram of the trusted data chain is shown. The first link includes link data, defect flag, previous link device identification (null value), current link device identification, next link device identification, current link device digital signature and previous link device digital signature (null value). When the next link device identification is different from the current link device identification, it migrates to the next link (second node). The second link includes link data, defect flag, previous link device identification, current link device identification, next link device identification, current link device digital signature and previous link device digital signature. When the next link device identification is different from the current link device identification, it migrates to the next link (third node).
[0076] When in the first stage, the embodiments of this specification can also be implemented by the following method:
[0077] 1.1 Set the device ID of the current link to the trusted data link client ID of this link. Set the device ID of the next link to the trusted data link client ID of the next link, or to the trusted data link client ID of this link. Set the device ID of the previous link to a null value.
[0078] 1.2 The trusted data link client digitally signs the link data, defect mark, previous link device identification, current link device identification, and next link device identification to obtain the current link device digital signature.
[0079] 1.3 The trusted data chain client sends the link data, defect mark, previous link device identification, current link device identification, next link device identification, and current link device digital signature to the data link smart contract.
[0080] 1.4 The data link smart contract queries the device ID of the next link where the data was saved last time based on the business type and item ID in the link data. If the above device ID can be queried and it is different from the current link device ID where the data will be saved this time, it is judged as an illegal data link and the data is refused to be written into the blockchain.
[0081] 1.5 The data link smart contract queries the device digital identity corresponding to the current link device identity from the device digital identity smart contract based on the current link device identity, including: device identity, public key, and whether it is invalid. If the data link smart contract does not query the corresponding device digital identity from the device digital identity smart contract; or the value of the invalidation field in the device digital identity is yes, it is judged as an illegal device and refuses to write data into the blockchain.
[0082] 1.6 The data link smart contract uses the public key obtained in the previous step to verify the digital signature of the device in the current link. If the signature verification fails, it is judged as an illegal device and refuses to write data into the blockchain.
[0083] 1.7 When a device is determined to be legitimate, the data link smart contract will write the link data, defect mark, previous link device ID, current link device ID, next link device ID, and current link device digital signature into the blockchain ledger.
[0084] When in the second stage, the embodiments of this specification can also be implemented by the following method:
[0085] 2.1 When the device identifier of the current link where the data link smart contract last saved data is different from the device identifier of the next link, the data link smart contract automatically enters the next link.
[0086] 2.2 Set the current link device ID to the trusted data chain client ID of this link. Set the next link device ID to the trusted data chain client ID of the next link, or to the trusted data chain client ID of this link. Set the previous link device ID to the current link device ID of the last time the data link smart contract saved data.
[0087] 2.3 When the second link takes over the items from the first link, it is necessary to check whether the physical items are consistent with the data stored on the blockchain. If they are not consistent, the defect flag needs to be set to "yes", and the previous link device needs to digitally sign the link data, defect flag, previous link device ID, current link device ID, and next link device ID to obtain the previous link device digital signature.
[0088] 2.4 The trusted data link client digitally signs the link data, defect mark, previous link device identification, current link device identification, and next link device identification to obtain the current link device digital signature.
[0089] 2.5 The trusted data chain client sends the link data, defect mark, previous link device identification, current link device identification, next link device identification, current link device digital signature, and previous link device digital signature to the data link smart contract.
[0090] 2.6 The data link smart contract queries the next link device ID of the last saved data based on the business type and item ID in the link data. If the next link device ID of the last saved data is different from the current link device ID of the data to be saved this time, it is judged as an illegal data link and the data is refused to be written into the blockchain.
[0091] 2.7 The data link smart contract queries the device digital identity corresponding to the current link device identity from the device digital identity smart contract based on the current link device identity, including: device identity, public key, and whether it is invalid. If the data link smart contract does not query the corresponding device digital identity from the device digital identity smart contract; or the value of the invalidation field in the device digital identity is yes, it is judged as an illegal device and refuses to write data into the blockchain.
[0092] 2.8 The data link smart contract uses the public key obtained in the previous step to verify the digital signature of the device in the current link. If the signature verification fails, it is judged as an illegal device and refuses to write data into the blockchain.
[0093] 2.9 If the item in the previous link is defective, that is, the defect mark is "yes", then the data link smart contract will query the device digital identity corresponding to the previous link equipment identification from the device digital identity smart contract based on the previous link equipment identification, including: device identification, public key, and whether it is invalid. If the data link smart contract does not query the corresponding device digital identity from the device digital identity smart contract; or the value of the invalidation field in the device digital identity is yes, it is judged as an illegal device and refuses to write data into the blockchain.
[0094] 2.10 If the item in the previous link is defective, that is, the defect mark is "yes", then the data link smart contract uses the public key obtained in the previous step to verify the digital signature of the device in the previous link. If the signature verification fails, it is judged as an illegal device and refuses to write data into the blockchain.
[0095] 2.11 When a device is determined to be legitimate, the data link smart contract will write the link data, defect mark, previous link device identification, current link device identification, next link device identification, current link device digital signature, and previous link device digital signature into the blockchain account book.
[0096] When it is necessary to explain, the beneficial effects of the embodiments of this specification include:
[0097] (1) Blockchain verifies the authenticity of terminal collection devices through digital identity verification. Only terminal collection devices that have been registered and have legal digital identities can upload data to the chain, ensuring the legitimacy of the data source.
[0098] (2) Lock the data on the chain through the digital identity of the device and establish an association between the digital identity of the device and the data on the chain to prepare for subsequent big data analysis, counterfeiting identification, accountability and product traceability.
[0099] (III) Throughout the entire supply chain, the digital identity of IoT devices and “interlocking digital signatures” play a key role in the formation of the data value chain and ensuring the authenticity of the data on the chain.
[0100] (IV) This case is not only applicable to the field of commodity circulation, but also to other fields that require secure data transmission and reliable traceability, such as the process of transmitting secret documents or archival documents.
[0101] Figure 4 A structural schematic diagram of a device for implementing a trusted data link is provided for one or more embodiments of this specification. The device includes: a setting unit 1, a collection unit 2, a sending unit 3 and a determination unit 4.
[0102] The setting unit 1 is used for the server to set a unique device digital identity for the client in each link, wherein the server is deployed and runs on the blockchain;
[0103] The collecting unit 2 is used for the client of each link to collect the relevant information of the corresponding link, and to sign the relevant information of the corresponding link through the digital identity of the device to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0104] The sending unit 3 is used for the client of each link to send the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0105] The determination unit 4 is used for the verification smart contract to determine whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain according to the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0106] Figure 5 A schematic diagram of a structure of a device for implementing a trusted data link is provided for one or more embodiments of this specification, including:
[0107] at least one processor; and,
[0108] a memory communicatively connected to the at least one processor; wherein,
[0109] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0110] The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain;
[0111] The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0112] The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0113] The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0114] One or more embodiments of this specification provide a trusted data link implementation medium, storing computer executable instructions, wherein the computer executable instructions are configured to:
[0115] The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain;
[0116] The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data;
[0117] The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server;
[0118] The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain based on the relevant information of the corresponding link and the digital signature of the device to realize a trusted data chain.
[0119] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0120] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0121] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0122] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0123] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0124] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0128] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0129] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0130] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0131] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0132] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0133] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0134] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for implementing a trusted data link, characterized in that: The method comprises: The server sets a unique device digital identity for each client in each link, wherein the server is deployed and runs on the blockchain; The client of each link collects relevant information of the corresponding link, and signs the relevant information of the corresponding link through the device digital identity to obtain the device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data; The client of each link sends the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server; The verification smart contract determines whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain to realize a trusted data chain according to the relevant information of the corresponding link and the digital signature of the device; The device digital identity includes one or more of a device identifier, a public key, and whether it is invalid; The link data includes one or more of business type, item ID, serial number, and item detailed data; The link data includes one or more of a defect mark, a previous link device identifier, a current link device identifier, and a next link device identifier; The link control data includes one or more of the digital signature of the current link device and the digital signature of the previous link device; The verification smart contract includes a device digital identity smart contract and a data link smart contract; The device digital identity smart contract is used to store the device digital identity; The data link smart contract is used to store the link data, the link data and the link control data; When in the first stage, the method further includes: The server sets the current link device identifier to the first link device identifier, and sets the previous link device identifier to a null value; The client digitally signs the link data and the link data to obtain a first link device digital signature, wherein the link data includes a defect flag, a first link device identifier, and a next link device identifier; The client sends the link data, the link data and the first link device digital signature to the data link smart contract; The data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the digital signature of the first link device, so as to realize a trusted data chain; The data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the first link device digital signature, specifically including: The data link smart contract queries the next link device identifier of the last saved data based on the business type and item ID in the link data. If the next link device identifier can be queried and the next link device identifier is the same as the first link device identifier of the data to be saved this time, it is determined to be a legal data link; and / or, The data link smart contract queries the device digital identity corresponding to the first link device identifier from the device digital identity smart contract based on the first link device identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the invalidation field in the device digital identity is no, it is determined to be a legal device; and / or, The data link smart contract uses the public key to verify the digital signature of the first link device. If the digital signature of the first link device is successfully verified, it is determined to be a legitimate device; Based on the judgment result, it will be determined whether the link data, link data and device digital signature of the first link will be written into the blockchain.
2. The method according to claim 1, characterized in that When in the second stage, the method further includes: Set the current link device ID to the second link device ID; The client digitally signs the link data and the link data to obtain a digital signature of the second link device, wherein the link data includes a defect mark, a previous link device identifier, a second link device identifier, and a next link device identifier; The client sends the link data, the link data, the digital signature of the second link device, and the digital signature of the previous link device to the data link smart contract; The data link smart contract determines whether to write the link data, link data and device digital signature of the second link into the blockchain based on the link data, and / or link data, and / or the digital signature of the device in the previous link, and / or the digital signature of the device in the second link to realize a trusted data chain.
3. The method according to claim 2, characterized in that The data link smart contract determines whether to write the link data, link data and device digital signature of the second link into the blockchain based on the link data, and / or link data, and / or the digital signature of the device of the previous link, and / or the digital signature of the device of the second link, specifically including: The data link smart contract queries the device digital identity corresponding to the second link device identifier from the device digital identity smart contract based on the second link device identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the whether invalidation field in the device digital identity is no, it is determined to be a legal device; and / or, The data link smart contract uses the public key to verify the digital signature of the second link device. If the digital signature of the second link device is successfully verified, it is determined to be a legitimate device; and / or, The data link smart contract queries the device digital identity corresponding to the previous link equipment identifier from the device digital identity smart contract based on the previous link equipment identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the invalidation field in the device digital identity is no, it is determined to be a legal device; and / or, The data link smart contract uses the public key to verify the digital signature of the device in the previous link. If the digital signature of the device in the previous link is successfully verified, it is determined to be a legitimate device; Based on the judgment result, it will be determined whether the link data, link data and device digital signature of the second link and the device digital signature of the previous link will be written into the blockchain.
4. A device for implementing a trusted data link, characterized in that: The device comprises: A setting unit, used for the server to set a unique device digital identity for the client in each link, wherein the server is deployed and runs on the blockchain; A collection unit, configured for the client of each link to collect relevant information of the corresponding link, and to sign the relevant information of the corresponding link through the device digital identity to obtain a device digital signature of the corresponding link, wherein the relevant information of the corresponding link includes link data, link data and link control data; A sending unit, used for the client of each link to send the relevant data of the corresponding link and the device digital signature to the verification smart contract of the server; A determination unit, configured to determine whether to write the relevant information of the corresponding link and the digital signature of the device into the blockchain according to the relevant information of the corresponding link and the digital signature of the device, so as to realize a trusted data chain; The device digital identity includes one or more of a device identifier, a public key, and whether it is invalid; The link data includes one or more of business type, item ID, serial number, and item detailed data; The link data includes one or more of a defect mark, a previous link device identifier, a current link device identifier, and a next link device identifier; The link control data includes one or more of the digital signature of the current link device and the digital signature of the previous link device; The verification smart contract includes a device digital identity smart contract and a data link smart contract; The device digital identity smart contract is used to store the device digital identity; The data link smart contract is used to store the link data, the link data and the link control data; When in the first stage, it is specifically used for: The server sets the current link device identifier to the first link device identifier, and sets the previous link device identifier to a null value; The client digitally signs the link data and the link data to obtain a first link device digital signature, wherein the link data includes a defect flag, a first link device identifier, and a next link device identifier; The client sends the link data, the link data and the first link device digital signature to the data link smart contract; The data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the digital signature of the first link device, so as to realize a trusted data chain; The data link smart contract determines whether to write the link data, link data and device digital signature of the first link into the blockchain based on the link data, and / or link data, and / or the first link device digital signature, specifically including: The data link smart contract queries the next link device identifier of the last saved data based on the business type and item ID in the link data. If the next link device identifier can be queried and the next link device identifier is the same as the first link device identifier of the data to be saved this time, it is determined to be a legal data link; and / or, The data link smart contract queries the device digital identity corresponding to the first link device identifier from the device digital identity smart contract based on the first link device identifier. If the data link smart contract queries the corresponding device digital identity from the device digital identity smart contract, and the value of the invalidation field in the device digital identity is no, it is determined to be a legal device; and / or, The data link smart contract uses the public key to verify the digital signature of the first link device. If the digital signature of the first link device is successfully verified, it is determined to be a legitimate device; Based on the judgment result, it will be determined whether the link data, link data and device digital signature of the first link will be written into the blockchain.
5. A device for implementing a trusted data link, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement the method for implementing a trusted data link as described in claim 1.
6. A trusted data link implementation medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer, the method for implementing a trusted data link as claimed in claim 1 can be implemented.
Citation Information
Patent Citations
Fruit and vegetable agricultural product tracing method, device and system based on block chain and storage medium
CN111369267A
Data processing method based on blockchain, terminal and storage medium
CN111506901A