CN110580605B - Electronic warehouse receipt information storage system based on block chain - Google Patents
Electronic warehouse receipt information storage system based on block chain Download PDFInfo
- Publication number
- CN110580605B CN110580605B CN201910857556.5A CN201910857556A CN110580605B CN 110580605 B CN110580605 B CN 110580605B CN 201910857556 A CN201910857556 A CN 201910857556A CN 110580605 B CN110580605 B CN 110580605B
- Authority
- CN
- China
- Prior art keywords
- block chain
- node
- warehouse
- internet
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000005516 engineering process Methods 0.000 claims description 14
- 238000012986 modification Methods 0.000 claims description 6
- 230000004048 modification Effects 0.000 claims description 6
- 238000000034 method Methods 0.000 abstract description 17
- 238000012546 transfer Methods 0.000 abstract description 4
- 230000007246 mechanism Effects 0.000 description 20
- 238000007726 management method Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 230000002457 bidirectional effect Effects 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 3
- 230000006855 networking Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 240000002234 Allium sativum Species 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000004907 flux Effects 0.000 description 2
- 235000004611 garlic Nutrition 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012954 risk control Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/08—Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
- G06Q10/087—Inventory or stock management, e.g. order filling, procurement or balancing against orders
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Economics (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Entrepreneurship & Innovation (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The utility model provides an electronic warehouse receipt information storage system based on block chain, electronic warehouse receipt information storage system based on block chain includes hardware system and software system, hardware system includes at least one independent storage subnet system, owner's hand-held device and one or more internet block chain book keeping accounts node, independent storage subnet system, hand-held device and one or more internet block chain book keeping accounts node all with the internet interconnection. The method utilizes the characteristic that a block chain cannot be modified, provides a credible information storage platform aiming at the characteristic of a warehousing system, stores various goods related information and monitored goods information of a warehouse represented by a warehouse slip into a credible information chain, and provides a bottom data platform support for establishing a trust relationship between all parties of a supply chain and credible transfer of the warehouse slip.
Description
Technical Field
The invention relates to an electronic warehouse slip information storage system, in particular to an electronic warehouse slip information storage system based on a block chain, and belongs to the technical field of warehouse slip information storage.
Background
Logistics warehousing is a key link in modern logistics systems, wherein warehouse storage is an important component of logistics storage. Warehouse storage is the behavior of storing articles in a specific place, the articles are stored and kept through warehousing, in a supply chain, the residence time of goods in a warehouse is the longest, and the warehouse storage is a core node. Only on the basis of trusted warehouse storage can a credit relationship be constructed between supply chains. Various risks may be encountered during storage, such as exchange, theft, damage, etc. Therefore, in the modern warehousing process, warehousing objects are monitored through a large number of internet of things devices such as cameras, vibration sensors and temperature and humidity sensors, so that a large amount of monitoring information is generated, and the purpose is to perform endorsement tasks for owners of goods behind the goods, warehouse receipt transactions and financial features borne behind the goods while the goods are safely stored.
The warehouse receipt is a unique legal property right certificate issued by a warehousing party to a depositor or a goods owner and recording warehoused goods. Treaty law, clause 387, specifies: a "manifest" is a proof of the extraction of the stored goods. The right to pick up the store can be transferred by an inventory person or a slip holder endorsing the slip and signing or stamping it by the custodian. The core foundation of the logistics bill is a credible bill, which not only requires the bill to be credible and untrustworthy, but also requires the stored materials represented by the bill and the storage process to be credible, so that the bill has the characteristics of high safety level such as effectiveness, credibility, untrustworthiness and the like. The storage list is expressed by information with credible storage articles as a core, and the rear of the storage articles is the property right and the transfer relation determined in the form of the storage list. The modern warehousing provides credibility for the stored articles due to a large amount of monitoring information and article storage information. However, when the conventional storage technology is adopted, since the information is theoretically modifiable, the responsibility of each party such as management and property right cannot be cleared, and finally the warehouse bill is not trusted.
The block chain technology is a distributed book technology which appears in recent years, and has the characteristics of decentralization, openness and transparency, no change, no counterfeiting and the like. The characteristics of the block chain determine the characteristics of high safety and reliability, difficulty in counterfeiting, incapability of tampering stored information, traceability and the like, so that if the related information taking the warehouse as a core can be stored in the block chain, the credibility of the block chain is greatly enhanced, a credible and complete monitored goods information chain is established, the establishment of a trust relationship among supply chain participants is facilitated, and the reliability endorsement is carried out on the warehouse bill.
Disclosure of Invention
The invention aims to: the method comprises the steps of utilizing the non-modifiable characteristic of a block chain, providing a credible information storage platform aiming at the characteristic of a warehousing system, storing various goods related information and monitored goods information of a warehouse represented by a warehouse slip as a credible information chain, and providing bottom layer data platform support for establishing a trust relationship among all parties of a supply chain and credible warehouse slip transfer.
In order to realize the purpose, the invention adopts the technical scheme that: an electronic warehouse receipt information storage system based on a block chain comprises a hardware system and a software system, wherein the hardware system comprises one or more independent warehouse sub-network systems, goods owner handheld equipment and one or more internet block chain accounting nodes, and the independent warehouse sub-network systems, the handheld equipment and the one or more internet block chain accounting nodes are all interconnected with an internet; the software system comprises an application layer, an interface layer and a block chain protocol layer, wherein the application layer comprises a warehouse slip platform system and a warehouse management system, the interface layer comprises an information storage interface, and the block chain protocol layer comprises custom warehouse slip storage information, a P2P network infrastructure, a custom consensus mechanism algorithm and a Berkeley DB chain area; furthermore, the block chain-based electronic warehouse receipt information storage system further comprises a CA authentication server which is unique in the whole network, the CA authentication server is interconnected with the internet, and the interface layer further comprises a CA-based entity authentication interface; furthermore, the independent warehousing sub-network system comprises warehousing handheld equipment, an RFID, a camera and a warehousing server/block chain accounting node, wherein the handheld equipment, the RFID and the warehousing server/block chain accounting node are connected through a network to form a relatively independent star-shaped warehousing sub-network system by taking the warehousing server/block chain accounting node as a center, and the warehousing server/block chain accounting node is interconnected with the internet; further, the consensus algorithm adopts a 3-layer architecture including: the system comprises an Internet of things equipment layer, a chain operation layer and a management layer, wherein the Internet of things equipment layer is used for voting through each accounting node, the chain operation layer is used for accounting, and the management layer is used for making a CA identity through a CA authentication server and an Internet block chain accounting node.
The invention has the positive and beneficial technical effects that: according to the storage system and the storage method, the credible storage of the warehousing information is realized by using a block chain technology, a consensus mechanism algorithm aiming at the characteristics of the Internet of things and a credible storage algorithm aiming at the information of the Internet of things are designed on the basis of the open-source bitcoin source code, the network architecture characteristics of a modern warehousing system are combined, the credibility requirement of a supply chain system is met, and the characteristics of non-tamper property, traceability and the like of the block chain are utilized to construct the warehouse storage system based on the block chain. The electronic warehouse receipt information storage system based on the block chain supports various access modes such as a local area network, a mobile network and wifi under the Internet network, supports information acquisition and transmission of various hardware devices such as a handheld device, a camera and a Radio Frequency Identification Radio Frequency Identifier (RFID), and supports various roles in logistics warehouse receipt finance: the goods owner, the warehouse custody, the bank and the like are accessed for inquiry, so that the participating parties can achieve the purpose of risk control.
Drawings
FIG. 1 is a schematic diagram of a network topology according to an embodiment of the present invention;
FIG. 2 is a diagram of a software system framework according to one embodiment of the present invention;
FIG. 3 is a block diagram of a consensus algorithm architecture design according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating registration and authentication of an internet of things device according to an embodiment of the present invention;
FIG. 5 is a flow chart of a consensus algorithm according to one embodiment of the present invention;
FIG. 6 is an overall framework diagram of the consensus algorithm according to one embodiment of the present invention;
FIG. 7 is a flow chart of a two-way acknowledgement mechanism according to an embodiment of the present invention;
fig. 8 is a schematic diagram of preventing network hard forking according to an embodiment of the present invention.
Detailed Description
In order to more fully explain the implementation of the present invention, the following examples are provided, which are merely illustrative of the present invention and do not limit the scope of the present invention.
An electronic warehouse receipt information storage system based on a block chain comprises a hardware system and a software system, wherein the hardware system comprises at least one independent warehousing sub-network system, goods owner handheld equipment and one or more internet block chain accounting nodes, and the independent warehousing sub-network system, the goods owner handheld equipment and the one or more internet block chain accounting nodes are all interconnected with an internet; in this embodiment, a network topology structure as shown in fig. 1 is adopted to support the block chain-based electronic warehouse receipt information storage system provided by the present invention, and a hardware system of this embodiment includes the following main roles: the system comprises a CA authentication server 3 which is unique in the whole network, two relatively independent warehousing sub-network systems 2, a goods owner handheld device 4 and an Internet block chain accounting node 5. The goods owner handheld equipment is intelligent equipment such as a mobile phone or a tablet personal computer and the like which can be networked, and the roles are connected with each other through an Internet network 1 by taking a constructed block chain system as a supporting platform. The warehousing subnetwork system comprises internet of things equipment such as a networking camera 6, warehousing handheld equipment 7 and RFID 11. The warehousing handheld devices can be networking handheld devices such as a PDA (personal digital assistant), a warehousing code scanning handheld terminal and the like, each warehousing subnet can adopt a private network for networking, but a public network interface is connected with the Internet, each warehousing subnet comprises a unique block chain accounting node, the node and an original warehousing traditional database can be located on the same host to form a warehousing server/block chain accounting node 10, and the warehousing server/block chain accounting node is connected with the block chain accounting node in the Internet public network.
The only CA authentication server in the whole network has the following functions: firstly, a main body in the real world is associated with virtual information stored in a block chain in a CA (certificate Authority) registration mode; the second can provide the admission mechanism of the apparatus, and make the apparatus that enters the network have different identities; and the three accounting nodes can adopt double signatures, so that the safety of block chain storage information is improved. A digital authentication server (CA) authenticates and issues a Certificate through a Registration Authority (RA) entity. The function is as follows: a) the entity authentication characteristics of each Internet of things participating device and the warehouse slip transfer participating party are ensured; b) the stored data is encrypted and signed in the data storage and transaction processes, and the added host is verified by using a certificate so as to ensure the reliability, credibility and stability of a private chain; c) when data is inquired and verified, a digital certificate system is used for verifying the signature of the stored data; d) the private key generated in the blockchain is cryptographically signed with a certificate system and enables wallet data export with certificates. e) The private key of the blockchain is encrypted and stored by using a digital certificate technology, so that the risk that the wallet data is possibly lost due to the fact that the private key of a traditional blockchain system is stored in a clear text is overcome.
As shown in a software system framework diagram of fig. 2, the software system provided by the present invention includes an application layer, an interface layer, and a blockchain protocol layer, wherein the application layer includes a warehouse slip platform system and a warehouse management system, the interface layer includes an information storage interface, and the blockchain protocol layer includes custom warehouse slip storage information, P2P network infrastructure, a custom consensus algorithm, and a Berkeley DB chain area;
the block chain protocol layer forms a software system bottom layer, the software system bottom layer utilizes a core framework of a block chain, a Berkeley DB database storage technology is adopted, data are stored according to blocks, a consensus mechanism algorithm is designed, blocks are generated by regularly negotiating a specific accounting host, the blocks are linked by a hash algorithm, the stored data are generated into a Merkle tree by the hash algorithm to facilitate query, an asymmetric key technology of a cryptography technology is utilized for each time of stored data, a private key of a user is used for encrypting and storing the data, a P2P technology is utilized, all transaction and stored data of all users are broadcast to nodes of the whole network, and other nodes verify the validity of the data according to transaction rules.
On the basis of the support of a block chain core technology and a digital certificate technology, the invention redesigns an upper-layer consensus mechanism algorithm, a transaction algorithm and a data query algorithm so as to be more suitable for transaction, storage and query of warehousing information, and finally achieves the aim of effectively endorsement of logistics warehouse receipt finance.
The consensus algorithm of the present embodiment is detailed as follows:
1. consensus mechanism architecture design
The consensus mechanism is a core technology point in a block chain, and a process of agreeing data, behaviors or processes by nodes participating in multiple parties through interaction among the nodes under a preset rule is called consensus. Consensus mechanisms refer to algorithms, protocols, and rules that define a consensus process. The consensus algorithm of the embodiment adopts an RPOS consensus algorithm, i.e., a consensus mechanism that consensus is performed after absolute agreement, and consensus is confirmed.
The consensus algorithm architecture design is shown in fig. 3, and the consensus algorithm adopts a 3-layer architecture design: through an internet of things device layer (voting), a chain operation layer (accounting) and a management layer (CA identity authentication, account book storage, no block generation, no voting participation and chain normal decision), the data storage requirement is reduced, and the block generator randomness is improved. The Internet of things equipment participates in voting through the accounting node.
The following definitions are first made:
device ID: the accounting node and the Internet of things equipment have a unique ID of the whole network, are unsigned integers of 4 bytes, and are uniformly distributed and managed by a management layer;
credit degree of the accounting node: the reliability of the accounting nodes is represented, the credit value of the nodes is increased by 1 in each accounting period, and when the credit value reaches the maximum value, the credit value is not increased;
host node view: the accounting main node broadcasts all information of the whole network, including accounting main node ID, credit degree and voting information, after a negotiation period is finished, each accounting node broadcasts all information of the node;
a full master node view: all host node views constitute a full host node view.
The roles of the layers are described as follows:
and (3) a management layer:
1) the system comprises a CA server, a data center and a data center, wherein the CA server is responsible for issuing digital certificates of Internet of things equipment and a billing main node;
2) allocating and managing accounting main nodes and Internet of things equipment IDs;
and (4) accounting main node:
1) creating blocks when accounting rights are obtained according to a consensus algorithm,
2) verifying the validity of the generated block according to a consensus algorithm;
3) forwarding the broadcast information;
4) broadcasting voting information of the Internet of things equipment;
5) broadcasting a full host node view to the associated Internet of things equipment;
6) each accounting main node has a credit degree, each consensus period, and if the accounting main nodes are normally online, the credit degree is increased by one;
7) each warehouse entry maintains at least one link-layer accounting node.
2. The Internet of things equipment comprises:
1) the Internet of things equipment is various Internet of things equipment added into the warehouse receipt system, such as a monitoring camera, an RFID reader-writer, NVR, handheld equipment and the like;
2) each device registers its block chain address in the management layer, and the management layer assigns a device ID;
3) the voting node acquires a full node view participating in voting and votes according to the full node view;
the internet of things device registration authentication process is shown in fig. 4.
The Internet of things equipment registers to the management layer equipment, and the registration comprises information such as Internet of things equipment numbers of equipment merchants; and after receiving the registration information, the management equipment allocates an equipment ID (4 bytes, unsigned integer) to the Internet of things equipment, stores the ID allocated to the equipment database record and returns equipment ID information.
3. The process of adding the accounting host node, namely the warehousing server/block chain accounting node into the block chain system is as follows:
the accounting host node joining blockchain algorithm is described as follows:
1) applying for a digital certificate to a management layer host;
2) applying for distributing an equipment ID to a management layer host;
3) when the credit degree of the accounting host node added into the main node for the first time is less than 4, no right exists, and the accounting host node can only receive the broadcast of the whole network view and cache the broadcast;
4) every time an accounting period passes, the credit degree is increased by 1;
5) and when the credit degree reaches 5, the credit degree of the accounting host node is not increased any more, and an optimal view is selected from 5 full main node views received in 5 periods in a caching mode to serve as a caching view and participate in the consensus accounting algorithm.
The most complete node optimal view algorithm: in each accounting period, the creation block node negotiated in the previous accounting period broadcasts a full node view, the accounting host node broadcasts evaluation on the creation block node negotiated in the previous accounting period, and in 5 rounds, the full node view broadcasted by the creation block node with the optimal evaluation is the optimal full node view.
4. Establishing consensus mechanism algorithm description
The consensus algorithm is a periodically running algorithm, and the overall framework is divided into a voting period, a negotiation period and a block creating period as shown in fig. 5. The flow of each cycle in the consensus algorithm is shown in fig. 6.
1) Voting period
The main functions are as follows: internet of things equipment voting accounting node.
Firstly, the accounting main node broadcasts the ID of each node in the view of the whole main node in the last creation block period to the associated Internet of things equipment, the Internet of things equipment randomly votes to select one accounting main node ID according to the node whole network accounting node ID, and the information is transmitted to the associated accounting main node;
2) negotiation period
The main functions are as follows: in the negotiation period, each accounting node broadcasts accounting node information in the whole network, each node obtains consistent information, each accounting main node firstly compares the view of the whole network obtained by the node with the view of the whole main node broadcasted by the accounting main node of the last creation block, if the views of the whole network obtained by the node and the view of the whole main node broadcasted by the accounting main node of the last creation block are inconsistent, the credit degree of the accounting main node of the last creation block is evaluated to be 0, otherwise, the credit degree of the node is evaluated to be 1.
Each billing master node needs to broadcast the following:
(1) voting information of each internet of things device: ID corresponding to the Internet of things and voting accounting node ID thereof;
(2) a billing master node view;
(3) and obtaining the ID and the credit degree of the accounting main node of the created block in the previous round of the accounting main node evaluation.
The key message in the period of the round is a message broadcasting algorithm, and in order to prevent broadcast storm and consider the resource consumption of the accounting main node, the message broadcasting adopts two schemes:
(1) when the size is small, the message may be cryptographically signed with a certificate obtained from the CA;
(2) when the size is large, all messages are broadcast directly.
3) Creating block periods
The period is divided into two parts, wherein one part is that according to the whole network view, all accounting main nodes negotiate out consistent accounting main nodes for creating blocks according to an election algorithm; and secondly, the accounting main node for obtaining the right of creating the block creates the block and broadcasts the block, and other main nodes verify the validity of the block.
The negotiation creation block master node algorithm is as follows:
(1) participating in creating block accounting node conditions:
the credit degree of the accounting main node is greater than 5, the number of votes of the obtained internet-of-things equipment is greater than a certain threshold value, for example, 80% of the total internet-of-things equipment, and the threshold value can be selected according to actual conditions;
(2) randomly selecting a created block accounting node from accounting nodes which are conditionally involved in created block election according to a uniform random selection algorithm;
(3) the accounting main node acquiring the accounting right creates a block, adds own signature information at the head of the block, and broadcasts the block to the whole network after creating the block;
other accounting master node algorithms are as follows:
(1) when a block is received and created, firstly verifying whether a negotiation result node exists or not according to the block header information, and if not, discarding the block;
(2) verifying the encrypted signature message, and if the verification is unsuccessful, setting the credibility of the node to-1000 (a great negative value, aiming to prevent the node from creating a block);
(3) each accounting node sets the credit degree of the block creation node to be 4 in the whole network view of the node, so as to prevent the node from continuously creating blocks;
(4) if the block is not created by the block creating node in the period, all other nodes set the credit degree of the node to be 0, and the negotiation is restarted.
5. The bidirectional determination mechanism:
as shown in fig. 7, the consensus algorithm adopts a bidirectional validation mechanism, which comprises the following steps:
(1) after the accounting main node is negotiated in the round, the created block node is considered as a high-reliability node, the accounting main node which obtains the power of creating the block broadcasts a full node view except the created block, and other host nodes verify the validity of the created block according to a unified negotiation algorithm;
(2) after each node receives the broadcast information, the ID of the created block nodes admitted by all nodes in the whole network is counted and the reliability is evaluated, so that most admitted created block nodes are confirmed to be legal created block nodes, and the last block is confirmed to be a credible legal block.
In the two-way confirmation mechanism, the recognition algorithm recognizes that the height of the valid block of a transaction is 2, i.e. the transaction can be confirmed to be a valid block after two blocks are created.
6. And (3) carrying out safety analysis on the consensus mechanism algorithm:
it is assumed that in this network, messages may be lost, corrupted, delayed, sent repeatedly, and that the order of acceptance does not coincide with the order of transmission. Furthermore, the behavior of the accounting node may be arbitrary: the system can join and quit the network at any time, can discard messages, forge messages, stop working and the like, and can also generate various artificial or non-artificial faults. The nodes cannot be completely synchronous considering the delay of the network, and the period is set to consider the redundancy of the network delay.
The consensus mechanism algorithm can effectively solve the following problems:
data consistency is guaranteed;
prevent creating block nodes from being counterfeited;
the method can prevent the bifurcation of a small part of nodes in joint counterfeiting or the hard bifurcation of a small part of nodes due to network reasons;
preventing poor nodes of the network.
(1) Compared with a PBFT consensus mechanism, the consensus algorithm can effectively ensure data consistency, and because the PBFT (practical Byzantine failure Tolerance) adopts a complex state mechanism, a long time is needed to ensure that all nodes reach a consistent view, the consensus algorithm is not suitable for large-scale node consensus, and the time needed for reaching the consensus is greatly increased along with the increase of the scale of the nodes, so that the consensus does not meet the efficiency requirement. The consensus with other nodes is obviously much longer than that of the current Bitcoin network, so that the method is also a theoretical consensus which cannot be put into practical use at present.
The invention adopts a two-way confirmation mechanism of the consensus algorithm, so that the accounting nodes in the whole network can obtain a consistent view in the whole network more quickly: for the initial node, the credit degree is small, no accounting authority exists, only the view broadcasted by the creation block node can be obtained, and in the process, the credibility of the whole network view can be confirmed through the obtained broadcast information confirmed by other accounting nodes to the creation block accounting node, so that when the credit degree reaches the authority of participating in negotiation, the view broadcasted by the creation block node with the highest credibility can be selected as the initial whole network view, and finally, the consistent whole network accounting node view is obtained when the initial accounting node has the authority of participating in the whole network negotiation creation block; for a common node with the accounting authority, when various network reasons are inconsistent with the view of the whole network of other nodes, consistent information can be obtained through the view of the credible creation block broadcast confirmed by other network nodes, so that the node is consistent with the view of other nodes for accounting the whole network; therefore, in each period, the whole network ensures a consistent whole network view information; and network forking can be prevented: when a small part of nodes are jointly counterfeited, bifurcation may occur; or divergence may occur due to partial nodes not being synchronized with other networks due to various network failures. At this time, through a bidirectional confirmation mechanism, the accounting node creates the block accounting node by counting the last round of period negotiation considered as legal by all the nodes, and finally, the block chain is merged into a unified block chain.
(2) Hard forking for preventing network failure
As shown in fig. 8, when a network failure occurs, the failed network elects node B as the create block node and the normal network elects node a as the create block node while creating blocks, so that hard forking of the block chain occurs. In the next period, node a obtains the number of confirmed nodes as being the created block nodes confirmed by most network negotiations as 4, and node B obtains the number of confirmed votes as 2 as being the created block nodes confirmed by few network negotiations. Therefore, the block created by B is an illegal block, and in a faulty network, node B, node C, and node D will discard the forked block created by node B, and the block chain is unified with the legal block chain created by a. Meanwhile, B, C, D accounting nodes in the fault network also obtain view information consistent with the whole network through the whole network view broadcasted by the node A, and negotiate the creation block nodes consistent with the whole network in the subsequent consensus period.
(3) And (3) preventing nodes with poor network states and malicious nodes:
the credibility of the node which is added into the network for the first time is 0, and no election participation right exists, so that the node is prevented from stopping working and the node with poor network state is prevented; if the negotiated creating block node cannot create blocks due to various reasons in a period, each node sets the credit degree of the creating block node to be 0 and starts the next round of negotiation, so that the nodes with bad network states are forbidden from participating in the block creating right in a certain time; for those malicious nodes, if the node which can not pass signature authentication directly sets the credibility to be-1000, the high-risk node prevents the possibility of doing malicious work for a long time.
7. In practical application, the circulation information requirement of the warehouse slip information is not a pure digital exchange process, the numbers in the warehouse are associated with the goods information, namely, the transaction of information assets is combined, the combination and separation of the assets of different information need to be processed according to specific rules, for example, garlic warehouse slips with the same quality can be combined, garlic warehouse slips with different qualities cannot be combined after being separated, and as the goods of the supporting warehouse slips are stored in the warehouse, a large amount of information for monitoring the warehouse is inevitably contained, such as the related information of goods received by RFID and information collected by various sensors such as video and vibration alarms. These information formats are different and need to be considered for different storage requirements. The information has the characteristic of only storing but not trading, and the purpose is mainly to clear the responsibility and source tracing problem source of all aspects of custody, owners, transporters and the like when the stored goods are damaged, stolen and unpredictable natural disasters occur. Thus, the information is not tamperproof and loses its effectiveness once it is proven to be modifiable.
To this end, the information in the original blockchain source code that stores the pure digital "coins" is extended to represent the bills and other new classes using object-oriented techniques. The block chain source code is added with the warehouse bill ID and the character string type for storing warehouse bill information, and the following modifications are mainly made:
1)class CAmount
{
int64_ t m _ nNum// number
string m _ string Key, key value, bin list invariant information, and may also store the log
string m _ string Stationary// variable information
int64_ t m _ nRecordTime// record time, store Log, etc
int64_t m_HashValue;
……
Meanwhile, the object-oriented technology is utilized, and the operations of adding, subtracting, comparing and the like of the type are overloaded according to the trading rules of the bill, so that the method is suitable for the operation of trading the bill and generating the wallet information.
2) Modification of transaction types
In order to adapt to the requirements of different types of circulation, transaction rules are modified, monitoring information such as logs is only stored but not traded, and the electronic bill can be traded, so that different transaction types are set as follows:
enum class TRANSACTION_TYPE:uint8_t
{
TRANSACTION_NONE = 0x00,
transition _ LOG = 0x01,// the first 16 bits being 0 indicates non-tradable data
Transition _ exchangeable _ INIT = 0x10,// the first 16 bits greater than 0 being of tradable type, the second bit representing a different state of that type
COINBASE = 0 xff// pure digital currency type transaction
};
The transaction types can be generally classified into 3 types, a non-transactable type, an electronic-bill transaction type, and a pure digital-coin type transaction.
And defining transaction types in the transaction class CTRANSACTION, and realizing different transaction rules according to different transaction types during transaction.
8. Examples testing: the system development is based on an open source software Bitcoin Core 0.14 version and C + +11 development, an operating system platform is Ubuntu 17.0 based on a Linux kernel, a compiler is gcc 7.2, and a block database adopts Berkeley DB 5.0.
The operating system of a server renting an Arry cloud is Linux serving as a CA server, the host rents two servers with operating systems of Ubuntu distributed in different areas in the Tencent cloud and the Arry cloud respectively to serve as block chain accounting nodes stored in a public network, and one local Ubuntu serves as a block chain accounting node simulating a local warehouse. The purpose is to test the data communication performance of the block chain accounting nodes in different networks.
The consensus algorithm shown in 3.2 was used with a consensus period of 30 s.
Based on analysis, the information amount of a common electronic bill is 2Kbytes, and based on the extension information containing the bill and a certain redundancy amount, the size of an electronic bill is simulated to be 4 Kbytes.
The experimental analysis is shown in Table 1
For information storage of internet of things equipment in warehousing, considering the characteristic of block chain distributed storage, video information with large internal storage capacity is unrealistic, and the information is stored for this reason: the NVR stores the check code of the file information machine, and the RFID only stores the warning information of goods vibration, so that the information quantity stored by the Internet of things equipment every time is small, and according to measurement and calculation, the information quantity stored by the Internet of things equipment every time is about 250bytes, and then a block chain information storage experiment is as shown in the following table 2:
as can be seen from table 1, the transaction flux of the blockchain to the warehouse slip is stabilized at about 13.4, as can be seen from table 2, the transaction flux of the storage internet of things information can be stabilized at about 120tps, based on the analysis of dozens of warehouses, a ten thousand square meters large warehouse system, the warehouse slip transaction generated in one day can be at most 100 bills, and the generated internet of things equipment information is averagely 2000 bills per day, and through the analysis and the test, the designed blockchain storage system can sufficiently meet the requirement that thousands of large warehouse systems are added to the blockchain system at the same time, and the requirement of actual warehousing work is met.
After the embodiments of the present invention have been described in detail, it will be apparent to those skilled in the art that various changes and modifications can be made without departing from the spirit and scope of the invention, and it is intended that all simple modifications, equivalent changes and modifications made to the above embodiments based on the technical spirit of the present invention shall fall within the technical scope of the present invention, and the present invention shall not be limited to the embodiments illustrated in the description.
Claims (3)
1. An electronic warehouse receipt information storage system based on a block chain is characterized in that: the block chain-based electronic warehouse receipt information storage system comprises a hardware system and a software system, wherein the hardware system comprises one or more independent warehousing sub-network systems, goods owner handheld equipment and one or more Internet block chain accounting nodes, and the one or more independent warehousing sub-network systems, the goods owner handheld equipment and the one or more Internet block chain accounting nodes are all interconnected with the Internet; the software system comprises an application layer, an interface layer and a block chain protocol layer, wherein the application layer comprises a warehouse slip platform system and a warehouse management system, the interface layer comprises an information storage interface, and the block chain protocol layer comprises custom warehouse slip storage information, a P2P network infrastructure, a custom consensus algorithm and a Berkeley DB chain area; the custom consensus algorithm adopts a 3-layer architecture comprising the following: the system comprises an Internet of things equipment layer, a chain operation layer and a management layer, wherein the Internet of things equipment layer is used for voting through each accounting node, the chain operation layer is used for accounting, the management layer performs CA identity authentication and account book storage through a CA authentication server and an Internet block chain accounting node, and the management layer does not generate a block and does not participate in voting and a chain normal decision; by using an object-oriented technology, the information of the pure digital currency stored in the original block chain source code is expanded into a class representing the warehouse bill, the warehouse bill ID and the character string type for storing the warehouse bill information are added in the block chain source code, and the following modifications are made: adding int 64-t m-nNum as a number character string, and adding string m-string key value as warehouse bill information or a storage log character string; adding string m _ string Stationary as a variable information character string; adding int64_ t m _ nRecordTime as recording time, storing a log string; in order to adapt to the requirements of different types of circulation, transaction rules are modified, and three different transaction types are set: the transaction rules comprise a non-transaction type, an electronic bill transaction type and a pure digital currency type transaction, and different transaction rules are realized according to different transaction types during transaction.
2. The block chain-based electronic manifest information storage system of claim 1, wherein: the electronic warehouse receipt information storage system based on the block chain further comprises a CA authentication server which is unique in the whole network, the CA authentication server is interconnected with the internet, and the interface layer further comprises an entity authentication interface based on the CA.
3. The block chain-based electronic manifest information storage system of claim 1, wherein: the independent warehousing sub-network system comprises handheld equipment, an RFID, a camera and a warehousing server, wherein the handheld equipment, the RFID and the warehousing server are connected through a network and form a relatively independent star-shaped warehousing sub-network system by taking the warehousing server as a center, and the warehousing server is interconnected with the internet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910857556.5A CN110580605B (en) | 2019-09-11 | 2019-09-11 | Electronic warehouse receipt information storage system based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910857556.5A CN110580605B (en) | 2019-09-11 | 2019-09-11 | Electronic warehouse receipt information storage system based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110580605A CN110580605A (en) | 2019-12-17 |
CN110580605B true CN110580605B (en) | 2022-06-24 |
Family
ID=68812816
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910857556.5A Active CN110580605B (en) | 2019-09-11 | 2019-09-11 | Electronic warehouse receipt information storage system based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110580605B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111464499A (en) * | 2020-03-06 | 2020-07-28 | 深圳壹账通智能科技有限公司 | Electronic warehouse receipt tracing method and device, computer equipment and storage medium |
CN111461622B (en) * | 2020-04-17 | 2021-12-07 | 支付宝(杭州)信息技术有限公司 | Block chain-based warehouse credit rating, result acquisition and verification method and device |
CN113112368A (en) * | 2021-04-26 | 2021-07-13 | 北京金玖银玖数字科技有限公司 | Block chain-based warehouse receipt circulation method and device |
CN113221192B (en) * | 2021-05-11 | 2023-03-31 | 支付宝(杭州)信息技术有限公司 | Block chain-based digital asset processing method and device |
CN115293769B (en) * | 2022-10-08 | 2022-12-27 | 中铱数字科技有限公司 | Dynamic management and check node system based on block chain |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107301522A (en) * | 2017-06-26 | 2017-10-27 | 深圳前海华深安信物联技术有限公司 | A kind of warehouse receipt system and application method based on block chain |
-
2019
- 2019-09-11 CN CN201910857556.5A patent/CN110580605B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110580605A (en) | 2019-12-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110570308B (en) | Block chain-based electronic warehouse receipt transaction system with incentive mechanism | |
CN110580605B (en) | Electronic warehouse receipt information storage system based on block chain | |
CN109360100B (en) | Transaction rapid confirmation method and device based on block chain technology | |
Zhou et al. | Solutions to scalability of blockchain: A survey | |
Jesus et al. | A survey of how to use blockchain to secure internet of things and the stalker attack | |
CN111611315B (en) | Financial big data-oriented multi-fork tree structure block chain integrated optimization storage method | |
CN109711836A (en) | A kind of storage method of transaction, storage network and electronic equipment | |
Avoine | Cryptography in radio frequency identification and fair exchange protocols | |
CN110473106B (en) | Transaction processing method and related device | |
CN109039847A (en) | Method and device for solving block chain whole network message consistency problem by using DMT | |
Zhang et al. | Cycledger: A scalable and secure parallel protocol for distributed ledger via sharding | |
Bilal et al. | Blockchain technology: Opportunities & challenges | |
CN109491965A (en) | The storage method and its network and electronic equipment of purchase sale of electricity contract | |
CN112053271B (en) | Public service platform data evidence management method and system based on block chain | |
CN109493041B (en) | Distributed accounting method and transaction platform based on regional field chain | |
CN114399320A (en) | Bill supply chain anti-counterfeiting traceability system and method based on block chain NFT | |
CN111325547B (en) | Block chain-based digital object full-life-cycle management method | |
CN115987697A (en) | Multi-level information data sharing method and system based on event subscription mechanism | |
Xu et al. | Precision Poverty Alleviation Methods in the Agricultural Field Based upon Wireless Communication Networks and Blockchain | |
CN109660357A (en) | Digital asset register method, verification method, device, equipment and storage medium | |
Yu et al. | Blockchain-based PKI system and its application in Internet of Things | |
Decker | On the scalability and security of bitcoin | |
Luo | Application of Blockchain Technology in Intellectual Property Protection | |
Christofi | Study of consensus protocols and improvement of the Delegated Byzantine Fault Tolerance (DBFT) algorithm | |
Wang et al. | A fast and secured peer-to-peer energy trading using blockchain consensus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231206 Address after: 518000 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong Patentee after: Shenzhen Yinolong Technology Co.,Ltd. Address before: 450007 No. 41 Zhongyuan Road, Zhongyuan District, Zhengzhou City, Henan Province Patentee before: ZHONGYUAN University OF TECHNOLOGY |
|
TR01 | Transfer of patent right |