A project inventory management method and system based on blockchain
By employing a blockchain-based inventory management approach, utilizing QR code encryption and hash algorithms, the project achieves both security and convenience in inventory management, addressing the shortcomings in security and convenience of existing inventory management technologies, and supporting remote management and rapid querying.
Patent Information
- Application Number
- CN202410904820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing technologies for project inventory management suffer from insufficient security and convenience, particularly in terms of data tampering and remote management.
The project inventory management method adopts a blockchain-based approach. By creating an inventory management table and saving it to the blockchain, QR codes are used to encrypt product information. Combined with hash algorithms and public key encryption technology, the secure transmission of product information and remote access to the inventory management table are achieved, and turnover logs are recorded in real time and stored in an encrypted manner.
It enhances the security and convenience of project inventory management, prevents product information from being stolen and tampered with, supports remote management, and facilitates quick querying of inventory information and traceability.
Smart Images

Figure CN118446625B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of inventory management, and in particular to a project inventory management method and system based on blockchain. Background Art
[0002] A project is an independent one-time or long-term work task that people organize human, material and financial resources through efforts and various methods, according to the relevant planning and arrangement of the business model, in order to achieve the goals defined by quantity and quality indicators. An engineering project is a project with engineering construction as the carrier, which is a one-time engineering construction task as the object of management. It takes buildings or structures as the target output, needs to pay a certain fee, follow a certain procedure, and be completed within a certain time, and should meet quality requirements.
[0003] During the progress of the project, it is necessary to purchase related products. The purchased products need to be stored in the warehouse for use at any time. The number of products stored in the warehouse directly affects the progress of the project. For example, the shortage of a certain type of product may cause the entire project to be unable to move forward and it is necessary to wait for the arrival of the product. If the storage quantity is too large, it will lead to idle waste of resources. Therefore, it is necessary to manage the project inventory.
[0004] Traditionally, project inventory management has adopted the method of manually registering products entering and leaving the warehouse and taking inventory regularly, which is not only time-consuming and labor-intensive, but also prone to errors. With the advancement of technology, electronic tags have emerged, and automatic inventory management is performed by identifying electronic tags. However, the following problems still exist: there is a security risk that the data entering and leaving the warehouse may be tampered with. If the quantity of a product is about to run out but it is tampered with to show that there is still a large amount left, it may directly affect the project schedule. In addition, inventory management cannot be performed remotely, and relevant data needs to be viewed on a computer running locally in the warehouse, which is very inconvenient.
[0005] Therefore, how to provide a blockchain-based project inventory management method and system to improve the security and convenience of project inventory management has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a project inventory management method and system based on blockchain, so as to improve the security and convenience of project inventory management.
[0007] In a first aspect, the present invention provides a project inventory management method based on blockchain, comprising the following steps:
[0008] Step S1: Create an inventory management table and save the inventory management table to the blockchain;
[0009] Step S2: Scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key;
[0010] Step S3: After verifying the signature data using the key, decrypt the ciphertext data to obtain product information;
[0011] Step S4: updating the inventory management table on the blockchain based on the product information, and performing a warehousing operation on the product;
[0012] Step S5: Scan the QR code set on the product to be shipped out of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform a shipping operation on the product;
[0013] Step S6: Record the product in-warehouse and out-warehouse turnover log in real time, and encrypt and store the turnover log;
[0014] Step S7: remotely access the inventory management table through the blockchain to remotely manage the project inventory;
[0015] The step S1 is specifically as follows:
[0016] Create an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the chain operation.
[0017] Furthermore, in step S2, the process of generating the two-dimensional code is specifically as follows:
[0018] Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data;
[0019] Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key;
[0020] A QR code of the corresponding product is generated based on the ciphertext data, signature data and key.
[0021] Furthermore, the step S3 is specifically as follows:
[0022] The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value;
[0023] The first encrypted data block is decrypted by the 3DES algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are concatenated to obtain product information, and the integrity of the product information is checked by the hash value.
[0024] Furthermore, the step S4 is specifically as follows:
[0025] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table;
[0026] The step S5 is specifically as follows:
[0027] Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value;
[0028] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
[0029] Furthermore, the step S6 is specifically as follows:
[0030] A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
[0031] In a second aspect, the present invention provides a project inventory management system based on blockchain, comprising the following modules:
[0032] An inventory management table creation module is used to create an inventory management table and save the inventory management table to the blockchain;
[0033] A QR code scanning module is used to scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key;
[0034] A product information acquisition module, used to verify the signature data using the key and then decrypt the ciphertext data to obtain the product information;
[0035] A warehousing module, used to update the inventory management table on the blockchain based on the product information and perform warehousing operations on the product;
[0036] The outbound module is used to scan the QR code set on the product to be outbound of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform outbound operations on the product;
[0037] A turnover log encryption storage module is used to record the turnover logs of product entry and exit in real time and encrypt and store the turnover logs;
[0038] A remote management module, used to remotely access the inventory management table through the blockchain to remotely manage the project inventory;
[0039] The inventory management table creation module is specifically used for:
[0040] Create an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the chain operation.
[0041] Furthermore, in the two-dimensional code scanning module, the process of generating the two-dimensional code is specifically as follows:
[0042] Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data;
[0043] Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key;
[0044] A QR code of the corresponding product is generated based on the ciphertext data, signature data and key.
[0045] Furthermore, the product information acquisition module is specifically used to:
[0046] The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value;
[0047] The first encrypted data block is decrypted by the 3DES algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are concatenated to obtain product information, and the integrity of the product information is checked by the hash value.
[0048] Furthermore, the warehousing module is specifically used for:
[0049] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table;
[0050] The outbound module is specifically used for:
[0051] Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value;
[0052] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
[0053] Furthermore, the turnover log encryption storage module is specifically used for:
[0054] A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
[0055] The advantages of the present invention are:
[0056] 1. By saving the created inventory management table to the blockchain, and then scanning the QR code set on the product to be put into the warehouse of the project to obtain the ciphertext data, signature data and key, after verifying the signature data with the key, decrypting the ciphertext data to obtain the product information, updating the inventory management table on the blockchain based on the product information and performing the warehousing operation on the product, scanning the QR code set on the product to be shipped out of the project to obtain the product information, updating the inventory management table on the blockchain based on the product information and performing the shipping operation on the product, recording the turnover log of product entry and shipment in real time and encrypting and storing it, remotely accessing the inventory management table through the blockchain to remotely manage the project inventory; that is, setting encryption measures for the QR code carrying product information to prevent the product information from being stolen and tampered with, managing the inventory management table through the blockchain, not only can prevent the inventory management table from being maliciously tampered with, but also remotely access the inventory management table through the blockchain, and record the turnover log in real time during the product entry and shipment process for later traceability, thereby greatly improving the security and convenience of project inventory management.
[0057] 2. By creating an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, you can quickly query product information, inventory quantity, storage area and other information through the inventory management table later, which is convenient for quickly executing outbound operations and better understanding of inventory status, thereby greatly improving the convenience of project inventory management.
[0058] 3. Perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block and a third data block, encrypt the first data block by using the 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using the RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using the IDEA algorithm to obtain a third encrypted data block, encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block and the hash value by using the AES algorithm to obtain ciphertext data; sign the ciphertext data by using the private key to obtain signature data, encrypt the public key by using the ElGamal algorithm to obtain a key, and The QR code is generated based on the data, signature data and key; that is, the product information is encrypted in blocks, and different encryption algorithms are used for different data blocks. The hash value can verify the integrity of the product information, and the public key can verify the signature data and legitimacy. The public key is encrypted by the ElGamal algorithm to avoid being stolen in plain text. At least eight security measures are taken before and after (hash calculation, product information blocking, 3DES algorithm, RSA algorithm, IDEA algorithm, AES algorithm, signature verification, ElGamal algorithm) to prevent the information carried by the QR code from being stolen and tampered with in plain text, which greatly ensures the security of product information and greatly improves the security of project inventory management.
[0059] 4. Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, that is, the inventory management table on the blockchain is legally modified to facilitate the management of the inventory management table.
[0060] 5. Encrypt the turnover log through the ECC algorithm to obtain the first-level encrypted data, perform character mapping on the first-level encrypted data through the preset mapping rules to obtain the second-level encrypted data, segment the second-level encrypted data based on the preset segmentation ratio and swap the order to obtain the third-level encrypted data, encrypt the third-level encrypted data through the BLOWFISH algorithm to obtain the encrypted log, store and distribute the encrypted log, and take at least five security measures (ECC algorithm, mapping rules, segmentation ratio, BLOWFISH algorithm, distributed backup) before and after, which greatly improves the security of the turnover log storage and backup, and facilitates the later traceability. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0062] Figure 1 It is a flow chart of a project inventory management method based on blockchain of the present invention.
[0063] Figure 2 It is a structural schematic diagram of a project inventory management system based on blockchain in the present invention. DETAILED DESCRIPTION
[0064] The overall idea of the technical solution in the embodiments of the present application is as follows: encryption measures are set for the QR code carrying product information to prevent the product information from being stolen and tampered with, and the inventory management table is managed through the blockchain, which can not only prevent the inventory management table from being maliciously tampered with, but also remotely access the inventory management table through the blockchain, and record the turnover log in real time during the product entry and exit process for later traceability, so as to improve the security and convenience of project inventory management.
[0065] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a project inventory management method based on blockchain of the present invention comprises the following steps:
[0066] Step S1: Create an inventory management table and save the inventory management table to the blockchain;
[0067] Step S2: Scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key;
[0068] Step S3: After verifying the signature data using the key, decrypt the ciphertext data to obtain product information;
[0069] Step S4: updating the inventory management table on the blockchain based on the product information, and performing a warehousing operation on the product;
[0070] Step S5: Scan the QR code set on the product to be shipped out of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform a shipping operation on the product;
[0071] Step S6: Record the product in-warehouse and out-warehouse turnover log in real time, and encrypt and store the turnover log;
[0072] Step S7: remotely access the inventory management table through the blockchain to remotely manage the project inventory;
[0073] The step S1 is specifically as follows:
[0074] Create an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the chain operation.
[0075] By creating an inventory management table that includes at least product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, you can quickly query product information, inventory quantity, storage area and other information through the inventory management table later, which facilitates rapid execution of outbound operations and better grasp of inventory status, thereby greatly improving the convenience of project inventory management.
[0076] In step S2, the generation process of the two-dimensional code is specifically as follows:
[0077] Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data;
[0078] Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key;
[0079] A QR code of the corresponding product is generated based on the ciphertext data, signature data and key.
[0080] The product information is hashed to obtain a hash value, the product information is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a 3DES algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block, the third encrypted data block and the hash value are encrypted by an AES algorithm to obtain ciphertext data; the ciphertext data is signed by a private key to obtain signature data, the public key is encrypted by an ElGamal algorithm to obtain a key, and based on the ciphertext data , signature data and key to generate a QR code; that is, the product information is encrypted in blocks, and different data blocks are encrypted with different encryption algorithms. The hash value can verify the integrity of the product information, and the public key can verify the signature data and legitimacy. The public key is encrypted by the ElGamal algorithm to avoid being stolen in plain text. At least eight security measures are taken before and after (hash calculation, product information blocking, 3DES algorithm, RSA algorithm, IDEA algorithm, AES algorithm, signature verification, ElGamal algorithm) to prevent the information carried by the QR code from being stolen and tampered with in plain text, which greatly ensures the security of product information and greatly improves the security of project inventory management.
[0081] The step S3 is specifically as follows:
[0082] The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value;
[0083] The first encrypted data block is decrypted by the 3DES algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are concatenated to obtain product information, and the integrity of the product information is checked by the hash value.
[0084] The step S4 is specifically as follows:
[0085] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table;
[0086] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, thereby achieving legal modifications to the inventory management table on the blockchain and facilitating the management of the inventory management table.
[0087] The step S5 is specifically as follows:
[0088] Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value;
[0089] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
[0090] The step S6 is specifically as follows:
[0091] A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
[0092] When it is necessary to trace the source through the turnover log later, first read the encrypted log, decrypt the encrypted log through the BLOWFISH algorithm to obtain the third-level encrypted data, divide the third-level encrypted data based on the inverse of the preset division ratio and swap the order to obtain the second-level encrypted data, character map the second-level encrypted data through the preset mapping rule to obtain the first-level encrypted data, and decrypt the first-level encrypted data through the ECC algorithm to obtain the turnover log.
[0093] The turnover log is encrypted by the ECC algorithm to obtain the first-level encrypted data, the first-level encrypted data is character mapped by the preset mapping rule to obtain the second-level encrypted data, the second-level encrypted data is segmented based on the preset segmentation ratio and the order is swapped to obtain the third-level encrypted data, the third-level encrypted data is encrypted by the BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up. At least five security measures are taken before and after (ECC algorithm, mapping rule, segmentation ratio, BLOWFISH algorithm, distributed backup), which greatly improves the security of the turnover log storage and backup, and facilitates later tracing.
[0094] A preferred embodiment of a project inventory management system based on blockchain of the present invention includes the following modules:
[0095] An inventory management table creation module is used to create an inventory management table and save the inventory management table to the blockchain;
[0096] A QR code scanning module is used to scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key;
[0097] A product information acquisition module, used to verify the signature data using the key and then decrypt the ciphertext data to obtain the product information;
[0098] A warehousing module, used to update the inventory management table on the blockchain based on the product information and perform warehousing operations on the product;
[0099] The outbound module is used to scan the QR code set on the product to be outbound of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform outbound operations on the product;
[0100] A turnover log encryption storage module is used to record the turnover logs of product entry and exit in real time and encrypt and store the turnover logs;
[0101] A remote management module, used to remotely access the inventory management table through the blockchain to remotely manage the project inventory;
[0102] The inventory management table creation module is specifically used for:
[0103] Create an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the chain operation.
[0104] By creating an inventory management table that includes at least product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, you can quickly query product information, inventory quantity, storage area and other information through the inventory management table later, which facilitates rapid execution of outbound operations and better grasp of inventory status, thereby greatly improving the convenience of project inventory management.
[0105] In the two-dimensional code scanning module, the process of generating the two-dimensional code is specifically as follows:
[0106] Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data;
[0107] Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key;
[0108] A QR code of the corresponding product is generated based on the ciphertext data, signature data and key.
[0109] The product information is hashed to obtain a hash value, the product information is divided into a first data block, a second data block and a third data block, the first data block is encrypted by a 3DES algorithm to obtain a first encrypted data block, the second data block is encrypted by an RSA algorithm to obtain a second encrypted data block, the third data block is encrypted by an IDEA algorithm to obtain a third encrypted data block, the first encrypted data block, the second encrypted data block, the third encrypted data block and the hash value are encrypted by an AES algorithm to obtain ciphertext data; the ciphertext data is signed by a private key to obtain signature data, the public key is encrypted by an ElGamal algorithm to obtain a key, and based on the ciphertext data , signature data and key to generate a QR code; that is, the product information is encrypted in blocks, and different data blocks are encrypted with different encryption algorithms. The hash value can verify the integrity of the product information, and the public key can verify the signature data and legitimacy. The public key is encrypted by the ElGamal algorithm to avoid being stolen in plain text. At least eight security measures are taken before and after (hash calculation, product information blocking, 3DES algorithm, RSA algorithm, IDEA algorithm, AES algorithm, signature verification, ElGamal algorithm) to prevent the information carried by the QR code from being stolen and tampered with in plain text, which greatly ensures the security of product information and greatly improves the security of project inventory management.
[0110] The product information acquisition module is specifically used for:
[0111] The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value;
[0112] The first encrypted data block is decrypted by the 3DES algorithm to obtain a first data block, the second encrypted data block is decrypted by the RSA algorithm to obtain a second data block, the third encrypted data block is decrypted by the IDEA algorithm to obtain a third data block, the first data block, the second data block and the third data block are concatenated to obtain product information, and the integrity of the product information is checked by the hash value.
[0113] The warehousing module is specifically used for:
[0114] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table;
[0115] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, thereby achieving legal modifications to the inventory management table on the blockchain and facilitating the management of the inventory management table.
[0116] The outbound module is specifically used for:
[0117] Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value;
[0118] Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
[0119] The turnover log encryption storage module is specifically used for:
[0120] A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
[0121] When it is necessary to trace the source through the turnover log later, first read the encrypted log, decrypt the encrypted log through the BLOWFISH algorithm to obtain the third-level encrypted data, divide the third-level encrypted data based on the inverse of the preset division ratio and swap the order to obtain the second-level encrypted data, character map the second-level encrypted data through the preset mapping rule to obtain the first-level encrypted data, and decrypt the first-level encrypted data through the ECC algorithm to obtain the turnover log.
[0122] The turnover log is encrypted by the ECC algorithm to obtain the first-level encrypted data, the first-level encrypted data is character mapped by the preset mapping rule to obtain the second-level encrypted data, the second-level encrypted data is segmented based on the preset segmentation ratio and the order is swapped to obtain the third-level encrypted data, the third-level encrypted data is encrypted by the BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up. At least five security measures are taken before and after (ECC algorithm, mapping rule, segmentation ratio, BLOWFISH algorithm, distributed backup), which greatly improves the security of the turnover log storage and backup, and facilitates later tracing.
[0123] In summary, the advantages of the present invention are:
[0124] 1. By saving the created inventory management table to the blockchain, and then scanning the QR code set on the product to be put into the warehouse of the project to obtain the ciphertext data, signature data and key, after verifying the signature data with the key, decrypting the ciphertext data to obtain the product information, updating the inventory management table on the blockchain based on the product information and performing the warehousing operation on the product, scanning the QR code set on the product to be shipped out of the project to obtain the product information, updating the inventory management table on the blockchain based on the product information and performing the shipping operation on the product, recording the turnover log of product entry and shipment in real time and encrypting and storing it, remotely accessing the inventory management table through the blockchain to remotely manage the project inventory; that is, setting encryption measures for the QR code carrying product information to prevent the product information from being stolen and tampered with, managing the inventory management table through the blockchain, not only can prevent the inventory management table from being maliciously tampered with, but also remotely access the inventory management table through the blockchain, and record the turnover log in real time during the product entry and shipment process for later traceability, thereby greatly improving the security and convenience of project inventory management.
[0125] 2. By creating an inventory management table that at least includes product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, you can quickly query product information, inventory quantity, storage area and other information through the inventory management table later, which is convenient for quickly executing outbound operations and better understanding of inventory status, thereby greatly improving the convenience of project inventory management.
[0126] 3. Perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block and a third data block, encrypt the first data block by using the 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using the RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using the IDEA algorithm to obtain a third encrypted data block, encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block and the hash value by using the AES algorithm to obtain ciphertext data; sign the ciphertext data by using the private key to obtain signature data, encrypt the public key by using the ElGamal algorithm to obtain a key, and The QR code is generated based on the data, signature data and key; that is, the product information is encrypted in blocks, and different encryption algorithms are used for different data blocks. The hash value can verify the integrity of the product information, and the public key can verify the signature data and legitimacy. The public key is encrypted by the ElGamal algorithm to avoid being stolen in plain text. At least eight security measures are taken before and after (hash calculation, product information blocking, 3DES algorithm, RSA algorithm, IDEA algorithm, AES algorithm, signature verification, ElGamal algorithm) to prevent the information carried by the QR code from being stolen and tampered with in plain text, which greatly ensures the security of product information and greatly improves the security of project inventory management.
[0127] 4. Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, that is, the inventory management table on the blockchain is legally modified to facilitate the management of the inventory management table.
[0128] 5. Encrypt the turnover log through the ECC algorithm to obtain the first-level encrypted data, perform character mapping on the first-level encrypted data through the preset mapping rules to obtain the second-level encrypted data, segment the second-level encrypted data based on the preset segmentation ratio and swap the order to obtain the third-level encrypted data, encrypt the third-level encrypted data through the BLOWFISH algorithm to obtain the encrypted log, store and distribute the encrypted log, and take at least five security measures (ECC algorithm, mapping rules, segmentation ratio, BLOWFISH algorithm, distributed backup) before and after, which greatly improves the security of the turnover log storage and backup, and facilitates the later traceability.
[0129] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A project inventory management method based on blockchain, characterized by: The steps include: Step S1: Create an inventory management table and save the inventory management table to the blockchain; Step S2: Scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key; Step S3: After verifying the signature data using the key, decrypt the ciphertext data to obtain product information; Step S4: updating the inventory management table on the blockchain based on the product information, and performing a warehousing operation on the product; Step S5: Scan the QR code set on the product to be shipped out of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform a shipping operation on the product; Step S6: Record the product in-warehouse and out-warehouse turnover log in real time, and encrypt and store the turnover log; Step S7: remotely access the inventory management table through the blockchain to remotely manage the project inventory; The step S1 is specifically as follows: Create an inventory management table that includes at least product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the on-chain operation; In step S2, the generation process of the two-dimensional code is specifically as follows: Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data; Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key; Generate a QR code of the corresponding product based on the ciphertext data, signature data and key; The step S3 is specifically as follows: The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value; Decrypting the first encrypted data block by using a 3DES algorithm to obtain a first data block, decrypting the second encrypted data block by using an RSA algorithm to obtain a second data block, decrypting the third encrypted data block by using an IDEA algorithm to obtain a third data block, concatenating the first data block, the second data block, and the third data block to obtain product information, and performing integrity verification on the product information by using the hash value; The step S4 is specifically as follows: Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table; The step S5 is specifically as follows: Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value; Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
2. A project inventory management method based on blockchain as claimed in claim 1, characterized in that: The step S6 is specifically as follows: A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
3. A project inventory management system based on blockchain, characterized by: Includes the following modules: An inventory management table creation module is used to create an inventory management table and save the inventory management table to the blockchain; A QR code scanning module is used to scan the QR code set on the product to be stored in the project, and parse the scanned QR code to obtain ciphertext data, signature data and key; A product information acquisition module, used to verify the signature data using the key and then decrypt the ciphertext data to obtain the product information; A warehousing module, used to update the inventory management table on the blockchain based on the product information and perform warehousing operations on the product; The outbound module is used to scan the QR code set on the product to be outbound of the project to obtain product information, update the inventory management table on the blockchain based on the product information, and perform outbound operations on the product; A turnover log encryption storage module is used to record the turnover logs of product entry and exit in real time and encrypt and store the turnover logs; A remote management module, used to remotely access the inventory management table through the blockchain to remotely manage the project inventory; The inventory management table creation module is specifically used for: Create an inventory management table that includes at least product name, product model, inventory quantity, update date, storage area, production date, manufacturer, and after-sales contact information, and save the inventory management table to the blockchain to perform the on-chain operation; In the two-dimensional code scanning module, the process of generating the two-dimensional code is specifically as follows: Obtain product information including at least a product name, a product model, a production date, a manufacturer, and after-sales contact information, perform hash calculation on the product information to obtain a hash value, divide the product information into a first data block, a second data block, and a third data block, encrypt the first data block by using a 3DES algorithm to obtain a first encrypted data block, encrypt the second data block by using an RSA algorithm to obtain a second encrypted data block, encrypt the third data block by using an IDEA algorithm to obtain a third encrypted data block, and encrypt the first encrypted data block, the second encrypted data block, the third encrypted data block, and the hash value by using an AES algorithm to obtain ciphertext data; Create a pair of public and private keys, sign the ciphertext data using the private key to obtain signature data, and encrypt the public key using the ElGamal algorithm to obtain a key; Generate a QR code of the corresponding product based on the ciphertext data, signature data and key; The product information acquisition module is specifically used for: The secret key is decrypted by the ElGamal algorithm to obtain a public key, the signature data is verified by the public key, and then the ciphertext data is decrypted by the AES algorithm to obtain a first encrypted data block, a second encrypted data block, a third encrypted data block and a hash value; Decrypting the first encrypted data block by using a 3DES algorithm to obtain a first data block, decrypting the second encrypted data block by using an RSA algorithm to obtain a second data block, decrypting the third encrypted data block by using an IDEA algorithm to obtain a third data block, concatenating the first data block, the second data block, and the third data block to obtain product information, and performing integrity verification on the product information by using the hash value; The warehousing module is specifically used for: Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is put into storage based on the storage area updated in the inventory management table; The outbound module is specifically used for: Scan the QR code set on the product to be shipped out of the project to obtain ciphertext data, signature data and key, decrypt the ciphertext data by AES algorithm to obtain the first encrypted data block, the second encrypted data block, the third encrypted data block and hash value; decrypt the first encrypted data block by 3DES algorithm to obtain the first data block, decrypt the second encrypted data block by RSA algorithm to obtain the second data block, decrypt the third encrypted data block by IDEA algorithm to obtain the third data block, splice the first data block, the second data block and the third data block to obtain product information, and perform integrity check on the product information by the hash value; Through the chameleon hash function and key sharing technology, the verification algorithm is jointly executed in a distributed manner to reach a consensus among a preset number of verifiers, and then the inventory management table on the blockchain is updated based on the product information, and the product is shipped out of the warehouse.
4. A blockchain-based project inventory management system as claimed in claim 3, characterized in that: The turnover log encryption storage module is specifically used for: A turnover log is recorded in real time on product entry and exit, the turnover log is encrypted by ECC algorithm to obtain primary encrypted data, the primary encrypted data is character mapped by preset mapping rules to obtain secondary encrypted data, the secondary encrypted data is segmented based on a preset segmentation ratio and the order is swapped to obtain tertiary encrypted data, the tertiary encrypted data is encrypted by BLOWFISH algorithm to obtain an encrypted log, and the encrypted log is stored and distributedly backed up.
Citation Information
Patent Citations
Production management system and method based on block chain
CN110430039A
Multi-server security aggregation system and method based on homomorphic chameleon hash
CN115021891A
Warehouse inventory management accuracy traceability method based on block chain technology
CN116934236A