CN109345159A - A kind of method for writing data and device, equipment, storage medium - Google Patents
A kind of method for writing data and device, equipment, storage medium Download PDFInfo
- Publication number
- CN109345159A CN109345159A CN201810951860.1A CN201810951860A CN109345159A CN 109345159 A CN109345159 A CN 109345159A CN 201810951860 A CN201810951860 A CN 201810951860A CN 109345159 A CN109345159 A CN 109345159A
- Authority
- CN
- China
- Prior art keywords
- cargo
- information
- address
- block chain
- goods
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/083—Shipping
- G06Q10/0833—Tracking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Economics (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- Entrepreneurship & Innovation (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the invention discloses a kind of method for writing data, which comprises obtains the goods information in detailed list of goods;The address of the corresponding block chain of the goods information is obtained from preconfigured address base according to the goods information;The block chain is written into the goods information according to the address of the block chain.In addition, the embodiment of the invention also discloses a kind of data transfer apparatus, equipment and storage mediums.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data writing method, a data writing device, data writing equipment and a data writing storage medium.
Background
Currently, the purchase, sale and inventory system, as a typical database application, is becoming an indispensable tool in the process of managing goods information by enterprises. The system is developed by adopting an advanced computer technology according to the requirements of enterprises and aiming at solving the problems of disordered accounts, inaccurate inventory, untimely information feedback and the like of the enterprises, and integrates multiple links of stocking, selling and storing.
Generally, the whole process of producing, transporting, storing and selling goods involves the benefits of the producer, the transporter, the seller and so on. Each enterprise has a respective purchase, sale and inventory system, data specifications of goods information recorded by each enterprise are different, heterogeneous problems exist in each data account book, and the problems of high cost, low efficiency and the like exist in mutual cooperation and intercommunication of the data account books.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data writing method, apparatus, device, and storage medium for solving at least one problem in the related art, and aim to implement traceability, verification, and multi-party unification and transparency of data of each link of a cargo by writing cargo information into a block chain.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a data writing method, where the method includes:
acquiring cargo information in a cargo list;
acquiring the address of a block chain corresponding to the cargo information from a pre-configured address library according to the cargo information;
and writing the cargo information into the block chain according to the address of the block chain.
In a second aspect, an embodiment of the present invention provides a data writing apparatus, where the apparatus includes: the device comprises a first acquisition module, a second acquisition module and a data writing module; wherein:
the first acquisition module is configured to acquire cargo information in a cargo list;
the second acquisition module is configured to acquire the address of the block chain corresponding to the cargo information from a pre-configured address library according to the cargo information;
and the data writing module is configured to write the cargo information into the block chain according to the address of the block chain.
In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor implements the steps in the data writing method when executing the program.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the data writing method.
The embodiment of the invention provides a data writing method, which comprises the following steps of firstly, acquiring goods information in a goods list; then, acquiring the address of a block chain corresponding to the cargo information from a pre-configured address library according to the cargo information; and finally, writing the cargo information into the block chain according to the address of the block chain. Therefore, the cargo information of the cargo is written into the block chain, so that enterprises of all parties related to the cargo can manage the cargo information through unified data standards, and the cargo information can be traced, verified, unified and transparent among multiple parties when the cargo circulates in all links.
Drawings
Fig. 1 is a schematic flow chart illustrating an implementation of a data writing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating another implementation of a data writing method according to an embodiment of the present invention;
FIG. 3A is a schematic structural diagram of a purchase-sale-inventory system according to an embodiment of the present invention;
fig. 3B is a schematic diagram of a code implementation structure of a block chain support module according to an embodiment of the present invention;
fig. 3C is a schematic diagram illustrating a functional implementation flow of a block chain support module according to an embodiment of the present invention;
fig. 3D is a schematic structural diagram of a block chain super book architecture according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a usage scenario of a purchase-sale-stock system according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating an exemplary use scenario of an alternate purchase-sale-stock system in accordance with an embodiment of the present invention;
FIG. 6 is a flowchart illustrating an exemplary use scenario of a purchase-sale-stock system according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating a usage scenario of another purchase-sale-stock system according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a further implementation of a data writing method according to an embodiment of the present invention;
FIG. 9 is a block diagram of a data writing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a hardware entity of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solution of the present invention is further elaborated below with reference to the drawings and the embodiments.
The present embodiment provides a data writing method, which is applied to a computer device, and the functions implemented by the method can be implemented by a processor in the computer device calling a program code, but the program code can be stored in a computer storage medium, and the computer device at least includes a processor and a storage medium.
Fig. 1 is a schematic flow chart illustrating an implementation of a data writing method according to an embodiment of the present invention, as shown in fig. 1, the method may include the following steps:
s11, acquiring goods information in the goods list;
in other embodiments, the manifest includes one of: warehousing, ex-warehouse, stock transferring and checking; the warehousing entry can be any document such as a purchase warehousing entry, an initial warehousing entry, a sales return warehousing entry and the like, and the delivery entry can be any document such as a sales delivery entry, a purchase return delivery and the like. It is understood that the cargo information is related to the type of the cargo list, for example, the cargo list is a warehousing entry, and the cargo information in the warehousing entry may include information of cargo type, warehousing time, warehousing location, cargo quantity, cargo source, and the like. For another example, if the invoice is a delivery order, the information of the goods in the delivery order may include: the goods type, the delivery time, the delivery place, the goods quantity, the goods destination and the like.
S12, acquiring the address of the block chain corresponding to the cargo information from a pre-configured address library according to the cargo information;
generally, the pre-configured address library generally includes addresses of the block chains and link-in keys corresponding to the addresses of the block chains, and storage addresses of different goods in the block chains are different, so that when the address library is configured, the addresses and the link-in keys of different block chains are generally allocated to goods of different goods types. For example, an address a and a key a are assigned to goods that are apples, an address B and a key B are assigned to goods that are bananas, an address C and a key C are assigned to goods that are oranges, and an address D and a key D are assigned to goods that are televisions.
And S13, writing the cargo information into the block chain according to the address of the block chain.
In the embodiment of the invention, a data writing method is provided, firstly, cargo information in a cargo list is obtained; then, acquiring the address of a block chain corresponding to the cargo information from a pre-configured address library according to the cargo information; and finally, writing the cargo information into the block chain according to the address of the block chain. Therefore, the cargo information of the cargo is written into the block chain, so that enterprises of all parties related to the cargo can manage the cargo information through unified data standards, and the cargo information can be traced, verified, unified and transparent among multiple parties when the cargo circulates in all links.
In other embodiments, the method may further comprise: and verifying the writing authority of the cargo information, and writing the cargo information into the block chain according to the address of the block chain after the verification is successful.
It can be understood that, in order to prevent an illegal user from maliciously accessing the block chain, the forged cargo information is written into the block chain, so that the writing authority of the cargo information needs to be verified, and after the verification is successful, the cargo information is allowed to be written into the block chain according to the address of the block chain.
In other embodiments, for step S11, the obtaining the cargo information in the cargo list may include the following steps:
s111, receiving a cargo execution instruction, wherein the cargo execution instruction is used for indicating execution of a cargo event corresponding to a cargo list;
and S112, when the goods execution instruction is responded, the goods information in the goods list is determined by scanning the goods identification of the goods.
It can be understood that, if the cargo list is a warehousing entry, the cargo event corresponding to the warehousing entry is warehousing of the cargo, and at this time, when the cargo is warehoused, the cargo information in the cargo list can be determined by scanning the cargo identification of the cargo; if the goods list is the delivery list, the goods event corresponding to the delivery list is that the goods are delivered out of the warehouse, at the moment, when the goods are delivered out of the warehouse, the goods information in the goods list can be determined by scanning the goods identification of the goods, and if the goods event is different from the goods information in the warehousing list, the goods event contained in the goods information in the delivery list is the goods going direction. Similarly, the cargo allocation order refers to allocation of the cargo among the warehouses, for example, the cargo a in the warehouse a is allocated to the warehouse B, the cargo event corresponding to the cargo allocation order is cargo allocation, and the determined cargo information includes information that the cargo is allocated from the warehouse a to the warehouse B and the like. In addition, the goods identification can be two-dimensional codes, bar codes and the like, and the goods information can be obtained through scanning by scanning equipment.
In other embodiments, after determining the cargo information in the manifest by scanning the cargo identification of the cargo, the method further comprises: and updating inventory information according to the cargo information in the cargo list.
It can be understood that after the cargo event corresponding to the cargo list is completed, the inventory information needs to be updated according to the cargo information in the cargo list.
An embodiment of the present invention provides another data writing method, and fig. 2 is a schematic diagram illustrating an implementation flow of another data writing method according to an embodiment of the present invention, as shown in fig. 2, the method may include the following steps:
s201, reading and displaying N cargo types belonging to the user authority from the address library according to the acquired user information; wherein N is an integer greater than or equal to 1;
s202, determining a selected cargo type from the N cargo types according to a selection instruction input by a user;
s203, acquiring cargo information belonging to the selected cargo type from the cargo list;
s204, acquiring a link access key corresponding to the cargo information;
generally, the link access key is stored in the address base, so that the link access key corresponding to the goods information in the goods in the address base can be accessed from the goods information.
S205, checking whether the link-in key is in the address library; if so, go to step S206; otherwise, ending;
here, it is understood that the check is successful if the link access key is in the address repository.
S206, acquiring the address of the block chain corresponding to the cargo information from a pre-configured address library according to the cargo information;
s207, mapping the cargo information into block data according to a preset data mapping protocol;
it is to be understood that the data type of the block data in the block chain is different from the data type of the cargo information recorded in the cargo list, for example, the data type stored in the block chain is binary data, and the data type of the cargo information recorded in the cargo list is chinese characters, and at this time, it is necessary to map the cargo information recorded in the cargo list with chinese characters into binary data, and then write the mapped binary data as block data into the block chain.
And S208, writing the block data into the block chain according to the address of the block chain.
In other embodiments, the tile data may include one of: a cargo event, a time at which the cargo event was performed, a location at which the cargo event was performed, a cargo state. It is understood that if the cargo event is the shipment of cargo out of the warehouse, then the cargo state is the out-of-warehouse state at this time; and if the goods event is that the goods are transported into the warehouse, the goods state is a warehousing state at the moment.
The purchase-sale-stock system is an important module on the mobile office pocket assistant. Blockchains, representing now and in the future, are believed to be as ubiquitous as the internet, becoming an infrastructure. The purchase-sale-stock system belongs to a ring in a supply chain. The blockchain technique is naturally suitable for use in supply chain management as a large scale collaboration tool. To accommodate technology trends, the purchase-sales-inventory system should also support blockchain applications accordingly.
Therefore, in order to keep up with the time of technical trend, not rainy, and not rainy, in the embodiment of the present invention, a scheme for making a normalized block chain application access interface based on a promotion and sale memory system in a pocket assistant is provided, that is, the data writing method in the above embodiment. Compared with the traditional purchase-sale-stock system, the method has the following advantages: firstly, mobile office can be realized through a pocket assistant type purchase-sales-stock system, namely, a traditional purchase-sales-stock system is energized; secondly, the method provides a normalized blockchain application access interface, namely, an implementation method for writing goods information into a blockchain is provided, thereby facilitating access of blockchain application.
It should be noted that, a data writing method according to an embodiment of the present invention is provided in consideration of: firstly, a traditional purchase-sales system can be revived in mobile office, for example, the purchase-sales system is provided with a pocket assistant function through a mobile phone Application (APP) version; secondly, block chain application expansion capacity can be provided for a purchase, sale and storage system in mobile office, and preparation is provided for future block chain popularization; thirdly, a supply chain problem solving idea based on a block chain is characterized in that firstly, cargo information can be made to be transparent between transaction parties through the block chain technology, so that a complete and smooth information flow is formed on the whole supply chain, the transaction parties can be ensured to find problems existing in the operation process of a supply chain system in time, a problem solving method can be found in a targeted manner, and the overall efficiency of supply chain management is improved; secondly, the characteristics of data non-falsification and existence certification of the timestamp of the block chain can be well applied to solving disputes among all participating main bodies in a supply chain system, and easy proof and accountability are realized; finally, the two characteristics of data non-falsification and transaction traceability are combined, so that the problems of counterfeiting and faking in the product circulation process in the supply chain can be solved.
It should also be noted that the use of blockchains does not mean to replace the interactive form of existing and effective supply chains, such as Electronic Data Interchange (EDI), which can implement well-established business value; and, utilizing blockchains also does not mean to replace the form of integration into an Enterprise application system, such as an Enterprise Resource Planning (ERP) system. Conversely, when an enterprise implements new supply chain technologies, for example, using Internet of things (IoT) technology to improve logistics process monitoring, blockchains may be used to provide synthetic records of information flows. This level of shared visibility enables enterprises the opportunity to optimize multi-party supply chain processes.
Based on this, the embodiment of the present invention provides a data writing method, which is intended to be able to adapt to a future blockchain as an infrastructure, and to accept the record and trace of "a commodity with blockchain application (i.e. the goods described in the above embodiment)" in the purchase-sale-inventory system.
The data writing method described in the above embodiment is applied to a purchase-sale-storage system, and the system has a world wide Web version and an Application (APP) version. As shown in fig. 3A, the system 30 mainly includes an inventory module 31, a procurement module 32, a sales module 33, and a blockchain support module 34; wherein,
the inventory module 31 comprises a warehouse unit 311, an inventory unit 312, an inventory checking unit 313, an inventory early warning unit 314, an inventory allocating unit 315 and an inventory reporting unit 316; wherein the warehouse unit 311 is used for warehouse management, such as adding a warehouse, deleting a warehouse, modifying a warehouse, querying a warehouse; the inventory unit 312 is used for inventory information query and inventory information derivation; the inventory checking unit 313 is used for inventory checking management, such as adding, deleting, modifying and inquiring inventory information, and the inventory checking unit 313 is also used for printing a checking list; the inventory early warning unit 314 is used for inventory early warning setting, such as adding, deleting, modifying, inquiring inventory early warning; the stock allocation unit 315 is used for allocating and allocating sheet management, for example, adding, deleting, modifying, and querying a stock allocation sheet, and the stock allocation unit 315 is also used for allocating and allocating sheet attribute setting, allocating and allocating sheet export, and printing an allocation sheet; the inventory reporting unit 316 is used for storing the inventory details and the inventory statistics;
the purchasing module 32 comprises a supplier unit 321, a purchase order unit 322, a warehousing unit 323 and a purchasing report unit 324; the provider unit 321 is used for provider management, such as adding, deleting, modifying, querying provider information, and the provider unit 321 is also used for provider information import and provider information export; the purchase order unit 322 is used for purchase order management, such as adding, deleting, modifying, and querying a purchase order, and the purchase order unit 322 is also used for purchase order attribute setting and purchase order derivation; the warehousing entry unit 323 is used for warehousing entry management, such as adding, deleting, modifying and inquiring warehousing entries, and the warehousing entry unit 323 is also used for warehousing entry attribute setting, warehousing entry export and printing warehousing entries; the purchase reporting unit 324 is used for storing purchase details and purchase statistics;
the sales module 33 comprises a sales order unit 331, a delivery order unit 332 and a sales report unit 333; wherein the sales order unit 331 is used for sales order management, such as adding, deleting, modifying, querying sales orders, and the sales order unit 331 is also used for sales order attribute setting, sales order export, and printing sales orders; the delivery order unit 332 is used for delivery order management, such as adding, deleting, modifying, and querying a delivery order, and the delivery order unit 331 is also used for delivery order attribute setting, delivery order export, and printing a delivery order; the sales report unit 333 is used for storing sales report details and sales statistics;
the block chain support module 34 is configured to write the goods information recorded by the documents in the inventory module 31, the purchasing module 32, and the selling module 33 into a block chain.
In other embodiments, as shown in fig. 3B, the block chain support module 34 may be implemented by code and may include: initializing interface init (), authenticating interface auth (), data mapping interface dataMap (), read () and write () of read chain data interface; correspondingly, as shown in fig. 3C, the function of the module 34 implements a flow, as shown in fig. 3C, which may include the following steps:
s301, acquiring a chain address blockChainAddr and a chain-in private key authKey;
here, it should be noted that the chain address blockChainAddr is an address of the block chain in the above embodiment, and the chain access private key authKey is the chain access key in the above embodiment.
S302, inputting two parameters of blockchain addr and authKey into an initialization interface init (), realizing initialization of basic information of a blockchain by loading the initialization interface init (blockchain addr, authKey), and then entering the step S302;
s303, inputting the authKey into an authentication interface auth (), realizing authority authentication by loading the authentication interface auth (authKey), and entering the step S304 after the authority authentication is passed;
here, it should be noted that, for each operation of the block chain, the authority needs to be checked, that is, each time the business data businessData (i.e., the cargo information described in the above embodiment) is written into the block chain, the authority needs to be checked.
S304, reading business data businessData from the cargo list through a reading chain data interface read ();
here, it should be noted that the service data businessData is the cargo information in the foregoing embodiment.
S305, inputting business data businessData into a data mapping interface dataMap (businessData), and mapping the business data businessData to block chain data blockchainData by loading the data mapping interface dataMap (businessData) to obtain mapped data newBlockChainData;
here, it should be noted that the mapped data newBlockChainData is the block data described in the above embodiment.
S306, inputting the mapped data newBlockChainData into a write chain data interface write (), and writing the mapped data newBlockChainData into the block chain by loading the write chain data interface write (newBlockChainData).
In addition, it should be noted that the initial version of the blockchain support module 34 may refer to a currently popular blockchain hyper-ledger (hyper-ledger) architecture, and then more supports may be added to the blockchain support module 34, or after the blockchain forms a standard, the blockchain support module 34 may support the standard; the composition structure of the superhedger architecture is shown in fig. 3D, and the architecture includes a member management module 35, a block service module 36, a page encapsulation module 37, and an account chain code module 38; wherein, the member management module 35 has the following features: firstly, functions of member registration, identity protection, content confidentiality, transaction audit and the like are provided; second, all members of an Open Block Chain (OBC) must be granted permission to initiate a transaction, unlike a public Chain (i.e., the participants do not need to log in and can submit directly); thirdly, when the OBC member initiates a Transaction, if a Transaction Certificate Authority (TCA) function is started, the Identity (ID) of the member is protected from being seen by an unrelated party by the Transaction certificate;
the block service module 36 has the following features: firstly, a distributed account book which is consistent with the whole network is maintained; secondly, a communication network based on a Peer-to-Peer (P2P) Protocol, for example, a remote procedure Call (gRPC) system, realizes message transmission between nodes through a hypertext transfer Protocol (HTTP) message; thirdly, the state synchronization is efficient and reliable due to the highly optimized design; fourthly, the consensus algorithm is modularized and pluggable, wherein the consensus algorithm, for example, a bayer Byzantine fault tolerance (PBFT) algorithm, a Raft algorithm, a mine excavation (Proof of Work, PoW) algorithm, a Proof of rights and interests (Proof of stamp, PoS) algorithm, etc.;
the page encapsulation module 37 has the following features: first, the OBC provides a Representational State Transfer (REST) Application Programming Interface (API) to access various services; second, the OBC also provides a Command-Line Interface (CLI) client tool that enables developers to quickly test account chain codes (chaincodes) or query for transaction conditions. The CLI tool can be written in the Go language, and only part of REST API is supported at present;
the ledger code module 38 has the following features: first, to form a Smart Contract (Smart Contract); second, the module is embedded in the transaction, and all validation nodes must execute the module 38 when validating the transaction; third, the execution environment is a "sandbox" (Docker); go language writing is supported at present, and languages such as Java and node.
To further illustrate a specific usage scenario of the purchase-sale-stock system 30, fig. 4 is a flow chart of a usage scenario of the purchase-sale-stock system 30, and as shown in fig. 4, the flow chart of the usage scenario of the system 30 may include:
s401, creating a purchase order according to the information of goods fed from a supplier;
s402, judging whether the purchase order passes examination and approval; if so, go to step S403; otherwise, ending;
s403, creating a warehousing entry according to the purchase order;
s404, judging whether the warehousing bill passes examination and approval; if yes, go to step S405; otherwise, ending;
s405, purchasing and warehousing are carried out according to the warehousing bill, and the warehousing bill is checked;
s406, updating warehouse inventory information according to the warehousing entry;
s407, judging whether the block chain application support is started or not; if yes, go to step S408; otherwise, ending;
and S408, writing the goods information in the warehousing entry into the block chain through the block chain support module.
Fig. 5 is a flowchart of another usage scenario of the purchase-sale-stock system 30, and as shown in fig. 5, the usage scenario flowchart of the system 30 may include:
s501, receiving a goods transferring instruction between warehouses and creating a stock transferring order;
s502, judging whether the inventory allocation sheet passes examination and approval; if yes, go to step S503; otherwise, ending;
s503, executing inventory allocation according to the inventory allocation list, and checking the inventory allocation list;
s504, updating warehouse inventory information according to the inventory allocation list;
s505, judging whether the block chain application support is started or not; if yes, go to step S506; otherwise, ending;
and S506, writing the goods information in the inventory allocation list into a block chain through a block chain support module.
Fig. 6 is a flowchart of another usage scenario of the purchase-sale-stock system 30, and as shown in fig. 6, the usage scenario flowchart of the system 30 may include:
s601, creating an inventory checking list according to the checking result of the goods in the regular checking warehouse;
s602, performing inventory checking according to the inventory checking list, and checking the inventory checking list;
s603, updating warehouse inventory information according to the inventory checking list;
s604, judging whether the block chain application support is started; if yes, go to step S605; otherwise, ending;
and S605, writing the goods information in the inventory checking list into a block chain through a block chain support module.
Fig. 7 is a flowchart of another usage scenario of the purchase-sale-stock system 30, and as shown in fig. 7, the usage scenario flowchart of the system 30 may include:
s701, creating a sales order according to the order taken from the client;
s702, judging whether the sales order passes examination and approval; if yes, go to step S703; otherwise, ending;
s703, creating a delivery order according to the sales order;
s704, judging whether the delivery list passes examination and approval; if yes, go to step S705; otherwise, ending;
s705, carrying out goods delivery according to the inventory allocation sheet, and checking the delivery sheet;
s706, updating warehouse inventory information according to the delivery list;
s707, judging whether the block chain application support is opened; if so, go to step S708; otherwise, ending;
and S708, writing the goods information in the delivery list into a block chain through a block chain support module.
Based on the usage scenario flows of the purchase-sale-stock system described in fig. 4 to fig. 7, fig. 8 provides a flowchart of a method for implementing data writing through a blockchain support module, and as shown in fig. 8, the method may include the following steps:
s801, reading and displaying selectable items in the user authority range from a preset [ chain address and key ] library according to user information input by a user, and enabling the selectable items to be selected by the user;
wherein, the [ chain address, key ] library is the address library described in the above embodiment, and the [ chain address, key ] library includes a chain address, a key, a cargo type and user information; the selectable item comprises N goods types corresponding to the N chain addresses respectively; the link address is the address of the block link described in the above embodiment; the key is the link-in key described in the above embodiments.
S802, receiving a selection instruction input by the user;
s803, determining the type of the selected goods from the selectable items according to the selection instruction;
s804, acquiring a chain address and a key corresponding to the selected cargo type from a [ chain address, key ] library according to the selected cargo type;
s805, initializing block chain basic information;
s806, verifying whether the key corresponding to the selected cargo type is in a [ chain address, key ] library; if yes, go to step S807; otherwise, ending;
s807, reading cargo information belonging to the selected cargo type from a current cargo list according to the selected cargo type;
it should be noted that the inventory, for example, the incoming documents of the related goods such as the warehousing entry, the stock transfer entry, the stock checking entry, and the delivery entry.
S808, mapping the cargo information into block data according to a preset data mapping protocol;
and S809, writing the block data into a block chain according to the chain address.
Wherein the block data includes a cargo event, a time at which the cargo event is performed, a place at which the cargo event is performed, a cargo state, and the like.
Based on the foregoing embodiments, an embodiment of the present invention provides a data writing apparatus, where the apparatus includes modules and units included in the modules, and the data writing apparatus may be implemented by a processor in a computer device; of course, the implementation can also be realized through a specific logic circuit; in implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 9 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention, and as shown in fig. 9, the apparatus 90 includes a first obtaining module 91, a second obtaining module 92, and a data writing module 93; wherein:
the first obtaining module 91 is configured to obtain cargo information in a cargo list;
the second obtaining module 92 is configured to obtain, according to the cargo information, an address of a block chain corresponding to the cargo information from a preconfigured address library;
the data writing module 93 is configured to write the cargo information into the block chain according to the address of the block chain.
In other embodiments, the apparatus 90 further includes a verification module 94, where the verification module 94 is configured to verify the writing authority of the cargo information, and after the verification is successful, the cargo information is written into the block chain according to the address of the block chain.
In other embodiments, the verification module 94 includes:
the first acquisition unit is configured to acquire a link-in key corresponding to the cargo information;
a verification unit configured to verify whether the link-in key is in the address repository;
a first determining unit configured to verify success if the link access key is in the address repository.
In other embodiments, the first obtaining module 91 includes:
the receiving unit is configured to receive a cargo execution instruction, wherein the cargo execution instruction is used for indicating execution of a cargo event corresponding to a cargo list;
and the second determining unit is configured to determine the cargo information in the cargo list by scanning the cargo identification of the cargo when responding to the cargo execution instruction.
In other embodiments, the first obtaining module 91 includes:
the reading unit is configured to read N cargo types belonging to the user authority from the address library according to the acquired user information;
a display unit configured to display the N cargo types;
a third determining unit configured to determine a selected cargo type from the N cargo types according to a selection instruction input by a user;
and the second acquisition unit is configured to acquire cargo information belonging to the selected cargo type from the cargo list.
In other embodiments, the writing module 93 includes:
the mapping unit is configured to map the cargo information into block data according to a preset data mapping protocol;
the writing unit is configured to write the block data into the block chain according to the address of the block chain.
In other embodiments, the block data includes one of: a cargo event, a time at which the cargo event was performed, a location at which the cargo event was performed, a cargo state.
In other embodiments, the manifest includes one of: warehousing entry, ex-warehouse entry, inventory allocation and inventory checking.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention for understanding.
It should be noted that, in the embodiment of the present invention, if the data writing method is implemented in the form of a software functional module and is sold or used as a standalone product, the data writing method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor executes the computer program to implement the steps in the data writing method provided in the above embodiment.
Accordingly, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps in the data writing method provided in the above-described embodiment.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention.
It should be noted that fig. 10 is a schematic diagram of a hardware entity of a computer device according to an embodiment of the present invention, and as shown in fig. 10, the hardware entity of the computer device 100 includes: a processor 101, a communication interface 102 and a memory 103, wherein
The processor 101 generally controls the overall operation of the computer device 100.
The communication interface 102 may enable the computer device to communicate with other terminals or servers via a network.
The memory 103 is configured to store instructions and applications executable by the processor 101, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 101 and modules in the computer device 100, and may be implemented by a FLASH memory (FLASH) or a Random Access Memory (RAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present invention, and all such changes or substitutions are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
1. A method of writing data, the method comprising:
acquiring cargo information in a cargo list;
acquiring the address of a block chain corresponding to the cargo information from a pre-configured address library according to the cargo information;
and writing the cargo information into the block chain according to the address of the block chain.
2. The method of claim 1, further comprising:
and verifying the writing authority of the cargo information, and writing the cargo information into the block chain according to the address of the block chain after the verification is successful.
3. The method of claim 2, wherein the verifying the right to write the cargo information comprises:
acquiring a link access key corresponding to the cargo information;
verifying whether the link-in key is in the address repository;
if the link access key is in the address repository, the verification is successful.
4. The method of claim 1, wherein the obtaining the cargo information in the manifest comprises:
receiving a cargo execution instruction, wherein the cargo execution instruction is used for indicating execution of a cargo event corresponding to a cargo list;
and when the goods execution instruction is responded, the goods information in the goods list is determined by scanning the goods identification of the goods.
5. The method of claim 1, wherein the obtaining the cargo information in the manifest comprises:
reading and displaying N cargo types belonging to the user authority from the address library according to the acquired user information;
determining a selected cargo type from the N cargo types according to a selection instruction input by a user;
and acquiring cargo information belonging to the selected cargo type from the cargo list.
6. The method of any one of claims 1 to 5, wherein the writing the cargo information into the blockchain according to the address of the blockchain comprises:
mapping the cargo information into block data according to a preset data mapping protocol;
and writing the block data into the block chain according to the address of the block chain.
7. The method of claim 6, wherein the block data comprises one of: a cargo event, a time at which the cargo event was performed, a location at which the cargo event was performed, a cargo state.
8. The method of claim 7, wherein the manifest comprises one of: warehousing entry, ex-warehouse entry, inventory allocation and inventory checking.
9. A computer device comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor implements the steps of the data writing method according to any one of claims 1 to 8 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the data writing method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951860.1A CN109345159A (en) | 2018-08-21 | 2018-08-21 | A kind of method for writing data and device, equipment, storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951860.1A CN109345159A (en) | 2018-08-21 | 2018-08-21 | A kind of method for writing data and device, equipment, storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109345159A true CN109345159A (en) | 2019-02-15 |
Family
ID=65296991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810951860.1A Pending CN109345159A (en) | 2018-08-21 | 2018-08-21 | A kind of method for writing data and device, equipment, storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109345159A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110503373A (en) * | 2019-08-21 | 2019-11-26 | 腾讯云计算(北京)有限责任公司 | A kind of material-flow method and device based on block chain network |
CN111858603A (en) * | 2020-07-23 | 2020-10-30 | 浙江永旗区块链科技有限公司 | Data writing method and system for block chain |
CN113139775A (en) * | 2021-05-12 | 2021-07-20 | 北京京东乾石科技有限公司 | Cargo allocation information processing method, device, equipment and storage medium |
US11201727B2 (en) | 2019-03-27 | 2021-12-14 | Advanced New Technologies Co., Ltd. | System and method for managing user interactions with a blockchain |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collecting device |
CN107247749A (en) * | 2017-05-25 | 2017-10-13 | 阿里巴巴集团控股有限公司 | A kind of database positioning determines method, consistency verification method and device |
CN107301522A (en) * | 2017-06-26 | 2017-10-27 | 深圳前海华深安信物联技术有限公司 | A kind of warehouse receipt system and application method based on block chain |
CN107330026A (en) * | 2017-06-22 | 2017-11-07 | 物链(北京)科技有限公司 | A kind of method and system of compatible isomery block platform chain |
-
2018
- 2018-08-21 CN CN201810951860.1A patent/CN109345159A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collecting device |
CN107247749A (en) * | 2017-05-25 | 2017-10-13 | 阿里巴巴集团控股有限公司 | A kind of database positioning determines method, consistency verification method and device |
CN107330026A (en) * | 2017-06-22 | 2017-11-07 | 物链(北京)科技有限公司 | A kind of method and system of compatible isomery block platform chain |
CN107301522A (en) * | 2017-06-26 | 2017-10-27 | 深圳前海华深安信物联技术有限公司 | A kind of warehouse receipt system and application method based on block chain |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11201727B2 (en) | 2019-03-27 | 2021-12-14 | Advanced New Technologies Co., Ltd. | System and method for managing user interactions with a blockchain |
CN110503373A (en) * | 2019-08-21 | 2019-11-26 | 腾讯云计算(北京)有限责任公司 | A kind of material-flow method and device based on block chain network |
CN110503373B (en) * | 2019-08-21 | 2024-07-19 | 腾讯云计算(北京)有限责任公司 | Logistics method and device based on block chain network |
CN111858603A (en) * | 2020-07-23 | 2020-10-30 | 浙江永旗区块链科技有限公司 | Data writing method and system for block chain |
CN111858603B (en) * | 2020-07-23 | 2023-05-26 | 浙江永旗区块链科技有限公司 | Block chain data writing method and system |
CN113139775A (en) * | 2021-05-12 | 2021-07-20 | 北京京东乾石科技有限公司 | Cargo allocation information processing method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190342085A1 (en) | System and method for tracking product and providing verified product information and consumer rewards | |
CN110503373B (en) | Logistics method and device based on block chain network | |
US20240289774A1 (en) | Method for processing cargo allocation information, electronic device, and non-transitory computer-readable storage medium | |
CN115829559A (en) | Adding added value to NFT | |
CN109740317A (en) | A blockchain-based digital fingerprint storage method and device | |
US20160164884A1 (en) | Cryptographic verification of provenance in a supply chain | |
Akhtar et al. | Traceability and detection of counterfeit medicines in pharmaceutical supply chain using blockchain-based architectures | |
CN113221192B (en) | Block chain-based digital asset processing method and device | |
US20170083860A1 (en) | Tracking unitization occurring in a supply chain | |
CN115730277A (en) | Complementary digital content access control using non-fungible token NFT | |
US11989726B2 (en) | Database system public trust ledger token creation and exchange | |
US20160203572A1 (en) | Method to securely establish, affirm, and transfer ownership of artworks | |
CN112598426B (en) | Article anti-counterfeiting tracing method | |
US20160335609A1 (en) | Representation of digital asset structure, ownership and evolution by virtue of a hierarchical, compounding tagging mechanism on a transaction-based network | |
EP4070221A1 (en) | Cross-partition calls in partitioned, tamper-evident data stores | |
WO2021208762A1 (en) | Data storage and query | |
US20210133875A1 (en) | Comprehensive buying, selling, trading, tracking, verification, validation, tokenization and financial services using blockchain | |
CN109345159A (en) | A kind of method for writing data and device, equipment, storage medium | |
US20230085481A1 (en) | Database system public trust token redeem architecture using wallets | |
CN113657960B (en) | A matching method, device and equipment based on trusted asset data | |
US11727414B2 (en) | Internet data usage control system | |
CN109559164B (en) | Preferential information processing method and device, electronic equipment and computer readable medium | |
CN115065682A (en) | Product tracing full life cycle management system based on industrial internet identification analysis | |
US12361019B2 (en) | Systems and methods for distributed entity tracking | |
KR20150126741A (en) | Method of personal information management and personal information management server performing the same |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190215 |