Disclosure of Invention
The invention provides an inventory management method, an inventory management device, a storage medium and electronic equipment, which enable all parties in an inventory management system to have uniform inventory data so as to carry out inventory management of all channels.
In a first aspect, an embodiment of the present invention provides an inventory management method, including:
acquiring inventory change information, wherein the inventory change information is a change request initiated by any node in a block chain network, and the node of the block chain network at least comprises: a first party node, a second party node and a third party node;
determining inventory data according to the acquired inventory change information, and writing the inventory data into a block chain;
and displaying the inventory data according to the block data in the block chain.
In one possible design, the determining the inventory data according to the acquired inventory modification information includes:
determining first inventory data according to first inventory change information and first original inventory data, wherein the first inventory change information is initiated by the first party node, the first original inventory data is inventory data before the first party node inventory is changed, and the first inventory data is inventory data after the first party node inventory is changed;
determining second inventory data according to the first inventory change information and second original inventory data, wherein the second original inventory data is inventory data before the inventory of the node B is changed, and the second inventory data is inventory data after the inventory of the node B is changed;
and determining third inventory data according to the first inventory change information and third original inventory data, wherein the third original inventory data is inventory data before the inventory of the third party node is changed, and the third inventory data is inventory data after the inventory of the third party node is changed.
In one possible design, the blockchain network includes: the system comprises an application layer, a service layer, a consensus layer, a network service layer and a data layer;
the application layer is provided with a first party node port, a second party node port and a third party node port, wherein the first party node port, the second party node port and the third party node port are respectively used for receiving the inventory change information;
a monitoring port is arranged in the service layer and used for monitoring the first inventory data, the second inventory data and the third inventory data;
the consensus layer is used for unifying the inventory data in the first party node, the second party node and the third party node;
the network service layer is used for providing data transmission service for each node of the block chain network;
the data layer is used for storing the block data.
In one possible design, the first party node port, the second party node port, and the third party node port are all page ports.
In one possible design, the first party node is a consignor node, the second party node is a seller node, and the third party node is a merchant node.
In a second aspect, an embodiment of the present invention further provides an inventory management apparatus, including:
an obtaining module, configured to obtain inventory change information, where the inventory change information is a change request initiated by any node in a blockchain network, and a node of the blockchain network at least includes: a first party node, a second party node and a third party node;
the processing module is used for determining inventory data according to the acquired inventory change information and writing the inventory data into the block chain;
and the display module is used for displaying the inventory data according to the block data in the block chain.
In one possible design, the processing module is specifically configured to:
determining first inventory data according to first inventory change information and first original inventory data, wherein the first inventory change information is initiated by the first party node, the first original inventory data is inventory data before the first party node inventory is changed, and the first inventory data is inventory data after the first party node inventory is changed;
determining second inventory data according to the first inventory change information and second original inventory data, wherein the second original inventory data is inventory data before the inventory of the node B is changed, and the second inventory data is inventory data after the inventory of the node B is changed;
and determining third inventory data according to the first inventory change information and third original inventory data, wherein the third original inventory data is inventory data before the inventory of the third party node is changed, and the third inventory data is inventory data after the inventory of the third party node is changed.
In one possible design, the blockchain network includes: the system comprises an application layer, a service layer, a consensus layer, a network service layer and a data layer;
the application layer is provided with a first party node port, a second party node port and a third party node port, wherein the first party node port, the second party node port and the third party node port are respectively used for receiving the inventory change information;
a monitoring port is arranged in the service layer and used for monitoring the first inventory data, the second inventory data and the third inventory data;
the consensus layer is used for unifying the inventory data in the first party node, the second party node and the third party node;
the network service layer is used for providing data transmission service for each node of the block chain network;
the data layer is used for storing the block data.
In one possible design, the first party node port, the second party node port, and the third party node port are all page ports.
In one possible design, the first party node is a consignor node, the second party node is a seller node, and the third party node is a merchant node.
In a third aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the possible inventory management methods in the first aspect.
In a fourth aspect, an embodiment of the present invention further provides an electronic device, including:
a processor; and the number of the first and second groups,
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform any one of the possible inventory management methods of the first aspect via execution of the executable instructions.
According to the inventory management method, the inventory management device, the inventory management storage medium and the electronic equipment, the inventory change information is obtained firstly, then the inventory data is determined according to the obtained inventory change information, the inventory data is written into the block chain, finally the inventory data is displayed according to the block data in the block chain, different nodes are integrated into a block chain network through a block chain technology, so that all the nodes synchronize the same inventory data, the data fairness, the uniqueness and the consistency of the inventory data in all-channel interaction are effectively protected, the inventory circulation difference is avoided, the synchronization and the accuracy of the inventory circulation are protected, customer complaints are reduced, and the user experience is improved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic diagram illustrating an application scenario of an inventory management method according to an example embodiment of the present invention. As shown in fig. 1, the inventory management method based on the blockchain according to the embodiment of the present invention may be applied to the blockchain network shown in fig. 1, where the blockchain network may include a plurality of nodes, and the nodes may be any one of the supply chains, such as a consignor node, a seller node, and a shipper node.
Fig. 2 is a block chain network architecture diagram of the embodiment shown in fig. 1. As shown in fig. 2, the blockchain network applied by the inventory management method provided in this embodiment includes: an application layer, an extension layer, and a protocol layer. The extension layer specifically includes a service layer and a common layer, and the protocol layer includes a network service layer and a data layer.
The application layer is provided with a first party node port, a second party node port and a third party node port, wherein the first party node port, the second party node port and the third party node port are respectively used for receiving inventory change information. In a possible design, the first node port, the second node port and the third node port can be input through page ports, for example, a Browser/server (Browser/server, B/S for short) mode is used for inventory inquiry, analysis and tracking, a B/S mode is adopted, a block chain framework is combined to store a large amount of transaction and inventory circulation information, each record is orderly linked from back to front, and the method has the characteristics of openness, transparency, no tampering and convenience in tracing, thereby not only enhancing the safety and the usability of a block chain network, but also enhancing the irreducible modification of data. And the application layer provides services, the first party node, the second party node and the third party node carry out transaction and inventory circulation, and the results are displayed to the client.
The service layer is provided with a monitoring port used for monitoring first inventory data, second inventory data and third inventory data corresponding to the first party node, the second party node and the third party node respectively, and the service layer is also provided with a store POS application, a node management, an inventory application and a logistics application.
In addition, the consensus layer is used for unifying inventory data in the nodes of the first party, the nodes of the second party and the nodes of the third party, namely, all nodes in the whole network can reach the agreement of transaction and data. Moreover, the algorithm is used for preventing the consensus attacks such as the Byzantine attack, the Sybil attack, the 51% attack and the like, is called a consensus mechanism, and because the application scenes are different, a plurality of characteristic consensus mechanisms appear in the block chain 2.0. In the embodiment, various stock information, transaction information, sku information and the like can be issued and recorded, and data interaction and processing can be performed with other external systems, so that the application of the retail industry and the manufacturing industry is realized.
The network service layer is used to provide data transmission services for each node of the blockchain network, and specifically, may be based on IP protocol, ARP protocol, RARP protocol, and other protocols to take charge of point-to-point transmission and provide services for the transport layer.
The data layer is used for storing the block data, wherein the data layer is also the bottom layer and is the basis of all other layers, two functions are mainly realized, one is storage of related data, and the other is realization and safety of accounts and transactions. The data storage can be realized in a block mode and a chain structure based on a Merkle tree, and the persistence is realized in a KV database mode, for example, the Etherhouse adopts leveldb. The realization of the account number and the transaction is based on various cryptographic algorithms and technologies such as digital signature, hash function, asymmetric encryption technology and the like, thereby ensuring that the transaction can be safely carried out under the condition of decentralization.
The game interface testing method is described in detail below with several specific implementations.
FIG. 3 is a flow diagram illustrating an inventory management method according to an example embodiment. As shown in fig. 3, the inventory management method provided in this embodiment includes:
step 101, obtaining inventory change information.
Specifically, the inventory change information is a change request initiated by any node in the blockchain network, where the nodes of the blockchain network include: a party a node, a party b node, and a party a node. Alternatively, the first party node may be a consignor node, the second party node may be a seller node, and the third party node may be a merchant node. When the inventory change information is sent to the consignor node, the information of the quantity of the goods spread for the consignor seller can be sent; when the inventory change information is initiated by the seller node, the information of the number of the seller can be sold; and when the inventory change information is sent to the merchant node, the merchant sends the seller goods quantity information. It should be noted that, in this embodiment, the specific form of the inventory modification information is not limited, and only the inventory modification information is ensured to truly reflect the inventory condition and change of each node.
And step 102, determining inventory data according to the acquired inventory change information.
Specifically, after the inventory change information is acquired, the inventory data may be determined according to the acquired inventory change information.
After any node in the blockchain network initiates the inventory change information, other nodes and corresponding inventory information are also changed. Fig. 4 is a schematic flowchart of a possible flow of step 102 in the embodiment shown in fig. 3, and as shown in fig. 4, step 102 in the inventory management method provided in this embodiment may include:
step 1021, determining first inventory data according to the first inventory modification information and the first original inventory data.
Specifically, first inventory data is determined according to first inventory change information and first original inventory data, wherein the first inventory change information is initiated by a first-party node, the first original inventory data is inventory data before the first-party node inventory is changed, and the first inventory data is inventory data after the first-party node inventory is changed.
Step 1022, determining second inventory data according to the first inventory modification information and the second original inventory data.
Specifically, second inventory data is determined according to the first inventory change information and the second original inventory data, wherein the second original inventory data is inventory data before the inventory of the node B is changed, and the second inventory data is inventory data after the inventory of the node B is changed
Step 1023, third inventory data is determined based on the first inventory modification information and the third raw inventory data.
Specifically, third inventory data is determined according to the first inventory change information and third original inventory data, wherein the third original inventory data is inventory data before the third-party node inventory is changed, and the third inventory data is inventory data after the third-party node inventory is changed.
Step 103, writing the inventory data into the block chain.
After determining the inventory data, the inventory data is written into the blockchain. Specifically, the stock data is stored in the tile data of the tile chain, and the tile data is stored in the data layer.
And 104, displaying the inventory data according to the block data in the block chain.
And after the inventory data is written into the blockchain, the inventory data can be displayed according to the block data in the blockchain at the application layer. Namely, the first party node, the second party node and the third party node can obtain inventory data in an interface of an application layer.
In the embodiment, the inventory change information is acquired firstly, then the inventory data is determined according to the acquired inventory change information, the inventory data is written into the block chain, finally the inventory data is displayed according to the block data in the block chain, different nodes are integrated into a block chain network through the block chain technology, so that all the nodes synchronize the same inventory data, the data fairness, the uniqueness and the consistency of the inventory data in the full-channel interaction are effectively protected, the inventory circulation difference is avoided, the synchronization and the accuracy of the inventory circulation are protected, customer complaints are reduced, and the user experience is improved. In addition, due to the expandability of the block chain network, the management mode performed by using the inventory management method provided by the embodiment has strong expandability, and each node can conveniently access to perform inventory chain goods selling.
The following describes a change principle of the inventory data in conjunction with a specific application scenario of the inventory management method provided in this embodiment.
FIG. 5 is a schematic diagram illustrating an application of an inventory management method according to an example embodiment. As shown in fig. 5, in the inventory management method provided in this embodiment, the consignor node, the seller node and the merchant node are all connected to the blockchain network, when the consignor node wants to deliver the inventory to the seller node, the consignor node initiates an inventory change request, writes the blockchain inventory flow and changes thereof into the blockchain, when the seller node finishes receiving the inventory, the blockchain is also written into the blockchain, changes the inventory data are made, and when the merchant node finishes receiving the inventory or completing the order, the inventory data is also modified and written into the blockchain.
FIG. 6 is a control flow diagram illustrating an inventory management method according to an example embodiment. FIG. 7 is another control flow diagram illustrating an inventory management method according to an example embodiment. Specifically, the control flowcharts shown in fig. 6 and 7 are specific processes of inventory change in the first round and the second round, respectively. In actual supply chain management, in order to make the status of each type of inventory more clearly displayed, the actual categories are classified into inventory data, merchant inventory, seller inventory, in-transit inventory, spot inventory, to-be-returned inventory, returned inventory and available inventory.
Fig. 8 is a schematic diagram illustrating a configuration of an inventory management device according to an example embodiment of the invention. As shown in fig. 8, an inventory management device according to an embodiment of the present invention includes:
an obtaining module 201, configured to obtain inventory change information, where the inventory change information is a change request initiated by any node in a block chain network, where a node of the block chain network at least includes: a first party node, a second party node and a third party node;
the processing module 202 is configured to determine inventory data according to the acquired inventory change information, and write the inventory data into a block chain;
a display module 203, configured to display the inventory data according to the tile data in the tile chain.
In one possible design, the processing module 202 is specifically configured to:
determining first inventory data according to first inventory change information and first original inventory data, wherein the first inventory change information is initiated by the first party node, the first original inventory data is inventory data before the first party node inventory is changed, and the first inventory data is inventory data after the first party node inventory is changed;
determining second inventory data according to the first inventory change information and second original inventory data, wherein the second original inventory data is inventory data before the inventory of the node B is changed, and the second inventory data is inventory data after the inventory of the node B is changed;
and determining third inventory data according to the first inventory change information and third original inventory data, wherein the third original inventory data is inventory data before the inventory of the third party node is changed, and the third inventory data is inventory data after the inventory of the third party node is changed.
In one possible design, the blockchain network includes: the system comprises an application layer, a service layer, a consensus layer, a network service layer and a data layer;
the application layer is provided with a first party node port, a second party node port and a third party node port, wherein the first party node port, the second party node port and the third party node port are respectively used for receiving the inventory change information;
a monitoring port is arranged in the service layer and used for monitoring the first inventory data, the second inventory data and the third inventory data;
the consensus layer is used for unifying the inventory data in the first party node, the second party node and the third party node;
the network service layer is used for providing data transmission service for each node of the block chain network;
the data layer is used for storing the block data.
In one possible design, the first party node port, the second party node port, and the third party node port are all page ports.
In one possible design, the first party node is a consignor node, the second party node is a seller node, and the third party node is a merchant node.
It should be noted that the inventory management device provided in the embodiment shown in fig. 8 may be used to execute the inventory management method provided in the embodiments shown in fig. 3 to fig. 4, and the specific implementation and technical effects are similar and will not be described again here.
Fig. 9 is a schematic structural diagram of an electronic device shown in accordance with an example embodiment of the present invention. As shown in fig. 9, the electronic device 30 provided in the present embodiment includes:
a processor 301;
a memory 302 for storing a computer program for the processor;
wherein the processor 301 is configured to implement the inventory management method provided by any implementation manner of the foregoing method embodiments by executing the computer program.
The processor 401 is configured to execute the technical solution of any one of the foregoing method embodiments by executing the executable instructions, and the implementation principle and technical effect are similar, which are not described herein again.
The present embodiment also provides a readable storage medium, in which a computer program is stored, and when at least one processor of the electronic device executes the computer program, the electronic device executes the methods provided by the above various embodiments.
The present embodiment also provides a program product comprising a computer program stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the electronic device, and the execution of the computer program by the at least one processor causes the electronic device to implement the methods provided by the various embodiments described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.