Disclosure of Invention
The invention aims to provide a trusted stream tracing system based on a blockchain so as to solve the problems in the background technology.
In order to solve the technical problems, the invention provides the following technical scheme: a trusted stream tracing method based on block chain includes:
Performing role distribution on data information in the data circulation process of the Internet of things, and collecting traceability information of a data entity;
Carrying out identity authentication on the data tracing participation main body;
Performing uplink storage on the traceability information through a block chain;
And visually displaying the tracing information inquiry result.
According to the above technical scheme, the role allocation is performed on the data information in the data circulation process of the internet of things, and the acquisition of the traceability information of the data entity comprises the following steps:
dividing participants in the data flow process into data providers, processors, sellers and users;
and collecting information in the data circulation process.
According to the above technical scheme, the identity authentication of the data tracing participant comprises:
And carrying out identity verification and authentication on the user added into the blockchain network by the node identity through a public and private key cryptographic algorithm and a hash encryption algorithm in the blockchain technology.
According to the above technical scheme, the uplink storage of the traceability information through the blockchain includes:
Storing all the tracing information in a uplink manner;
The process of forming the current data state finally through the data source point through multiple data processing and data circulation by the directed acyclic graph is represented.
According to the technical scheme, the visual display of the traceability information query result comprises the following steps:
The user can search and trace the tracing information of the object needing tracing, and provide the circulation process and operation processing information of the tracing object for the user in a visual mode.
According to the above technical scheme, the trusted stream tracing system based on blockchain includes:
The tracing information acquisition module is used for acquiring tracing information;
the traceability information storage module is used for storing traceability information;
and the traceability information display module is used for displaying the traceability information of the query.
According to the above technical scheme, the traceability information acquisition module comprises:
The role allocation module is used for performing role allocation on the data;
The data acquisition module is used for acquiring data;
And the identity authentication module is used for authenticating the identity of the user.
According to the above technical scheme, the traceability information storage module includes:
the uplink storage module is used for uplink storage of data;
And the data conversion diagram construction module is used for constructing the data conversion diagram.
According to the above technical scheme, the traceability information display module includes:
The information inquiry module is used for inquiring the traceability information;
And the visual display module is used for visually displaying the queried information.
Compared with the prior art, the invention has the following beneficial effects: according to the invention, the traceability information acquisition module, the traceability information storage module and the traceability information display module are arranged, a participation subject in the data circulation process is taken as a node to be incorporated into the same blockchain network, and each node in the network can perform information interaction through the blockchain network; through the true and credible identity authentication, the real participants are ensured to perform data operation or sharing transaction in the data circulation process of the Internet of things, namely the data tracing is safe and effective; when a certain tracing object is queried, the corresponding tracing information storage transaction hash can be directly obtained through the identification ID of the tracing object, tracing information backtracking is realized through the transaction hash value, block traversal is not needed, and query efficiency is effectively improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one:
Fig. 1 is a flowchart of a trusted stream tracing method based on a blockchain, which is provided by an embodiment of the present invention, and the method may be implemented by a trusted stream tracing system based on a blockchain, and the system is composed of a plurality of software and hardware modules, and the method specifically includes the following steps:
s101, performing role allocation on data information in the data circulation process of the Internet of things, and collecting traceability information of a data entity;
In some embodiments of the present invention, the participants in the data streaming process are divided into four roles of data provider, processor, seller and user, there is a many-to-many relationship between them, and the actual users of the roles are brought into the same ecological circle, so as to trace the acquisition of the source information. Specifically, the acquisition mode includes: the method comprises the steps that a monitor monitors operation types, such as data uploading, processing, downloading, trading and the like, experienced by data in an Internet of things platform, so that traceability information about data change is obtained; collecting key data on a data operation webpage script; and acquiring the traceability information through a log file in the system. In an exemplary embodiment of the present invention, the data provider mainly collects data, and the data owned by the data provider is original data; the data processor mainly processes the original data to generate a data product for sale to sellers or consumers; the data seller mainly performs sales of original data or data products; data consumers primarily refer to individuals or businesses that use raw data or data products.
S102, carrying out identity authentication on a data tracing participation main body;
In some embodiments of the present invention, in order to ensure that a real participant performs data operation or sharing transaction in the data circulation process of the internet of things, a public-private key cryptographic algorithm and a hash encryption algorithm in a blockchain technology are used to perform authentication on a user added to a blockchain network in a node identity, and authentication information between two authentication parties is signed, authenticated and encrypted, so that non-repudiation and integrity of the authentication information are ensured.
In the embodiment of the invention, an administrator is arranged in the system, each user represents a certain participation subject in data flow, and when the administrator and the user join in the blockchain network in node identity, the Ethernet platform distributes public keys and private keys for the user by using elliptic curve signature algorithm; the administrator allocates an identification ID for each user, connects the identification ID of the user with the account address in series, uses elliptic curve algorithm to carry out hash operation, and encrypts the hash value by using the public key of the user to form a user identity authentication credential.
Specifically, an administrator acquires an authentication credential of an authenticated user through an authenticated user ID, then sends an authentication request to an authenticated user, wherein the authentication request comprises the authentication credential and a random number, and the random number is encrypted through a public key of the authenticated user and then signed by a private key of the administrator; the random number in the step ensures that the verification dialogue is safe and effective and cannot be intercepted and utilized by malicious persons; after receiving the verification request, the verified user decrypts the random number in the verification request by using the public key of the verifier and the private key of the user to obtain the random number, and then calculates the random number identifier by adopting an elliptic curve algorithm; the authenticated user uses the private key to decrypt the authentication credentials to obtain hash values after the user ID and the user address are connected in series, and then the random number identification and the user information hash values obtained after decryption are sent to an administrator; after the administrator receives the random number identification, the random number in the original verification request is used for calculating the random number identification through an elliptic curve algorithm, whether the random number identification is the same as the received random number identification is compared, and if the random number identification is the same, the next step is carried out; calculating an account address through a public key of the verified user, connecting the ID of the verified user with the account address in series, and calculating by using an elliptic curve algorithm to obtain a hash value; comparing whether the received hash value of the user information is the same as the hash value calculated in the previous step, if so, indicating that the identity is true, and if not, indicating that the identity is counterfeit.
In the step, parameters can be adjusted through an elliptic curve signature algorithm, so that the consideration of the operation efficiency and the safety of the algorithm is carried out, and the collision performance is further improved; through the true and credible identity authentication, the real participants are ensured to perform data operation or sharing transaction in the data circulation process of the Internet of things, namely, the data tracing is safe and effective, and the situation that the main body can falsify or falsify the tracing information of the main body due to the conflict of each participant main body, so that the tracing information is unreliable, the safe tracing cannot be provided, or the user with the fake identity performs the uploading of the related tracing information can be effectively avoided.
S103, performing uplink storage on the traceability information through a block chain;
In some embodiments of the present invention, all the trace information is stored in a uplink, where the content stored in the link specifically includes transaction hash values of each trace information and additional trace information; meanwhile, the mapping relation between the written data ID and the transaction hash value of the trace information corresponding to the appended data ID is managed by trace information, and specific information, data activity information and the like of the related data entity are written on the blockchain through corresponding intelligent contracts. Specifically, when the tracing information is stored in a uplink manner, firstly, obtaining an ID of original data used for generating new data in the tracing information, obtaining a transaction hash value of the tracing information of the additional original data through the IDs of the original data, and then packaging the transaction hash value and the tracing information together to form a new transaction; in the step, when a certain traceable object is queried, the corresponding traceable information storage transaction hash can be directly obtained through the identification ID of the traceable object, and the traceable information backtracking is realized through the transaction hash value.
In the embodiment of the invention, the process of forming the current data state finally through data processing for the data source point and data circulation through the directed acyclic graph is shown in an exemplary mode in the process of circulating the data. Specifically, the graph is denoted as T (a, B), wherein, Represents a set of nodes in T, each nodeFor a specific state of a certain data, the node ID is the same as the ID of the data entity; b i={b1,b2,…,bn }, representing a set of directed edges in T, each directed edge B i (1.ltoreq.i.ltoreq.n) representing data activity information that results in the current state of the data; in the whole data circulation process from the source to the consumer, the current data state is changed due to the fact that the data is continuously changed by the data activity, and the data activity needs additional data entities, and finally a data conversion diagram of the directed acyclic graph is formed. In the step, a participation subject in the data circulation process is taken as a node to be incorporated into the same blockchain network, and each node in the network can perform information interaction through the blockchain network, so that the situation formed by the original self-forming system, less information interaction and the like due to the data island is effectively broken; information recording and updating are completed through common interaction of the distributed main bodies, and meanwhile, each node in the block chain network is mutually independent and peer-to-peer, so that single-point faults are avoided.
S104, visually displaying the tracing information inquiry result;
in some embodiments of the present invention, a user may perform tracing information query and tracing on an object to be traced, and provide a circulation process and operation processing information of the traced object for the user in a visual manner. Exemplary, the traceability information query specifically includes: acquiring a data Identification (ID) to be traced, and acquiring a blockchain transaction hash value added with the latest tracing information of the data through the data ID; judging whether the transaction hash value exists, if not, indicating that the data does not have relevant traceability information, and if so, carrying out the next step; acquiring transaction specific information from the blockchain according to the transaction hash value, and acquiring tracing information of the data from the additional data; whether the piece of tracing information has original data or not, if so, directly acquiring a transaction hash value stored in the tracing information; and repeating the two steps according to the transaction hash value until the original data in the tracing information is null, ending tracing information inquiry, and displaying a tracing information result set. In the step, the tracing information is directly obtained through the transaction hash value, block traversal is not needed, and query efficiency is effectively improved.
Specifically, when specific query is performed on the traceability information, the traceability tracking is directly performed from the blockchain, in order to perform specific visual presentation of the traceability information, a traceability result set obtained by query from the blockchain is mapped into data in a resource description frame expression form only when visual presentation is performed, the data is stored after verification, then query is performed on the data in the resource description frame form by using a query language, and finally a visual result is formed and presented to a user. The tracing result is clearly and simply displayed to the inquiring user through the step, so that the inquiring efficiency and the using experience of the user are improved.
Embodiment two:
The second embodiment of the present invention provides a trusted stream tracing system based on a blockchain, and fig. 2 is a schematic diagram of module configuration of the trusted stream tracing system based on a blockchain provided in the second embodiment, as shown in fig. 2, where the system includes:
The tracing information acquisition module is used for acquiring tracing information;
the traceability information storage module is used for storing traceability information;
and the traceability information display module is used for displaying the traceability information of the query.
In some embodiments of the present invention, the traceability information acquisition module includes:
The role allocation module is used for performing role allocation on the data;
The data acquisition module is used for acquiring data;
And the identity authentication module is used for authenticating the identity of the user.
In some embodiments of the present invention, the traceability information storage module includes:
the uplink storage module is used for uplink storage of data;
And the data conversion diagram construction module is used for constructing the data conversion diagram.
In some embodiments of the present invention, the traceability information display module includes:
The information inquiry module is used for inquiring the traceability information;
And the visual display module is used for visually displaying the queried information.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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.
Finally, it should be noted that: the foregoing description is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art, although the present invention has been described in detail with reference to the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.