CN115982208B - Cold chain product relevance query method and device based on block chain cross-chain collaboration - Google Patents
Cold chain product relevance query method and device based on block chain cross-chain collaboration Download PDFInfo
- Publication number
- CN115982208B CN115982208B CN202211022139.7A CN202211022139A CN115982208B CN 115982208 B CN115982208 B CN 115982208B CN 202211022139 A CN202211022139 A CN 202211022139A CN 115982208 B CN115982208 B CN 115982208B
- Authority
- CN
- China
- Prior art keywords
- chain
- product
- information
- cross
- block
- 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
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a cold chain product relevance query method and device based on block chain cross-chain cooperation, which are used for carrying out data cleaning and data processing on cold chain product information; constructing a multi-label text classification model for the cleaned data set, and training to obtain a classification result; storing different types of cold chain product information in different block chains to form a plurality of product chains, so as to form a product chain network; determining whether the product chain performs identity verification by using a consensus algorithm through the relay chain link point to obtain a legal application registered product chain; the user puts forward a cross-chain inquiry request, and cross-chain identity authentication is carried out between product chains by utilizing an intelligent contract in hash locking; and carrying out association analysis and calculation on block nodes of each chain to obtain the query result information of the final product. The method and the system effectively solve the problems of low product classification accuracy and low query efficiency in the cold chain field by using a multi-label text classification model, a blockchain storage and cross-chain technology fusion and a data correlation analysis algorithm.
Description
Technical Field
The invention belongs to the field of text multi-label classification and block chain crossing technology fusion, and particularly relates to a cold chain product relevance query method and device based on block chain crossing collaboration.
Background
The blockchain technology is a bottom core technology fused by various technologies such as cryptography, databases and the like, and is essentially a distributed ledger with neutralization. The blockchain has the characteristics of transparency, tamper resistance, collective maintainability and the like, so that the blockchain has higher credibility and safety. However, there are different public chains, federated chains, private chains, and the existence of chains in isolation from chain to chain prevents collaborative interactions between different blockchains. Therefore, how to implement information intercommunication among chains is a problem faced by the development of blockchain technology.
Cold chain products generally cover four links: freezing, freezing storage, refrigerated transportation, distribution, and refrigerated sales. The product chain mainly comprises an upper part, a middle part and a lower part, wherein the upper part is mainly used for material supply and equipment manufacture, the middle part is used for logistics transportation and storage management, and the lower part is mainly used for a product to food, medicine, chemical industry, electronics and commercial cold chain. Therefore, the quantity of the cold chain products is huge, and the relevance among the products is high, so that the cold chain product information is accurately classified and stored in the blocks of a plurality of block chains, the storage pressure of a local database can be reduced, and the credibility and tamper resistance of data can be ensured. Meanwhile, the product information among each blockchain has close correlation, so that cross-chain collaborative technology fusion is provided to realize the interoperability among multiple chains, and the data query interaction is ensured. Based on the cross-chain, a relevance analysis algorithm is provided to calculate the product relevance between blocks and between chains, and finally more accurate product information is obtained, thereby facilitating convenience for users.
There are a number of problems in querying a browser for product information: 1. inaccurate classification of cold chain products; 2. the problem of long information acquisition time due to large data volume; 3. there is no result problem in querying the associated cold chain product information.
Disclosure of Invention
The invention aims to: aiming at the problems, the invention provides a block chain cross-chain collaboration-based cold chain product relevance query method and device, which are used for solving the problems of inaccurate product classification, long time consumption for querying product information and low query efficiency of users in massive cold chain product data.
The technical scheme is as follows: the invention provides a cold chain product relevance query method and device based on cross-chain collaboration, comprising the following steps:
step 1: crawling cold chain product information to perform data cleaning and data processing to obtain a cleaned and processed data set;
step 2: constructing a multi-label text classification model through the cleaned data set, training to obtain a classification result, and acquiring a fused text information vector representation E as input of a classifier to acquire the classification result y through the multi-label text classification model by combining a CNN (computer numerical network), an LSTM (computer-aided design) model and a multi-channel attention;
step 3: according to the classification result, different types of cold chain product information are stored in different block chains to form a plurality of product chains Pi, so as to form a product chain network;
step 4: multiple product chains in the product chain network are used as a main body of block chain cross-chain interaction, and on the basis of conforming to relay chain identity registration, the cross-chain interaction can be performed with legal authority, and supervision registration and verification are performed by utilizing a consensus algorithm in the relay chain, so that the product chain with legal identity registration is finally obtained;
step 5: according to a user, providing a cross-chain inquiry request, and performing cross-chain identity authentication between product chains by utilizing an intelligent contract in hash locking;
step 6: and after the identity verification, carrying out association analysis on block nodes of each chain to obtain final query product result information.
Further, the specific method of the step 1 is as follows:
step 1.1: removing the duplication, the nullification and the special characters of the data set D1 to be cleaned to obtain a cleaned data set D2;
step 1.2: performing jieba word segmentation on the text to be processed of the cleaned data set D2;
step 1.3: fixing the text content to be processed of the data set D2 to be uniform length Lmax, performing token word segmentation on the text by utilizing a pretrained Bert model, and converting each word into a vector with a fixed length to obtain a data set D3 of word vectors;
step 1.4: the word vectors are respectively sent to a Token Embedding layer, a Segment Embeddings layer, a Position Embeddings layer and a bidirectional transducer in the Bert model, the word vectors are converted into word vectors, and len (D3) word vector sequences s=s1, S2, S3 are output.
Further, the specific method of the step 2 is as follows:
step 2.1: inputting the word vector subsequence sj of the word vector sequence S into a CNN network for training to obtain a feature vector f4j;
step 2.2: performing bidirectional operation on a word vector subsequence sj by using an LSTM model, and obtaining another feature vector lj after the obtained output is subjected to operation of a nonlinear activation layer;
step 2.3: the feature vectors f4j and lj are used as inputs of multi-channel attention;
step 2.4: calculating matching scores S1j and S2j of the feature vectors f4j and lj and the whole feature vectors;
step 2.5: calculating the feature vector scores accounting for the overall percentages alpha 1j and alpha 2j according to the matching scores S1j and S2j;
step 2.6: summing and then averaging the feature vectors according to the percentage of the feature vector score in the total percentage to obtain final output vectors V and T;
step 2.7: fusing the output vectors V and T to obtain a final text information vector representation E, wherein the vector E is used as the input of a classifier;
step 2.8: inputting the vectorized representation Ej to a softmax through a full connection layer and a hidden layer, and carrying out document classification prediction by adopting a softmax function to obtain classification probability prediction vectors P=p1, P2.
Step 2.9: searching the maximum value in the vector P, and outputting a result corresponding to the maximum value to obtain a classification result y.
Further, the specific method of the step 3 is as follows:
step 3.1: dividing y different block chains according to the product classification result y in the step 2, and forming a cold chain product block network by y different cold chain product information chains;
step 3.2: connecting each cold chain product block chain by a plurality of blocks, wherein each block stores products under the same category, each block consists of a verification block and an information block, the verification block stores the verification id and the secret key of the product, and the information block stores the id and specific information of the product;
step 3.3: a user browses in a cold chain product information website through a browser, and requests are sent through an HTTP protocol to realize interaction between an access interface and other subsystems;
step 3.4: and after the server group receives the HTTP request, synchronous symmetric encryption key processing is carried out according to the cold chain product keyword information acquired in the text box and the cold chain product information acquired from the product blockchain server node.
Further, the specific method in the step 4 is as follows:
step 4.1: the product chain Pi is accessed to a cross-chain gateway, a registration application is sent to a relay chain through the cross-chain gateway, and request registration information reg comprises block chain identification, certificates and identity identification information, namely reg= { blockchain info, version and UID } as a mapping relation;
step 4.2: the inter-chain gateway receives a request for applying for registration of the product chain Pi, forwards the request message, and adds a registration request identifier in a registration information mapping relation;
step 4.3: the relay chain node determines whether the product chain Pi can be registered or not through a consensus algorithm, and generates a subkey for legal nodes of the product chain by utilizing a secret sharing mechanism;
step 4.4: if the application is not received, returning to the step 4.1 to continue the application request;
step 4.5: if the relay chain receives the application registration request, the registration request verification is carried out to verify whether the registration information is legal or not, and the private key of the relay chain is disclosed;
step 4.4: storing the address and the hash of the product chain Pi into a relay chain account book, and returning the result to the request product chain as a record;
step 4.5: confirming a product chain Pi registered for legal application, encrypting and storing identity information of the product chain Pi in a relay chain, generating an encryption private key and a signature private key for the terminal by using a key generation algorithm of SM9, and combining the encryption private key and the signature private key into a corresponding digital identity ID according to a specification;
step 4.6: and returning the identity of the product chain Pi to be consistent with the signature, if so, registering the identity of the product chain, otherwise, rolling back to the step 4.3 to continue identity registration and verification.
Further, the specific method in the step 5 is as follows:
step 5.1: firstly, initializing a system on a relay chain to generate a system public and private key;
step 5.2: the user generates a system random number in a product chain Pi;
step 5.3: the product chain Pi sends a registration request to the relay chain through the gateway;
step 5.4: checking in a relay chain, and judging whether to issue an identity;
step 5.5: if not, the connection is withdrawn, and the flag is failed;
step 5.6: otherwise, sending the digital identity ID and the corresponding secret key;
step 5.7: the product chain Pi returns signature information of the random number to the relay chain;
step 5.8: and then verifying the signature in the relay chain, if not, rejecting the cross-chain request, and if so, forwarding the cross-chain query interaction request.
Further, the specific method in the step 6 is as follows:
step 6.1: starting from a block N of a storage product chain, filtering out nodes with lower association degree obtained by calculation through a filtering stage on the basis of association calculation, and primarily determining a block with a certain association degree with target product label classification;
step 6.2: in the node relation mining stage, calculating the association degree according to the text information of the classified products, and screening out the blocks meeting the association degree > Q1 in the candidate blocks to serve as candidate blocks M;
step 6.3: in the inter-product chain stage, tracing the relevance between the product chains through the blocks in the step 6.2, calculating the relevance based on the blocks according to the relevance analysis, and if the relevance is more than Q2, further screening and filtering the candidate product chains;
step 6.4: and in the total association degree sorting stage, the total association degree is sorted, and the result with the highest final association degree is output to be used as final query cold chain product result information.
The invention also discloses a cold chain product relevance query device based on the block chain cross-chain collaboration, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program executes the steps of the cold chain product relevance query method based on the block chain cross-chain collaboration when being loaded to the processor.
The beneficial effects are that:
1. the invention applies the block chain data storage technology to the cold chain field for storing massive cold chain product information, and utilizes the encryption technology and the consensus mechanism to realize tamper resistance of the stored cold chain product data, namely, the data is required to be encrypted, the block chain network only stores the encrypted data and index data, and only a user who obtains the data access authority can access the key, so that the data safety can be ensured, and the reliability and stability of storage can be effectively improved.
2. The invention adopts a multi-label classification improved model based on two-way long-short-term memory neural network and attention mechanism weighted fusion to carry out classification training, and finally obtains classification results. Therefore, the problems of label errors, data overfitting and unbalanced categories are solved, the accuracy of text classification of the descriptive information of the cold chain products is improved, and convenience is provided for inquiry.
3. The invention relies on the local database and the product block network server to store the data, keeps the encryption keys consistent, can improve the storage performance and the query efficiency, does not need to transition the product information to a third party mechanism, and can realize the joint collaboration and the integrated maintainability.
4. According to the invention, the multi-chain type storage product chain is adopted, and the cold chain product information is stored in different block chains according to the text classification result, so that a product block chain network is formed, and the distributed storage performance is improved. The blocks in each block chain are composed of verification blocks and information blocks, so that validity and accuracy can be verified during inter-block data query, and product information stored in the information blocks can be conveniently acquired.
5. The invention adopts a method of fusing a relay chain and a hash locking mechanism in a cross-chain technology, and the inter-chain interaction needs a cross-chain request, identity registration and identity verification. The product chain needs to be registered to determine that the legal chain has authority to receive the cross-chain request, the product chain registered through the identity needs to verify whether the identity is correct or not, and the cross-chain contract processing is needed, so that the flow between the chains can be ensured, and finally, the data intercommunication and flow between the chains are realized.
6. When the browser inquires the cold chain product information, the relevance analysis algorithm is adopted, and the stored text information is subjected to relevance sorting by inquiring the internal data of the blocks in the product chain, so that the result information of the inquired cold chain product is finally obtained.
Drawings
FIG. 1 is a diagram of the overall framework of the present invention;
FIG. 2 is a flow chart of cold chain product data processing;
FIG. 3 is a flow chart of an improved multi-tag text classification;
FIG. 4 is a schematic diagram of storing cold chain products in a blockchain based on classification results;
FIG. 5 is a block chain cross-chain digital identity registration flow diagram;
FIG. 6 is a block chain cross-chain authentication flow diagram;
FIG. 7 is a flowchart of a cold chain product association analysis calculation after a cross-chain request.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
The invention discloses a cold chain product relevance query method and device based on block chain cross-chain collaboration, comprising cold chain product data processing, cold chain product classification model training, cold chain product storage in a block chain, block chain cross-chain identity authentication and cold chain product relevance analysis and calculation, wherein the method and device framework is shown in figure 1, and comprises the following steps:
step 1: data cleaning and data processing are carried out through the crawled cold chain product information, and a cleaned data set is obtained, and is specifically shown in fig. 2:
step 1.1: definition T is a single text to-be-cleaned information set, definition item_name, TYPE are text content and category labels of the commodity title, respectively, and the relation t=item_name, TYPE is satisfied.
Step 1.2: define D1 as the data set to be cleaned, d1=t1, T2,..once., ta,..once., tlen (D1), ta is the a-th text label information data to be cleaned in D1, where len (D1) is the number of text contents in D1, variable a ε [1, len (D1) ].
Step 1.3: after removing the duplication, the null and the special characters from the text in the dataset D1, the cleaned dataset d2=t1, T2 is obtained.
Step 1.4: and performing jieba word segmentation on the text content Tb to be processed through the cleaned data set D2.
Step 1.5: each piece of data is traversed, and the dictionary Da of the word segmentation and the occurrence number is returned.
Step 1.6: and calling the local stop word list Ti, and judging whether the stop word exists or not.
Step 1.7: if yes, deleting the stop words in the dictionary, and if not, returning to 1.6 and continuously calling the stop word list.
Step 1.8: and extracting the labels from the times of occurrence of the segmented words in the new dictionary, and returning to the label dictionary Dc after the segmentation ordering.
Step 1.9: and performing form processing on the word and the label in Dc, and returning the dictionary pair Dd of the word and the sequence number thereof and the dictionary pair Df of the label and the sequence number thereof.
Step 1.10: the text content Tb to be processed is fixed to a uniform length Lmax by processing the data set D2.
Step 1.11: define j as the circulation variable, and assign j as 1 as the initial value, start circulation.
Step 1.12: if j.ltoreq.len (D2), proceeding to step S1.13; otherwise, the process goes to step S1.14.
Step 1.13: defining len (Tj) as the length of the j-th text in the text, and if the length of the len (Tj) +2 is less than or equal to Lmax, entering a step S1.14; otherwise, the first Lmax words of the text are intercepted and step S1.14 is entered.
Step 1.14: performing token word segmentation on the text Tj by using a pretrained Bert model, and converting each word into a vector with a fixed length to obtain a word vector, wherein the word vector corresponds to a data set D3, and the text Tj ', tj' =w1, W2 of the data set D3.
Step 1.15: and respectively sending each text Tj' in the data set D3 into a Token encoding layer, a Segment Embeddings layer and a Position Embeddings layer in the Bert model to respectively obtain a vector code V1, a sentence code V2 and a position code V3.
Step 1.16: the vector code V1 sentence code V2 and the position code V3 are added and input into a bi-directional Transformer of Bert, and the Bert model outputs a word vector sub-sequence vj=s (W1), S (W2),...
Step 1.17: the loop is ended and len (D3) word vector sequences s=s1, S2, S3,..sj,...
Step 2: through the cleaned data set, a multi-label text classification model is constructed, and a classification result is obtained through training, and the method is specifically shown in fig. 3:
step 2.1: and (3) inputting the word vector sequence S generated in the step (1.17) into a CNN network, and setting convolution kernel sizes to be 3, 4 and 5 respectively.
Step 2.2: the word vector sequence sj is transmitted into a convolution layer with the convolution kernel size of 5 to carry out convolution operation, so as to obtain a vector fj, wherein fj is obtained to represent the j-th f vector of the output, and j epsilon (1, len (D3)).
Step 2.4: inputting fj obtained in the last step into an activation function Relu to obtain an output f2j,where f2j is found to represent the j-th f2 vector of the output.
Step 2.5: inputting f2j obtained in the previous step into a maximum pooling layer with the step length of 2 to obtain f3j, wherein f3j is obtained to represent the j-th f3 vector of the output.
Step 2.6: repeating S2.2 to S2.5, replacing part of the parameters: the convolution layers are changed to 4 and 3, and the resulting output is f4j, where f4j represents the j-th f4 vector of the output.
Step 2.7: and performing bidirectional operation on the word vector subsequence sj on one sequence by using the LSTM model, and obtaining another feature vector lj after the obtained output is subjected to operation of a nonlinear activation layer, wherein the obtained lj represents the j-th l vector of the output.
Step 2.8: the feature vectors f4j and lj obtained in the step 2.6 and the step 2.7 are used as inputs of the multi-channel attention.
Step 2.9: feature vectors f4j and lj are calculated to match the entire feature vectors by scores S1j and S2j.
Step 2.10: feature vector scores are calculated from the match scores S1j and S2j as overall percentages α1j and α2j.
Step 2.11: and summing and then averaging the feature vectors according to the percentage of the feature vector score to the total percentage to obtain final vectors V and T.
Step 2.12: and fusing the output vectors V and T of the multichannel attention to obtain a final text information vector representation E, wherein the vector E is used as the input of the classifier.
Step 2.13: the vectorized representation Ej obtained in step 2.12 is input to softmax via the fully connected layer and the hidden layer.
Step 2.14: document classification prediction is performed by using a softmax function, and classification probability prediction vectors p=p1, P2, pi, pn are obtained.
Step 2.15: searching the maximum value in the vector P, and outputting a result corresponding to the maximum value to obtain a classification result y.
Step 3: by storing different types of cold chain product information in different block chains according to the classification result to form a plurality of product chains, a product chain network is formed, as shown in fig. 4 in detail:
step 3.1: and (3) dividing y different block chains according to the product classification result y obtained in the step (2.15), and forming a cold chain product block network by using y different cold chain product information chains such as a product chain A, B.
Step 3.2: each cold chain product block chain is connected by a plurality of blocks, each block stores products under the same category, each block is composed of a verification block and an information block, the verification block mainly stores verification id and secret key of the products, and the information block mainly stores id and specific information of the products.
Step 3.3: and the user browses in the cold chain product information website through the browser, and the request is sent through the HTTP protocol, so that the interaction between the access interface and other subsystems is realized.
Step 3.4: and after the server group receives the HTTP request, synchronous symmetric encryption key processing is carried out according to the cold chain product keyword information acquired in the text box and the cold chain product information acquired from the product blockchain server node.
Step 4: multiple product chains in the product chain network are used as a main body of block chain cross-chain interaction, and on the basis of conforming to relay chain identity registration, legal authority can be used for cross-chain interaction, and supervision registration and verification are carried out by utilizing a consensus algorithm in the relay chain, so that the product chain with legal identity registration is finally obtained, and the method is specifically shown in fig. 5:
step 4.1: the product chain Pi accesses the cross-chain gateway, a registration application is sent to the relay chain through the cross-chain gateway, and the request registration information reg comprises block chain identification, certificate and identity identification information, namely reg= { blockchain info, version and UID } as a mapping relation.
Step 4.2: the gateway receives the request of the product chain for registration, forwards the request message, and adds a registration request identifier in the registration information mapping relation.
Step 4.3: the relay chain node determines whether the product chain Pi can be registered by a consensus algorithm. The sub-keys are generated using a secret sharing mechanism.
Step 4.4: if the application is not received, returning to the step 4.1 to continue the application request.
Step 4.5: if the relay chain receives the application registration request, the registration request verification is carried out to verify whether the registration information is legal or not, and the private key of the relay chain is disclosed.
Step 4.4: the address and hash of the product chain Pi are stored in a relay chain ledger, and the result is returned to the requested product chain as a record.
Step 4.5: and confirming a product chain Pi registered for legal application, encrypting and storing identity information in a relay chain, generating an encryption private key and a signature private key for the terminal by using a key generation algorithm of SM9, and combining the encryption private key and the signature private key into a corresponding digital identity ID according to a specification.
Step 4.6: and returning the identity of the product chain Pi to be consistent with the signature, if so, registering the identity of the product chain, otherwise, rolling back to the step 4.3 to continue identity registration and verification.
Step 5: by providing a cross-chain query request by a user, the intelligent contract in hash locking is utilized to carry out cross-chain identity authentication between product chains, and the method is specifically shown in fig. 6:
step 5.1: firstly, initializing a system on a relay chain to generate a system public and private key.
Step 5.2: the user generates a system random number in the product chain Pi.
Step 5.3: the product chain Pi sends a registration request to the relay chain via the gateway.
Step 5.4: and checking in the relay chain, and judging whether to issue the identity.
Step 5.5: if not, the connection is revoked and the flag is not passed.
Step 5.6: otherwise, the digital identity ID and the corresponding key are sent.
Step 5.7: the product chain Pi returns the signature information of the random number to the relay chain.
Step 5.8: and then verifying the signature in the relay chain, if not, rejecting the cross-chain request, and if so, forwarding the cross-chain query interaction request.
Step 6: after passing the identity verification, performing association analysis between block nodes of each chain to obtain a query result product chain, which is specifically shown in fig. 7:
step 6.1: starting from a block N of a storage product chain, on the basis of relevance calculation, nodes with lower relevance degree obtained by calculation are filtered out through a filtering stage, and the nodes are used for preliminarily determining the block with certain relevance degree to the target product label classification.
Step 6.2: in the node relation mining stage, the association degree is calculated according to the text information of the classified products, and the blocks meeting the association degree more than Q1 in the candidate blocks are screened out to be used as candidate blocks M.
Step 6.3: and in the inter-product chain stage, tracing the relevance between the product chains through the blocks in the step 6.2, calculating the relevance based on the blocks according to the relevance analysis, and if the relevance is more than Q2, further screening and filtering the candidate product chains.
Step 6.4: and in the total association degree sorting stage, the total association degree is sorted, and the result with the highest final association degree is output to be used as final query cold chain product result information.
The foregoing embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the present invention and to implement the same, not to limit the scope of the present invention. All equivalent changes or modifications made according to the spirit of the present invention should be included in the scope of the present invention.
Claims (6)
1. A cold chain product relevance query method based on block chain cross-chain collaboration is characterized by comprising the following steps:
step 1: crawling cold chain product information to perform data cleaning and data processing to obtain a cleaned and processed data set;
step 2: constructing a multi-label text classification model through the cleaned data set, training to obtain a classification result, carrying out weighted fusion on the multi-label text classification model by using a CNN (computer numerical network), an LSTM (computer-aided design) model and a multi-channel attention mechanism, and acquiring a fused text information vector representation E serving as input of a classifier to acquire the classification result y through the multi-label text classification model;
step 3: according to the classification result, different types of cold chain product information are stored in different block chains to form a plurality of product chains Pi, so as to form a product chain network;
step 3.1: dividing y different block chains according to the product classification result y in the step 2, and forming a cold chain product block network by y different cold chain product information chains;
step 3.2: connecting each cold chain product block chain by a plurality of blocks, wherein each block stores products under the same category, each block consists of a verification block and an information block, the verification block stores the verification id and the secret key of the product, and the information block stores the id and specific information of the product;
step 3.3: a user browses in a cold chain product information website through a browser, and requests are sent through an HTTP protocol to realize interaction between an access interface and other subsystems;
step 3.4: after receiving the HTTP request, the server group carries out synchronous symmetric encryption key processing according to the cold chain product keyword information acquired in the text box and the cold chain product information acquired from the product blockchain server node;
step 4: multiple product chains in the product chain network are used as a main body of block chain cross-chain interaction, and on the basis of conforming to relay chain identity registration, the cross-chain interaction can be performed with legal authority, and supervision registration and verification are performed by utilizing a consensus algorithm in the relay chain, so that the product chain with legal identity registration is finally obtained;
step 4.1: the product chain Pi is accessed to a cross-chain gateway, a registration application is sent to a relay chain through the cross-chain gateway, and request registration information reg comprises block chain identification, certificates and identity identification information, namely reg= { blockchain info, version and UID } as a mapping relation;
step 4.2: the inter-chain gateway receives a request for applying for registration of the product chain Pi, forwards the request message, and adds a registration request identifier in a registration information mapping relation;
step 4.3: the relay chain node determines whether the product chain Pi can be registered or not through a consensus algorithm, and generates a subkey for legal nodes of the product chain by utilizing a secret sharing mechanism;
step 4.4: if the application is not received, returning to the step 4.1 to continue the application request;
step 4.5: if the relay chain receives the application registration request, the registration request verification is carried out to verify whether the registration information is legal or not, and the private key of the relay chain is disclosed;
step 4.6: storing the address and the hash of the product chain Pi into a relay chain account book, and returning the result to the request product chain as a record;
step 4.7: confirming a product chain Pi registered for legal application, encrypting and storing identity information in a relay chain, generating an encrypted private key and a signature private key for a terminal by using a key generation algorithm of SM9, and combining the encrypted private key and the signature private key into a corresponding digital identity ID according to a specification;
step 4.8: the product chain Pi returns whether the identity is consistent with the signature, if so, the product chain identity is registered, otherwise, the step 4.3 is rolled back to continue the identity registration and verification;
step 5: according to a user, providing a cross-chain inquiry request, and performing cross-chain identity authentication between product chains by utilizing an intelligent contract in hash locking;
step 6: and after the identity verification, carrying out association analysis on block nodes of each chain to obtain final query product result information.
2. The cold chain product relevance query method based on blockchain cross-chain collaboration according to claim 1, wherein the specific method of step 1 is as follows:
step 1.1: removing the duplication, the nullification and the special characters of the data set D1 to be cleaned to obtain a cleaned data set D2;
step 1.2: performing jieba word segmentation on the text to be processed of the cleaned data set D2;
step 1.3: fixing the text content to be processed of the data set D2 to be uniform length Lmax, performing token word segmentation on the text by utilizing a pretrained Bert model, and converting each word into a vector with a fixed length to obtain a data set D3 of word vectors;
step 1.4: and respectively sending the word vectors into a Token Embedding layer, a Segment Embeddings layer, a Position Embeddings layer and a bidirectional transducer in the Bert model, converting the word vectors into word vectors, and outputting len (D3) word vector sequences S=s1, S2, S3, …, sj, … and slen (D3).
3. The cold chain product relevance query method based on blockchain cross-chain collaboration according to claim 2, wherein the specific method of step 2 is as follows:
step 2.1: inputting the word vector subsequence sj of the word vector sequence S into a CNN network for training to obtain a feature vector f4j;
step 2.2: performing bidirectional operation on a word vector subsequence sj by using an LSTM model, and obtaining another feature vector lj after the obtained output is subjected to operation of a nonlinear activation layer;
step 2.3: the feature vectors f4j and lj are used as inputs of multi-channel attention;
step 2.4: calculating matching scores S1j and S2j of the feature vectors f4j and lj and the whole feature vectors;
step 2.5: calculating the feature vector scores accounting for the overall percentages alpha 1j and alpha 2j according to the matching scores S1j and S2j;
step 2.6: summing and then averaging the feature vectors according to the percentage of the feature vector score in the total percentage to obtain final output vectors V and T;
step 2.7: fusing the output vectors V and T to obtain a final text information vector representation E, wherein the vector E is used as the input of a classifier;
step 2.8: the vectorized representation Ej is input to softmax through a full connection layer and a hidden layer, document classification prediction is carried out by adopting a softmax function, and classification probability prediction vectors P=p1, P2, …, pi, … and pn are obtained;
step 2.9: searching the maximum value in the vector P, and outputting a result corresponding to the maximum value to obtain a classification result y.
4. The cold chain product relevance query method based on blockchain cross-chain collaboration according to claim 1, wherein the specific method of step 5 is as follows:
step 5.1: firstly, initializing a system on a relay chain to generate a system public and private key;
step 5.2: the user generates a system random number in a product chain Pi;
step 5.3: the product chain Pi sends a registration request to the relay chain through the gateway;
step 5.4: checking in a relay chain, and judging whether to issue an identity;
step 5.5: if not, the connection is withdrawn, and the flag is failed;
step 5.6: otherwise, sending the digital identity ID and the corresponding secret key;
step 5.7: the product chain Pi returns signature information of the random number to the relay chain;
step 5.8: and then verifying the signature in the relay chain, if not, rejecting the cross-chain request, and if so, forwarding the cross-chain query interaction request.
5. The cold chain product relevance query method based on blockchain cross-chain collaboration according to claim 1, wherein the specific method of step 6 is as follows:
step 6.1: starting from a block N of a storage product chain, filtering out nodes with lower association degree obtained by calculation through a filtering stage on the basis of association calculation, and primarily determining a block with a certain association degree with target product label classification;
step 6.2: in the node relation mining stage, calculating the association degree according to the text information of the classified products, and screening out the blocks meeting the association degree > Q1 in the candidate blocks to serve as candidate blocks M;
step 6.3: in the inter-product chain stage, tracing the relevance between the product chains through the blocks in the step 6.2, calculating the relevance based on the blocks according to the relevance analysis, and if the relevance is more than Q2, further screening and filtering the candidate product chains;
step 6.4: and in the total association degree sorting stage, the total association degree is sorted, and the result with the highest final association degree is output to be used as final query cold chain product result information.
6. A cold chain product relevance query device based on blockchain cross-chain synergy, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the computer program when loaded into the processor performs the steps of the cold chain product relevance query method based on blockchain cross-chain synergy as claimed in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211022139.7A CN115982208B (en) | 2022-08-24 | 2022-08-24 | Cold chain product relevance query method and device based on block chain cross-chain collaboration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211022139.7A CN115982208B (en) | 2022-08-24 | 2022-08-24 | Cold chain product relevance query method and device based on block chain cross-chain collaboration |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115982208A CN115982208A (en) | 2023-04-18 |
CN115982208B true CN115982208B (en) | 2023-09-29 |
Family
ID=85963529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211022139.7A Active CN115982208B (en) | 2022-08-24 | 2022-08-24 | Cold chain product relevance query method and device based on block chain cross-chain collaboration |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115982208B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111769957A (en) * | 2020-09-02 | 2020-10-13 | 百度在线网络技术(北京)有限公司 | Block chain cross-chain query method, device, equipment and storage medium |
US20210051023A1 (en) * | 2018-09-04 | 2021-02-18 | Advanced New Technologies Co., Ltd. | Cross-chain authentication method, system, server, and computer-readable storage medium |
CN112507095A (en) * | 2020-12-15 | 2021-03-16 | 平安国际智慧城市科技股份有限公司 | Information identification method based on weak supervised learning and related equipment |
CN112583917A (en) * | 2020-12-10 | 2021-03-30 | 浙商银行股份有限公司 | CSCP-based hybrid chain construction method |
US20210328791A1 (en) * | 2020-07-08 | 2021-10-21 | Alipay (Hangzhou) Information Technology Co., Ltd. | Blockchain data processing methods and apparatuses based on cloud computing |
CN113609294A (en) * | 2021-08-10 | 2021-11-05 | 北京工商大学 | Fresh and fresh cold chain supervision method and system based on emotion analysis |
CN114499898A (en) * | 2022-04-15 | 2022-05-13 | 北京邮电大学 | Block chain cross-chain secure access method and device |
CN114615095A (en) * | 2022-05-12 | 2022-06-10 | 北京邮电大学 | Block chain cross-chain data processing method, relay chain, application chain and cross-chain network |
CN114819891A (en) * | 2022-04-18 | 2022-07-29 | 北京工商大学 | Rice full supply chain information supervision method based on parallel block chain and intelligent contract |
-
2022
- 2022-08-24 CN CN202211022139.7A patent/CN115982208B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210051023A1 (en) * | 2018-09-04 | 2021-02-18 | Advanced New Technologies Co., Ltd. | Cross-chain authentication method, system, server, and computer-readable storage medium |
US20210328791A1 (en) * | 2020-07-08 | 2021-10-21 | Alipay (Hangzhou) Information Technology Co., Ltd. | Blockchain data processing methods and apparatuses based on cloud computing |
CN111769957A (en) * | 2020-09-02 | 2020-10-13 | 百度在线网络技术(北京)有限公司 | Block chain cross-chain query method, device, equipment and storage medium |
CN112583917A (en) * | 2020-12-10 | 2021-03-30 | 浙商银行股份有限公司 | CSCP-based hybrid chain construction method |
CN112507095A (en) * | 2020-12-15 | 2021-03-16 | 平安国际智慧城市科技股份有限公司 | Information identification method based on weak supervised learning and related equipment |
CN113609294A (en) * | 2021-08-10 | 2021-11-05 | 北京工商大学 | Fresh and fresh cold chain supervision method and system based on emotion analysis |
CN114499898A (en) * | 2022-04-15 | 2022-05-13 | 北京邮电大学 | Block chain cross-chain secure access method and device |
CN114819891A (en) * | 2022-04-18 | 2022-07-29 | 北京工商大学 | Rice full supply chain information supervision method based on parallel block chain and intelligent contract |
CN114615095A (en) * | 2022-05-12 | 2022-06-10 | 北京邮电大学 | Block chain cross-chain data processing method, relay chain, application chain and cross-chain network |
Also Published As
Publication number | Publication date |
---|---|
CN115982208A (en) | 2023-04-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhang et al. | PPHOPCM: Privacy-preserving high-order possibilistic c-means algorithm for big data clustering with cloud computing | |
Kaliyar | Fake news detection using a deep neural network | |
Li et al. | Exploiting explicit and implicit feedback for personalized ranking | |
Li et al. | Topological Influence‐Aware Recommendation on Social Networks | |
CN111898031B (en) | Method and device for obtaining user portrait | |
CN111026858B (en) | Project information processing method and device based on project recommendation model | |
CN110069623A (en) | Summary texts generation method, device, storage medium and computer equipment | |
Gkoulalas-Divanis et al. | Modern privacy-preserving record linkage techniques: An overview | |
US11128479B2 (en) | Method and apparatus for verification of social media information | |
WO2021175021A1 (en) | Product push method and apparatus, computer device, and storage medium | |
US11941353B2 (en) | Data reuse computing architecture | |
CN112131471B (en) | Method, device, equipment and medium for recommending relationship based on unowned undirected graph | |
Wang et al. | Collaborative filtering and association rule mining‐based market basket recommendation on spark | |
Shan et al. | A web service clustering method based on semantic similarity and multidimensional scaling analysis | |
Ning et al. | Multiplex Network Embedding Model with High‐Order Node Dependence | |
CN115982208B (en) | Cold chain product relevance query method and device based on block chain cross-chain collaboration | |
KR102148451B1 (en) | Method, server, and system for providing question and answer data set synchronization service for integration management and inkage of multi-shopping mall | |
CN115114519A (en) | Artificial intelligence based recommendation method and device, electronic equipment and storage medium | |
Manalu et al. | The development of document similarity detector by Jaccard formulation | |
CN115203138A (en) | Data retrieval method, device and storage medium | |
CN113821608A (en) | Service search method, service search device, computer equipment and storage medium | |
CN116150663A (en) | Data classification method, device, computer equipment and storage medium | |
Chen | Semantic Matching Efficiency of Supply and Demand Text on Cross‐Border E‐Commerce Online Technology Trading Platforms | |
Xin et al. | Improving latent factor model based collaborative filtering via integrated folksonomy factors | |
Moraes et al. | Design principles and a software reference architecture for big data question answering systems |
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 |