CN112667661B - Tracing information correlation query method and device - Google Patents

Tracing information correlation query method and device Download PDF

Info

Publication number
CN112667661B
CN112667661B CN202011548438.5A CN202011548438A CN112667661B CN 112667661 B CN112667661 B CN 112667661B CN 202011548438 A CN202011548438 A CN 202011548438A CN 112667661 B CN112667661 B CN 112667661B
Authority
CN
China
Prior art keywords
data
information
block
tracing information
original data
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
CN202011548438.5A
Other languages
Chinese (zh)
Other versions
CN112667661A (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.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
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 Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN202011548438.5A priority Critical patent/CN112667661B/en
Publication of CN112667661A publication Critical patent/CN112667661A/en
Application granted granted Critical
Publication of CN112667661B publication Critical patent/CN112667661B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a traceability information association query method and device, wherein a data label corresponding to data to be queried is obtained, a query condition is obtained based on the data label, traceability information corresponding to the query condition is queried from a block chain based on the query condition, if traceability information corresponding to the query condition is queried from one block of the block chain, the traceability information corresponding to the query condition is used as current traceability information, a storage identifier of another piece of traceability information relevant to the current traceability information is obtained from the block storing the current traceability information, based on the storage identifier of the another piece of traceability information, the another piece of traceability information is obtained from the block pointed by the storage identifier, the another piece of traceability information is used as the current traceability information, the storage identifier of the another piece of traceability information relevant to the current traceability information is obtained from the block storing the current traceability information is returned until the value of the storage identifier obtained from the block is empty, all the queried traceability information is output, and the traceability information association query is realized.

Description

Tracing information correlation query method and device
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a traceability information association query method and device.
Background
The data tracing is to acquire the evolution process of the original data through the collection of the historical data evolution process, store the tracing information after generating the tracing information and ensure the source reliability of the original data; and verifying the source of the original data through inquiring the tracing information.
At present, in the process of querying the tracing information, tracing is performed through the hash value of the original data, but the original data with high continuity, high timeliness and high information content is obtained and is fragmented due to excessive data volume, and the hash value of the fragmented data has no relation, so that only one piece of tracing information pointed by the hash value can be obtained in the process of obtaining the tracing information based on the hash value.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for querying related to source tracing information, which are used to obtain all related source tracing information in a query process based on a query condition obtained by data annotation.
In one aspect, the present application provides a method for querying relevance of traceability information, where the method includes:
acquiring a data label corresponding to data to be queried, and obtaining a query condition based on the data label;
based on the query condition, querying the tracing information corresponding to the query condition from the block chain;
if the tracing information corresponding to the query condition is queried from one block of the block chain, taking the tracing information corresponding to the query condition as the current tracing information;
acquiring a storage identifier of another piece of tracing information related to the current tracing information from a block for storing the current tracing information;
based on the storage identifier of the other piece of tracing information, acquiring the other piece of tracing information from the block pointed by the storage identifier, taking the other piece of tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identifier of the other piece of tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identifier acquired from the block is null;
and outputting all the searched tracing information.
Optionally, the method further includes:
after a piece of tracing information containing the data label corresponding to the original data is obtained at present, inquiring whether the data label corresponding to the original data is stored in the block of the block chain;
if the data label corresponding to the original data is not stored in the block of the block chain, storing the currently obtained tracing information containing the data label corresponding to the original data and a storage identifier in one block of the block chain, wherein the storage identifier in the block is empty;
if the block of the block chain stores the data label corresponding to the original data, acquiring a storage identifier of a block storing the last tracing information containing the data label corresponding to the original data, and storing the acquired storage identifier and the currently acquired tracing information containing the data label corresponding to the original data in one block of the block chain.
Optionally, the obtaining a storage identifier of a block storing the source tracing information labeled with the data corresponding to the original data includes:
and acquiring a block number of a block where a data label corresponding to the stored original data and the last tracing information containing the data label corresponding to the original data are located, and taking the block number as a storage identifier of the last block containing the tracing information of the data label corresponding to the original data.
Optionally, the generating process of the data annotation includes:
acquiring attribute information of original data, stream characteristic parameter information of the original data, previous-level data identification information of the original data and verification information of the original data, wherein the stream characteristic parameter information is used for indicating the transmission and creation process of the original data, the previous-level data identification information is used for indicating the previous-level data for generating the original data, and the verification information of the original data is used for verifying the integrity of the original data;
and generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the upper-level data identification information and the verification information.
Optionally, the method further includes: and writing the data label of the original data into the file attribute of the original data.
Optionally, the generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the previous-stage data identification information, and the verification information includes:
generating a data annotation for the raw data based on:
Annotation{IP,Port,Creator,Hash,Time,Attrib,Patent};
IP, port, creator and Time are flow characteristic parameter information, IP represents a source IP address corresponding to the original data, port represents a source Port number corresponding to the original data, creator represents the original data, time represents creation Time of the original data, attrib is the attribute information, patent is the upper-level data identification information, and Hash is the verification information.
Optionally, the outputting of all the source tracing information obtained by querying includes: and integrating all the tracing information according to the query sequence of all the tracing information, and outputting all the integrated tracing information, wherein the query sequence of all the tracing information is determined by the storage identifier corresponding to the tracing information.
Optionally, obtaining the query condition based on the data annotation includes:
determining the data labels as the query conditions;
or alternatively
And obtaining the query condition based on the parameter value in the data annotation.
On the other hand, the present application further provides a device for querying related source tracing information, the device includes:
the query device comprises a condition obtaining unit, a query processing unit and a query processing unit, wherein the condition obtaining unit is used for obtaining data labels corresponding to data to be queried and obtaining query conditions based on the data labels;
a first query unit, configured to query, based on the query condition, source tracing information corresponding to the query condition from a block chain;
a determining unit, configured to, if the tracing information corresponding to the query condition is queried from one block of the block chain, use the tracing information corresponding to the query condition as current tracing information;
the second query unit is used for acquiring a storage identifier of another piece of tracing information related to the current tracing information from a block for storing the current tracing information; based on the storage identifier of the other piece of tracing information, acquiring the other piece of tracing information from the block pointed by the storage identifier, taking the other piece of tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identifier of the other piece of tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identifier acquired from the block is null;
and the output unit is used for outputting all the searched tracing information.
In yet another aspect, the present application further provides a server, including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to execute the instructions to implement the tracing information correlation query method.
In another aspect, the present application further provides a storage medium, in which computer program codes are stored, and when executed, the traceability information association query method is implemented.
By means of the technical scheme, data labels corresponding to data to be queried are obtained, query conditions are obtained based on the data labels, traceability information corresponding to the query conditions is queried from a block chain based on the query conditions, if traceability information corresponding to the query conditions is queried from one block of the block chain, the traceability information corresponding to the query conditions is used as current traceability information, a storage identifier of another piece of traceability information related to the current traceability information is obtained from the block storing the current traceability information, the another piece of traceability information is obtained from the block pointed by the storage identifier based on the storage identifier of the another piece of traceability information, the another piece of traceability information is used as the current traceability information, the storage identifier of the another piece of traceability information related to the current traceability information is obtained from the block storing the current traceability information in a return mode until the value of the storage identifier obtained from the block is empty, all pieces of traceability information queried are output, all pieces of traceability information can be obtained in the query process based on the query conditions obtained by the data labels, and all relevant traceability information can be obtained through query conditions, and different hash values of the query data to be obtained.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for querying source tracing information association provided in an embodiment of the present application;
FIG. 2 is a flow chart of data annotation generation provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a traceability information query provided in an embodiment of the present application;
fig. 4 is a flowchart of another tracing information association query method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a blockchain containing tracing information according to an embodiment of the present disclosure;
fig. 6 is a flowchart illustrating a structure of a device for querying source information related according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flowchart of a method for querying related to source tracing information according to an embodiment of the present application is shown, where the method includes the following steps:
101: and acquiring data labels corresponding to the data to be queried, and obtaining query conditions based on the data labels.
In this embodiment, the data label is used as an identifier of the data to be queried and is used for uniquely pointing to the data to be queried, the data label is at least used for indicating a data source of the data to be queried, an attribute of the data to be queried, and the like, and the data label corresponding to the data to be queried is generated when the data to be queried is obtained, and if the data to be queried is received and a data label is generated in a storage process, the data to be queried can be regarded as original data. For any piece of original data, the generation process of the corresponding data label is as follows:
acquiring attribute information of original data, stream characteristic parameter information of the original data, previous-level data identification information of the original data and verification information of the original data, wherein the stream characteristic parameter information is used for indicating the transmission and creation process of the original data, the previous-level data identification information is used for indicating the previous-level data of the generated original data, and the verification information of the original data is used for verifying the integrity of the original data; and generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the upper-level data identification information and the verification information.
The data source is usually the device from which the original data is obtained (or transmitted by which device), the creation information, and the data generated by which data, and the stream characteristic parameter information and the previous-level data identification information can indicate these contents, for example, the stream characteristic parameter information is used to indicate the device from which the original data is transmitted and the creation information of the original data, the previous-level data identification information is used to indicate the previous-level data that generates the original data, if the original data is a fragmented data stream, the previous-level data identification information points to a data stream set, and if the original data is obtained by performing an intercepting operation on the fragmented data stream, the previous-level data identification information points to the data stream targeted by the intercepting operation.
In this embodiment, a feasible way to generate the data label is to generate the data label of the original data based on the following ways:
Annotation{IP,Port,Creator,Hash,Time,Attrib,Patent}。
IP, port, creator and Time are flow characteristic parameter information, IP represents a source IP address corresponding to original data, port represents a source Port number corresponding to the original data, creator represents the original data, time represents creation Time of the original data, attrib is attribute information, patent is upper-level data identification information and can be expanded, and Hash is check information.
The IP and the Creator are bound and used for checking whether the data source is correct and whether fake data exists; when the raw data has errors, positioning and checking equipment for creating the raw data through a Creator; the Hash carries out integrity protection on the original data to prevent the original data from being tampered; attribute information of different original data may be the same, so that the same attribute information can be used to search the traceability information of the same data stream (obtained by operating multiple pieces of original data on the same data stream) or the same data stream set (obtained by operating multiple pieces of original data on the same data stream set). For a data stream uploaded by certain internet of things equipment, the value of the Creator can be the number of the internet of things equipment, and the value of the Patent is null; for the data stream uploaded by the user, the Creator may take the form of a user name, and the content may take the form of a null, or may take the form of higher-level data that generates the data, such as a data stream set generated by an internet of things device, or analysis data generated by data analysis, and expressed by Hash, time, and Attrib in a data label corresponding to the higher-level data, such as content = (Hash, time, attrib), note that Hash, time, and Attrib in content = (Hash, time, attrib) are all higher-level data.
The attribute information of the original data is determined when the original data are grouped, and after the original data are obtained, the original data are automatically divided into corresponding data groups by adopting a clustering algorithm, and the attribute information of the original data is given. Original data in the same data group have similar or close attribute information, while original data in different data groups have little similar attribute information. For example, the data stream is used as original data, the data stream is subjected to clustering analysis after being received, the data stream is automatically divided into different data groups by adopting a clustering algorithm, and attribute information corresponding to the data stream is given. In this embodiment, the attribute information of the original data is classified into, but not limited to, the following types of attribute information according to the source or use: monitoring data, processing data, analyzing data, and the like.
Because the attribute information of the original data may be similar or similar, and there is a problem that the original data cannot be uniquely identified by the attribute information, in order to ensure the uniqueness of the original data, in the embodiment, stream characteristic parameter information and the like are added in the data label besides the attribute information, which is described in detail in the foregoing description.
After the data label of the original data is generated, the data label is encrypted and protected to ensure the unforgeability and confidentiality of the data label. The data annotations are encrypted, for example, using, but not limited to, a symmetric cryptographic algorithm, such as AES (Advanced Encryption Standard). All blocks corresponding to the block chain share the AES key, which is to ensure that other blocks can read data through decryption during the propagation of the original data.
After the data label of the original data is generated, the data label is embedded into the original data, so that the data label is invisible and is tightly combined with the original data to form an inseparable part of the original data, the expense for repeatedly generating the data label is reduced, and the interaction process of recording the original data by the tracing information is facilitated. However, the hidden embedding manner of the data label is considered to enhance the protection of the data label, which does not affect the viewing of the original data, but may change the original data, possibly causing the problem of integrity. In order that the use of the original data is not affected after the data label is embedded, and the integrity of the data label is not affected when the original data is operated, the label is written in the remark of the detailed information of the file attribute by depending on the file format of the original data, so that the data label can be conveniently read, and the damage to the original data can be avoided.
Taking the original data obtained by slicing the data stream as an example, the process from slicing the data stream to writing the data label into the original data is shown in fig. 2, and may include the following steps:
201: and under the condition that the data stream is monitored to be acquired, fragmenting the data stream to acquire a plurality of original data in preset formats. For example, using, but not limited to, a FileSystemWatcher class provided by net to monitor the data stream uploading, and when the data stream uploading is monitored (i.e. the data stream is regarded as being acquired), fragmenting the data stream by using ffmpeg to form a plurality of mp4 format original data. The step of fragmenting the data stream may be to fragment a data stream set composed of a plurality of data streams to obtain a data stream as the original data; or, a data stream is fragmented to obtain a plurality of fragments of the data stream, and each fragment is regarded as a data stream.
202: the IP and Port of the upload data stream are obtained, such as by but not limited to, using the net to obtain the IP and Port of the file data stream.
203: the creation Time and Creator of the data stream are obtained, such as by using, but not limited to, microsoft.
204: and grouping the original data by adopting a cluster analysis algorithm, and giving corresponding attribute information to the original data based on a data group in which the original data is located, for example, grouping the original data by adopting the cluster analysis algorithm based on, but not limited to, IP, port and Creator.
205: and determining the Hash of the original data, and if the Hash is performed on the original data by adopting but not limited to the md5 algorithm in security.
206: the Patent of the original data is determined.
207: connecting IP, port, creator, hash, time, attrib and Patent together to form a string format data association, namely association { IP, port, creator, hash, time, attrib, patent }.
208: the indication is encrypted, such as but not limited to AES.
209: and modifying the remark in the detailed information of the file attribute by using Microsoft Windows API ICodePack.Shell, and writing the encrypted data label into the remark.
As can be seen from the generation process of the data label shown in fig. 2, the data label in this embodiment includes: the method comprises the following steps of (1) uniqueness, (2) non-forgeability, (3) confidentiality, (4) no influence on the use of original data after embedding, and (5) no influence on the integrity of labeling when the original data is operated.
In this embodiment, the manner of obtaining the query condition based on the data annotation includes, but is not limited to, the following manners:
in one mode, data annotations are determined as query conditions; in another mode, based on the parameter values in the data labels, query conditions are obtained, for example, at least one parameter value is selected from the data labels as a query condition, and at least one parameter in Time, attrib and the like is selected from the data labels as a query condition.
102: and querying the tracing information corresponding to the query condition from the blockchain based on the query condition. In this embodiment, each block of the block chain stores the tracing information containing the data label corresponding to the original data, so that the tracing information corresponding to the query condition is the tracing information in the block where the data label containing the query condition is located.
For example, the block chain includes N blocks, in the process of querying the tracing information corresponding to the query condition from the block chain, if the data pointed by the query condition is marked with a corresponding storage identifier i, querying the tracing information stored in the ith block of the block chain, and acquiring the storage identifier stored in the block, which is j; and then inquiring tracing information stored in the jth block of the block chain, acquiring a storage identifier stored in the block, and inquiring the block of the corresponding block chain according to the storage identifier until the value of the storage identifier stored in the acquired block is empty.
103: and if the tracing information corresponding to the query condition is queried from one block of the block chain, using the tracing information corresponding to the query condition as the current tracing information.
104: and acquiring a storage identifier of another piece of tracing information related to the current tracing information from the block for storing the current tracing information.
In this embodiment, in the storage process of any block in the block chain, not only the tracing information containing the data label is stored, but also the storage identifier of another tracing information containing the same data label as the tracing information stored in the block is stored, and after the tracing information is queried based on the query condition, the storage identifier of another piece of tracing information related to the searched tracing information can be obtained from the block storing the tracing information, so as to obtain another piece of tracing information from the block pointed by the storage identifier, so that the tracing information can be directly obtained based on the storage identifier, a link of traversing all blocks in the block chain is omitted, and the query efficiency is improved.
105: and based on the storage identification of the other tracing information, acquiring the other tracing information from the block pointed by the storage identification, taking the other tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identification of the other tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identification acquired from the block is empty.
106: and outputting all the searched tracing information. One way to output all the queried traceability information is: and integrating all the tracing information according to the query sequence of all the tracing information, outputting all the integrated tracing information, and determining the query sequence of all the tracing information by using the storage identifier corresponding to the tracing information. The query sequence of the tracing information can be indicated by the storage identifier, so that the query sequence is obtained based on the storage identifier corresponding to each tracing information, the arrangement sequence of the tracing information is determined, and all the tracing information is integrated based on the arrangement information of the tracing information.
In order to improve the confidentiality and query efficiency of the tracing information, an index database is constructed in the embodiment, and the index database is used for storing each data label and a storage identifier corresponding to the last piece of tracing information, for example, a block number of a block where the data label is located, and the block number of the block where the data label is located is stored in the index database as an index value, wherein the last piece of tracing information is, relative to the currently obtained tracing information, the tracing information which is stored in the block last time and corresponds to the same data label as the currently obtained tracing information.
If the data annotation is used as the query condition, the query process based on the index database is as shown in fig. 3: acquiring an index value corresponding to data labels serving as query conditions from an index database, determining a block corresponding to the acquired index value from a block chain, and acquiring traceability information and the block number of the block in which the previous traceability information is located from the block; and obtaining the tracing information and the block number of another block from the corresponding block according to the block number of the block where the last piece of tracing information is located, and repeating the steps until the block number of the obtained block is empty, wherein the result shows that all the tracing information of the query is obtained, and the query is stopped. The query based on the index value can avoid the query of useless data when traversing the query block chain, and improve the query speed of the source tracing information.
In addition, the data label can be used as a query condition, the query condition can be obtained based on the data label, for example, at least one parameter value is selected from the data label as the query condition, for example, the same field in the data label is regarded as storage association, such as one time or the same creator, and the like, so that the query condition obtained based on the data label realizes query of the tracing information from multiple aspects, for example, tracing for the same data stream (such as through Patent), tracing for data in the same task (such as through creator and IP), tracing for data in the same period of time, and the like, tracing for data from multiple aspects, and connecting the tracing information in parallel, so that the tracing information is fully utilized, for example, the queried tracing information is analyzed to clarify a data flow path, so as to evaluate reliability of the data.
The data label contains a hash value of the original data, and the tracing information cannot be acquired when the original data is tampered; when the original data is not tampered, the complete and real tracing information can be obtained from the blockchain, so that the authenticity of the original data is verified in the process of inquiring the tracing information. The data label also contains the identification information of the previous level data, and for some analysis data, the identification information of the previous level data can know the data analysis from which the analysis data is obtained, so that whether the analysis of the data is correct or not can be deduced so as to correct the problem and identify the error responsibility.
By means of the technical scheme, data labels corresponding to data to be queried are obtained, query conditions are obtained based on the data labels, traceability information corresponding to the query conditions is queried from a block chain based on the query conditions, if traceability information corresponding to the query conditions is queried from one block of the block chain, the traceability information corresponding to the query conditions is used as current traceability information, a storage identifier of another piece of traceability information related to the current traceability information is obtained from the block storing the current traceability information, the another piece of traceability information is obtained from the block pointed by the storage identifier based on the storage identifier of the another piece of traceability information, the another piece of traceability information is used as the current traceability information, the storage identifier of the another piece of traceability information related to the current traceability information is obtained from the block storing the current traceability information in a return mode until the value of the storage identifier obtained from the block is empty, all pieces of traceability information queried are output, all pieces of traceability information can be obtained in the query process based on the query conditions obtained by the data labels, and all relevant traceability information can be obtained through query conditions, and different hash values of the query data to be obtained.
Referring to fig. 4, a flowchart of another tracing information association query method provided in the embodiment of the present application is shown, which illustrates a process of storing data labels and tracing information, and may include the following steps:
301: after a piece of tracing information containing the data label corresponding to the original data is obtained at present, whether the data label corresponding to the original data is stored in the block of the block chain is inquired. It can be understood that: the tracing information is a record of a certain processing process of the original data, so that one piece of tracing information is generated every time one piece of original data is processed. Whether the data labels corresponding to the original data are stored in the blocks of the block chain is queried so as to obtain the storage identifiers of the blocks storing the data labels of the same original data in the process of storing the traceability information, so that all relevant traceability information can be queried based on one data label in the querying process.
302: if the block of the block chain does not store the data label corresponding to the original data, storing the tracing information containing the data label corresponding to the original data and the storage identifier in one block of the block chain, wherein the storage identifier in the block is empty.
If the block of the block chain does not store the data label corresponding to the original data, it is described that the block chain does not store the data label corresponding to the original data, the tracing information containing the data label corresponding to the original data is currently stored for the first time, and the block of the block chain does not store the data label corresponding to the original data before, which means that the value of the storage identifier cannot be obtained, the storage identifier is null.
303: if the block of the block chain stores the data label corresponding to the original data, acquiring a storage identifier of a block storing the last tracing information containing the data label corresponding to the original data, and storing the acquired storage identifier and the currently obtained tracing information containing the data label corresponding to the original data in one block of the block chain.
If the block of the block chain stores the data label corresponding to the original data, which means that the block chain stores the tracing information of the original data, the block chain can obtain a storage identifier for storing the last tracing information containing the data label corresponding to the original data, and store the obtained storage identifier and the currently obtained tracing information containing the data label corresponding to the original data in one block of the block chain. The last tracing information containing the data label corresponding to the original data is the tracing information of the data label corresponding to the same original data corresponding to the last tracing information stored in the block, and if the tracing information containing the data label A is obtained currently, the last tracing information containing the data label A is determined to be stored in the block of the block chain for the jth time through searching the block of the block chain, and then the storage identifier of the block of the tracing information of the data label A stored for the jth time is obtained.
In this embodiment, but not limited to, the index database may store each data label and the storage identifier corresponding to the tracing information, and the block number of the block where the tracing information is located is used as one representation form of the storage identifier, whether the corresponding data label corresponding to the original data is stored in the block of the query block chain or not may be searched from the index database, if the data label corresponding to the original data is stored in the index database, the block number of the block where the data label corresponding to the original data and the tracing information containing the data label corresponding to the original data are located is obtained from the index database, the block number is used as the storage identifier of the latest block containing the tracing information of the data label corresponding to the original data, and the obtained block number storage identifier and the currently obtained tracing information containing the data label corresponding to the original data are stored in one block of the block chain.
In the process of storing the acquired block number storage identifier and the traceability information containing the data label corresponding to the original data in the block of the block chain, updating the index database, and updating the index value of the currently stored data label in the index database to the block number of the block storing the traceability information this time/currently, so that all relevant traceability information can be inquired based on one data label in the inquiry process.
In the storage process, the tracing information containing the data label and the storage identifier can be stored in the block body of the block chain together by calling the intelligent contract, a return function in the intelligent contract is called, the block number of the block where the tracing information and the storage identifier are currently stored is returned, the corresponding index value of the data label in the index database is updated, the block number of the block returned by the return function is modified, one tracing information generated by each operation of each original data is stored in one block, and finally a tracing chain is formed, as shown in fig. 5.
304: and acquiring data labels corresponding to the data to be queried, and obtaining query conditions based on the data labels. The data label corresponding to the data to be queried may be a data label corresponding to one piece of original data stored in the block chain.
305: and querying the tracing information corresponding to the query condition from the blockchain based on the query condition.
306: and querying the tracing information corresponding to the query condition from one block of the block chain, and taking the tracing information corresponding to the query condition as the current tracing information.
307: and acquiring a storage identifier of another piece of tracing information related to the current tracing information from the block for storing the current tracing information.
308: and based on the storage identification of the other tracing information, acquiring the other tracing information from the block pointed by the storage identification, taking the other tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identification of the other tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identification acquired from the block is empty.
309: and outputting all the searched tracing information.
By means of the technical scheme, the storage of the tracing information labeled on each piece of data containing the original data is realized in a block chain mode, and the association between the tracing information of the same original data is established through the storage identification, so that the association query of the tracing information is facilitated. In the process of storing the traceability information by adopting the block chain technology, all blocks of the uplink store the traceability information, once the traceability information in a certain block is tampered, verification can be performed through verification information in other blocks (the block heads of the blocks carry the verification information, and the block bodies of the blocks store data labels and traceability information), and the reliability of the traceability information is improved by the decentralized block chain technology.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present application is not limited by the order of acts or acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Please refer to fig. 6, which shows an optional structure of a tracing information association query apparatus provided in an embodiment of the present application, and the optional structure may include: a condition obtaining unit 10, a first querying unit 20, a determining unit 30, a second querying unit 40 and an output unit 50.
The condition obtaining unit 10 is configured to obtain a data label corresponding to data to be queried, and obtain a query condition based on the data label; the manner in which the condition obtaining unit 10 obtains the query condition includes, but is not limited to: determining the data labels as query conditions; or obtaining the query condition based on the parameter value in the data annotation.
The generation process of the data annotation comprises the following steps: acquiring attribute information of original data, stream characteristic parameter information of the original data, previous-level data identification information of the original data and verification information of the original data, wherein the stream characteristic parameter information is used for indicating the transmission and creation process of the original data, the previous-level data identification information is used for indicating the previous-level data of the generated original data, and the verification information of the original data is used for verifying the integrity of the original data; and generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the upper-level data identification information and the verification information. A writing mode of data labels is as follows: and writing the data labels of the original data into the file attributes of the original data.
The data annotation of the raw data may be generated based on:
Annotation{IP,Port,Creator,Hash,Time,Attrib,Patent};
IP, port, creator and Time are stream characteristic parameter information, the IP represents a source IP address corresponding to original data, the Port represents a source Port number corresponding to the original data, the Creator of the original data, the Time represents creation Time of the original data, attrib is attribute information, the Patent is upper-level data identification information, and the Hash is verification information.
A first query unit 20, configured to query, based on a query condition, source tracing information corresponding to the query condition from a block chain;
the determining unit 30 is configured to, if the tracing information corresponding to the query condition is queried from a block of the block chain, use the tracing information corresponding to the query condition as current tracing information.
A second query unit 40, configured to obtain, from the block storing the current tracing information, a storage identifier of another piece of tracing information related to the current tracing information; and based on the storage identification of the other tracing information, acquiring the other tracing information from the block pointed by the storage identification, taking the other tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identification of the other tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identification acquired from the block is empty.
And the output unit 50 is used for outputting all the searched tracing information. One output mode is: and integrating all the tracing information according to the query sequence of all the tracing information, outputting all the integrated tracing information, and determining the query sequence of all the tracing information by using the storage identifier corresponding to the tracing information.
The tracing information association query device further includes: the storage unit is configured to, after a piece of tracing information including a data label corresponding to original data is currently obtained, store the currently obtained tracing information including the data label corresponding to the original data and a storage identifier in a block of the block chain if the block of the block chain does not store the data label corresponding to the original data, where the storage identifier in the block is empty, and, if the block of the block chain stores the data label corresponding to the original data, obtain the storage identifier of the block storing the last tracing information including the data label corresponding to the original data, and store the obtained storage identifier and the currently obtained tracing information including the data label corresponding to the original data in a block of the block chain.
One way to obtain the storage identifier of the block storing the previous tracing information containing the data label corresponding to the original data is as follows: and acquiring a block number of a block where a data label corresponding to the stored original data and the last tracing information containing the data label corresponding to the original data are located, and taking the block number as a storage identifier of the last block containing the tracing information of the data label corresponding to the original data.
The tracing information correlation query device obtains the data labels corresponding to the data to be queried, obtains query conditions based on the data labels, queries the tracing information corresponding to the query conditions from a block chain based on the query conditions, if the tracing information corresponding to the query conditions is queried from a block of the block chain, takes the tracing information corresponding to the query conditions as the current tracing information, obtains the storage identifier of another piece of tracing information related to the current tracing information from the block storing the current tracing information, obtains another piece of tracing information from the block pointed by the storage identifier based on the storage identifier of the another piece of tracing information, takes the another piece of tracing information as the current tracing information, returns to continuously execute the step of obtaining the storage identifier of the another piece of tracing information related to the current tracing information from the block storing the current tracing information until the value of the storage identifier obtained from the block is empty, outputs all pieces of queried tracing information, can obtain all pieces of related tracing information in the query conditions obtained based on the data labels in the query process, and can obtain all pieces of related tracing information even if all pieces of query information corresponding to-be obtained by the hash values of the query data are obtained by the hash information in the query conditions based on the query conditions obtained by the query information.
An embodiment of the present application further provides a server, including: a processor and a memory for storing processor-executable instructions; the processor is configured to execute the instructions to implement the tracing information correlation query method.
The embodiment of the present application further provides a storage medium, where a computer program code is stored in the storage medium, and when executed, the traceability information association query method is implemented.
It should be noted that, various embodiments in this specification may be described in a progressive manner, and features described in various embodiments in this specification may be replaced with or combined with each other, each embodiment focuses on differences from other embodiments, and similar parts between various embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and reference may be made to the partial description of the method embodiment for relevant points.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (9)

1. A tracing information correlation query method is characterized by comprising the following steps:
acquiring a data label corresponding to data to be queried, and obtaining a query condition based on the data label;
based on the query condition, querying the tracing information corresponding to the query condition from the block chain;
if the tracing information corresponding to the query condition is queried from one block of the block chain, taking the tracing information corresponding to the query condition as current tracing information;
acquiring a storage identifier of another piece of tracing information related to the current tracing information from a block for storing the current tracing information;
based on the storage identification of the other tracing information, acquiring the other tracing information from the block pointed by the storage identification, taking the other tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identification of the other tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identification acquired from the block is empty;
outputting all the searched tracing information;
the generation process of the data annotation comprises the following steps: acquiring attribute information of original data, stream characteristic parameter information of the original data, previous-level data identification information of the original data and verification information of the original data, wherein the stream characteristic parameter information is used for indicating the transmission and creation process of the original data, the previous-level data identification information is used for indicating the previous-level data for generating the original data, and the verification information of the original data is used for verifying the integrity of the original data; and generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the upper-level data identification information and the verification information.
2. The method of claim 1, further comprising:
after obtaining a piece of tracing information containing a data label corresponding to original data at present, inquiring whether a block of the block chain stores the data label corresponding to the original data or not;
if the block of the block chain does not store the data label corresponding to the original data, storing the currently obtained tracing information containing the data label corresponding to the original data and a storage identifier in one block of the block chain, wherein the storage identifier in the block is empty;
if the block of the block chain stores the data label corresponding to the original data, acquiring a storage identifier of a block storing the last tracing information containing the data label corresponding to the original data, and storing the acquired storage identifier and the currently acquired tracing information containing the data label corresponding to the original data in one block of the block chain.
3. The method according to claim 2, wherein the obtaining of the storage identifier of the last block storing the tracing information containing the data label corresponding to the original data comprises:
and acquiring a block number of a block where a data label corresponding to the stored original data and the last tracing information containing the data label corresponding to the original data are located, and taking the block number as a storage identifier of the last block containing the tracing information of the data label corresponding to the original data.
4. The method of claim 1, further comprising: and writing the data labels of the original data into the file attributes of the original data.
5. The method of claim 4, wherein the generating the data label of the original data based on the attribute information, the stream characteristic parameter information, the previous-level data identification information, and the verification information comprises:
generating a data annotation for the raw data based on:
Annotation{IP, Port, Creator, Hash, Time, Attrib, Patent };
IP, port, creator and Time are flow characteristic parameter information, IP represents a source IP address corresponding to the original data, port represents a source Port number corresponding to the original data, creator represents the original data, time represents creation Time of the original data, attrib is the attribute information, patent is the upper-level data identification information, and Hash is the verification information.
6. The method according to any one of claims 1 to 5, wherein the outputting all the traced information obtained by the query comprises: and integrating all the tracing information according to the query sequence of all the tracing information, and outputting all the integrated tracing information, wherein the query sequence of all the tracing information is determined by the storage identifier corresponding to the tracing information.
7. The method according to any one of claims 1 to 5, wherein the obtaining of the query condition based on the data annotation comprises:
determining the data labels as the query conditions;
or alternatively
And obtaining the query condition based on the parameter value in the data annotation.
8. A tracing information association query device is characterized in that the device comprises:
the query device comprises a condition obtaining unit, a query processing unit and a query processing unit, wherein the condition obtaining unit is used for obtaining data labels corresponding to data to be queried and obtaining query conditions based on the data labels;
a first query unit, configured to query, based on the query condition, source tracing information corresponding to the query condition from a block chain;
a determining unit, configured to, if the tracing information corresponding to the query condition is queried from one block of the block chain, use the tracing information corresponding to the query condition as current tracing information;
the second query unit is used for acquiring a storage identifier of another piece of tracing information related to the current tracing information from a block for storing the current tracing information; based on the storage identification of the other tracing information, acquiring the other tracing information from the block pointed by the storage identification, taking the other tracing information as the current tracing information, and returning to continue to execute the step of acquiring the storage identification of the other tracing information related to the current tracing information from the block for storing the current tracing information until the value of the storage identification acquired from the block is empty;
the output unit is used for outputting all the searched tracing information;
the generation process of the data annotation comprises the following steps: acquiring attribute information of original data, stream characteristic parameter information of the original data, previous-stage data identification information of the original data and verification information of the original data, wherein the stream characteristic parameter information is used for indicating the transmission and creation process of the original data, the previous-stage data identification information is used for indicating the generation of the previous-stage data of the original data, and the verification information of the original data is used for verifying the integrity of the original data; and generating a data label of the original data based on the attribute information, the stream characteristic parameter information, the upper-level data identification information and the verification information.
9. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the traceability information association query method of any one of claims 1 to 7.
CN202011548438.5A 2020-12-24 2020-12-24 Tracing information correlation query method and device Active CN112667661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011548438.5A CN112667661B (en) 2020-12-24 2020-12-24 Tracing information correlation query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011548438.5A CN112667661B (en) 2020-12-24 2020-12-24 Tracing information correlation query method and device

Publications (2)

Publication Number Publication Date
CN112667661A CN112667661A (en) 2021-04-16
CN112667661B true CN112667661B (en) 2022-10-28

Family

ID=75408282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011548438.5A Active CN112667661B (en) 2020-12-24 2020-12-24 Tracing information correlation query method and device

Country Status (1)

Country Link
CN (1) CN112667661B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392625A (en) * 2017-06-29 2017-11-24 雷霞 Distributed medicine source tracing method and device based on block chain
CN109800248A (en) * 2018-12-17 2019-05-24 上海点融信息科技有限责任公司 Digital content for block chain network is traced to the source and recording method, storage medium, calculating equipment
CN110675171A (en) * 2019-09-29 2020-01-10 匿名科技(重庆)集团有限公司 Anti-counterfeiting tracing method based on block chain
CN111737343A (en) * 2020-05-11 2020-10-02 广州大学 Information labeling method based on block chain
CN112000730A (en) * 2020-07-10 2020-11-27 邦邦汽车销售服务(北京)有限公司 Tracing information writing and tracing information verification method and system based on block chain
WO2020237874A1 (en) * 2019-05-24 2020-12-03 平安科技(深圳)有限公司 Project data verification method, device, computer apparatus and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807641A (en) * 2018-08-01 2020-02-18 隽名有限公司 Pet food traceability system
US11250411B2 (en) * 2018-10-16 2022-02-15 American Express Travel Related Services Company, Inc. Secure mobile checkout system
US11399031B2 (en) * 2019-02-05 2022-07-26 Centurylink Intellectual Property Llc Tracking or storing of equipment configuration data using immutable ledger functionality of blockchains

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392625A (en) * 2017-06-29 2017-11-24 雷霞 Distributed medicine source tracing method and device based on block chain
CN109800248A (en) * 2018-12-17 2019-05-24 上海点融信息科技有限责任公司 Digital content for block chain network is traced to the source and recording method, storage medium, calculating equipment
WO2020237874A1 (en) * 2019-05-24 2020-12-03 平安科技(深圳)有限公司 Project data verification method, device, computer apparatus and storage medium
CN110675171A (en) * 2019-09-29 2020-01-10 匿名科技(重庆)集团有限公司 Anti-counterfeiting tracing method based on block chain
CN111737343A (en) * 2020-05-11 2020-10-02 广州大学 Information labeling method based on block chain
CN112000730A (en) * 2020-07-10 2020-11-27 邦邦汽车销售服务(北京)有限公司 Tracing information writing and tracing information verification method and system based on block chain

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
A Big Data Provenance Model for Data Security Supervision Based on PROV-DM Model;Yuanzhao Gao et al.;《IEEE Access》;20200224;第38742-38752页 *
Application and research progress of food safety traceability system based on blockchain technology;Xu Rui et al.;《Journal of Food Safety and Quality》;20201125;第7610-7616页 *
Internet News Traceability Solution Based on Blockchain;Zhang Xin et al.;《2019 IEEE/ACIS 18th International Conference on Computer and Information Science (ICIS)》;20191227;第 236-240页 *
ProvChain: A Blockchain-Based Data Provenance Architecture in Cloud Environment with Enhanced Privacy and Availability;Xueping Liang et al.;《2017 17th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID)》;20170713;第468-477页 *
基于区块链的农产品追溯系统信息存储模型与查询方法;杨信廷等;《农业工程学报》;20191123(第22期);第323-330页 *
基于区块链的数据溯源可信查询方法;张学旺 等;《应用科学学报》;20201214;第1-13页 *
基于区块链的溯源信息存储平台的研究与实现;刘雅东;《中国优秀硕士学位论文全文数据库 信息科技辑》;20190815;第I138-502页 *
数据溯源研究与实践进展;王芳等;《情报学进展》;20200731(第00期);第313-353页 *

