CN115982208A - Cold chain product relevance query method and device based on block chain cross-chain cooperation - Google Patents

Cold chain product relevance query method and device based on block chain cross-chain cooperation Download PDF

Info

Publication number
CN115982208A
CN115982208A CN202211022139.7A CN202211022139A CN115982208A CN 115982208 A CN115982208 A CN 115982208A CN 202211022139 A CN202211022139 A CN 202211022139A CN 115982208 A CN115982208 A CN 115982208A
Authority
CN
China
Prior art keywords
chain
product
block
cross
information
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.)
Granted
Application number
CN202211022139.7A
Other languages
Chinese (zh)
Other versions
CN115982208B (en
Inventor
李翔
费晶茹
谢乾
朱全银
周泓
任柯
孙纪舟
张豪杰
丁婧娴
张宁
束玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huaiyin Institute of Technology
Original Assignee
Huaiyin Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huaiyin Institute of Technology filed Critical Huaiyin Institute of Technology
Priority to CN202211022139.7A priority Critical patent/CN115982208B/en
Publication of CN115982208A publication Critical patent/CN115982208A/en
Application granted granted Critical
Publication of CN115982208B publication Critical patent/CN115982208B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing 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 a cold chain product relevance query 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 obtaining a classification result through training; storing cold chain product information of different types in different block chains to form a plurality of product chains to form a product chain network; determining whether the product chain is subjected to identity verification or not by using a consensus algorithm through the relay link nodes to obtain a product chain which legally applies for registration; a user puts forward a cross-chain query request, and cross-chain identity authentication is carried out between product chains by using an intelligent contract in Hash locking; and performing relevance analysis calculation between the block nodes of each chain to obtain final product query result information. The method effectively solves the problems of low product classification accuracy and low query efficiency in the cold chain field by using a multi-label text classification model, block chain storage, cross-chain technology fusion and a data correlation analysis algorithm.

Description

Cold chain product relevance query method and device based on block chain cross-chain cooperation
Technical Field
The invention belongs to the field of text multi-label classification and block chain cross-chain technology fusion, and particularly relates to a cold chain product relevance query method and device based on block chain cross-chain cooperation.
Background
The block chain technology is a bottom core technology fused by various technologies such as cryptography, databases and the like, and is essentially a decentralized distributed account book. 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, alliance, and private blockchains, and the presence of a chain in isolation prevents collaborative interaction between different blockchains. Therefore, how to implement information intercommunication between chains is a problem faced by the development of block chain technology.
Cold chain products generally cover four links: freezing and processing, freezing and storing, refrigerating, transporting and distributing, and freezing and selling. The system mainly comprises an upstream product chain, a middle-downstream product chain, a downstream product chain, wherein the upstream product chain mainly comprises material supply and equipment manufacturing, the middle-downstream product chain comprises logistics transportation and storage management, and the downstream product chain mainly comprises a cold chain from products to foods, medicines, chemical engineering, electronics and commerce. Therefore, the number of cold chain products is huge, and the relevance among the products is high, so that the cold chain product information is proposed to be accurately classified, and then the cold chain product information is stored into blocks of a plurality of block chains, so that the storage pressure of a local database can be reduced, and the credibility and the tamper resistance of data can be ensured. Meanwhile, product information between each block chain has close relevance, so that a cross-chain cooperation technology is provided, the interoperability among multiple chains is realized, and the data query interaction is guaranteed. On the basis of chain crossing, a relevance analysis algorithm is provided, product relevance between blocks and between chains is calculated, more accurate product information is finally obtained, and convenience is brought to users.
There are many problems when querying a browser for product information: 1. the cold chain product is not accurately classified; 2. the problem of long time for acquiring information due to large data volume is solved; 3. querying the cold chain product information for relevancy has no outcome problem.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the problems, the invention provides a cold chain product correlation query method and device based on block chain cross-chain cooperation, which are used for solving the problems of inaccurate product classification, long product information query time and low query efficiency of a user in massive cold chain product data.
The technical scheme is as follows: the invention provides a cold chain product relevance query method and a cold chain product relevance query device based on cross-chain cooperation, which comprise 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, and obtaining a classification result through training, wherein the multi-label text classification model is combined with a CNN (convolutional neural network), an LSTM (least squares metric) model and multi-channel attention, and a fused text information vector representation E is obtained through the multi-label text classification model and is used as an input of a classifier to obtain a classification result y;
and step 3: storing cold chain product information of different categories in different block chains to form a plurality of product chains Pi according to the classification result, and forming a product chain network;
and 4, step 4: a plurality of product chains in the product chain network are used as main bodies of block chain cross-chain interaction, on the basis of conforming to the relay chain identity registration, cross-chain interaction can be carried out with legal authority, 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 5: performing cross-chain identity authentication between product chains by using an intelligent contract in hash locking according to a cross-chain query request provided by a user;
step 6: and after the identity is verified, performing relevance analysis on the block nodes of each chain to obtain final query product result information.
Further, the specific method of step 1 is as follows:
step 1.1: carrying out duplicate removal, null removal and special character removal on the data set D1 to be cleaned to obtain a cleaned data set D2;
step 1.2: carrying out 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 into uniform length Lmax, performing tokenization word segmentation on the text by using a pre-trained Bert model, and converting each word into a vector with fixed length to obtain a data set D3 of a word vector;
step 1.4: and respectively sending the word vectors into a Token Embedding layer, a Segment Embedding layer and a Position Embedding layer in a Bert model and a bidirectional Transformer, converting the word vectors into word vectors, and outputting a len (D3) word vector sequence S = S1, S2, S3, a.
Further, 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 characteristic vector f4j;
step 2.2: performing bidirectional operation on one sequence on the word vector subsequence sj by using an LSTM model, and obtaining another characteristic vector lj after the obtained output is operated by a nonlinear activation layer;
step 2.3: taking the feature vectors f4j and lj as the input of multi-channel attention;
step 2.4: calculating matching scores S1j and S2j of the feature vectors f4j and lj and the whole feature vector;
step 2.5: calculating the total percentages alpha 1j and alpha 2j of the feature vector scores according to the matching scores S1j and S2j;
step 2.6: summing and averaging the feature vectors according to the total percentage of the feature vector scores 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 the classifier;
step 2.8: inputting the vectorization expression Ej into softmax through a full connection layer and a hidden layer, and performing document classification prediction by adopting a softmax function to obtain a classification probability prediction vector P = P1, P2, a.
Step 2.9: and 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 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 using the 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 in the same category, each block is composed of a verification block and an information block, the verification block stores a verification id and a 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 a request is sent through an HTTP (hyper text transport protocol) protocol to realize interaction between an access interface and other subsystems;
step 3.4: and after receiving the HTTP request, the server group performs 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 block chain server node.
Further, the specific method of step 4 is as follows:
step 4.1: the product chain Pi is accessed to the cross-link gateway, a registration application is sent to the relay chain through the cross-link gateway, and registration information reg is requested to contain block chain identification, a certificate and identity identification information, namely reg = { BlockchainInfo, version, UID } is used as a mapping relation;
step 4.2: the cross-link gateway receives a request for applying registration of a product link Pi, forwards the request message, and appends 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 sub-key for a legal node of the product chain by using a secret sharing mechanism;
step 4.4: if not, returning to the step 4.1 to continue the application request;
step 4.5: if the relay chain receives the request for applying registration, the registration request is verified, whether the registration information is legal or not is verified, and the private key of the relay chain is disclosed;
step 4.4: storing the address and the hash of the product chain Pi to 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 which is legally applied for registration, 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 secret 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 whether the identity and the signature are consistent or not by the product chain Pi, if so, registering the identity of the product chain, and otherwise, rolling back to the step 4.3 to continue identity registration and verification.
Further, 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: a 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: auditing the relay chain, and judging whether to issue an identity;
step 5.5: if not, the connection is cancelled, and the mark is unqualified;
step 5.6: otherwise, sending the digital identity ID and the corresponding key;
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 inquiry interaction request.
Further, the specific method of step 6 is as follows:
step 6.1: starting from a block N for storing a product chain, filtering out nodes with lower correlation degrees obtained by calculation through a filtering stage on the basis of correlation calculation so as to preliminarily determine a block with a certain correlation degree with a target product label classification;
step 6.2: calculating the association degree according to the text information of the classified products in the node relation mining stage, and screening out the blocks meeting the association degree greater than Q1 from the alternative blocks as alternative blocks M;
step 6.3: in the stage of product chains, the relevance among the source tracing product chains is carried out through the blocks in the step 6.2, the relevance based on the blocks is calculated according to relevance analysis, and if the relevance is more than Q2, the candidate product chains are further screened and filtered;
step 6.4: and in the total association degree sorting stage, sorting the total association degree in a high-low mode, and outputting a result with the highest final association degree as the result information of the final query cold chain product.
The invention also discloses a cold chain product relevance query device based on block chain cross-chain cooperation, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the computer program executes the steps of the cold chain product relevance query method based on block chain cross-chain cooperation when being loaded to the processor.
Has the advantages 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 the tamper resistance of the cold chain product data, namely, the data needs to be encrypted, the block chain network only stores the encrypted data and the index data, and only the user obtaining the data access authority can access the key, thereby ensuring the data security and effectively improving the reliability and the stability of the storage.
2. The invention adopts a multi-label classification improved model based on the weighted fusion of the bidirectional long-short term memory neural network and the attention mechanism to carry out classification training, and finally obtains a classification result. Therefore, the problems of label errors, overfitting of data and unbalanced classification are solved, the accuracy of text classification of the description information of the cold chain products is improved, and convenience is provided for query.
3. The invention depends on the local database and the product block network server for data storage, keeps the encryption key consistent, can improve the storage performance and the query efficiency, does not need to transit the product information to a third party organization, and can realize the co-cooperation and the integrated maintenance.
4. The invention adopts the multi-chain type storage product chain, and stores the cold chain product information in different block chains according to the text classification result to form a product block chain network, thereby improving the distributed storage performance. The blocks in each block chain are composed of verification blocks and information blocks, so that the validity and accuracy of data query between the blocks can be verified, and product information stored in the information blocks can be conveniently acquired.
5. The invention adopts a method of combining a relay chain and a Hash locking mechanism in a cross-chain technology, and cross-chain request, identity registration and identity verification are required for interaction among chains. The product chain needs to be registered to determine that the legal chain has the 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 cross-chain contract processing needs to be carried out, so that the circulation among the chains can be guaranteed, and finally data intercommunication and flow among the chains are realized.
6. According to the method, a relevance analysis algorithm is adopted, when the cold-chain product information is inquired by a browser, the cold-chain product inquiring result information is finally obtained by inquiring the internal data of the blocks in the product chain and then sequencing the relevance of the stored text information.
Drawings
FIG. 1 is an overall frame diagram of the present invention;
FIG. 2 is a flow chart of data processing for a cold chain product;
FIG. 3 is a flow diagram of an improved multi-label text classification;
FIG. 4 is a schematic diagram of storing cold chain products in a blockchain according to classification results;
FIG. 5 is a block chain cross-chain digital identity registration flow diagram;
FIG. 6 is a block chain cross-chain identity authentication flow diagram;
FIG. 7 is a flow chart of calculation of correlation analysis of cold chain products after request through cross-chain.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The invention discloses a cold chain product relevance query method and a device based on block chain cross-chain cooperation, which comprises the steps of 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 a frame of the method and the device is shown in figure 1, and the method comprises the following steps:
step 1: data cleaning and data processing are carried out through the crawled cold chain product information, a cleaned data set is obtained, and the method is specifically shown in fig. 2:
step 1.1: defining T as a single text information set to be cleaned, defining ITEM _ NAME, and TYPE as the text content and the classification label of the commodity title respectively, and satisfying the relation T = ITEM _ NAME, TYPE.
Step 1.2: defining D1 as a data set to be cleaned, and D1= T1, T2,.., ta,.., tlen (D1), wherein Ta is information data of the a-th text label to be cleaned in D1, len (D1) is the number of text contents in D1, and a variable a belongs to [1, len (D1) ].
Step 1.3: after the text in the data set D1 is subjected to duplicate removal, null removal and special character removal, a cleaned data set D2= T1, T2,.. Tb.. And Tlen (D2) is obtained, where Tb is the information data of the b-th to-be-processed text label in D2, len (D2) is the number of texts in D2, and variable b belongs to [1, len (D2) ].
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: and traversing each piece of data, and returning the dictionary Da of the word segmentation and the occurrence times.
Step 1.6: and calling the local stop word list Ti to judge whether stop words exist.
Step 1.7: if yes, deleting stop words in the dictionary, and if not, returning to 1.6 to continue calling the stop word list.
Step 1.8: and extracting labels from the times of occurrence of the participles in the new dictionary, and returning to the label dictionary Dc after the participles are sequenced.
Step 1.9: and performing formal processing on the participles and the labels in the Dc, and returning the dictionary pairs Dd of the participles and the serial numbers thereof and the dictionary pairs Df of the labels and the serial numbers thereof.
Step 1.10: by processing the data set D2, the text content Tb to be processed is fixed to a uniform length Lmax.
Step 1.11: define j as a loop variable and assign j an initial value of 1, start the loop.
Step 1.12: if j is less than or equal to len (D2), the step S1.13 is entered; otherwise, jump to step S1.14.
Step 1.13: defining len (Tj) as the length of the jth text in the text, and if leh (Tj) +2 is less than or equal to Lmax, then entering step S1.14; otherwise, the first Lmax words of the text are intercepted, and the step S1.14 is then entered.
Step 1.14: carrying out tokenization word segmentation on the text Tj by using a pre-trained Bert model, converting each word into a vector with a fixed length to obtain a word vector, wherein the word vector corresponds to the data set D3, and the text Tj ', tj' = W1, W2,. Faradic, wk,. Faradic and WLmax of the data set D3, wherein Wk represents the kth word vector.
Step 1.15: and respectively sending each text Tj' in the data set D3 into a Token Embedding layer, a Segment Embedding layer and a Position Embedding layer in the Bert model to respectively obtain a vector code V1, a sentence code V2 and a Position code V3.
Step 1.16: vector coding V1, sentence coding V2 and position coding V3 are added and input into a bidirectional Transformer of Bert, and the Bert model outputs a word-wise quantum sequence vj = S (W1), S (W2),. Once, S (Wk),. Once, S (WLmax), wherein S (Wk) represents the kth word vector.
Step 1.17: the loop is ended, and the len (D3) word vector sequence S = S1, S2, S3,. To., sj,. To, slen (D3) is output.
And 2, step: through the cleaned data set, a multi-label text classification model is constructed, and a classification result is obtained through training, which 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 the sizes of convolution kernels to be 3, 4 and 5 respectively.
Step 2.2: and (3) transmitting the word vector sequence sj into a convolutional layer with a convolutional kernel size of 5 to perform convolution operation, and obtaining a vector fj, wherein fj represents the jth f vector of the output, and j belongs to (1, len (D3)).
Step (ii) of2.4: inputting fj obtained in the last step into an activation function Relu to obtain an output f2j,
Figure SMS_1
where the f2j is derived to represent the jth f2 vector of the output.
Step 2.5: and inputting the f2j obtained in the last step into the maximum pooling layer with the step size of 2 to obtain f3j, wherein the obtained f3j represents the j-th f3 vector of the output.
Step 2.6: repeating S2.2 to S2.5, replacing part of parameters: the convolutional layers are changed to 4 and 3 and the resulting output is f4j, where f4j is the jth f4 vector representing the output.
Step 2.7: and performing bidirectional operation on one sequence on the word vector subsequence sj by using an LSTM model, and obtaining another characteristic vector lj after the obtained output is subjected to operation of a nonlinear activation layer, wherein the obtained lj represents the j-th output l vector.
Step 2.8: the feature vectors f4j and lj obtained in step 2.6 and step 2.7 are used as the input of the multi-channel attention.
Step 2.9: the feature vectors f4j and lj are calculated to match scores S1j and S2j with the entire feature vectors.
Step 2.10: and calculating the total percentages alpha 1j and alpha 2j of the feature vector scores according to the matching scores S1j and S2j.
Step 2.11: and summing and averaging the feature vectors according to the total percentage of the feature vector scores to obtain final vectors V and T.
Step 2.12: and fusing the output vectors V and T of the multi-channel 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 from step 2.12 is input to softmax via the fully connected layer and the hidden layer.
Step 2.14: and performing document classification prediction by adopting a softmax function to obtain a classification probability prediction vector P = P1, P2, a.
Step 2.15: and searching the maximum value in the vector P, and outputting a result corresponding to the maximum value to obtain a classification result y.
And step 3: storing different types of cold chain product information in different block chains according to the classification result to form a plurality of product chains, and forming a product chain network, as shown in fig. 4 specifically:
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 the product chain A, B.
Step 3.2: each cold chain product block chain is connected by a plurality of blocks, each block stores products in the same category, each block is composed of a verification block and an information block, the verification block mainly stores the verification id and the secret key of the product, and the information block mainly stores the id and the specific information of the product.
Step 3.3: and a user browses in the cold-chain product information website through a browser, and a request is sent through an HTTP (hyper text transport protocol) protocol to realize interaction between the access interface and other subsystems.
Step 3.4: and after receiving the HTTP request, the server group performs 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 block chain server node.
And 4, step 4: multiple product chains in the product chain network are used as main bodies of block chain cross-chain interaction, on the basis of conforming to relay chain identity registration, legal authority can be provided for cross-chain interaction, supervision registration and verification are performed by using a consensus algorithm in the relay chain, and finally, a product chain with legal identity registration is obtained, specifically as shown in fig. 5:
step 4.1: the product chain Pi is accessed to the cross-chain gateway, and sends a registration application to the relay chain through the cross-chain gateway, and requests registration information reg to contain block chain identification, certificate and identity identification information, namely reg = { BlockchainInfo, version, UID } as a mapping relation.
Step 4.2: the gateway receives the request of applying for registration of the product chain, forwards the request message, and appends the 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 through a consensus algorithm. A secret sharing mechanism is used to generate the subkey.
Step 4.4: if not, returning to the step 4.1 to continue the application request.
Step 4.5: if the relay chain receives the request for applying registration, the registration request is verified, whether the registration information is legal or not is verified, and the private key of the relay chain is disclosed.
Step 4.4: and storing the address and the hash of the product chain Pi to a relay chain account book, and returning the result to the request product chain as a record.
Step 4.5: and confirming the product chain Pi which is legally applied for registration, encrypting and storing the identity information in the relay chain, generating an encryption private key and a signature private key for the terminal by using a secret key generation algorithm of SM9, and combining the encryption private key and the signature private key into a corresponding digital Identity (ID) according to the specification.
Step 4.6: and returning whether the identity and the signature are consistent or not by the product chain Pi, if so, registering the identity of the product chain, and otherwise, rolling back to the step 4.3 to continue identity registration and verification.
And 5: a cross-chain query request is provided by a user, and cross-chain identity authentication is performed between product chains by using an intelligent contract in hash locking, which is specifically shown in fig. 6:
step 5.1: firstly, a system is initialized on a relay link to generate a system public and private key.
Step 5.2: the user generates a systematic random number in the product chain Pi.
Step 5.3: the product chain Pi sends a registration request to the relay chain through the gateway.
Step 5.4: and auditing the relay chain, and judging whether to issue the identity.
Step 5.5: if not, the connection is cancelled, and the mark is not qualified.
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 inquiry interaction request.
Step 6: after passing the identity authentication, performing relevance analysis between the 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 for storing a product chain, on the basis of relevance calculation, filtering out nodes with low relevance degrees obtained through calculation through a filtering stage to preliminarily determine a block with a certain relevance degree with a target product label classification.
Step 6.2: and 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 greater than Q1 from the alternative blocks to serve as alternative blocks M.
Step 6.3: in the inter-product chain stage, the relevance among the source tracing product chains is carried out through the blocks in the step 6.2, the relevance based on the blocks is calculated according to the relevance analysis, and if the relevance is more than Q2, the candidate product chains are further screened and filtered.
Step 6.4: and in the total association degree sorting stage, sorting the total association degree in a high-low mode, and outputting a result with the highest final association degree as the result information of the final query cold chain product.
The above embodiments are merely illustrative of the technical concepts and features of the present invention, and the purpose of the embodiments is to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the protection scope of the present invention. All equivalent changes and modifications made according to the spirit of the present invention should be covered within the protection scope of the present invention.

Claims (8)

1. A cold chain product relevance query method based on block chain cross-chain cooperation 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, obtaining a classification result through training, performing weighted fusion on the multi-label text classification model by utilizing a CNN (CNN network), an LSTM (local state machine model) and a multi-channel attention mechanism, and obtaining a fused text information vector representation E through the multi-label text classification model as an input of a classifier to obtain a classification result y;
and step 3: storing cold chain product information of different categories in different block chains to form a plurality of product chains Pi according to the classification result, and forming a product chain network;
and 4, step 4: a plurality of product chains in the product chain network are used as main bodies of block chain cross-chain interaction, on the basis of conforming to the relay chain identity registration, cross-chain interaction can be carried out with legal authority, 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 5: performing cross-link identity authentication between product chains by using an intelligent contract in hash locking according to a cross-link query request provided by a user;
and 6: and after the identity is verified, performing relevance analysis between the block nodes of each chain to obtain final query product result information.
2. The cold chain product relevance query method based on block chain cross-chain collaboration as claimed in claim 1, wherein the specific method of step 1 is:
step 1.1: carrying out duplication removal, null removal and special character removal on the data set D1 to be cleaned to obtain a cleaned data set D2;
step 1.2: carrying out 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 into uniform length Lmax, performing tokenization word segmentation on the text by using a pre-trained Bert model, and converting each word into a vector with fixed length to obtain a data set D3 of a word vector;
step 1.4: and respectively sending the word vectors into a Token Embedding layer, a Segment Embedding layer and a Position Embedding layer in a Bert model and a bidirectional Transformer, converting the word vectors into word vectors, and outputting a len (D3) word vector sequence S = S1, S2, S3, a.
3. The cold chain product relevance query method based on block chain cross-chain collaboration according to claim 2, wherein 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 characteristic vector f4j;
step 2.2: performing bidirectional operation on one sequence on the word vector subsequence sj by using an LSTM model, and obtaining another characteristic vector lj after the obtained output is subjected to operation of a nonlinear activation layer;
step 2.3: taking the feature vectors f4j and lj as the input of multi-channel attention;
step 2.4: calculating matching scores S1j and S2j of the feature vectors f4j and lj and the whole feature vector;
step 2.5: calculating the total percentages alpha 1j and alpha 2j of the feature vector scores according to the matching scores S1j and S2j;
step 2.6: summing and averaging the feature vectors according to the total percentage of the feature vector scores 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 the classifier;
step 2.8: inputting the vectorization expression Ej into softmax through a full connection layer and a hidden layer, and performing document classification prediction by adopting a softmax function to obtain a classification probability prediction vector P = P1, P2, a.
Step 2.9: and 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 block chain cross-chain collaboration as claimed in claim 1, wherein the specific method of step 3 is:
step 3.1: according to the product classification result y in the step 2, y different block chains are divided, and the y different cold chain product information chains form a cold chain product block network;
step 3.2: connecting each cold chain product block chain by a plurality of blocks, wherein each block stores products in the same category, each block is composed of a verification block and an information block, the verification block stores a verification id and a 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 a request is sent through an HTTP (hyper text transport protocol) protocol to realize interaction between an access interface and other subsystems;
step 3.4: and after receiving the HTTP request, the server group performs synchronous symmetric encryption key processing according to the cold chain product keyword information acquired from the text box and the cold chain product information acquired from the product block chain server node.
5. The block chain cross-chain collaboration-based cold chain product relevance query method according to claim 1, wherein the specific method of 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 registration information reg is requested to contain block chain identification, a certificate and identity identification information, namely reg = { BlockchainInfo, version, UID } is used as a mapping relation;
step 4.2: the cross-link gateway receives a request for applying registration of a product link Pi, forwards the request message, and appends 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 sub-key for a legal node of the product chain by using a secret sharing mechanism;
step 4.4: if not, returning to the step 4.1 to continue the application request;
step 4.5: if the relay chain receives the request for applying registration, the registration request is verified, whether the registration information is legal or not is verified, and the private key of the relay chain is disclosed;
step 4.4: storing the address and the hash of the product chain Pi to a relay chain account book, and returning a result to the request product chain as a record;
step 4.5: confirming a product chain Pi which is legally applied for registration, 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 secret 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 whether the identity and the signature are consistent or not by the product chain Pi, if so, registering the identity of the product chain, and otherwise, rolling back to the step 4.3 to continue identity registration and verification.
6. The block chain cross-chain collaboration-based cold chain product relevance query method according to claim 1, wherein the specific method of the step 5 is as follows:
step 5.1: firstly, initializing a system on a relay link to generate a system public and private key;
step 5.2: a 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: auditing the relay chain, and judging whether to issue an identity;
and step 5.5: if not, the connection is cancelled, and whether the mark is unqualified is judged;
step 5.6: otherwise, sending the digital identity ID and the corresponding key;
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 inquiry interaction request.
7. The cold chain product relevance query method based on block chain cross-chain collaboration as claimed in claim 1, wherein the specific method of step 6 is:
step 6.1: starting from a block N for storing a product chain, filtering out nodes with lower correlation degrees obtained by calculation through a filtering stage on the basis of correlation calculation so as to preliminarily determine a block with a certain correlation degree with a target product label classification;
step 6.2: calculating the association degree according to the text information of the classified products in the node relation mining stage, and screening out the blocks meeting the association degree greater than Q1 from the alternative blocks as alternative blocks M;
step 6.3: in the stage of product chains, the relevance among the source tracing product chains is carried out through the blocks in the step 6.2, the relevance based on the blocks is calculated according to relevance analysis, and if the relevance is more than Q2, the candidate product chains are further screened and filtered;
step 6.4: and in the total association degree sorting stage, sorting the total association degree in a high-low mode, and outputting a result with the highest final association degree as the result information of the finally inquired cold chain product.
8. A cold chain product association query device based on blockchain cross-chain coordination, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the computer program, when loaded into the processor, performs the steps of the cold chain product association query method based on blockchain cross-chain coordination according to any one of claims 1 to 7.
CN202211022139.7A 2022-08-24 2022-08-24 Cold chain product relevance query method and device based on block chain cross-chain collaboration Active CN115982208B (en)

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 true CN115982208A (en) 2023-04-18
CN115982208B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116595231A (en) * 2023-05-17 2023-08-15 深圳市中京政通科技有限公司 Business full-flow and automatic query method based on block chain technology

Citations (9)

* Cited by examiner, † Cited by third party
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

Patent Citations (9)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116595231A (en) * 2023-05-17 2023-08-15 深圳市中京政通科技有限公司 Business full-flow and automatic query method based on block chain technology

Also Published As

Publication number Publication date
CN115982208B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
Yin et al. Deep fusion of multimodal features for social media retweet time prediction
Bhuvaneshwari et al. Spam review detection using self attention based CNN and bi-directional LSTM
Li et al. Topological Influence‐Aware Recommendation on Social Networks
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
WO2014160282A1 (en) Classifying resources using a deep network
US11128479B2 (en) Method and apparatus for verification of social media information
Abdullah et al. Single‐Valued Neutrosophic DEMATEL for Segregating Types of Criteria: A Case of Subcontractors’ Selection
EP4181010A1 (en) Data reuse computing architecture
Wang et al. Exploring the Combination of Dempster‐Shafer Theory and Neural Network for Predicting Trust and Distrust
US11861551B1 (en) Apparatus and methods of transport token tracking
Wang et al. Collaborative filtering and association rule mining‐based market basket recommendation on spark
Ouf A Proposed Architecture for Pharmaceutical Supply Chain Based Semantic Blockchain.
Ning et al. Multiplex Network Embedding Model with High‐Order Node Dependence
Shan et al. A web service clustering method based on semantic similarity and multidimensional scaling analysis
Qiao et al. TAG: Joint triple-hierarchical attention and GCN for review-based social recommender system
KR102148451B1 (en) Method, server, and system for providing question and answer data set synchronization service for integration management and inkage of multi-shopping mall
CN115982208B (en) Cold chain product relevance query method and device based on block chain cross-chain collaboration
Ming et al. Hybrid recommendation scheme based on deep learning
US20230252416A1 (en) Apparatuses and methods for linking action data to an immutable sequential listing identifier of a user
CN115114519A (en) Artificial intelligence based recommendation method and device, electronic equipment and storage medium
Shi et al. MFPR: A personalized ranking recommendation with multiple feedback
Gürbüz et al. Research article classification with text mining method
Yin et al. Social spammer detection: a multi-relational embedding approach
Liu et al. A Blockchain Consensus Optimization‐Based Algorithm for Food Traceability

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