Method and device for updating industrial chain data based on blockchain
Through the blockchain-based industry chain data update method, the blockchain identification BID is generated and signed, which solves the problem of upstream information loss when product information is updated, realizes the query and security management of full life cycle information, and reduces the cost of enterprise management. cost.
Patent Information
- Application Number
- CN202210957399.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-08-10
AI Technical Summary
In the industrial production process, product information at each stage cannot be updated effectively, resulting in users being unable to obtain information about the entire product life cycle. In particular, different companies cannot modify each other's product information that was not created by the company, resulting in the loss of upstream information.
Using the blockchain-based industry chain data update method, by generating the blockchain identification BID, obtain and sign the BID document of the target product, upload it to the blockchain, link to the target identification of the target product, and update the BID in response Documents are updated to ensure the relevance and security of information at each stage.
It enables users to quickly and accurately query the full life cycle information of target products, reduces the cost of enterprise management of a large number of identifiers, and ensures the security and integrity of information.
Smart Images

Figure CN115277024B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to industrial Internet technology, and in particular to a method and device for updating industrial chain data based on blockchain. Background Art
[0002] In the process of industrial production, with the continuous iteration of the product life cycle, new product data is also generated. Often, new product data is also an important part of product information. Since each stage of the product is often completed by different companies, for example, the finished milk is generally provided by the ranch, then transported by the transportation company, and finally processed by the food company to become the finished milk. Since different companies cannot modify each other's product information that is not created by the company, and when creating product information, companies often only indicate the product-related information generated during their own work, resulting in the loss of product information generated at other stages (such as upstream companies). As a result, when users need to trace the product or query the product information at each stage, they can only query part of the product information at the latest stage, and cannot obtain product information throughout the product life cycle. Summary of the invention
[0003] The disclosed embodiments provide a blockchain-based method and device for updating industrial chain data to solve the problem in the prior art that when product information is updated, upstream information of the product is lost, resulting in users being unable to obtain product information throughout the product life cycle.
[0004] One aspect of an embodiment of the present disclosure provides a method for updating industrial chain data based on blockchain, including: generating a blockchain identifier BID based on preset information; obtaining a BID document generated for a target product, wherein the BID document includes attribute information of the target product; signing the BID document based on a private key in a public-private key pair to obtain a signed BID document; identifying the signed BID document with the blockchain identifier BID, and uploading the signed BID document to the blockchain; linking the blockchain identifier BID to a target identifier of the target product; in response to generating an updated BID document for the target product, obtaining an updated BID of the updated BID document; identifying the updated BID document with the updated BID, and uploading the updated BID document to the blockchain; linking the updated BID to the target identifier.
[0005] According to one aspect of an embodiment of the present disclosure, there is provided a device for updating industrial chain data based on blockchain, including: a generation module, for generating a blockchain identifier BID based on preset information; a first acquisition module, for acquiring a blockchain identifier BID document generated for a target product, wherein the BID document includes attribute information of the target product; a signature module, for signing the BID document based on a private key in a public-private key pair to obtain a signed BID document; a first identification module, for identifying the signed BID document using the blockchain identifier BID and uploading the signed BID document to the blockchain; a first linking module, for linking the blockchain identifier BID to a target identifier of the target product; a response module, for acquiring an updated BID of the updated BID document in response to generating an updated BID document of the target product; a second identification module, for identifying the updated BID document using the updated BID and uploading the updated BID document to the blockchain; and a second linking module, for linking the updated BID to the target identifier.
[0006] According to one aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory for storing a computer program product; and a processor for executing the computer program product stored in the memory, wherein when the computer program product is executed, any of the above-described methods is implemented.
[0007] One aspect of an embodiment of the present disclosure provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, any of the above-mentioned methods is implemented.
[0008] The disclosed embodiment provides a method and device for updating industrial chain data based on blockchain, including: generating a blockchain identifier BID based on preset information; obtaining a blockchain identifier BID document generated for a target product; signing the BID document based on the private key in the public-private key pair to obtain a signed BID document; using the blockchain identifier BID to identify the signed BID document, and uploading the signed BID document to the blockchain; linking the blockchain identifier BID to the target identifier of the target product; in response to generating an updated BID document for the target product, obtaining an updated BID of the updated BID document; using the updated BID to identify the updated BID document, and uploading the updated BID document to the blockchain; linking the updated BID to the target identifier. Thus, in the disclosed embodiment, by linking the updated BID of the updated BID document that identifies the target product with the target identifier of the target product, the user only needs to use the target identifier to query the BID documents of each stage of the target product, thereby realizing a fast and accurate query of all information in the entire life cycle of the target product.
[0009] In addition, in the disclosed embodiment, the BIDs of the BID documents identifying the target product at each stage are associated through a target identifier, so that the downstream enterprise only needs to link the updated BID of the identification update BID document generated in its own production stage to the target identifier, so that the enterprise does not need to manage a large number of BIDs, but only needs to manage the target identifier, saving the manpower and material costs incurred by the enterprise for managing a large number of identifiers; at the same time, because the private key is used to sign the BID documents of each stage, the information in the BID document cannot be changed without the corresponding private key, effectively ensuring the security of the information in the BID documents of each stage of the target product.
[0010] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0012] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0013] Figure 1 This is a flowchart of an embodiment of a method for updating industrial chain data based on blockchain according to an embodiment of the present disclosure;
[0014] Figure 2 is a flowchart of an embodiment of step 100 of the embodiment of the present disclosure;
[0015] Figure 3 A flowchart of another embodiment of a method for updating industrial chain data based on blockchain implemented in the present disclosure;
[0016] Figure 4 A flowchart of another embodiment of the method for updating industrial chain data based on blockchain implemented in the present disclosure;
[0017] Figure 5 A flowchart of one embodiment of step 320 implemented for the present disclosure;
[0018] Figure 6 A flowchart of another embodiment of the method for updating industrial chain data based on blockchain implemented in the present disclosure;
[0019] Figure 7 A schematic diagram of an application example of the blockchain-based industrial chain data updating method implemented in the present disclosure;
[0020] Figure 8 A schematic diagram of another application example of the blockchain-based industrial chain data updating method implemented in the present disclosure;
[0021] Fig. 9 This is a structural diagram of an embodiment of a device for updating industrial chain data based on blockchain in an embodiment of the present disclosure;
[0022] Fig.10 The figure is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. DETAILED DESCRIPTION
[0023] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0024] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0025] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0026] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0027] In addition, the term "and / or" in this disclosure is only a description of the association relationship of the associated target products, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated target products before and after are in an "or" relationship.
[0028] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0029] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0030] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0031] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0032] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0033] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0034] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0035] Figure 1 The flowchart of the method for updating industrial chain data based on blockchain in the embodiment of the present disclosure is shown. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the method for updating industrial chain data based on blockchain in this embodiment includes the following steps:
[0036] Step 100: Generate a blockchain identifier BID based on preset information.
[0037] Among them, BID (Blockchain-based Identifier) is a distributed identity identifier that can be used in the BIF (Blockchain Infrastructure and Facility) blockchain authentication system to uniformly identify trusted personal identities, corporate information, product information, and digital target products. The preset information can be set according to actual conditions.
[0038] Exemplarily, the preset information may include the storage address, encoding type information, encryption type, public-private key, etc. of the BID document. Each production end may correspond to one preset information. The production end of the target product may generate a blockchain identifier BID based on the preset information and the generation rule of the preset identifier. For example, a correspondence between the encoding and the storage address, encoding type information, encryption type, public-private key pair, etc. may be created in advance, and the encoding corresponding to the preset information may be obtained according to the preset information and the correspondence between the encoding and the storage address, encoding type information, encryption type, public-private key pair, etc., and the blockchain identifier BID may be generated according to the structure of the blockchain identifier BID.
[0039] Step 110: Obtain a BID document generated for the target product.
[0040] The target product may be an industrial product or a commercial product, for example, a food product, a car, etc. The BID document includes the attribute information of the target product. The attribute information of the target product is used to characterize the relevant information of the target product. For example, the attribute information of the target product may include the ingredients, raw materials, production information, inspection results, production date, transportation method, storage method, etc. of the target product. The BID document may also include other relevant information of the target product and relevant information of the enterprise such as the survival, processing or transportation of the target product, and the above information may be in the form of text, pictures or videos.
[0041] Exemplarily, each production stage of the target product may correspond to a production end, and each production end may be an enterprise. The production end may create a BID document for the target product it produces, processes or transports. The BID document may be pre-set with a corresponding format. For example, the format of the BID document may include a title and content, and the content may include relevant information of the target product.
[0042] Step 120: Sign the BID document based on the private key in the public-private key pair to obtain a signed BID document.
[0043] The public-private key pair includes a public key and a private key, wherein the private key is used to sign the BID document to encrypt the BID document, and the public key is used to verify the signature formed by the private key in the BID document.
[0044] In one implementation, the target product's production end can generate a public-private key pair based on encryption algorithms such as MD5 and SM2, and upload the public key in the generated public-private key pair to the blockchain, which can use the public key to verify the signature in the uploaded BID document. After the target product's production end generates the target product's BID document, the private key stored on the production end can be used to sign the BID document to obtain a signed BID document.
[0045] Step 130: Use the blockchain identifier BID to identify the signed BID document, and upload the signed BID document to the blockchain.
[0046] Among them, each blockchain identifier BID uniquely identifies a BID document, and the BID document of the target product after the blockchain identifier BID is signed can be uploaded to the blockchain for storage. When the BID document needs to be queried, it can be obtained by parsing the BID that identifies the BID document.
[0047] Exemplarily, the production end of the target product generates a blockchain identifier BID according to preset information, generates a BID document according to the attribute information of the target product, and signs the BID document using the private key of the production end. At the same time, the BID document is identified by the blockchain identifier BID, and the identified BID document is uploaded to the blockchain through the upload service node. The consensus node in the blockchain performs consensus voting and signature verification on the BID document according to the preset consensus strategy and the pre-stored public key of the production end. When the BID document passes the consensus and signature verification, it is copied to each node of the blockchain to complete the storage of the BID document, and the blockchain feedbacks the successful chaining information to the production end.
[0048] Step 140, linking the blockchain identifier BID to the target identifier of the target product.
[0049] The target identifier can be a barcode, a QR code, or a 3D code, etc. The target identifier can be used to link all blockchain identifiers BID of the target product. For example, when the target product is produced or processed for the first time, the production end can use a barcode encoder to generate a barcode as the target identifier, or use a QR code encoder to generate a QR code as the target identifier, and link the blockchain identifier BID of the BID document identifying the target product to the target identifier of the target product.
[0050] Step 150: In response to generating an updated BID document of the target product, obtaining an updated BID of the updated BID document.
[0051] The BID document including the updated attribute data of the target product is used as the updated BID document of the target product. For example, when the target product is further processed, the production end that further processes the target product will generate an updated BID document of the target product and sign the updated BID document. The updated BID can be an updated blockchain identifier BID.
[0052] Step 160: Update the BID document using the updated BID identifier, and upload the updated BID document to the blockchain.
[0053] The BID used to identify the updated BID document is called the updated BID. The BID can be generated according to the preset information. For example, the updated BID of the target product can be generated according to the preset information on the production end. The updated BID of the target product is used to identify the updated BID document of the target product. The updated BID document is uploaded to the blockchain for storage.
[0054] Step 170, link the updated BID to the target identifier.
[0055] The update BID of the update BID document identifying the target product is linked to the target identifier of the target product.
[0056] In the disclosed embodiment, by associating the update BID of the update BID document that identifies the target product with the target identification of the target product, the user can query the BID documents of each stage of the target product only through the target identification, thereby realizing a quick and accurate query of all information in the entire life cycle of the target product. In addition, in the disclosed embodiment, the BID of the BID document that identifies each stage of the target product is associated with a target identification, so that the downstream enterprise only needs to link the update BID of the update BID document generated in its own production stage to the target identification, so that the enterprise does not need to manage a large number of BIDs, but only needs to manage the target identification, saving the human and material costs generated by the enterprise for the management of a large number of identifications; at the same time, because the BID documents of each stage are signed with a private key, the information in the BID document cannot be changed without the corresponding private key, effectively ensuring the security of the information in the BID documents of each stage of the target product.
[0057] In one embodiment of the present disclosure, the blockchain-based industrial chain data updating method of the embodiment of the present disclosure also includes: the target identifier links to at least one sub-target identifier of the target product.
[0058] Each sub-target identifier in the at least one sub-target identifier identifies characteristic information of a BID document of a target product, and the characteristic information includes enterprise information and creation time of the BID document.
[0059] In one embodiment, the sub-target identifier may be a barcode or a QR code, etc., and the sub-target identifier is used to uniquely identify a characteristic information. The characteristic information of the BID document of the target product includes the time when the BID document of the target product is created, and the enterprise information of the enterprise that produces or processes the target product. The enterprise information may include the enterprise name, organization code, enterprise address, etc.
[0060] Exemplarily, the production end of the target product can generate a barcode or a QR code as a sub-target identifier through a barcode encoder or a QR code encoder, generate the characteristic information of the target product according to the creation time and enterprise information of the BID document of the target product, identify the characteristic information using the sub-target identifier of the target product, and link the sub-target identifier of the target product to the target identifier of the target product. When the updated characteristic information of the target product is generated, the production end can generate an updated sub-target identifier, and use the updated sub-target identifier to identify the updated characteristic information, and link the updated sub-target identifier to the target identifier. The characteristic information can be uploaded to the blockchain for storage, or it can be stored on the server.
[0061] In the disclosed embodiment, the characteristic information of the BID document is identified by a sub-target identifier, and the sub-target identifier is linked to the target identifier, so that the user can quickly find the enterprise information of the target product at each stage of production or processing through the target identifier, avoiding the problem of sifting through a large amount of other product information when the user needs the enterprise information of the target product, thereby greatly improving the efficiency of the user in obtaining information.
[0062] In one embodiment of the present disclosure, Figure 2 As shown, step 100 in the embodiment of the present disclosure also includes the following steps:
[0063] Step 101, in response to the preset information including the chain code, encoding type information, encryption type and prefix information, the blockchain identifier BID is obtained according to the processing code, chain code, encoding type information, encryption type and prefix information.
[0064] The preset information can be stored at the production end of the target product. The chain code is used to identify the subchain of the blockchain where the BID document is stored. The blockchain can include a main chain and a subchain (side chain), and each chain code uniquely identifies a subchain. The BID document of the target product can be stored in the main chain or the subchain. Specifically, the chain code is the only code in the blockchain that represents the legitimacy of the subchain. It is a subchain identity code (referred to as chain code) issued by the backbone node for the super node to apply for the chain code. When applying for the chain code, the backbone node needs to submit the industry to which the subchain belongs, the name of the subchain, slogan, introduction, device fingerprint information, routing address (including device IP, port), etc. After the super node passes the review, it issues the chain code with the super node signature to the backbone node. When there is a chain code in the preset information, the BID document is stored in the subchain identified by the chain code. When there is no chain code in the preset information, the BID document is stored in the main chain. The encoding type information includes: the encoding type and the encoding algorithm corresponding to the encoding type. For example, the encoding algorithm can be Base58 or Base64, and the corresponding encoding types are a and b respectively. The encryption type is the encryption type corresponding to the public-private key pair encryption method. The encryption type can be set according to the actual situation. For example, the encryption method of the public-private key pair is SM2, and the corresponding encryption type is 1; the encryption method of the public-private key pair is MD5, and the corresponding encryption type is 2. The prefix information is a fixed setting of the blockchain identifier BID, which is used to form the prefix of the blockchain identifier BID, indicating that the category of the identifier is the blockchain identifier BID. For example, the prefix information can be did:bid.
[0065] The processing code can be created according to the coding type information. Exemplarily, the initial code can be obtained randomly, or the initial code can be generated according to the coding preset rules. For example, the initial code can be generated according to the date, the target product code, the randomly generated code, etc. The initial code can be intercepted according to the coding algorithm in the coding type information, so that the length of the intercepted initial code corresponds to the coding algorithm in the coding type, and the processing code is obtained.
[0066] You can first check whether the preset information includes the chain code. When the preset information includes the chain code, based on the structure of the blockchain identifier BID, the blockchain identifier BID is generated by the processing code, chain code, encoding type in the encoding type information, encryption type and prefix information.
[0067] Exemplarily, the structure of the blockchain identifier BID is as follows:
[0068] Blockchain identifier BID: did: bid: 0a1: 1234563234asd;
[0069] Among them, did:bid is the prefix, 0 is the chain code, a is the encoding type, 1 is the encryption type, and 1234563234asd is the processing code. The BID document identified by the blockchain identifier BID is stored in the subchain with the chain code 0.
[0070] Step 102, in response to the preset information including the encoding type information, the encryption type and the prefix information, the blockchain identifier BID is obtained according to the processing code, the encoding type information, the encryption type and the prefix information.
[0071] Among them, it is detected whether the preset information includes the chain code. When the preset information does not include the chain code, the BID can be generated based on the structure of the blockchain identifier BID, by the processing code, the encoding type in the encoding type information, the encryption type and the prefix information.
[0072] Exemplarily, the structure of the blockchain identifier BID is as follows:
[0073] Blockchain identifier BID: did: bid: a1:1234563234asd;
[0074] Among them, did:bid is the prefix, a is the encoding type, 1 is the encryption type, and 1234563234asd is the processing code. When the preset information does not include the chain code, the BID document identified by the BID generated based on the preset information is stored in the main chain of the blockchain, that is, the blockchain document identified by the blockchain identifier BID is stored in the main chain of the blockchain.
[0075] In one embodiment of the present disclosure, Figure 3 As shown, the method for updating industrial chain data based on blockchain in the disclosed embodiment also includes the following steps:
[0076] Step 200, obtaining the information digest of the public key in the public-private key pair.
[0077] Among them, the public key in the public-private key pair is hashed at the production end to obtain the hash value of the public key, and the hash value of the public key is used as the information summary.
[0078] Step 210, determining the processing code according to the code type information and the information summary.
[0079] Among them, at the production end, the information digest of the public key can be used as the initial code, and the information digest (initial code) can be intercepted according to the coding algorithm in the coding type information in the preset information, so that the length of the intercepted information digest corresponds to the coding algorithm in the coding type. The information digest processed according to the coding algorithm in the coding type information and having a length corresponding to the coding algorithm is used as the processed code.
[0080] In one embodiment of the present disclosure, Figure 4 As shown, the method for updating industrial chain data based on blockchain in the embodiment of the present disclosure also includes the following steps:
[0081] Step 300: receiving a target identifier resolution request sent by a client for obtaining information about a target product.
[0082] The target identifier resolution request includes the target identifier to be resolved. When the user needs information about a target product, the target identifier of the target product can be used as the target identifier to be resolved.
[0083] Step 310: Obtain at least one blockchain identifier BID linked to the target identifier to be resolved as the target BID.
[0084] Among them, the target identifier to be resolved can be resolved to obtain the URL of the BID linked to the target identifier to be resolved, the blockchain identifier BID can be determined according to the URL of the blockchain identifier BID, and the blockchain identifier BID linked to the target identifier to be resolved can be used as the target BID (blockchain identifier).
[0085] Exemplarily, when the target identifier to be resolved is a barcode or a QR code, the target identifier to be resolved can be resolved by a barcode scanner to obtain the blockchain identifier BID linked to the target identifier to be resolved.
[0086] Step 320: Obtain first feedback information of the target identifier resolution request in the blockchain according to the target BID.
[0087] The first feedback information includes: a BID document identified by a target BID. For any target BID, the BID document identified by the target BID can be searched on the blockchain according to the target BID, and the BID document identified by the target BID is used as the first feedback message.
[0088] Step 330: Feedback the first feedback information to the client.
[0089] Among them, the blockchain sends the first feedback message to the client, the client receives the first feedback information, and the user can obtain the attribute information of the target product through the BID document of the target product in the first feedback information.
[0090] In one embodiment of the present disclosure, Figure 5 As shown, step 320 of the embodiment of the present disclosure may include the following steps:
[0091] Step 321: parse the target BID to determine whether the target BID includes a chain code.
[0092] Among them, the target BID can be parsed according to the structure of the BID to determine whether the target BID includes a chain code.
[0093] Step 322: In response to the target BID including the chain code, first feedback information of the target identifier resolution request is obtained on the subchain of the blockchain identified by the chain code based on the target BID.
[0094] Each chain code identifies a subchain of a blockchain. When the target BID includes a chain code, it means that the BID document identified by the target BID is stored on the subchain of the blockchain. The subchain identified by the chain code is determined according to the chain code, and the BID document identified by the target BID is searched on the subchain identified by the chain code, and the BID document identified by the target BID is sent to the client as the first feedback information.
[0095] Step 323, in response to the chain code not existing in the target BID, first feedback information of the target identifier resolution request is obtained on the main chain of the blockchain based on the target BID.
[0096] When the target BID does not include a chain code, it means that the BID document identified by the target BID is stored on the main chain of the blockchain, and the BID document identified by the target BID is searched on the main chain of the blockchain according to the target BID. The BID document identified by the found target BID is sent to the client as the first feedback information.
[0097] In one embodiment of the present disclosure, Figure 6 As shown, the method for updating industrial chain data based on blockchain in the embodiment of the present disclosure also includes the following steps:
[0098] Step 340: Obtain at least one sub-target identifier linked to the target identifier to be resolved as the sub-target identifier to be resolved.
[0099] When the user needs information about the target product, the target product's target identifier to be resolved can be resolved to obtain the sub-target identifier linked to the target identifier to be resolved, and the sub-target identifier linked to the target identifier to be resolved can be used as the sub-target identifier to be resolved. For example, when the target identifier to be resolved is a barcode or a QR code, the target identifier to be resolved can be resolved by a barcode scanner to obtain the sub-target identifier linked to the target identifier to be resolved.
[0100] Step 350: Obtain second feedback information of the target identifier resolution request according to the sub-target identifier to be resolved.
[0101] The second feedback information includes: feature information identified by the sub-target identifier to be resolved. According to the sub-target identifier to be resolved, the feature information identified by the sub-target identifier to be resolved can be obtained on a server or blockchain storing the sub-target identifier to be resolved, and the feature information identified by the sub-target identifier to be resolved can be obtained as the second feedback information.
[0102] Step 360: Feedback the second feedback information to the client.
[0103] The second feedback message is sent to the client, and the client receives the second feedback information. The user can use the feature information of the target product in the second feedback information.
[0104] The following is an application example of the method for updating industrial chain data based on blockchain in the embodiment of the present disclosure, taking milk as an example. Figure 7 and Figure 8 As shown, the following steps are included:
[0105] Step 1: The ranch (production end 1) produces milk, and production end 1 creates a BID (blockchain identifier) based on preset information.
[0106] Step 2, the production end 1 creates a BID document for the milk, which includes: cow information, feed information, milk production date and raw material ingredients of the milk.
[0107] Step 3, the production end 1 uses the private key to sign the BID document to obtain the signed BID document; using the BID to identify the signed BID document, the production end 1 uses a barcode encoder to generate a barcode as a target identifier.
[0108] Step 4: Production terminal 1 uploads the BID document to the blockchain.
[0109] Step 5, the producer 1 links the BID to the target identifier.
[0110] Step 6: The dairy enterprise (production end 2) sterilizes and processes the milk provided by production end 1 to obtain finished milk. Production end 2 creates an updated BID document for the milk. The updated BID document includes: sterilization method, milk ingredients, protein content, bacteria content, production date, and shelf life. Production end 2 creates an updated BID based on the preset information on it.
[0111] Step 7: The production end 2 will update the BID identifier and the BID document, and upload the updated BID document to the blockchain.
[0112] Step 8, the producer 2 updates the BID link to the target identifier.
[0113] Fig. 9 A block diagram of a device for updating industrial chain data based on blockchain in an embodiment of the present disclosure is shown. Fig. 9 As shown, the updating device of the industrial chain data based on blockchain in this embodiment includes:
[0114] A generation module 400, used to generate a blockchain identifier BID based on preset information;
[0115] A first acquisition module 410 is used to acquire a BID document generated for a target product, wherein the BID document includes attribute information of the target product;
[0116] The signature module 420 is used to sign the BID document based on the private key in the public-private key pair to obtain a signed BID document;
[0117] A first identification module 430, configured to identify the signed BID document using the blockchain identifier BID, and upload the signed BID document to the blockchain;
[0118] A first linking module 440, configured to link the blockchain identifier BID to the target identifier of the target product;
[0119] A response module 450 is used for obtaining an updated BID of the updated BID document in response to generating the updated BID document of the target product;
[0120] A second identification module 460, configured to identify the updated BID document using the updated BID, and upload the updated BID document to the blockchain;
[0121] The second linking module 470 is configured to link the update BID to the target identifier.
[0122] In an optional example, the device of the present disclosure also includes: the target identifier is linked to at least one sub-target identifier of the target product, wherein each sub-target identifier of the at least one sub-target identifier respectively identifies characteristic information of the BID document of the target product, and the characteristic information includes enterprise information and creation time of the BID document.
[0123] In an optional example, the generation module 400 of the present disclosure may include:
[0124] The first sub-response module 401 (not shown in the figure) is used to obtain the blockchain identifier BID according to the processing code, the chain code, the encoding type information, the encryption type and the prefix information in response to the preset information including the chain code, the encoding type information, the encryption type and the prefix information, wherein the chain code is used to identify the subchain of the blockchain where the BID document is stored;
[0125] The second sub-response module 402 (not shown in the figure) is used to respond to the preset information including the encoding type information, the encryption type and the prefix information, and obtain the blockchain identifier BID according to the processing code, the encoding type information, the encryption type and the prefix information.
[0126] In an optional example, the apparatus of the present disclosure further includes:
[0127] A second acquisition module 480 (not shown in the figure), configured to acquire an information summary of a public key in the public-private key pair;
[0128] The determination module 490 (not shown in the figure) is used to determine the processing code according to the code type information and the information summary.
[0129] In an optional example, the apparatus of the present disclosure further includes:
[0130] A receiving module 500 (not shown in the figure), configured to receive a target identifier resolution request sent by a client for obtaining information of the target product, wherein the target identifier resolution request includes a target identifier to be resolved;
[0131] A third acquisition module 510 (not shown in the figure) is used to acquire at least one blockchain identifier BID linked to the target identifier to be resolved as a target BID;
[0132] The fourth acquisition module 520 (not shown in the figure) is used to obtain the first feedback information of the target identifier resolution request in the blockchain according to the target BID, wherein the first feedback information includes: the BID document identified by the target BID;
[0133] The first feedback module 530 (not shown in the figure) is configured to feed back the first feedback information to the client.
[0134] In an optional example, the fourth acquisition module 520 described in the present disclosure further includes:
[0135] A parsing submodule 521 (not shown in the figure) is used to parse the target BID and determine whether the target BID includes a chain code;
[0136] The third response submodule 522 (not shown in the figure) is used to obtain the first feedback information of the target identifier resolution request on the subchain of the blockchain identified by the chain code based on the target BID in response to the target BID including the chain code;
[0137] The fourth response submodule 523 (not shown in the figure) is used to obtain the first feedback information of the target identifier resolution request on the main chain of the blockchain based on the target BID in response to the absence of the chain code in the target BID.
[0138] In an optional example, the apparatus of the present disclosure further includes:
[0139] A fifth acquisition module 540 (not shown in the figure), configured to acquire at least one sub-target identifier linked to the target identifier to be resolved as a sub-target identifier to be resolved;
[0140] The sixth acquisition module 550 (not shown in the figure) is used to acquire the second feedback information of the target identifier resolution request according to the sub-target identifier to be resolved, wherein the second feedback information includes: the feature information identified by the sub-target identifier to be resolved;
[0141] The second feedback module 560 (not shown in the figure) is configured to feed back the second feedback information to the client.
[0142] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0143] Memory for storing computer programs;
[0144] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for updating the blockchain-based industrial chain data described in any of the above embodiments of the present disclosure is implemented.
[0145] Fig.10 FIG. 1 is a schematic diagram of a structure of an application embodiment of the electronic device disclosed in the present invention. Fig.10 As shown, the electronic device includes one or more processors 600 and memory 610 .
[0146] The processor 600 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0147] The memory 610 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may run the program instructions to implement the above-described methods for updating industrial chain data based on blockchain and / or other desired functions of the various embodiments of the present disclosure.
[0148] In one example, the electronic device may further include: an input device 620 and an output device 630 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0149] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0150] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0151] Of course, to simplify, Fig.10 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0152] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the blockchain-based industrial chain data updating method according to various embodiments of the present disclosure described in the above part of this specification.
[0153] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including programming languages for target products, such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages . The program code can be executed entirely on the user's computing device, partially on the user's device, as a separate software package, partially on the user's computing device and partially on a remote computing device, or completely on a remote computing device or server.
[0154] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method for updating industrial chain data based on blockchain according to various embodiments of the present disclosure described in the above part of this specification.
[0155] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0156] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0157] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0158] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0159] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0160] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0161] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0162] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0163] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for updating industrial chain data based on blockchain, It is characterized in that include: Generate a blockchain identifier BID based on preset information; Acquire a BID document generated for a target product, wherein the BID document includes attribute information of the target product; Based on the private key in the public-private key pair, the BID document is signed to obtain a signed BID document; Using the blockchain identifier BID to identify the signed BID document, and uploading the signed BID document to the blockchain; Linking the blockchain identifier BID to the target identifier of the target product; In response to generating an updated BID document of the target product, acquiring an updated BID of the updated BID document; Using the updated BID to identify the updated BID document, and uploading the updated BID document to the blockchain; The update BID is linked to the target identification.
2. The method according to claim 1, It is characterized in that Also includes: The target identifier is linked to at least one sub-target identifier of the target product, wherein each sub-target identifier of the at least one sub-target identifier respectively identifies characteristic information of the BID document of the target product, and the characteristic information includes enterprise information and creation time of the BID document.
3. The method according to claim 1 or 2, It is characterized in that The generating of the blockchain identifier BID based on the preset information includes: In response to the preset information including the chain code, the encoding type information, the encryption type and the prefix information, the blockchain identifier BID is obtained according to the processing code, the chain code, the encoding type information, the encryption type and the prefix information, wherein the chain code is used to identify the subchain of the blockchain where the BID document is stored; In response to the preset information including encoding type information, encryption type and prefix information, the blockchain identifier BID is obtained according to the processing code, the encoding type information, the encryption type and the prefix information.
4. The method according to claim 3, It is characterized in that Also includes: Obtaining a summary of the public key in the public-private key pair; The processing code is determined according to the code type information and the information summary.
5. The method according to claim 1 or 2, It is characterized in that Also includes: Receiving a target identifier resolution request sent by a client for obtaining information about the target product, wherein the target identifier resolution request includes a target identifier to be resolved; Obtain at least one blockchain identifier BID linked to the target identifier to be resolved as the target BID; According to the target BID, first feedback information of the target identifier resolution request is obtained in the blockchain, wherein the first feedback information includes: a BID document identified by the target BID; The first feedback information is fed back to the client.
6. The method according to claim 5, It is characterized in that The obtaining, in the blockchain, first feedback information of the target identifier resolution request according to the target BID includes: Parsing the target BID to determine whether the target BID includes a chain code; In response to the target BID including a chain code, obtaining first feedback information of the target identifier resolution request on a subchain of the blockchain identified by the chain code based on the target BID; In response to the chain code not existing in the target BID, first feedback information of the target identifier resolution request is obtained on the main chain of the blockchain based on the target BID.
7. The method according to claim 5, It is characterized in that Also includes: Acquire at least one sub-target identifier linked to the target identifier to be resolved as the sub-target identifier to be resolved; According to the sub-target identifier to be resolved, obtaining second feedback information of the target identifier resolution request, wherein the second feedback information includes: feature information identified by the sub-target identifier to be resolved; The second feedback information is fed back to the client.
8. A device for updating industrial chain data based on blockchain, It is characterized in that include: A generation module, used to generate a blockchain identifier BID based on preset information; A first acquisition module is used to acquire a BID document generated for a target product, wherein the BID document includes attribute information of the target product; A signature module, used to sign the BID document based on the private key in the public-private key pair to obtain a signed BID document; A first identification module, configured to identify the signed BID document using the blockchain identifier BID, and upload the signed BID document to the blockchain; A first linking module, used to link the blockchain identifier BID to the target identifier of the target product; A response module, configured to obtain an updated BID of the updated BID document in response to generating the updated BID document of the target product; A second identification module, configured to identify the updated BID document using the updated BID, and upload the updated BID document to the blockchain; The second linking module is used to link the update BID to the target identifier.
9. An electronic device, It is characterized in that include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data cross-chain transfer method and system based on distributed identity label
CN113850607A
Systems and methods for proving immutability of blockchains
US20210297265A1
Methods and apparatus to control access to user data based on user-specified attributes
US20220121765A1
