A data tracing method, device, equipment and storage medium
By using blockchain technology to obtain and verify data in data traceability, the data traceability process is accelerated, the inefficiency and data security problems are solved, and efficient and reliable data traceability is achieved.
Patent Information
- Application Number
- CN202410221983.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-02-28
AI Technical Summary
In the prior art, data traceability is inefficient due to the huge data and the need for manual intervention to mark, and there are problems of data leakage and data loss.
By obtaining the traceability query request, accessing the blockchain to obtain the target encryption information and the node information of the Merkel tree, querying the storage area to obtain the original data. If the encryption information is consistent, determine the time period and traverse the Merkel tree to obtain the traceability data. Blockchain technology ensures data security.
Improve the efficiency and reliability of data traceability without interfering with normal data operation, avoiding data leakage and missing, and ensuring data security.
Smart Images

Figure CN118550968B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a data tracing method, device, equipment and storage medium. Background Art
[0002] Multimodal sensor technology is a key innovation in data collection and analysis, which involves the use of various types of sensors to capture different data modalities or types, such as images, sound, temperature, humidity, etc. These sensors work in different ways, for example, image sensors are used to capture visual information of the scene, microphone sensors are used to capture sound signals, temperature sensors are used to measure ambient temperature, etc. These sensors can provide rich data at different time and space scales, thereby providing data views from multiple angles and dimensions to more comprehensively and accurately understand and analyze the environment, events or objects.
[0003] When there is a problem with the data provided by the sensor, data traceability is required. Data traceability can be used to track the propagation and evolution of data to identify data risks and anomalies. Traditional data traceability methods usually require intervention and labeling of data to record the path and changes of data, but this method will interfere with the normal use of data, consume a lot of manpower and time, and is prone to privacy data leakage and data loss during data traceability. Summary of the invention
[0004] The embodiments of the present invention provide a data tracing method, device, equipment and storage medium, which solve the problems of low efficiency, data leakage and data missing caused by huge data and the need for manual intervention and marking in data tracing in the prior art.
[0005] According to one aspect of the present invention, a data tracing method is provided, comprising:
[0006] Obtain a provenance query request, access the blockchain according to the provenance query request, and obtain target encrypted information and target Merkle tree node information corresponding to the provenance query request;
[0007] Query the target storage area according to the node information of the target Merkle tree to obtain the original data corresponding to the traceability query request;
[0008] If the first encryption information of the original data corresponding to the traceability query request is consistent with the target encryption information corresponding to the traceability query request, determining the target time period according to the traceability query request and the preset period;
[0009] The target Merkle tree is traversed, and the original data corresponding to the node information of the target Merkle tree within the target time period is determined as the target tracing data.
[0010] According to another aspect of the present invention, a data tracing device is provided, the data tracing device comprising:
[0011] An acquisition module is used to acquire a traceability query request, access the blockchain according to the traceability query request, and obtain the target encrypted information and the node information of the target Merkle tree corresponding to the traceability query request;
[0012] The obtaining module is used to query the target storage area according to the node information of the target Merkle tree and obtain the original data corresponding to the traceability query request;
[0013] a determination module, configured to determine a target time period according to the source tracing query request and a preset period if the first encryption information of the original data corresponding to the source tracing query request is consistent with the target encryption information corresponding to the source tracing query request;
[0014] The traversal module is used to traverse the target Merkle tree and determine the original data corresponding to the node information of the target Merkle tree within the target time period as the target tracing data.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data tracing method described in any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data tracing method described in any embodiment of the present invention when executed.
[0020] The embodiment of the present invention obtains a traceability query request, accesses the blockchain according to the traceability query request, obtains the target encrypted information corresponding to the traceability query request and the node information of the target Merkle tree; queries the target storage area according to the node information of the target Merkle tree, and obtains the original data corresponding to the traceability query request; if the first encrypted information of the original data corresponding to the traceability query request is consistent with the target encrypted information corresponding to the traceability query request, determines the target time period according to the traceability query request and the preset period; traverses the target Merkle tree, and determines the original data corresponding to the node information of the target Merkle tree within the target time period as the target traceability data, which solves the problems of low efficiency, data leakage and data missing caused by huge data and the need for manual intervention and marking in the prior art, can trace the data without interfering with the normal operation of the data, ensure the security of the data through blockchain technology, and thus improve the efficiency and reliability of data traceability.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flow chart of a data tracing method in Embodiment 1 of the present invention;
[0024] Figure 2 is a schematic diagram of a multimodal fusion coding feature in the first embodiment of the present invention;
[0025] Figure 3 It is a structural schematic diagram of a data tracing device in Embodiment 2 of the present invention;
[0026] Figure 4 It is a structural schematic diagram of an electronic device in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0030] Embodiment 1
[0031] Figure 1 This is a flow chart of a data tracing method in Embodiment 1 of the present invention. This embodiment is applicable to the case of tracing the source of data. This method can be executed by a data tracing device in the embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:
[0032] S110, obtaining a traceability query request, accessing the blockchain according to the traceability query request, and obtaining the target encryption information and the node information of the target Merkle tree corresponding to the traceability query request.
[0033] Among them, the traceability query request may include a timestamp and a sensor identifier, and may also include a timestamp, a sensor identifier, and target encryption information. The target encryption information is the encryption information related to the timestamp and sensor identifier in the traceability query request, and the encryption information may be Token information. The target Merkle tree is a Merkle tree related to the traceability query request, and the node information of its nodes is related to the timestamp and sensor identifier of the traceability query request. The node information includes the Merkle root node, and also includes the address information of the original data corresponding to the node when it is stored. According to the address information, the original data corresponding to the node can be queried.
[0034] Specifically, obtain the traceability query request, parse the traceability query request, obtain the specific timestamp and sensor identifier in the traceability query request, access the blockchain according to the specific timestamp and sensor identifier in the traceability query request, and obtain the target encryption information and target Merkle tree node information related to the traceability query request in the blockchain. For example, the traceability query request can be Request = {Timestamp, SensorID}, where Timestamp is a specific timestamp, SensorID is a sensor identifier, and the number of sensor identifiers is not limited.
[0035] S120, query the target storage area according to the node information of the target Merkle tree to obtain the original data corresponding to the traceability query request.
[0036] Among them, the data stored in the target storage area is original data, which may include initial unimodal data and multimodal fusion coding features. The original data may also include reduced-dimensional unimodal data corresponding to the initial unimodal data and unimodal fusion coding features corresponding to the initial unimodal data, wherein the initial unimodal data may carry the corresponding sensor identifier.
[0037] Specifically, the target storage area is queried according to the address information in the node information of the target Merkle tree to obtain the original data corresponding to the address information in the target storage area.
[0038] S130: If the first encryption information of the original data corresponding to the source tracing query request is consistent with the target encryption information corresponding to the source tracing query request, determine the target time period according to the source tracing query request and the preset period.
[0039] The first encrypted information of the original data corresponding to the traceability query request is the encrypted information obtained by performing a hash function calculation on the original data corresponding to the traceability query request. The preset period can be set according to actual needs, and the target time period is determined according to the timestamp in the traceability query request and the preset period.
[0040] Specifically, after obtaining the original data corresponding to the traceability query request, a hash calculation is performed on the original data corresponding to the traceability query request to obtain the first encrypted information. If the first encrypted information is consistent with the target encrypted information, it means that the data recorded in the blockchain is consistent with the original data stored in the target storage area, and the original data remains intact. The target time period is determined based on the timestamp and preset period in the traceability query request.
[0041] S140, traversing the target Merkle tree, and determining the original data corresponding to the node information of the target Merkle tree within the target time period as the target tracing data.
[0042] The target traceability data is the data to be traced by the traceability query request.
[0043] Specifically, the nodes on the target Merkle tree are traversed, the original data in the target storage area is queried according to the node information of all target Merkle trees within the target time period, and the original data corresponding to the node information of the target Merkle tree within the target time period is determined as the target tracing data.
[0044] Optionally, the original data includes: initial single-modal data and multi-modal fusion coding features;
[0045] Before obtaining the traceability query request, it also includes:
[0046] Acquire at least two types of initial unimodal data, and obtain multimodal fusion coding features according to the at least two types of initial unimodal data;
[0047] The original encrypted information and the node information of the original Merkle tree are obtained according to the multimodal fusion coding features, and the original encrypted information and the node information of the original Merkle tree are stored in the blockchain;
[0048] The initial unimodal data and the multimodal fusion coding features are stored in a target storage area.
[0049] Among them, the initial unimodal data is the data obtained by the sensor. Each type of sensor can obtain a type of initial unimodal data, for example, the sound modal data obtained by the sound sensor, and the image modal data obtained by the image sensor (such as a camera). The initial unimodal data can carry a timestamp and a sensor identifier. The multimodal fusion coding feature is the multimodal fusion coding feature after the dimensionality reduction and fusion of at least two types of initial unimodal data. The original encrypted information is the encrypted information corresponding to the multimodal fusion coding feature, and the node information of the original Merkel tree is the node information obtained by hashing the original encrypted information.
[0050] Specifically, at least two types of initial unimodal data are obtained, dimension reduction is performed on each type of initial unimodal data, and each type of initial unimodal data after dimension reduction is fused to obtain multimodal fusion coding features.
[0051] Specifically, a hash calculation is performed on the multimodal fusion coding features to obtain the original encrypted information, a hash calculation is performed on the original encrypted information to obtain the node information of the original Merkle tree, and the original encrypted information and the node information of the original Merkle tree are stored in the blockchain.
[0052] Specifically, each initial single-modal data and the multimodal fusion coding feature are associated and stored as raw data in the target storage area.
[0053] By storing the original encrypted information and the node information of the original Merkle tree in the blockchain, the data can be ensured to be tamper-proof and traceable. Storing the initial single-modal data and multimodal fusion coding features in the target storage area can facilitate subsequent data tracing.
[0054] Optionally, obtaining a multimodal fusion coding feature according to the at least two types of initial single-modal data includes:
[0055] Inputting the at least two types of initial unimodal data into a multi-layer tensor autoencoder to obtain dimension-reduced unimodal data corresponding to each of the initial unimodal data;
[0056] Inputting the dimension-reduced unimodal data corresponding to each of the initial unimodal data into a self-attention encoder to obtain a unimodal fusion coding feature corresponding to each of the initial unimodal data;
[0057] A multimodal fusion coding feature is obtained according to the unimodal fusion coding feature corresponding to each initial unimodal data.
[0058] Among them, the multi-layer tensor auto-encoder (TAE) belongs to the category of tensor decomposition model. This model is a technology for extracting high-level semantic features of data. It is suitable for processing large-scale data and is particularly suitable for extracting high-level semantic features of multi-source heterogeneous data. The tensor model uses tensors (high-dimensional arrays) to represent the internal structure of the data, and decouples the high-level features of the data by decomposing the tensors, which helps to preserve the integrity of the data while reducing the dimension of the data, thereby reducing the complexity of the data. The multi-layer tensor auto-encoder is similar to a neural network. The data of each layer is represented by a tensor and passed to the next layer through an S-shaped activation function. This stacked TAE model can gradually extract high-level semantic features from the data and effectively achieve data dimensionality reduction and feature extraction.
[0059] Specifically, each initial unimodal data is input into a multi-layer tensor autoencoder to obtain dimension-reduced unimodal data corresponding to each initial unimodal data after dimension reduction.
[0060] Specifically, the reduced-dimensional unimodal data corresponding to each initial unimodal data is input into the self-attention encoder, and the reduced-dimensional unimodal data corresponding to each initial unimodal data can be fused, as follows:
[0061]
[0062] in, is the reduced-dimensional unimodal data corresponding to each initial unimodal data, Z is the key vector, and the depth representation code is projected as the query vector Q. The key vector and the query vector determine the generation of the value vector V. D represents the dimension of the hidden layer of the self-attention encoder and the feedforward neural network. In the actual calculation of the self-attention encoder, the attention weight is obtained by scaling the dot product of the query vector and the key vector and applying the softmax function. Finally, the attention weight is applied to the value vector to generate the final unimodal fusion coding feature corresponding to each initial unimodal data.
[0063] Specifically, the unimodal fusion coding features corresponding to each initial unimodal data can be stacked in pairs, and the stacked coding features can be fused to obtain multimodal fusion coding features. For example, if the unimodal fusion coding feature corresponding to the initial unimodal data of sensor k1 is Z k , the unimodal fusion encoding feature corresponding to the initial unimodal data of sensor m2 is Z m , the unimodal fusion encoding feature corresponding to the initial unimodal data of sensor n3 is Z n , Z k , Z m With Z n Stacked two by two <Z k ,Z m >、 <Z k ,Z n > and <Z n ,Z m >, then <Z k ,Z m >、 <Z k ,Z n > and <Z n ,Z m >Fusing to obtain multimodal fusion coding features; the single-modal fusion coding features can also be sorted according to the sensor identification, and the adjacent single-modal fusion coding features after sorting are stacked in pairs, and the stacked single-modal fusion coding features are fused to obtain multimodal fusion coding features. For example, according to the single-modal fusion coding features of k1 sensor, m2 sensor and n3 sensor, the single-modal fusion coding features are sorted to obtain Z k , Z m , Z n , after stacking two by two, <Z k ,Zm > and <Z m ,Z n >, <Z k ,Z m > and <Z m ,Z n >Fuse to obtain multimodal fusion encoding features.
[0064] Optionally, obtaining a multimodal fusion coding feature according to the unimodal fusion coding feature corresponding to each initial unimodal data includes:
[0065] Performing a stacking operation on the unimodal fusion coding features corresponding to each initial unimodal data to obtain at least one multimodal stacked coding feature;
[0066] Aggregating at least one multimodal stacked coding feature through a maximum pooling layer to obtain at least one multimodal aggregated coding feature;
[0067] At least one multimodal aggregated encoding feature is input into a multi-head attention encoder to obtain a multimodal fusion encoding feature.
[0068] The stacking operation may be a multi-modal multiplication operation of two single-modal fusion coding features.
[0069] Specifically, the unimodal fusion coding feature corresponding to each initial unimodal data is represented in the form of a tensor, and at least one multimodal stacked coding feature is obtained according to the multimodal multiplication operation of the tensor. For example, if a K-th order tensor is represented as: Its elements can be expressed as Another K-order tensor is represented as: Its elements can be expressed as Multiply tensor A and tensor B in a specific order to obtain a new tensor, the multimodal stacked encoding feature<A,B> , expressed as:
[0070]
[0071] That is to say, if a single modal fusion encoding feature is Z k , and the other is a single-modal fusion encoding feature Z m , the multimodal stacked encoding feature is <Z k ,Z m >.
[0072] Specifically, after obtaining at least one multimodal stacking coding feature, each multimodal stacking coding feature is aggregated through a maximum pooling layer to obtain a multimodal aggregated coding feature corresponding to each multimodal stacking coding feature. For example, the multimodal stacking coding feature <Z k ,Z m>Perform maximum pooling layer aggregation to obtain multimodal aggregated encoding features <Z k ,Z m >′.
[0073] Specifically, at least one multimodal aggregate coding feature is input into the multi-head attention encoder to further refine the fusion of the multimodal aggregate coding features to obtain the final reduced-dimensional multimodal fusion coding features. In this process, in order to measure the spatiotemporal correlation of the fusion of different multimodal aggregate coding features, the following formula can be used:
[0074] k ij =softmax(X T ·tanh(Y·S ij ));
[0075] Among them, X and Y are the training parameters of the multi-head attention encoder, and S is the weight matrix used for the multi-head attention mechanism. ij The multimodal fusion encoding feature can be a fusion of multimodal aggregate encoding features. In the multi-head attention encoder, the values of X and Y affect how the multi-head attention encoder learns to allocate attention to the weight of each multimodal aggregate encoding feature input into the multi-head attention encoder. During the training process, the X and Y parameters are updated by back propagation to minimize the loss function.
[0076] In a specific example, Figure 2 is a schematic diagram of a multi-modal fusion coding feature in the first embodiment of the present invention, such as Figure 2 As shown in, if three types of initial unimodal data are obtained, the reduced-dimensional unimodal data corresponding to the three types of initial unimodal data are The reduced-dimensional unimodal data is input into the self-attention encoder to obtain the unimodal fusion coding feature Z k , Z m With Z n , the single-modal fusion coding features are stacked to obtain multi-modal stacked coding features <Z k ,Z m > and <Z m ,Z n >, aggregate the multimodal stacked coding features through the maximum pooling layer to obtain the multimodal aggregated coding features <Z k ,Z m >′ and <Z m ,Z n ′, input the multimodal aggregate coding features into the multi-head attention encoder, fuse the multimodal aggregate coding features, and obtain the multimodal fusion coding feature Z k,m,n .
[0077] At least one multimodal stacked coding feature is obtained by stacking the unimodal fusion coding features corresponding to each initial unimodal data, at least one multimodal stacked coding feature is aggregated through a maximum pooling layer to obtain at least one multimodal aggregated coding feature, and at least one multimodal aggregated coding feature is input into a multi-head attention encoder to obtain a multimodal fusion coding feature. The multi-head attention encoder can be used to fuse and stack the multimodal aggregated coding features multiple times, thereby increasing the depth of the multi-head attention encoder and better capturing the relationship between the multimodal aggregated coding features, thereby more efficiently obtaining the multimodal fusion coding features.
[0078] Optionally, the original encrypted information and the node information of the original Merkle tree are obtained according to the multimodal fusion coding features, including:
[0079] The multimodal fusion coding features are converted into a one-dimensional array, and are sorted according to the sensor identifiers carried by the multimodal fusion coding features to obtain sorted multimodal fusion coding features;
[0080] Determine the original encrypted information corresponding to the multimodal fusion coding feature according to the hash function and the sorted multimodal fusion coding feature;
[0081] The node information of the original Merkle tree is determined according to the original encrypted information corresponding to the hash function and the multimodal fusion coding features.
[0082] The encrypted information may be Token information.
[0083] Specifically, the server may convert the multimodal fusion coding features into one-dimensional data, and then arrange them in sequence according to the sensor identifiers carried by the multimodal fusion coding features to obtain sorted multimodal fusion coding features.
[0084] Specifically, the sorted multimodal fusion encoding features are converted into a byte stream through UTF-8 encoding, and a header c+d+e representing the dimension is added to the head of the byte stream, and sensor identifiers k1, k2, ...k are added to the tail. c ,m1,m2,…m d ,n1,n2,…n e It should be noted that when obtaining multimodal fusion coding, multimodal data is allowed to exist. Sensors can have multiple types of modal sensors, and each type of sensor can have multiple, such as k1, k2, ... k c There are c sensors, and the c sensors are all k types of sensors. The data obtained by each type of sensor is the same modal data. Then the original encrypted information corresponding to the multimodal fusion coding feature is calculated by the hash function, as follows:
[0085]
[0086] Among them, f hash is a hash function, The sorted multimodal fusion encoding features can be SHA-3 or Blake2. To optimize performance, the Blake2b hash function that improves the processing efficiency of high-dimensional input data can be selected to extract the original encrypted information.
[0087] Specifically, the node information of the original Merkle tree includes the Merkle root node and address information. The address information is the address of the original data stored in the target storage area, and the Merkle root node can be calculated by the hash function, as follows:
[0088] Merkle cur =f hash (Merkle pre ||Token cur );
[0089] Among them, Merkle pre Indicates the previous Merkle node, Token cur The original encrypted information corresponding to the multimodal fusion coding feature corresponding to each timestamp, that is, the current original encrypted information.
[0090] The original encrypted information and the node information of the original Merkle tree are obtained by multimodal fusion coding features and hash function calculations, and then the original encrypted information and the nodes of the original Merkle tree are stored in the blockchain, which can ensure the immutability of the data and facilitate subsequent data tracing.
[0091] Optionally, before inputting the at least two types of initial unimodal data into the multi-layer tensor autoencoder to obtain the reduced-dimensional unimodal data corresponding to each initial unimodal data, the method further includes:
[0092] Build the autoencoder model to be trained;
[0093] Based on a target training set, the autoencoder model to be trained is iteratively trained according to a preset reconstruction error function to obtain a multi-layer tensor autoencoder, wherein the target training set includes: at least one training sample, and the training sample is historical unimodal data.
[0094] Among them, the autoencoder model to be trained includes a decoder and an encoder.
[0095] Specifically, a target training set is obtained, which includes at least one training sample, which is historical single-modal data. The autoencoder model to be trained is iteratively trained according to the target training set and a preset reconstruction error function, and the training goal is to minimize the preset reconstruction error function until a multi-layer tensor autoencoder is obtained. For example, if there are multiple initial samples of k types of sensors, each of which has t1, t2, ... tP features and timestamp T, and t1, t2, …t P The features are concatenated to form a training sample historical unimodal data X, whose dimension is The training autoencoder model learns a compression mapping to map the training sample to a low-dimensional representation Z with dimension (u, v), where v is much smaller than The goal of training the self-encoder model to be trained is to minimize the input X and output The reconstruction error function between:
[0096]
[0097] in, is the output of the autoencoder model to be trained during training, Where f is the encoder part and g is the decoder part. By compressing the encoder part f, we can get This is unimodal data with reduced dimension.
[0098] Optionally, a stacking operation is performed on the unimodal fusion coding features corresponding to each initial unimodal data to obtain at least one multimodal stacked coding feature, including:
[0099] Sort the unimodal fusion coding features corresponding to the initial unimodal data according to the sensor identifiers carried by the initial unimodal data;
[0100] The sorted adjacent single-modal fusion coding features are stacked to obtain at least one multi-modal stacked coding feature.
[0101] Specifically, the single-modal fusion coding features corresponding to the initial single-modal data are sequentially sorted according to the preset order of the sensor identification, and the sorted adjacent single-modal fusion coding features are stacked, that is, the current single-modal fusion coding feature and the next single-modal fusion coding feature are stacked to obtain at least one multi-modal stacked coding feature. For example, the single-modal fusion coding features of the k1 sensor, the m2 sensor, and the n3 sensor are sorted to obtain the sorted single-modal fusion coding feature Z k , Z m , Z n , stack adjacent single-modal fusion coding features to obtain multi-modal stacked coding features <Z k ,Z m > and <Z m ,Z n >.
[0102] By sorting the unimodal fusion coding features corresponding to the initial unimodal data according to the sensor identifier carried by the initial unimodal data; stacking the sorted adjacent unimodal fusion coding features to obtain at least one multimodal stacked coding feature, there is no need to stack each unimodal fusion coding feature with other unimodal fusion coding features, which can save stacking time and thus improve the efficiency of subsequently obtaining multimodal fusion coding features.
[0103] The technical solution of this embodiment obtains a traceability query request, accesses the blockchain according to the traceability query request, obtains the target encrypted information corresponding to the traceability query request and the node information of the target Merkle tree; queries the target storage area according to the node information of the target Merkle tree, and obtains the original data corresponding to the traceability query request; if the first encrypted information of the original data corresponding to the traceability query request is consistent with the target encrypted information corresponding to the traceability query request, determines the target time period according to the traceability query request and the preset period; traverses the target Merkle tree, and determines the original data corresponding to the node information of the target Merkle tree within the target time period as the target traceability data, which solves the problems of low efficiency, data leakage and data missing caused by huge data and the need for manual intervention and marking in the prior art, and can perform data traceability without interfering with the normal operation of the data, ensure the security of the data through blockchain technology, and thus improve the efficiency and reliability of data traceability.
[0104] Embodiment 2
[0105] Figure 3 This is a schematic diagram of the structure of a data tracing device in the second embodiment of the present invention. This embodiment is applicable to the case of tracing the source of data. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides data tracing functions, such as Figure 3 As shown, the data tracing device specifically includes: an acquisition module 210, a obtaining module 220, a determination module 230 and a traversal module 240.
[0106] The acquisition module 210 is used to obtain a traceability query request, access the blockchain according to the traceability query request, and obtain the target encryption information and the node information of the target Merkle tree corresponding to the traceability query request;
[0107] Obtaining module 220, for querying the target storage area according to the node information of the target Merkle tree, and obtaining the original data corresponding to the traceability query request;
[0108] A determination module 230 is configured to determine a target time period according to the source tracing query request and a preset period if the first encryption information of the original data corresponding to the source tracing query request is consistent with the target encryption information corresponding to the source tracing query request;
[0109] The traversal module 240 is used to traverse the target Merkle tree and determine the original data corresponding to the node information of the target Merkle tree within the target time period as the target tracing data.
[0110] Optionally, the original data includes: initial single-modal data and multi-modal fusion coding features;
[0111] Also includes:
[0112] A modality data acquisition module, used to acquire at least two types of initial single-modality data, and obtain multi-modality fusion coding features according to the at least two types of initial single-modality data;
[0113] An encrypted information storage module, used to obtain the original encrypted information and the node information of the original Merkle tree according to the multimodal fusion coding feature, and store the original encrypted information and the node information of the original Merkle tree in the blockchain;
[0114] The original data storage module is used to store the initial single-modal data and the multi-modal fusion coding features into a target storage area.
[0115] Optionally, the modal data acquisition module is specifically used for:
[0116] Inputting the at least two types of initial unimodal data into a multi-layer tensor autoencoder to obtain dimension-reduced unimodal data corresponding to each of the initial unimodal data;
[0117] Inputting the dimension-reduced unimodal data corresponding to each of the initial unimodal data into a self-attention encoder to obtain a unimodal fusion coding feature corresponding to each of the initial unimodal data;
[0118] A multimodal fusion coding feature is obtained according to the unimodal fusion coding feature corresponding to each initial unimodal data.
[0119] Optionally, the modal data acquisition module is specifically used for:
[0120] Performing a stacking operation on the unimodal fusion coding features corresponding to each initial unimodal data to obtain at least one multimodal stacked coding feature;
[0121] Aggregating at least one multimodal stacked coding feature through a maximum pooling layer to obtain at least one multimodal aggregated coding feature;
[0122] At least one multimodal aggregated encoding feature is input into a multi-head attention encoder to obtain a multimodal fusion encoding feature.
[0123] Optionally, the encryption information storage module is specifically used for:
[0124] The multimodal fusion coding features are converted into a one-dimensional array, and are sorted according to the sensor identifiers carried by the multimodal fusion coding features to obtain sorted multimodal fusion coding features;
[0125] Determine the original encrypted information corresponding to the multimodal fusion coding feature according to the hash function and the sorted multimodal fusion coding feature;
[0126] The node information of the original Merkle tree is determined according to the original encrypted information corresponding to the hash function and the multimodal fusion coding features.
[0127] Optionally, the modal data acquisition module is further used for:
[0128] Build the autoencoder model to be trained;
[0129] Based on a target training set, the autoencoder model to be trained is iteratively trained according to a preset reconstruction error function to obtain a multi-layer tensor autoencoder, wherein the target training set includes: at least one training sample, and the training sample is historical unimodal data.
[0130] Optionally, the modal data acquisition module is specifically used for:
[0131] Sort the unimodal fusion coding features corresponding to the initial unimodal data according to the sensor identifiers carried by the initial unimodal data;
[0132] The sorted adjacent single-modal fusion coding features are stacked to obtain at least one multi-modal stacked coding feature.
[0133] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0134] Embodiment 3
[0135] Figure 4 : is a structural diagram of an electronic device in Embodiment 3 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0136] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0137] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0138] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a data tracing method.
[0139] In some embodiments, the data traceability method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data traceability method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data traceability method in any other appropriate manner (e.g., by means of firmware).
[0140] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0142] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0144] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0145] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0146] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0147] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data tracing method, characterized in that: include: Obtain a provenance query request, access the blockchain according to the provenance query request, and obtain target encrypted information and target Merkle tree node information corresponding to the provenance query request; Query the target storage area according to the node information of the target Merkle tree to obtain the original data corresponding to the traceability query request; If the first encryption information of the original data corresponding to the traceability query request is consistent with the target encryption information corresponding to the traceability query request, determining the target time period according to the traceability query request and the preset period; The target Merkle tree is traversed, and the original data corresponding to the node information of the target Merkle tree within the target time period is determined as the target tracing data.
2. The method according to claim 1, characterized in that The original data includes: initial single-modal data and multi-modal fusion coding features; Before obtaining the traceability query request, it also includes: Acquire at least two types of initial unimodal data, and obtain multimodal fusion coding features according to the at least two types of initial unimodal data; The original encrypted information and the node information of the original Merkle tree are obtained according to the multimodal fusion coding features, and the original encrypted information and the node information of the original Merkle tree are stored in the blockchain; The initial unimodal data and the multimodal fusion coding features are stored in a target storage area.
3. The method according to claim 2, characterized in that Obtaining a multimodal fusion coding feature according to the at least two types of initial single-modal data includes: Inputting the at least two types of initial unimodal data into a multi-layer tensor autoencoder to obtain dimension-reduced unimodal data corresponding to each of the initial unimodal data; Inputting the dimension-reduced unimodal data corresponding to each of the initial unimodal data into a self-attention encoder to obtain a unimodal fusion coding feature corresponding to each of the initial unimodal data; A multimodal fusion coding feature is obtained according to the unimodal fusion coding feature corresponding to each initial unimodal data.
4. The method according to claim 3, characterized in that: Obtaining a multimodal fusion coding feature according to the unimodal fusion coding feature corresponding to each initial unimodal data includes: Performing a stacking operation on the unimodal fusion coding features corresponding to each initial unimodal data to obtain at least one multimodal stacked coding feature; Aggregating at least one multimodal stacked coding feature through a maximum pooling layer to obtain at least one multimodal aggregated coding feature; At least one multimodal aggregated encoding feature is input into a multi-head attention encoder to obtain a multimodal fusion encoding feature.
5. The method according to claim 2, characterized in that: According to the multimodal fusion coding features, the original encrypted information and the node information of the original Merkle tree are obtained, including: The multimodal fusion coding features are converted into a one-dimensional array, and are sorted according to the sensor identifiers carried by the multimodal fusion coding features to obtain sorted multimodal fusion coding features; Determine the original encrypted information corresponding to the multimodal fusion coding feature according to the hash function and the sorted multimodal fusion coding feature; The node information of the original Merkle tree is determined according to the original encrypted information corresponding to the hash function and the multimodal fusion coding features.
6. The method according to claim 3, characterized in that Before inputting the at least two types of initial unimodal data into the multi-layer tensor autoencoder to obtain the dimension-reduced unimodal data corresponding to each of the initial unimodal data, the method further includes: Build the autoencoder model to be trained; Based on a target training set, the autoencoder model to be trained is iteratively trained according to a preset reconstruction error function to obtain a multi-layer tensor autoencoder, wherein the target training set includes: at least one training sample, and the training sample is historical unimodal data.
7. The method according to claim 4, characterized in that The unimodal fusion coding features corresponding to each initial unimodal data are stacked to obtain at least one multimodal stacked coding feature, including: Sort the unimodal fusion coding features corresponding to the initial unimodal data according to the sensor identifiers carried by the initial unimodal data; The sorted adjacent single-modal fusion coding features are stacked to obtain at least one multi-modal stacked coding feature.
8. A data tracing device, characterized in that: include: An acquisition module is used to acquire a traceability query request, access the blockchain according to the traceability query request, and obtain the target encrypted information and the node information of the target Merkle tree corresponding to the traceability query request; The obtaining module is used to query the target storage area according to the node information of the target Merkle tree and obtain the original data corresponding to the traceability query request; a determination module, configured to determine a target time period according to the source tracing query request and a preset period if the first encryption information of the original data corresponding to the source tracing query request is consistent with the target encryption information corresponding to the source tracing query request; The traversal module is used to traverse the target Merkle tree and determine the original data corresponding to the node information of the target Merkle tree within the target time period as the target tracing data.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data tracing method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data tracing method described in any one of claims 1 to 7 when executed.