Also Published As

Publication number Publication date
CN112667661A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN112685436B (en) Tracing information processing method and device
CA2318908C (en) Content addressable information encapsulation, representation, and transfer
US7398391B2 (en) Content addressable information encapsulation, representation, and transfer
US7681045B2 (en) Software algorithm identification
US8010803B2 (en) Methods and apparatus for automated export compliance
US20090113545A1 (en) Method and System for Tracking and Filtering Multimedia Data on a Network
JP2006518508A (en) Additional hash functions in content-based addressing
CN109522328B (en) Data processing method and device, medium and terminal thereof
KR20040021684A (en) Multiple step identification of recordings
JP2008542865A (en) Digital proof bag
CN111459935B (en) Internet of things data storage method, storage system, query method and storage medium
US20080243751A1 (en) Method and Apparatus for Recording Associations with Logs
Raghavan A framework for identifying associations in digital evidence using metadata
Pahade et al. A survey on multimedia file carving
CN112667661B (en) Tracing information correlation query method and device
Raghavan et al. Eliciting file relationships using metadata based associations for digital forensics
CN115567212A (en) File processing method and device, computer equipment and computer readable storage medium
CN114003737A (en) Double-record examination assisting method, device, equipment and medium based on artificial intelligence
CN112035890B (en) Data integrity verification method and device
JP5063440B2 (en) Processing apparatus and processing method
CN112631873B (en) Log monitoring method, device, computer equipment and storage medium
Nguyen et al. A Novel Solution to Query Assurance Verification for Dynamic Outsourced XML Databases.
US20240119178A1 (en) Anonymizing personal information for use in assessing fraud risk
CN117788019A (en) Food traceability verification method and system
Sigvardsson Code Cloning Habits Of The Jupyter Notebook Community

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