CN108769154B - Data storage method based on directed acyclic graph and distributed account book - Google Patents

Data storage method based on directed acyclic graph and distributed account book Download PDF

Info

Publication number
CN108769154B
CN108769154B CN201810462696.8A CN201810462696A CN108769154B CN 108769154 B CN108769154 B CN 108769154B CN 201810462696 A CN201810462696 A CN 201810462696A CN 108769154 B CN108769154 B CN 108769154B
Authority
CN
China
Prior art keywords
data
stored
acyclic graph
directed acyclic
vertex
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
Application number
CN201810462696.8A
Other languages
Chinese (zh)
Other versions
CN108769154A (en
Inventor
张正
杨睿哲
张延华
孙恩昌
司鹏搏
金凯
杨兆鑫
林波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing University of Technology filed Critical Beijing University of Technology
Priority to CN201810462696.8A priority Critical patent/CN108769154B/en
Publication of CN108769154A publication Critical patent/CN108769154A/en
Application granted granted Critical
Publication of CN108769154B publication Critical patent/CN108769154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/105Multiple levels of security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention provides a data storage method based on a directed acyclic graph and a distributed account book, which comprises the following steps: according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex; and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger. According to the data storage method based on the directed acyclic graph and the distributed account book, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed account book according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed account book, and the tracing requirement of high-frequency and massive data is met.

Description

Data storage method based on directed acyclic graph and distributed account book
Technical Field
The invention relates to the technical field of computers, in particular to a data storage method based on a directed acyclic graph and a distributed account book.
Background
At present, the potential of the distributed ledger technology applied to data tracing is more and more recognized and concerned, especially in the product data tracing field. The product data tracing is carried out by adopting the distributed account book technology, the product data can be shared, copied and synchronized among the network member nodes, one network member node stores the generated product data into the distributed account book and synchronizes among other network member nodes, so that other network member nodes with authority can read the product data, the uniqueness and the falsification prevention of the data are ensured, the distrust barriers among enterprises or individuals in the process that products finally reach consumers from production, processing and distributors are eliminated, and the information circulation and transaction efficiency is improved.
In the prior art, the distributed ledger technique is based on a block-chain structure. The block chain is formed by connecting the formed blocks through a chain structure, and each block comprises a generation time, a current block root hash value, a previous block root hash value and a contained transaction record. In the block chain-based product information traceability system, the product traceability information adding method comprises the steps that the traceability information of products is sequentially added into a block chain according to the circulation sequence of the products, and one link information of the products is added into one block of the block chain to serve as one transaction in the block. While the product information is added to the block chain, a unique ID is generated for the product, and the unique ID is also added as detailed information of the product to one block of the block chain. In the product source tracing information inquiry step, the detailed information of the product is inquired in the block chain, and the uniqueness of the ID of the product is confirmed. Each blockchain participant holds all blockchains, and new reasonable transaction information added by any participant is synchronized into the blockchains held by other participants. And similarly, the participants can also view the product information added by other participants in the block chain, so that the purpose of tracing the source is realized.
However, in the data storage method based on the block-and-chain structure distributed book, the data that can be stored in a single block is limited and cannot be expanded, and in the case that the information stored in a single block has reached the upper limit, the remaining data information must be queued until the next block is generated before the uplink can be added. In practical application, the quantity of product data to be recorded is huge, the product circulation link is complex, a large amount of product data information needs to be recorded into a block, and if the product information cannot be added into the block in time, the product data information is always queued and accumulated, and finally block chain network congestion is caused.
Disclosure of Invention
The invention aims to provide a data storage method based on a directed acyclic graph and a distributed ledger, and solves the technical problems that the time consumption of data storage of the distributed ledger is long and network congestion occurs in the prior art.
In order to solve the technical problem, in one aspect, the present invention provides a data storage method based on a directed acyclic graph and a distributed ledger, including:
according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
In another aspect, the present invention provides a data storage device for a directed acyclic graph and a distributed ledger, including:
the vertex generation module is used for newly building a plurality of directed acyclic graph vertexes according to a plurality of data to be stored acquired at the same moment, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and the storage module is used for storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed account book.
In yet another aspect, the present invention provides an electronic device for data storage based on a directed acyclic graph and a distributed ledger, comprising:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, which when called by the processor are capable of performing the methods described above.
In a further aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method described above.
According to the data storage method based on the directed acyclic graph and the distributed account book, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed account book according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed account book, and the tracing requirement of high-frequency and massive data is met.
Drawings
FIG. 1 is a data storage method based on a directed acyclic graph and a distributed ledger, in accordance with an embodiment of the present invention;
FIG. 2 is a functional hierarchy diagram of a product tracing system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a directed acyclic graph used in a distributed ledger according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating transaction contents in a directed acyclic graph, according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a process of storing product information in a product traceability system according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating reading product information in a product traceability system according to an embodiment of the present invention;
FIG. 7 is a data store based on a directed acyclic graph and a distributed ledger, in accordance with embodiments of the present invention;
fig. 8 is a schematic structural diagram of an electronic device for data storage based on a directed acyclic graph and a distributed ledger according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a data storage method based on a directed acyclic graph and a distributed ledger according to an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides a data storage method based on a directed acyclic graph and a distributed ledger, an execution subject of the data storage method is a data storage device based on a directed acyclic graph and a distributed ledger, and the device may be disposed in any network member node. The method comprises the following steps:
step S101, according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly established, the number of the data to be stored is the same as that of the newly established directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and S102, storing the data to be stored corresponding to each vertex in the directed acyclic graph into a distributed account book.
Specifically, in the distributed ledger technology provided by the embodiment of the present invention, a network has a plurality of network member nodes, each network member node holds a distributed ledger, and the structure of the distributed ledger is a directed acyclic graph structure, that is, data is stored in the distributed ledger by using the structure of a directed acyclic graph. The authorized network member node can store the generated data in the held distributed account book, update the distributed account book, and synchronize the updated distributed account book among other network member nodes to realize sharing of the data in the distributed account book, and the authorized network member node can inquire the data in the synchronized distributed account book according to the authority. The data stored in the distributed ledger can be a transaction, a one-step operation in a transaction, data of one link in the production and sale processes of a product, and the like. The users of the network member nodes may be participants in any one transaction process, product production process, sales process, etc., and may be, for example, traders, product producers, yield distributors, logistics companies, consumers, etc.
Firstly, the method needs to obtain data to be stored, if a plurality of data to be stored need to be stored at the same time, the plurality of data to be stored can be obtained at the same time, a plurality of directed acyclic graph vertexes are newly built according to the plurality of data to be stored obtained at the same time, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex.
And then, storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger. Therefore, the data to be stored can be timely stored in the distributed account book at any moment, the data to be stored is stored in the distributed account book in a directed acyclic graph structure, one data to be stored corresponds to one directed acyclic graph vertex, even if a plurality of data to be stored need to be stored at the same moment, only a plurality of directed acyclic graph vertices need to be newly built and respectively correspond to a plurality of data to be stored one by one, and conflict during data storage can be effectively avoided.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met.
On the basis of the above embodiment, further, each piece of data to be stored at least includes a timestamp and data details, where the timestamp is a time when the piece of data to be stored is generated, and the data details are specific contents of the piece of data to be stored.
Specifically, each data to be stored at least comprises a timestamp and a data detail part, wherein the timestamp is the time generated by the data to be stored, so that a directed acyclic graph is established according to the sequence of the timestamps, and the occurrence of conflict during data storage is prevented. The details of the data are the specific content of the data to be stored. The method is convenient for a user to inquire the specific content of the data in the distributed account book through the network member node. The data details include, but are not limited to, transaction information, product processing information, product unique identification number, quality control authentication information, production principal ID, product feature description, product delivery information, distribution logistics information, and the like.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met.
On the basis of the above embodiments, further, each piece of data to be stored in the plurality of pieces of data to be stored acquired at the same time is verified data to be stored, and the verification method includes:
judging whether the target data to be stored conflicts with any data in the distributed account book or not;
and if the data to be stored in the target is judged and obtained not to conflict with any data in the distributed account book, the data to be stored in the target is the data to be stored after the data to be stored in the target passes the verification.
Specifically, before data is stored, the data to be stored needs to be verified, and only the data that passes the verification is stored. The specific verification method comprises the following steps:
and judging whether the target data to be stored conflicts with any data in the distributed account book, if the target data to be stored and any data in the distributed account book do not conflict, judging that the target data to be stored is the data to be stored after verification is passed, and if the target data to be stored and any data in the distributed account book conflict are judged and known, verifying the target data to be stored not to pass.
For example, in a transaction application scenario, if data to be stored is transaction data, a certain user spends a certain fund through a network member node and records the fund into a distributed account book, the user wants to spend the fund again and records the fund into the distributed account book, data storage of two spending times before and after the spending time conflicts, and then data of the latter spending time cannot be verified. For another example, in a product circulation application scenario, a product manufacturer records performance description information of a product into a distributed ledger, and users of other network member nodes such as logistics companies and buyers can read the performance description information of the product through a shared distributed ledger. In the later period, if the product has a quality problem, a manufacturer wants to change the original product performance description information to remove responsibility, the new product performance description information conflicts with the original product performance description information recorded in the distributed account book, and the new product performance description information cannot be verified to pass.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met. Meanwhile, data storage verification can ensure uniqueness and tamper resistance of the data.
On the basis of the above embodiments, further, each piece of data to be stored in the plurality of pieces of data to be stored acquired at the same time is encrypted data, and the encryption mode is symmetric encryption or asymmetric encryption.
Specifically, in order to prevent data from being acquired by an unrelated node in a network member node, the data to be stored needs to be encrypted, and the encryption mode is symmetric encryption or asymmetric encryption.
The symmetric encryption method is characterized in that all network member nodes adopt the same encryption key, all network member nodes can check all contents of data added by other network member nodes through the key, and irrelevant network member nodes cannot analyze the data contents even if the data in the distributed account book is obtained without the key. The asymmetric encryption mode is that all network member nodes obtain a public key and a private key, the public key is open to all the network member nodes and can encrypt product information, the private key determines the data reading authority of the network member nodes, and data content is checked according to the authority of the private key.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met. Meanwhile, the data is encrypted, so that the uniqueness and the tamper resistance of the data can be ensured.
On the basis of the foregoing embodiments, further after the storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger, the method further includes:
and synchronizing the distributed ledger into other network member nodes.
Specifically, after any network member node stores the encrypted and verified data to be stored in the distributed ledger held by the network member node, the encrypted and verified data to be stored is immediately synchronized into the distributed ledger held by other network member nodes. And the network member nodes with the authority can inquire the data in the synchronized distributed account book according to the authority. Even if the historical data stored in the distributed account book of the single network member node is tampered, the tampered data cannot be acknowledged because the correct data information is stored in the other network member nodes, and therefore the product information added into the distributed account book can be unique and cannot be tampered.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met. Meanwhile, the distributed account book is synchronized among the network member nodes, so that uniqueness and tamper resistance of data can be guaranteed.
On the basis of the foregoing embodiments, further after the storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger, the method further includes:
and reading the data stored in the distributed account book according to the acquired account information of the user.
Specifically, after the distributed account book is synchronized among the network member nodes, the user can read the corresponding data stored in the distributed account book according to the authority of the user through any one of the network member nodes. The account information of the user corresponds to the access authority of the user, that is, the users with different access authorities have different data analysis keys and different data in the distributed account book.
In the process of reading data in the distributed account book, a user firstly logs in own account information, the system acquires a corresponding data analysis secret key according to the account information, then acquires data to be read, and analyzes the data to be read by using the data analysis secret key, so that the detailed content of the data is read.
According to the data storage method based on the directed acyclic graph and the distributed ledger, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed ledger according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed ledger, and the tracing requirements of high-frequency and massive data are met. Meanwhile, the user can read the corresponding data stored in the distributed account book according to the authority of the user through any network member node.
The following describes a data storage method based on a directed acyclic graph and a distributed ledger in detail, taking a specific application of product tracing as an example. The method comprises the following specific steps:
the product traceability system can realize the functions of collecting, inputting and inquiring product information, fig. 2 is a function layering schematic diagram of the product traceability system according to the embodiment of the invention, and as shown in fig. 2, the product traceability system can be functionally divided into an application layer, a network layer, a data layer and a physical layer, wherein the distributed ledger technology based on the cyclic acyclic graph is applied to the data layer and the communication layer.
The physical layer mainly comprises an internet of things sensor and is responsible for collecting product information in the product circulation process and forwarding the information to the data layer through the network layer, and the mainly collected product data comprises temperature, humidity, air pressure, specification parameters of products and the like.
The network layer mainly comprises a network structure and a protocol, and is mainly responsible for a communication protocol (such as traditional internet of things communication protocols like bluetooth, Zigbee and Lora) for sensing data on the sensor, synchronous communication (P2P protocol) between distributed book nodes, and a communication protocol (Http) for a consumer to perform a traceability request to the traceability system.
The data layer mainly refers to a database for recording product information, and the system mainly adopts a distributed account book with a directed acyclic graph structure to undertake a storage function. Each transaction in the directed acyclic graph only contains information data of a certain stage of a product, the transaction is sent by a network member node responsible for the stage, and once the transaction is added into the directed acyclic graph and verified, the transaction can be immediately synchronized into directed acyclic graphs of other network member nodes. Even if the historical transaction records in the single node are tampered, the correct transaction information is stored in the other nodes and cannot be acknowledged, so that the product information added into the distributed account book can be unique and cannot be tampered.
The application layer is mainly responsible for providing an interface and an application for accessing the distributed account book for an organization or an individual, and the service objects mainly comprise a producer, a distributor and a payer of a product.
After the physical layer of the product traceability system collects product information, the product information is forwarded to the data layer through the network layer to be stored, and the application layer provides interfaces for all participants in the traceability process, so that the participants can access the data layer through the network layer to access the product traceability information data.
Fig. 3 is a schematic structural diagram of a directed acyclic graph used in a distributed ledger according to an embodiment of the present invention, and as shown in fig. 3, the time sequence of transaction transactions is arranged from left to right, in the directed acyclic graph, there is no concept of a block, all transaction records are directly added to the directed acyclic graph in the form of independent transaction transactions, and all transaction transactions constitute a set of the directed acyclic graph. If a new transaction is added into the directed acyclic graph by the network member node, two random transactions in the directed acyclic graph must be verified, a new directed edge in the directed acyclic graph is formed after the verification is passed, and the verification relationship between the new transaction and the old transaction is represented by the directed edge; and in the verification process, the network member node checks whether the verified transaction conflicts with other transactions in the directed acyclic graph, and if the transaction conflicts are found, the network member node cannot pass the verification. As transactions continue to increase, verified-few transactions will not be acknowledged by the distributed ledger system.
Fig. 4 is a schematic diagram of transaction contents in a directed acyclic graph according to an embodiment of the present invention, where the directed acyclic graph in the embodiment of the present invention is an 81-bit hash value directed acyclic graph, and as shown in fig. 4, each transaction mainly includes a generation time (timestamp) of a transaction, a hash value of a current transaction, a hash value of a first verified previous transaction, a hash value of a second verified previous transaction, and transaction information details, where the transaction information details include an acceptance account address of the transaction, an initiation account address, and a transaction additional message.
Note, however, that in a distributed ledger of acyclic graph structure, transaction information details cannot be directly retrieved, and all transactions that meet the retrieved value must be retrieved through the hash value of the current transaction or the account address involved in the transaction.
Before the product information is recorded in the directed acyclic graph, a unique identification number of the product is obtained (for example, through a bar code, an RFIC and the like), and the product information and the number are sent to the distributed nodes together. The distributed node receives the number, firstly confirms whether the account book creates a retrieval number for the product, and if not, firstly registers the retrieval number for the product; and if so, adding new product information for the retrieval number. . To prevent the product information from being obtained by other unrelated people in the distributed ledger, the node encrypts the transaction information details (i.e., the product information).
According to the tracing function requirement, the encryption can select a symmetric encryption method and an asymmetric encryption method. The symmetric encryption method is characterized in that all participants participating in the tracing process adopt the same encryption key, all participants can check all contents of tracing information added by other users through the key, and non-tracing participants can not obtain the tracing contents even if messages in a directed acyclic graph are obtained without the key. The asymmetric encryption mode is that all participants who participate in the tracing process obtain a public key and a private key, the public key is open to all the participants and can encrypt product information, the private key determines the information reading authority of the user, and tracing content data are checked according to the authority of the private key.
In the product traceability system based on the distributed ledger of the directed acyclic graph product, all involved participants register a unique account in the distributed ledger, and the participants are divided into the following categories from the responsibility function:
1. the product manufacturer: and the system is responsible for producing products and recording production data of the products. Data sources are mainly acquired through sensors, and the data include but are not limited to product processing information, product unique identification numbers, quality inspection authentication information, ID of production responsible persons, product feature description and the like.
2. The product distributor: is responsible for selling the product to the consumer and recording the sales data of the product, including but not limited to the product shipment information, the distribution logistics information, etc.
3. The consumer: a product is purchased from a dealer with access to product specific information. At ordinary times, the product can only be checked for sales logistics information, and key production information can be accessed after the product has a safety problem.
Fig. 5 is a flowchart of storing product information in the product traceability system according to an embodiment of the present invention, and as shown in fig. 5, the process of storing product information in the product traceability system includes:
1. manufacturer a registers an account in the distributed account book to become a complete network member node in the distributed account book.
2. Manufacturer a receives sensor data and a product number.
3. Manufacturer A obtains all registered product numbers and corresponding retrieval numbers in the directed acyclic graph by retrieving a specific recipient address in the distributed account book.
4. And the manufacturer A checks whether the account book has a retrieval number corresponding to the product number, if so, the step 5 is executed, and otherwise, a unique retrieval number is generated.
5. And (3) the manufacturer A verifies the two latest random transactions in the directed acyclic graph, if the two latest random transactions pass the verification, the step 6 is executed, and if the two latest random transactions do not pass the verification, other transactions are continuously searched for verification.
6. And the manufacturer A sends a new transaction by taking the retrieval number as a transaction receiving address, the transaction additional information is encrypted sensor data and a product number, and the transaction fills in the Hash values of the two verified transactions.
7. And the transaction initiated by the manufacturer A is verified by other nodes, and the product information is uploaded and completed.
Fig. 6 is a flowchart of reading product information in the product traceability system according to an embodiment of the present invention, and as shown in fig. 5, the process step of reading product information in the product traceability system includes:
1. customer B registers an account in the distributed ledger, accessing the distributed ledger through the e-commerce platform (one of the ledger nodes).
2. The consumer obtains the retrieval number corresponding to the product number and a private key capable of accessing partial product information.
3. And the transaction receiving address of the distributed account book retrieval transaction in the consumer B is the transaction with the retrieval number, and the encrypted information data is obtained.
4. Consumer B parses the encrypted data through the private key.
5. And obtaining the sales logistics information of the product.
The product data tracing method of the directed acyclic graph structure distributed ledger technology provided by the embodiment of the invention ensures the uniqueness and the tamper resistance of data by using the distributed ledger technology, eliminates the distrust barriers among enterprises or individuals in the process that products finally arrive at consumers from production, processing and distributors, and improves the information circulation and transaction efficiency. By adopting the account book structure in the form of directed acyclic graphs, the problem of slow confirmation of blocked transactions occurs in the original block link structure account book under the condition of high-frequency information entry. The product information in the account book is subjected to an asymmetric encryption mode, so that the safety of the product information is guaranteed against being leaked.
Fig. 7 is a data storage apparatus based on a directed acyclic graph and a distributed ledger according to an embodiment of the present invention, and as shown in fig. 7, an embodiment of the present invention provides a data storage apparatus based on a directed acyclic graph and a distributed ledger, which is used for implementing the method described in the above embodiment, and specifically includes a vertex generation module 701 and a storage module 702, where,
the vertex generation module 701 is configured to create a plurality of directed acyclic graph vertices according to a plurality of data to be stored acquired at the same time, where the number of the data to be stored is the same as the number of the created directed acyclic graph vertices, and one data to be stored corresponds to one directed acyclic graph vertex;
the storage module 702 is configured to store data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
The embodiment of the present invention provides a data storage device based on a directed acyclic graph and a distributed ledger, which is used to complete the method described in the above embodiment, and the specific steps for completing the method described in the above embodiment by using the device provided in this embodiment are the same as those in the above embodiment, and are not described here again.
According to the data storage device based on the directed acyclic graph and the distributed account book, the data to be stored, which are acquired at the same time, are efficiently stored in the distributed account book according to the structure of the directed acyclic graph, all information of relevant data can be inquired from the distributed account book, and the tracing requirement of high-frequency and massive data is met.
Fig. 8 is a schematic structural diagram of an electronic device for data storage based on a directed acyclic graph and a distributed ledger according to an embodiment of the present invention, where as shown in fig. 8, the device includes: a processor 801, a memory 802, and a bus 803;
wherein, the processor 801 and the memory 802 complete the communication with each other through the bus 803;
the processor 801 is configured to call program instructions in the memory 802 to perform the methods provided by the above-described method embodiments, including, for example:
according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes:
according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include:
according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex;
and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatuses and devices are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method of storing data, comprising:
according to a plurality of data to be stored acquired at the same time, a plurality of directed acyclic graph vertexes are newly built, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex; each piece of data to be stored in the plurality of pieces of data to be stored acquired at the same moment is verified, a new directed edge is established between each newly-established directed acyclic graph vertex and two random vertices in the directed acyclic graph, and the verification relation between the new vertex and the old vertex is represented by the directed edge;
and storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger.
2. The method of claim 1, wherein each data to be stored at least comprises a time stamp and data details, wherein the time stamp is the time when the data to be stored is generated, and the data details are the specific content of the data to be stored.
3. The method of claim 1, wherein the method for verifying the data to be stored is as follows:
judging whether the target data to be stored conflicts with any data in the distributed account book or not;
and if the data to be stored in the target is judged and obtained not to conflict with any data in the distributed account book, the data to be stored in the target is the data to be stored after the data to be stored in the target passes the verification.
4. The method according to claim 1, wherein each of the plurality of data to be stored acquired at the same time is encrypted data in a symmetric encryption manner or an asymmetric encryption manner.
5. The method of claim 1, wherein after storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger, the method further comprises:
and synchronizing the distributed ledger into other network member nodes.
6. The method of claim 1, wherein after storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed ledger, the method further comprises:
and reading the data stored in the distributed account book according to the acquired account information of the user.
7. A data storage device, comprising:
the vertex generation module is used for newly building a plurality of directed acyclic graph vertexes according to a plurality of data to be stored acquired at the same moment, the number of the data to be stored is the same as that of the newly built directed acyclic graph vertexes, and one data to be stored corresponds to one directed acyclic graph vertex; each piece of data to be stored in the plurality of pieces of data to be stored acquired at the same moment is verified, a new directed edge is established between each newly-established directed acyclic graph vertex and two random vertices in the directed acyclic graph, and the verification relation between the new vertex and the old vertex is represented by the directed edge;
and the storage module is used for storing the data to be stored corresponding to each vertex in the directed acyclic graph into the distributed account book.
8. An electronic device for data storage, comprising:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN201810462696.8A 2018-05-15 2018-05-15 Data storage method based on directed acyclic graph and distributed account book Active CN108769154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810462696.8A CN108769154B (en) 2018-05-15 2018-05-15 Data storage method based on directed acyclic graph and distributed account book

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810462696.8A CN108769154B (en) 2018-05-15 2018-05-15 Data storage method based on directed acyclic graph and distributed account book

Publications (2)

Publication Number Publication Date
CN108769154A CN108769154A (en) 2018-11-06
CN108769154B true CN108769154B (en) 2021-01-01

Family

ID=64007727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810462696.8A Active CN108769154B (en) 2018-05-15 2018-05-15 Data storage method based on directed acyclic graph and distributed account book

Country Status (1)

Country Link
CN (1) CN108769154B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111225008B (en) * 2018-11-27 2021-09-21 北京新唐思创教育科技有限公司 Method, system, terminal and computer program for saving trace information
DE102018221740A1 (en) * 2018-12-14 2020-06-18 Volkswagen Aktiengesellschaft Method, device and computer program for a vehicle
CN109672733B (en) * 2018-12-20 2022-06-07 众安信息技术服务有限公司 Account book synchronization method and device based on DAG block chain
CN109561100B (en) * 2018-12-24 2021-02-12 浙江天脉领域科技有限公司 Method and system for duplex energized network attack and defense based on distributed and artificial intelligence
CN113287110A (en) * 2019-01-23 2021-08-20 株式会社斯凯拉 Data management system with tamper detection
CN109783699B (en) * 2019-01-29 2023-07-21 众安信息技术服务有限公司 Method and apparatus for monitoring distributed ledgers of blockchain networks
CN109857924A (en) * 2019-02-28 2019-06-07 重庆科技学院 A kind of big data analysis monitor information processing system and method
CN111861459A (en) * 2019-04-28 2020-10-30 常州一仙智能科技有限公司 Iota account book optimization system and method based on DPoS consensus algorithm
CN110569246B (en) * 2019-07-23 2022-03-11 腾讯科技(深圳)有限公司 Block chain node information synchronization method and device, computer equipment and storage medium
CN110489460B (en) * 2019-08-09 2021-09-24 北京大学 Optimization method and system for rapid statistics
CN110580307B (en) * 2019-08-09 2021-09-24 北京大学 Processing method and device for fast statistics
CN113516557B (en) * 2021-07-14 2022-09-23 桂林电子科技大学 Block chain with directed acyclic graph structure and implementation method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101535955A (en) * 2005-06-27 2009-09-16 起元软件有限公司 Managing parameters for graph-based computations
CN104182499A (en) * 2014-08-16 2014-12-03 成都飞机工业(集团)有限责任公司 Different structure converting method from AOE (Activity On Edge) network to multi-way tree structure
CN106130929A (en) * 2016-06-17 2016-11-16 众安在线财产保险股份有限公司 The service message automatic processing method of the Internet based on graph-theoretical algorithm insurance field and system
CN106293971A (en) * 2016-08-15 2017-01-04 张家林 A kind of method and apparatus of distributed task dispatching
CN107450972A (en) * 2017-07-04 2017-12-08 阿里巴巴集团控股有限公司 A kind of dispatching method, device and electronic equipment
CN107656730A (en) * 2017-09-28 2018-02-02 链家网(北京)科技有限公司 The adaptive visualization method and device of distributed software system topological structure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9436923B1 (en) * 2015-02-26 2016-09-06 Skuchain, Inc. Tracking unitization occurring in a supply chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101535955A (en) * 2005-06-27 2009-09-16 起元软件有限公司 Managing parameters for graph-based computations
CN104182499A (en) * 2014-08-16 2014-12-03 成都飞机工业(集团)有限责任公司 Different structure converting method from AOE (Activity On Edge) network to multi-way tree structure
CN106130929A (en) * 2016-06-17 2016-11-16 众安在线财产保险股份有限公司 The service message automatic processing method of the Internet based on graph-theoretical algorithm insurance field and system
CN106293971A (en) * 2016-08-15 2017-01-04 张家林 A kind of method and apparatus of distributed task dispatching
CN107450972A (en) * 2017-07-04 2017-12-08 阿里巴巴集团控股有限公司 A kind of dispatching method, device and electronic equipment
CN107656730A (en) * 2017-09-28 2018-02-02 链家网(北京)科技有限公司 The adaptive visualization method and device of distributed software system topological structure

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
"Blockchain technology in the chemical industry: Machine-to-machine electricity market";Janusz J. Sikorski等;《Applied Energy》;20171231;全文 *
"Cassandra - A Decentralized Structured Storage System";Avinash Lakshman等;《https://research.cs.cornell.edu/ladis2009/papers/lakshman-ladis2009.pdf》;20101231;全文 *
"Distributed ledger technology in payments, clearing, and settlement";David Mills等;《https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2881204##》;20161207;全文 *
"Jeff Zhou:DAG高速异步区块链技术";佚名;《https://blog.csdn.net/Christina_1991/article/details/78951593?utm_source=blogxgwz9》;20180102;全文 *
"区块链的几大技术障碍";佚名;《https://www.jianshu.com/p/ca42eea9601a》;20180204;全文 *
"深度解读——TrustNote推动时代变革的高速异步的DAG公有链";佚名;《https://zhuanlan.zhihu.com/p/33763054》;20180211;全文 *
"算法精解:DAG有向无环图";佚名;《https://www.cnblogs.com/Evsward/p/dag.html》;20180314;全文 *

Also Published As

Publication number Publication date
CN108769154A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN108769154B (en) Data storage method based on directed acyclic graph and distributed account book
CN109165966B (en) E-commerce platform evaluation management system based on block chain
US11798008B2 (en) Blockchain-based product authentication system
CN109829824B (en) Commodity transaction information sharing method based on block chain technology
AU2019295815B2 (en) Blockchain-based data verification method and apparatus, and electronic device
CN106982203B (en) Robust ATM network system based on block chain technology and information processing method thereof
US20180349968A1 (en) Systems and methods for product review management with distributed database
CN102609846B (en) Anti-false verification method and system based on communication network
JP2020035436A (en) Traceability system for pet food
CN109829726B (en) Block chain-based drug information management method and system
US20190378162A1 (en) Systems and methods for enforcing advertising standards and digital advertisement measurements
CN110275891A (en) Artificial intelligence software market
JP2016522948A (en) Product authentication system and product authentication method
CN114399320B (en) Bill supply chain anti-counterfeiting traceability system and method based on block chain NFT
CN110490640A (en) Method, apparatus and system for object distribution processor
CN111488372A (en) Data processing method, device and storage medium
CN111095863A (en) Block chain based system and method for communicating, storing and processing data over a block chain network
CN112307458A (en) Light node uplink method and device, Internet of things central control terminal and block chain network
CN110909381A (en) Block chain-based user comment tamper-proof system and method
CN111339550A (en) Comment information credibility method based on block chain technology
CN113469716A (en) Product tracing method and system based on block chain and identification analysis
JP6669609B2 (en) Data trading system and program
WO2021018366A1 (en) Adaption of a production process, edge device of an industrial control system and product ordering process
US11362806B2 (en) System and methods for recording codes in a distributed environment
CN116028982A (en) Processing method, device and system based on non-homogeneous general evidence

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