Bill of materials data storage method and device, electronic equipment and storage medium
By storing the metadata hash of bill of materials data on a blockchain platform, the problems of easy tampering in centralized storage and low efficiency of cross-enterprise collaboration are solved, and the secure, reliable and efficient transmission of bill of materials data is achieved.
Patent Information
- Application Number
- CN202311269679.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Existing centralized storage methods for storing bill of materials data are prone to tampering, have low efficiency in cross-enterprise data collaboration, are difficult to improve query and parsing performance, and lack data security and credibility.
The metadata of the extracted material list data is hashed to obtain the metadata hash, which is then added to the on-chain data and uploaded to the blockchain platform for storage. The uniqueness of the metadata hash is used to ensure the immutability and trustworthiness of the data.
It improves the reliability of bill of materials data, prevents tampering, enhances data storage and synchronization efficiency, meets the on-chain requirements of different product categories, and achieves efficient cross-enterprise data collaboration.
Smart Images

Figure CN117271516B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device and storage medium for storing bill of materials data. Background Technology
[0002] A Bill of Materials (BOM) is a technical document that defines the structure of a product, also known as a product structure table or product structure tree. In the industrial field, it can be referred to as a "formulation" or "factor list," spanning multiple internal and external aspects of an enterprise, including R&D, manufacturing, supply chain, sales, and service. Therefore, the storage, identification, and protection of BOM data are inherent challenges faced by the manufacturing industry.
[0003] Traditionally, bill of materials (BOM) data is stored using centralized solutions such as Oracle and MySQL. Centralized databases are highly susceptible to tampering due to security vulnerabilities, and it's difficult to trace the perpetrator, the time of the alteration, or the content of the alteration. Cross-enterprise interaction relies solely on mutual trust between companies. Furthermore, traditional cross-enterprise BOM data collaboration still relies on RPC (Remote Procedure Call Protocol) interfaces, which become extremely time-consuming when acquiring large amounts of data. Many manufacturing industries still rely on manual collaboration, lacking digitalization and resulting in very low efficiency. Given the tree-like structure of the BOM, traditional storage methods still involve significant traversal queries, making it difficult to effectively improve query and parsing performance. Analyzing BOM relationships requires complex calculations. In summary, centralized storage methods clearly suffer from various problems, including a lack of trust in data between companies, insufficient data security, time-consuming and laborious cross-enterprise data collaboration, and difficulties in parsing and identifying BOM data. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for storing bill of materials (BOM) data, in order to solve the problem that existing centralized storage methods are prone to tampering with BOM data.
[0005] In a first aspect, embodiments of this application provide a method for storing bill of materials data, applied to a target server, the method comprising:
[0006] Extract the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform to obtain the metadata corresponding to the bill of materials data;
[0007] Perform a hash operation on the metadata to obtain the metadata hash;
[0008] The metadata hash is added to the on-chain data corresponding to the bill of materials data to determine the target on-chain data, and the target on-chain data is uploaded to the blockchain platform for storage.
[0009] Secondly, embodiments of this application provide a bill of materials data storage method applied to a blockchain platform, the method comprising:
[0010] The system receives a data upload request sent by the target server. The data upload request carries target data to be uploaded to the blockchain. The target data to be uploaded to the blockchain is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the upload data corresponding to the bill of materials data.
[0011] Verify the data upload request;
[0012] After successful verification, the target data is stored on the blockchain in the target block corresponding to the target server and synchronized to each block included in the blockchain platform.
[0013] Thirdly, embodiments of this application also provide a bill of materials data storage device, applied to a target server, the device comprising:
[0014] The extraction module is used to extract the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, and obtain the meta data package corresponding to the bill of materials data. The blockchain platform corresponds to multiple servers, and any one of the multiple servers is the target server.
[0015] The processing module is used to perform a hash operation on the metadata data packet to obtain the metadata hash;
[0016] The upload module is used to add the metadata hash to the on-chain data corresponding to the bill of materials data, determine the target on-chain data, and upload the target on-chain data to the blockchain platform for storage.
[0017] Fourthly, embodiments of this application also provide a bill of materials data storage device, applied to a blockchain platform, the device comprising:
[0018] The receiving module is used to receive a data upload request sent by the target server. The data upload request carries target data to be uploaded to the blockchain. The target data to be uploaded to the blockchain is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the on-chain data corresponding to the bill of materials data.
[0019] The verification module is used to verify the data upload request;
[0020] The storage module is used to store the target data on the blockchain into the target block corresponding to the target server after the verification is passed, and synchronize it to each block included in the blockchain platform.
[0021] Fifthly, embodiments of this application provide an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the above-described bill of materials data storage method.
[0022] Sixthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described bill of materials data storage method.
[0023] The embodiments of this application include at least the following technical effects:
[0024] The technical solution of this application embodiment, after determining the bill of materials data to be uploaded to the blockchain platform, extracts the metadata of the bill of materials data, performs a hash operation on the metadata to obtain the metadata hash, and adds the metadata hash to the on-chain data corresponding to the bill of materials data to obtain the target on-chain data to be uploaded to the blockchain platform for storage. As part of the target on-chain data, the metadata hash has a one-to-one correspondence with the metadata. Therefore, if the bill of materials data is tampered with, the metadata hash of the metadata corresponding to the tampered bill of materials data will be inconsistent with the metadata hash stored on the blockchain platform, thereby avoiding the tampering of the bill of materials data and improving the credibility of the bill of materials data. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0026] Figure 1 This is one of the flowcharts illustrating the bill of materials data storage method provided in this application embodiment;
[0027] Figure 2 This is the tree structure between products and components in the bill of materials data in this application embodiment;
[0028] Figure 3 This is a second schematic flowchart of the bill of materials data storage method provided in the embodiments of this application;
[0029] Figure 4 This is a schematic diagram of the structure of the bill of materials data display provided in the embodiments of this application;
[0030] Figure 5 This is a schematic diagram of the bill of materials data display page provided in an embodiment of this application;
[0031] Figure 6 This is one of the structural schematic diagrams of the bill of materials data storage device provided in the embodiments of this application;
[0032] Figure 7 This is a second schematic diagram of the structure of the bill of materials data storage device provided in the embodiments of this application;
[0033] Figure 8 A block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0036] In the various embodiments of this application, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0037] like Figure 1 As shown in the figure, this application provides a bill of materials data storage method, applied to a target server, the method including:
[0038] Step 101: Extract the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform to obtain the metadata corresponding to the bill of materials data.
[0039] A blockchain platform can communicate with multiple servers. Based on the communication connection between the blockchain platform and the servers, the servers can upload data to the blockchain platform for storage, and can also retrieve data stored on the blockchain platform. Any one of these multiple servers is considered the target server.
[0040] For the bill of materials (BOM) data to be uploaded to the blockchain platform, the target server can extract the correspondence between each product and each component in the BOM data through data cleaning operations, thereby obtaining the metadata corresponding to the BOM data. The metadata is used to characterize the association between each product and component in the BOM data. For example, the BOM data to be uploaded to the blockchain platform includes two products (product A and product B). For each product, there is at least one component. For example, product A includes component A1 and component A2, and product B includes component B1, component B2, and component B3. The relationship between products and components is uniquely determined. Then, the target server can extract the correspondence between each product and each component in the BOM data to obtain the correspondence between product A, product B, component A1, component A2, component B1, component B2, and component B3, thereby obtaining the metadata corresponding to the BOM data.
[0041] Step 102: Perform a hash operation on the metadata to obtain the metadata hash.
[0042] After obtaining the metadata corresponding to the bill of materials data, a hash operation is performed on the metadata to obtain the metadata hash. Through the hash operation, the metadata can be transformed into a short and unique hash value.
[0043] Step 103: Add the metadata hash to the on-chain data corresponding to the bill of materials data, determine the target on-chain data, and upload the target on-chain data to the blockchain platform for storage.
[0044] After determining the metadata hash, the on-chain data corresponding to the bill of materials data is obtained, the metadata hash is added to the on-chain data to obtain the target on-chain data, and the target on-chain data is uploaded to the blockchain platform for storage.
[0045] It should be noted that the on-chain data here refers to the data that needs to be uploaded to the blockchain platform for storage, which may include the codes, names, status information, etc. of each product and component in the bill of materials data.
[0046] In this embodiment, after determining the bill of materials data to be uploaded to the blockchain platform, the metadata of the bill of materials data is extracted, and a hash operation is performed on the metadata to obtain the metadata hash. By adding the metadata hash to the on-chain data corresponding to the bill of materials data, the target on-chain data to be uploaded to the blockchain platform for storage is obtained. As part of the target on-chain data, the metadata hash has a one-to-one correspondence with the metadata. Therefore, if the bill of materials data is tampered with, the metadata hash of the metadata corresponding to the tampered bill of materials data will be inconsistent with the metadata hash stored on the blockchain platform, thereby preventing the bill of materials data from being tampered with and improving the credibility of the bill of materials data.
[0047] In an optional embodiment of this application, after obtaining the target on-chain data, the method further includes:
[0048] Obtain the attribute information corresponding to the bill of materials data, wherein the attribute information includes product information corresponding to each product and component information corresponding to each component in the bill of materials data;
[0049] Store the attribute information and the metadata in the storage space corresponding to the target server, and obtain the storage address;
[0050] Add the storage address to the target on-chain data.
[0051] Specifically, after the target server determines the bill of materials (BOM) data to be uploaded to the blockchain platform, it cleans the BOM data to obtain both metadata and attribute information. Attribute information refers to product information for each product and component information for each part included in the BOM data. This attribute information can be stored in the target server's storage space, along with the metadata. The storage address for both the attribute information and metadata is then obtained and added to the target on-chain data. After the target on-chain data is uploaded to the blockchain platform, users on other nodes can access the storage address to retrieve the corresponding attribute information for products or components within the BOM data.
[0052] The above implementation plan achieves the goal of viewing attribute information through storage address by adding the storage address of the attribute information and metadata corresponding to the stored bill of materials data to the target on-chain data. Since it is not necessary to upload the attribute information to the blockchain platform, it can also improve the efficiency of uploading bill of materials data to the blockchain platform and the efficiency of data synchronization between blocks on the blockchain platform.
[0053] In an optional embodiment of this application, before adding the metadata hash to the on-chain data corresponding to the bill of materials data to obtain the target on-chain data, the method further includes:
[0054] Based on preset on-chain requirements, data matching the preset on-chain requirements is extracted from the bill of materials data to obtain the on-chain data corresponding to the bill of materials data.
[0055] Specifically, when the target server determines the bill of materials data that needs to be uploaded to the blockchain platform, it can extract data that matches the preset on-chain requirements from the bill of materials data, thereby obtaining the on-chain data corresponding to the bill of materials data.
[0056] It should be noted that the on-chain requirements differ for different product categories and models. The preset on-chain requirements here refer to the on-chain requirements that match the product category and model corresponding to the bill of materials data. These preset on-chain requirements can be set according to the product category, model, etc., and this application does not impose specific limitations. For example, preset on-chain requirements may include product code, component code, product name, component name, creation time, etc.
[0057] The above-described implementation scheme of this application can determine the on-chain data corresponding to the bill of materials data according to the preset on-chain requirements. This allows the target server to pre-set different on-chain requirements for different products, thereby ensuring that the data uploaded to the blockchain platform can meet the actual usage needs, avoid missing or over-transmitting data, and improve transmission efficiency.
[0058] In an optional embodiment of this application, before extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, the method further includes:
[0059] Receive material information to be uploaded to the blockchain platform;
[0060] Based on preset coding rules, the products, components, and configurations included in the material information are coded respectively, and the obtained product codes are added to the corresponding product information, the obtained component codes are added to the corresponding component information, and the obtained configuration codes are added to the corresponding configuration information.
[0061] Determine the association information consisting of the product code and the component code;
[0062] Based on the product information, component information, configuration information, and association information, determine the bill of materials data corresponding to the material information.
[0063] Specifically, when the target server extracts the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, this bill of materials data needs to be generated by the bill of materials management system configured on the target server based on the material information to be uploaded to the blockchain platform. Therefore, before extracting the correspondence between each product and each component in the bill of materials data, it needs to receive the material information to be uploaded to the blockchain platform. This material information includes product information (including product name and other product-related parameters) for each product, component information (including component name and other component-related parameters) for each component, and configuration information (including configuration type and other configuration-related parameters) for each configuration. Then, based on preset coding rules, the products, components, and configurations included in the material information are coded respectively, and the obtained product codes are added to the corresponding product information, the obtained component codes are added to the corresponding component information, and the obtained configuration codes are added to the corresponding configuration information.
[0064] After coding products and components, the association information composed of product codes and component codes can be determined. This association information is a tree-structured information indexed and linked by codes (product codes and component codes). For example, ... Figure 2 As shown, product 1 includes component 1 and component 2, component 1 includes component 3 and component 4, component 4 includes component 5 and component 6. Based on the above relationships, a tree structure indexed and associated by codes can be obtained.
[0065] Then, based on product information, component information, configuration information, and relationship information, the bill of materials data corresponding to the material information can be determined.
[0066] The above-described implementation scheme of this application, by encoding the products, components and configurations included in the material information, thereby obtaining the bill of materials data, realizes the preprocessing of the material information to be uploaded to the material platform, and obtains the bill of materials data that is convenient for subsequent uploading to the blockchain platform, thus improving the efficiency of data on-chaining.
[0067] In an optional embodiment of this application, before uploading the target on-chain data to the blockchain platform for storage, the method further includes:
[0068] The target on-chain data is encapsulated based on a preset data receiving format.
[0069] Specifically, before uploading the target data to the blockchain platform for storage, the target data needs to be encapsulated based on a preset data receiving format. This encapsulation is done in a data receiving format agreed upon by multiple servers on the blockchain platform, forming a transaction with a specific transaction type, and the transaction type is then marked.
[0070] The above-described implementation scheme of this application, by encapsulating the target on-chain data based on a preset data receiving format, enables the target on-chain data to meet the data format set by the blockchain platform, avoids upload failures, and improves data upload efficiency.
[0071] like Figure 3 As shown in the figure, this application provides a bill of materials data storage method applied to a blockchain platform. The method includes:
[0072] Step 301: Receive a data upload request sent by the target server. The data upload request carries target data to be uploaded to the blockchain. The target data to be uploaded to the blockchain is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the on-chain data corresponding to the bill of materials data.
[0073] A blockchain platform can communicate with multiple servers. Based on the communication connection between the blockchain platform and the servers, the servers can upload data to the blockchain platform for storage, and can also retrieve data stored on the blockchain platform. Any one of these multiple servers is considered the target server.
[0074] The blockchain platform can receive data upload requests sent by the target server, which carry the target data to be uploaded to the blockchain. The target data to be uploaded to the blockchain is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the on-chain data corresponding to the bill of materials data.
[0075] Step 302: Verify the data upload request.
[0076] After receiving a data upload request from the target server, the blockchain platform needs to verify the request. Specifically, it needs to verify the transaction corresponding to sending the data upload request.
[0077] Step 303: After verification, the target on-chain data is stored in the target block corresponding to the target server and synchronized to each block included in the blockchain platform.
[0078] After the data upload request is verified, the blockchain service platform can use its smart contract engine to store the target data onto the target block on the target server and synchronize it to every block within the blockchain platform. For example... Figure 4 As shown, a blockchain platform can include multiple enterprise nodes, with each enterprise node corresponding to one block.
[0079] In this embodiment of the application, the target on-chain data received by the blockchain from the target server includes the metadata hash of the metadata corresponding to the bill of materials data. As part of the target on-chain data, the metadata hash has a one-to-one correspondence with the metadata. Therefore, if the bill of materials data is tampered with, the metadata hash of the metadata corresponding to the tampered bill of materials data will be inconsistent with the metadata hash stored on the blockchain platform. This can prevent the bill of materials data from being tampered with and improve the credibility of the bill of materials data.
[0080] In an optional embodiment of this application, storing the target on-chain data in the target block corresponding to the target server includes:
[0081] The target on-chain data is encapsulated in a Merkle tree structure to obtain the target data;
[0082] The target data is stored in the target block.
[0083] When storing the target data on the blockchain into the target block corresponding to the target server, the target data is encapsulated in a Merkle tree structure by the smart contract engine to obtain the target data, and then the target data is stored into the target block.
[0084] Specifically, receiving target data on the blockchain is equivalent to a transaction. For each transaction, the Merkel tree structure encapsulation process is as follows:
[0085] S1. The contract identifies the on-chain information, i.e. the target on-chain data, based on the transaction type. It then performs a hash calculation on the product code in the identified product to obtain a hash digest, which serves as the Merkle root of the product's Merkle tree and also the root of the product's BOM tree. After generation, the product code is used as the key and the Merkle root is used as the value to store the key-value pair mapping relationship in the contract. This key-value pair is then stored in the on-chain block, i.e., the target block, as the contract execution result of the transaction.
[0086] S2. The contract identifies the BOM relationship based on the transaction type and records the transaction on the blockchain. The first-level BOM relationship is based on the product code as the parent code and the component code as the child code. The second-level relationship is based on the parent component code and the child component code, and so on. If it is a first-level relationship, the corresponding Merkle root is found based on the parent component code. Merkle hash calculation is performed on the parent and child component codes based on the Merkle root to obtain the second Merkle root. That is, the child component code can be found based on the second Merkle root and the parent component code. Merkle calculation is performed layer by layer for the BOM relationship, and the mapping relationship between the parent component code and the Merkle root is recorded on the blockchain as the contract execution result of the BOM relationship transaction.
[0087] The Merkle tree of the BOM is generated as follows:
[0088] Merkel root generation: Tree = NewTree(HASH(“Product Code”), TreeDB);
[0089] Second Merkle tree generation: Tree.Update(“parent part code”, “child part code”);
[0090] Merkle root hash generation and commit: Root = Tree.Commit();
[0091] Sub-part code lookup: Sub-part code = Tree.Get(“parent part code”);
[0092] S3. After being uploaded to the blockchain, the code and Merkle root hash can be obtained by querying the transaction details. The sub-part code can be obtained by Merkle query calculation. By doing so, the BOM tree relationship can be restored.
[0093] S4. Based on the Merkle tree sub-part code query method in S2, set up a method on the chain to obtain sub-part codes by part codes.
[0094] The above implementation scheme of this application encapsulates the uploaded target on-chain data into a Merkle tree structure. Based on the fit between the Merkle tree storage structure and the BOM tree structure, a high degree of restoration of the BOM relationship on the blockchain platform can be achieved.
[0095] In an optional embodiment of this application, the blockchain platform is configured with a bill of materials data display page, and the method further includes:
[0096] By querying each block included in the blockchain platform, the storage address and metadata hash corresponding to each metadata stored on the blockchain platform can be obtained;
[0097] For each piece of metadata, the metadata stored at the storage address is verified using the metadata hash.
[0098] For the metadata that passes verification, the corresponding data list relationship is obtained through Merkel query and displayed on the bill of materials data display page.
[0099] like Figure 4 As shown, each enterprise node in the blockchain system corresponds to a block. When displaying bill of materials (BOM) data, the blockchain system first queries each block on the blockchain platform to obtain the storage address and metadata hash corresponding to each piece of metadata stored on the blockchain platform. Then, for each piece of metadata, the metadata stored at the storage address is verified using the metadata hash. If the verification passes, the corresponding data list relationship is obtained through a Merkel query. This data list relationship is saved to the MySQL database corresponding to each enterprise node in the blockchain platform and finally displayed on the BOM data display page, which can be a web page. Figure 5 The diagram shows a schematic of the Bill of Materials (BOM) data display page. It only shows the BOM relationship for one product. For each product and component in the BOM relationship, the product's attribute information is stored in the storage space corresponding to the server that uploaded the product, and the component's attribute information is stored in the storage space corresponding to the server that uploaded the component. By binding the storage address link (i.e., URL) of the attribute information to the corresponding code (product code or component code), clicking on the product code or component code will redirect to the corresponding product or component's attribute information storage address (URL). The content stored at the address can then be displayed on the details page, allowing users to view the product and component attribute information while viewing the BOM relationship.
[0100] The above-described implementation scheme of this application allows for the querying of each block included in the blockchain platform to obtain all data list relationships stored on the blockchain platform, thereby enabling the display of bill of materials relationships and facilitating the viewing of bill of materials data for each product uploaded to the blockchain platform.
[0101] The above describes the bill of materials data storage method provided by the embodiments of this application. The bill of materials data storage device provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0102] like Figure 6 As shown, this embodiment of the invention also provides a bill of materials data storage device, applied to a target server, the device comprising:
[0103] Extraction module 601 is used to extract the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, and obtain the meta data package corresponding to the bill of materials data. The blockchain platform corresponds to multiple servers, and any one of the multiple servers is the target server.
[0104] The first processing module 602 is used to perform a hash operation on the metadata data packet to obtain the metadata hash.
[0105] The upload module 603 is used to add the metadata hash to the on-chain data corresponding to the bill of materials data, determine the target on-chain data, and upload the target on-chain data to the blockchain platform for storage.
[0106] Optionally, the device further includes:
[0107] The first acquisition module is used to acquire attribute information corresponding to the bill of materials data, wherein the attribute information includes product information corresponding to each product and component information corresponding to each component in the bill of materials data;
[0108] The second acquisition module is used to store the attribute information and the metadata into the storage space corresponding to the target server and to acquire the storage address;
[0109] An add module is used to add the storage address to the target on-chain data.
[0110] Optionally, the device further includes:
[0111] The first determining module is used to extract data that matches the preset on-chain requirements from the bill of materials data, based on preset on-chain requirements, to obtain the on-chain data corresponding to the bill of materials data.
[0112] Optionally, the device further includes:
[0113] The first receiving module is used to receive material information to be uploaded to the blockchain platform;
[0114] The second processing module is used to encode the products, components and configurations included in the material information according to preset encoding rules, and add the obtained product codes to the corresponding product information, the obtained component codes to the corresponding component information, and the obtained configuration codes to the corresponding configuration information.
[0115] The second determining module is used to determine the association information composed of the product code and the component code;
[0116] The third determining module is used to determine the bill of materials data corresponding to the material information based on the product information, the component information, the configuration information, and the association information.
[0117] Optionally, the device further includes:
[0118] The encapsulation module is used to encapsulate the target on-chain data based on a preset data receiving format.
[0119] The bill of materials (BOM) data storage device provided in this application, after determining the BOM data to be uploaded to the blockchain platform, extracts the metadata of the BOM data, performs a hash operation on the metadata to obtain the metadata hash, and adds the metadata hash to the on-chain data corresponding to the BOM data to obtain the target on-chain data to be uploaded to the blockchain platform for storage. As the metadata hash is part of the target on-chain data, since it has a one-to-one correspondence with the metadata, if the BOM data is tampered with, the metadata hash of the metadata corresponding to the tampered BOM data will be inconsistent with the metadata hash stored on the blockchain platform, thereby preventing the BOM data from being tampered with and improving the credibility of the BOM data.
[0120] like Figure 7 As shown, this embodiment of the invention also provides a bill of materials data storage device applied to a blockchain platform, the device comprising:
[0121] The second receiving module 701 is used to receive a data upload request sent by the target server. The data upload request carries target data to be uploaded to the blockchain. The target data to be uploaded to the blockchain is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the upload data corresponding to the bill of materials data.
[0122] Verification module 702 is used to verify the data upload request;
[0123] The storage module 703 is used to store the target on-chain data into the target block corresponding to the target server after the verification is passed, and synchronize it to each block included in the blockchain platform.
[0124] Optionally, the storage module includes:
[0125] The encapsulation submodule is used to encapsulate the target on-chain data using a Merkle tree structure to obtain the target data.
[0126] The storage submodule is used to store the target data into the target block.
[0127] Optionally, the blockchain platform is configured with a bill of materials data display page, and the device further includes:
[0128] The query module is used to query each block included in the blockchain platform to obtain the storage address and metadata hash corresponding to each metadata stored on the blockchain platform.
[0129] The verification module is used to verify the metadata stored at the storage address for each piece of metadata using the metadata hash.
[0130] The display module is used to retrieve the corresponding data list relationship for the verified metadata through Merkel query and display it on the bill of materials data display page.
[0131] The bill of materials data storage device provided in this application includes a metadata hash of the metadata corresponding to the bill of materials data in the target on-chain data sent by the target server received by the blockchain. As part of the target on-chain data, the metadata hash has a one-to-one correspondence with the metadata. Therefore, if the bill of materials data is tampered with, the metadata hash of the metadata corresponding to the tampered bill of materials data will be inconsistent with the metadata hash stored on the blockchain platform. This can prevent the bill of materials data from being tampered with and improve the credibility of the bill of materials data.
[0132] This application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described bill of materials data storage method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here.
[0133] For example, Figure 8 A schematic diagram of the physical structure of an electronic device is shown.
[0134] like Figure 8As shown, the electronic device may include a processor 810, a communication interface 820, a memory 830, and a communication bus 840. The processor 810, communication interface 820, and memory 830 communicate with each other via the communication bus 840. When the electronic device is a target server, the processor 810 can call logical instructions in the memory 830. The processor 810 performs the following steps: extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform to obtain the metadata corresponding to the bill of materials data; performing a hash operation on the metadata to obtain the metadata hash; adding the metadata hash to the on-chain data corresponding to the bill of materials data to determine the target on-chain data, and uploading the target on-chain data to the blockchain platform for storage.
[0135] When the electronic device is a blockchain platform, the processor 810 can call the logic instructions in the memory 830. The processor 810 is used to perform the following steps: receiving a data upload request sent by a target server, wherein the data upload request carries target upload data, wherein the target upload data is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining the metadata corresponding to the bill of materials data, performing a hash operation on the metadata to obtain the metadata hash, and adding the metadata hash to the upload data corresponding to the bill of materials data; verifying the data upload request; after the verification is successful, storing the target upload data in the target block corresponding to the target server, and synchronizing it to each block included in the blockchain platform.
[0136] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0137] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described bill of materials data storage method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0138] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0140] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0143] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0145] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0146] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0147] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A bill of materials data storage method applied to a target server, characterized in that, The method comprises: extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform to obtain metadata corresponding to the bill of materials data; hashing the metadata to obtain a metadata hash; adding the metadata hash to the on-chain data corresponding to the bill of materials data to determine target on-chain data, and uploading the target on-chain data to the blockchain platform for storage; Before extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, the method further comprises: receiving material information to be uploaded to the blockchain platform; based on a preset encoding rule, the product, component and configuration included in the material information are respectively encoded, and the obtained product code is added to the corresponding product information, the obtained component code is added to the corresponding component information, and the obtained configuration code is added to the corresponding configuration information; determine the association information composed of the product code and the component code; the association information is tree structure information indexed and associated by encoding; determine the bill of materials data corresponding to the material information according to the product information, the component information, the configuration information and the association information.
2. The bill of materials data storage method of claim 1, wherein, After obtaining the target on-chain data, the method further comprises: obtaining attribute information corresponding to the bill of materials data, wherein the attribute information comprises product information corresponding to each product in the bill of materials data and component information corresponding to each component; store the attribute information and the metadata in the storage space corresponding to the target server to obtain a storage address; add the storage address to the target on-chain data.
3. The bill of materials data storage method of claim 1, wherein, Before adding the metadata hash to the on-chain data corresponding to the bill of materials data to obtain the target on-chain data, the method further comprises: based on a preset on-chain requirement, extract data matching the preset on-chain requirement from the bill of materials data to obtain on-chain data corresponding to the bill of materials data.
4. The bill of materials data storage method of claim 1, wherein, Before uploading the target on-chain data to the blockchain platform for storage, the method further comprises: based on a preset data receiving format, encapsulate the target on-chain data. 5.A bill of material data storage method applied to a blockchain platform, characterized in that, The method comprises: receiving a data on-chain request sent by a target server, the data on-chain request carrying target on-chain data, wherein the target on-chain data is obtained by the target server extracting the correspondence between each product and each component in the bill of materials data to be uploaded to the blockchain platform, obtaining metadata corresponding to the bill of materials data, hashing the metadata to obtain a metadata hash, and adding the metadata hash to the on-chain data corresponding to the bill of materials data; verify the data on-chain request; after verification, store the target on-chain data in the target block corresponding to the target server, and synchronize to each block included in the blockchain platform.
6. The bill of materials data storage method of claim 5, wherein, storing the target on-chain data in the target block corresponding to the target server comprises: The target data is obtained by performing a Merkel tree structure encapsulation on the target uplink data. The target data is stored in the target block.
7. The bill of materials data storage method of claim 5, wherein, The blockchain platform is configured with a bill of materials data display page, and the method further comprises: Each block included in the blockchain platform is queried one by one to obtain a storage address and metadata hash corresponding to each metadata stored on the blockchain platform; For each metadata, the metadata stored on the storage address is verified through the metadata hash; For the metadata that passes the verification, the data list relationship corresponding to the metadata is obtained through a Merkel query and displayed on the bill of materials data display page.
8. A bill of material data storage apparatus applied to a target server, characterized by, The device comprises: An extraction module configured to extract a corresponding relationship between each product and each component in bill of materials data to be uploaded to a blockchain platform to obtain a metadata package corresponding to the bill of materials data, wherein the blockchain platform corresponds to a plurality of servers, and any server of the plurality of servers is the target server; A processing module configured to perform a hash operation on the metadata package to obtain a metadata hash; A determination uploading module configured to add the metadata hash to uplink data corresponding to the bill of materials data, determine target uplink data, and upload the target uplink data to the blockchain platform for storage; The device further comprises: A first receiving module configured to receive material information to be uploaded to the blockchain platform; A second processing module configured to encode a product, a component, and a configuration included in the material information based on a preset encoding rule, and add a product code obtained to corresponding product information, add a component code obtained to corresponding component information, and add a configuration code obtained to corresponding configuration information; A second determination module configured to determine association relationship information composed of the product code and the component code; the association relationship information is tree structure information indexed and associated by the codes; A third determination module configured to determine bill of materials data corresponding to the material information according to the product information, the component information, the configuration information, and the association relationship information. 9.A bill of material data storage apparatus applied to a blockchain platform, characterized in that, The device comprises: A receiving module configured to receive a data uplink request sent by a target server, the data uplink request carrying target uplink data, wherein the target uplink data is obtained by extracting a corresponding relationship between each product and each component in bill of materials data to be uploaded to the blockchain platform by the target server, performing a hash operation on metadata corresponding to the bill of materials data to obtain a metadata hash, and adding the metadata hash to uplink data corresponding to the bill of materials data; A verification module configured to verify the data uplink request; A storage module configured to, after verification, store the target uplink data in a target block corresponding to the target server and synchronize the target uplink data to each block included in the blockchain platform; The device further comprises: A first receiving module configured to receive material information to be uploaded to the blockchain platform; The second processing module is configured to encode the product, the spare part and the configuration included in the material information based on a preset encoding rule, and add the obtained product encoding to the corresponding product information, add the obtained spare part encoding to the corresponding spare part information, and add the obtained configuration encoding to the corresponding configuration information. The second determining module is configured to determine association information composed of the product encoding and the spare part encoding, and the association information is tree structure information indexed and associated by the encoding. The third determining module is configured to determine bill of material data corresponding to the material information according to the product information, the spare part information, the configuration information and the association information.
10. An electronic device, comprising: A computer program is stored on the computer readable storage medium and is executable on the processor, and the computer program is executed by the processor to implement the steps of the bill of material data storage method according to any one of claims 1 to 4 or 5 to 7.
11. A computer readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium and is executable on the processor, and the computer program is executed by the processor to implement the steps of the bill of material data storage method according to any one of claims 1 to 4 or 5 to 7.
Citation Information
Patent Citations
Blockchain online evidence storage method and system
CN111159651A