A method and system for secure transmission of inspection data in a blockchain scenario
By adaptively selecting encryption algorithms and using digital signature verification in the blockchain scenario, the issues of blockchain data transmission security and efficiency are solved, and efficient and secure inspection data transmission is achieved.
Patent Information
- Application Number
- CN202410405586.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-04-07
AI Technical Summary
Existing technology cannot automatically select an appropriate encryption method in a blockchain scenario, resulting in low data encryption security or long encryption and decryption times, making it difficult to adapt to frequent data reading needs.
Obtain inspection data and blockchain transaction data through monitoring frequency, use classification compression model and encrypted storage model, adaptively select hybrid encryption algorithm or ordinary encryption algorithm, encrypt and decrypt inspection data, and verify data integrity through digital signatures property, using data steganography to decentralize key transmission.
It improves the security and efficiency of blockchain transmission, reduces computing and storage costs, ensures the security and privacy of inspection data, adapts to compression methods of different data types, and improves transmission efficiency and data integrity.
Smart Images

Figure CN118174879B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data transmission technology, and in particular to a method and system for securely transmitting inspection data in a blockchain scenario. Background Art
[0002] Blockchain is a distributed database technology, which is characterized by the fact that data is stored in a chain in the form of blocks, and each block is connected to the previous block through cryptographic methods to form an unchangeable and tamper-proof data chain. This technology provides data transparency, security and immutability. Inspection data usually refers to data collected during regular inspections or monitoring in a specific environment or equipment. These data contain important information such as the status, performance indicators, fault information, etc. of the inspection object. In many fields, such as industrial production, building maintenance, equipment monitoring, etc., it is crucial to ensure the accuracy, timeliness and security of inspection data.
[0003] However, the current existing technology cannot automatically select the appropriate encryption method according to the blockchain scenario. Traditional data encryption uses one encryption algorithm to encrypt data, which has low security and is easy to be cracked and tampered with. If multiple encryption algorithms are used to encrypt data, the encryption and decryption time is very long, which is not suitable for frequent data reading.
[0004] Therefore, we urgently need to provide a method and system for secure transmission of inspection data in a blockchain scenario that can adapt to cryptographic algorithms. Summary of the invention
[0005] The present invention aims to provide a method and system for secure transmission of inspection data in a blockchain scenario that can adapt to a cryptographic algorithm, thereby improving the security of blockchain transmission and enhancing transmission efficiency.
[0006] A method for secure transmission of inspection data in a blockchain scenario, comprising:
[0007] S1. Obtain inspection data and blockchain transaction data at a monitoring frequency of f to obtain real-time inspection data and real-time blockchain transaction data;
[0008] S2. Based on the real-time inspection data and the blockchain inspection data classification compression model, the inspection compressed data is obtained, and the inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data;
[0009] S3. Based on the inspection compression data and blockchain inspection data encryption storage model, the encrypted inspection data and the inspection data digital signature are obtained, and the inspection data key set is output. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data;
[0010] The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an attack-intensive period. If it is in an attack-intensive period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as 1; otherwise, the ordinary encryption algorithm is used to obtain the ordinary encrypted inspection data, and the inspection data target value is recorded as 0;
[0011] The inspection data key set includes multiple keys, including an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data;
[0012] The key of the inspection data key set is dispersedly added to the network protocol by using data steganography to obtain the inspection data key protocol, and the key position information of each key is recorded. The inspection data sender uses the key exchange protocol to send the inspection data key protocol and key position information to the inspection data receiver in the private network;
[0013] Add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the inspection data block; add the inspection data block to the blockchain network to obtain the inspection blockchain;
[0014] S4. The inspection data receiver accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, uses the key location information to find the required key in the inspection data key protocol and decrypts it, obtains the received inspection data, calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the inspection data digital signature to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is valid; otherwise, the inspection data to be encrypted has been tampered with, and the secure transmission is invalid; when the secure transmission is valid, the encrypted inspection data is decompressed to obtain the real-time inspection data;
[0015] As a preferred technical solution of the present invention, the specific steps of step S4 include:
[0016] S41. The inspection data recipient accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, and receives the inspection data key protocol and key location information in the private network, and searches for the required key in the inspection data key protocol according to the key location information;
[0017] Select the decryption method according to the inspection data target value on the inspection data block. If it is 1, jump to step S42; if it is 0, jump to step S43;
[0018] S42. Decrypt the inspection data composite key using the ECC algorithm through the inspection data composite decryption private key to obtain the grid password inspection key; decrypt the advanced encrypted inspection data by the grid password inspection key to obtain the initial encrypted inspection data received; decrypt the initial inspection data by the inspection data initial composite key using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44;
[0019] S43. The inspection data is decrypted by the inspection data ordinary key using the RSA algorithm to obtain the inspection data initial key; the inspection data initial key is used to decrypt the ordinary encrypted inspection data using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44;
[0020] S44. The inspection data receiver calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the digital signature of the inspection data to obtain the hash value of the inspection data. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is valid; otherwise, the inspection data to be encrypted has been tampered with, and the secure transmission is invalid; when the secure transmission is valid, the encrypted inspection data is decompressed to obtain real-time inspection data;
[0021] As a preferred technical solution of the present invention, the blockchain inspection data classification and compression model includes a classification preprocessing layer, a data classification layer, a data compression layer and a data output layer.
[0022] The classification preprocessing layer is used to preprocess the real-time inspection data to obtain the inspection data to be classified;
[0023] The data classification layer is used to use the inspection data classification model to obtain the target label value of the inspection data to be classified, and classify the inspection data to be classified into normal inspection data or abnormal inspection data according to the target label value;
[0024] The data compression layer is used to use a lossy compression algorithm to compress normal inspection data to obtain normal inspection compressed data, and to use a lossless compression algorithm to compress abnormal inspection data to obtain abnormal inspection compressed data;
[0025] The data output layer is used to output normal inspection compressed data and abnormal inspection compressed data to the blockchain inspection data encryption storage model;
[0026] As a preferred technical solution of the present invention, it also includes building an inspection data classification model, specifically the following steps:
[0027] C1. Obtain some inspection data to be classified, annotate the inspection data to be classified by target label value, obtain inspection data classification data set, and divide the inspection data classification data set into inspection data classification training set and inspection data classification test set;
[0028] C2. Input the inspection data classification training set into the SVM model for training, with the target label value as the target. After the training is completed, the initial inspection data classification model is obtained;
[0029] C3. Input the inspection data classification test set into the inspection data classification initial model for accuracy evaluation, and take the target label value as the target to obtain the test accuracy; if the test accuracy is within the error standard range, the inspection data classification initial model is the inspection data classification model; if the test accuracy exceeds the error standard range, adjust the hyperparameters and repeat steps C2 and C3;
[0030] As a preferred technical solution of the present invention, the lossy compression algorithm DPCM algorithm is used to compress the normal inspection data to obtain normal inspection compressed data, and the lossless compression algorithm LZ78 algorithm is used to compress the abnormal inspection data to obtain abnormal inspection compressed data;
[0031] As a preferred technical solution of the present invention, the blockchain inspection data encryption storage model includes an encryption preprocessing layer, an attack judgment layer, an advanced encryption layer, a common encryption layer, a digital signature layer, a key transmission layer, and a data block storage layer.
[0032] The encryption preprocessing layer is used to preprocess the inspection compression data to obtain the inspection data to be encrypted; and use the hash function to calculate the inspection data to be encrypted to obtain the inspection data hash value;
[0033] The attack judgment layer is used to use the inspection data security prediction model and real-time blockchain transaction data to determine whether the current period is an intensive attack period. If it is an intensive attack period, the inspection data to be encrypted will be transmitted to the advanced encryption layer for encryption processing, and the inspection data target value will be recorded as 1; if it is not an intensive attack period, the inspection data to be encrypted will be transmitted to the ordinary encryption layer for encryption processing, and the inspection data target value will be recorded as 0;
[0034] The advanced encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a hybrid encryption algorithm to obtain advanced encrypted inspection data, and record the inspection data initial composite key, inspection data composite key and inspection data composite decryption private key used for decryption;
[0035] The common encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a common encryption algorithm to obtain common encrypted inspection data, and record the inspection data common key for decryption and the inspection data common decryption private key;
[0036] The digital signature layer is used to calculate the hash value of the inspection data using the digital signature technology to obtain the digital signature of the inspection data;
[0037] The key transmission layer is used to combine the inspection data initial composite key, the inspection data composite key, the inspection data composite decryption private key, the inspection data common key and the inspection data common decryption private key into an inspection data key set, and use the network steganography method to disperse and add multiple keys of the inspection data key set to the network protocol to obtain the inspection data key protocol and record the key location information of each key. The inspection data sender uses the key exchange protocol to transmit the inspection data key protocol and key location information to the inspection data receiver in the private network. The private network is a private network established separately by the inspection data sender and the inspection data receiver.
[0038] The data block storage layer is used to add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the encrypted inspection data block, and add the encrypted inspection data block to the blockchain network to obtain the inspection blockchain;
[0039] As a preferred technical solution of the present invention, it also includes encrypting the inspection data to be encrypted using an advanced encryption layer or a common encryption layer, specifically the following steps:
[0040] In the advanced encryption layer, a random number generation algorithm is used to generate a random number of a fixed length to obtain an initial random number for inspection data, the initial random number for inspection data is organized into a matrix to obtain an initial matrix for inspection data, the inspection key matrix and the inspection data initial matrix are used to calculate to obtain an initial composite key for inspection data, the inspection data to be encrypted is calculated using the initial composite key for inspection data to obtain initial encrypted inspection data; the initial encrypted inspection data is calculated using a lattice cipher algorithm to obtain advanced encrypted inspection data and the lattice cipher inspection key is recorded; the lattice cipher inspection key is calculated using an ECC algorithm to obtain a composite key for inspection data, and the composite encryption public key for inspection data used for encryption and the composite decryption private key for inspection data used for decryption are recorded at the same time;
[0041] In the common encryption layer, a random number generation algorithm is used to generate a random number of a fixed length to obtain the initial key of the inspection data, and the inspection data to be encrypted is calculated using the initial key of the inspection data to obtain the common encrypted inspection data; the inspection data initial key is calculated using the RSA algorithm to obtain the common key of the inspection data, and the common encryption public key of the inspection data used for encryption and the common decryption private key of the inspection data used for decryption are recorded;
[0042] As a preferred technical solution of the present invention, it also includes building a patrol data security prediction model, specifically the following steps:
[0043] P1. Obtain some historical blockchain transaction data, perform preprocessing, obtain preprocessed blockchain transaction data, and annotate the preprocessed blockchain transaction data with a target value to obtain a preprocessed blockchain transaction data set, and divide the preprocessed blockchain transaction data set into a preprocessed blockchain transaction training set and a preprocessed blockchain transaction test set;
[0044] P2. Input the pre-processed blockchain transaction training set into the CNN model, train with the target value as the target, and obtain the initial model for inspection data security judgment; input the pre-processed blockchain transaction test set into the initial model for inspection data security judgment for testing, obtain the test target value, evaluate the test target value and the target value, and obtain the judgment accuracy; if the judgment accuracy is within the error standard range, the initial model for inspection data security judgment is the inspection data security judgment model; otherwise, adjust the hyperparameters and then conduct model training;
[0045] As a preferred technical solution of the present invention, it also includes a data block storage layer for storing encrypted inspection data blocks, and the specific steps are:
[0046] T1. Submit a transaction application to the blockchain network to obtain the storage target node and storage data block;
[0047] T2. Obtain the hash value of the storage data block of the previous node of the storage target node, obtain the hash value of the previous node, add the encrypted inspection data, the inspection data target value, the inspection data digital signature and the hash value of the previous node to the storage data block, and obtain the encrypted inspection data block;
[0048] T3. Broadcast the blockchain network, obtain the transaction confirmation application, add the encrypted inspection data block to the blockchain network, and obtain the inspection blockchain;
[0049] A secure transmission system for inspection data in a blockchain scenario, comprising:
[0050] A data capture module is used to capture inspection data and blockchain transaction data at a monitoring frequency f to obtain real-time inspection data and real-time blockchain transaction data;
[0051] The data compression module is used to deploy the blockchain inspection data classification and compression model, classify and characterize the real-time inspection data, and then compress it using different compression algorithms to obtain the inspection compressed data. The inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data;
[0052] The data encryption storage module is used to deploy the blockchain inspection data encryption storage model, obtain the encrypted inspection data and the inspection data digital signature based on the inspection compression data and the blockchain inspection data encryption storage model, and output the inspection data key set. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data. The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an intensive attack period. If it is in an intensive attack period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as dangerous; otherwise, the ordinary encryption algorithm is used to obtain the ordinary encrypted inspection data, and the inspection data target value is recorded as safe; the inspection data key set package The invention includes an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data; the inspection data key set is dispersedly added to the network protocol by using data steganography to obtain the inspection data key protocol, and the key location information is recorded; the inspection data sender uses the key exchange protocol to send the inspection data key protocol and the key location information to the inspection data receiver in the private network; the encrypted inspection data, the inspection data target value and the inspection data digital signature are added to the storage data block to obtain the inspection data block; the inspection data block is added to the blockchain network to obtain the inspection blockchain;
[0053] The data receiving module is used for the inspection data receiver to access the inspection data block through the inspection blockchain node, obtain the encrypted inspection data, the inspection data target value and the inspection data digital signature in the inspection data block, use the key location information to find the required key in the inspection data key protocol and decrypt and decompress it, obtain the received inspection data, calculate the hash value of the received inspection data, obtain the verification hash value, and use the digital signature technology to decrypt the digital signature of the inspection data to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is real-time inspection data, and the real-time inspection data has not been tampered with, and the secure transmission is valid; otherwise, the real-time inspection data has been tampered with and the secure transmission is invalid.
[0054] The present invention has the following advantages:
[0055] 1. The present invention uses a blockchain inspection data encryption storage model to adaptively encrypt the inspection compressed data and upload it to the blockchain network. The blockchain inspection data encryption storage model can automatically adjust the encryption algorithm according to whether it is in a blockchain attack intensive period, and choose to use a hybrid encryption algorithm or a common encryption algorithm, reduce unnecessary encryption operations and optimize the encryption process, which can reduce computing costs and storage costs, while ensuring the security of inspection data transmission and optimizing response speed; by packaging the inspection data key set into an inspection data key protocol and transmitting it to the inspection data receiver through a private network, the security and privacy of the inspection data key set key are guaranteed; by using the blockchain inspection data classification compression model to automatically classify and compress real-time inspection data, the transmission efficiency can be improved, the blockchain space can be saved, and the efficiency of subsequent encrypted data can be improved. Different compression methods are used for different inspection data types, which not only ensures the integrity of the data, but also can compress the data to the maximum extent.
[0056] 2. The present invention uses the SVM model as the basic model of the inspection data classification model, which can automatically determine whether the inspection data is normal or abnormal, and provide a high-accuracy classification effect. The present invention uses the CNN model as the basic model of the inspection data security prediction model, which can effectively capture the spatiotemporal characteristics in the blockchain transaction data, thereby realizing the prediction of whether the current period is an intensive attack period, and can improve the detection efficiency and accuracy of abnormal behavior in the blockchain network.
[0057] 3. The present invention encrypts the inspection data to be encrypted by using multiple encryption algorithms. Even if one algorithm is cracked, other algorithms can still protect the confidentiality of the data, and can adaptively select a hybrid encryption algorithm or a common encryption algorithm, thereby improving the flexibility and scalability of the system.
[0058] 4. The present invention verifies whether the inspection data has been tampered with by using the digital signature of the inspection data, thereby ensuring the integrity, authenticity and non-repudiation of the inspection data, which is an important guarantee for the secure transmission of data in the blockchain network. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a structural diagram of a system for securely transmitting inspection data in a blockchain scenario adopted in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to enable persons skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0061] Example 1
[0062] A method for secure transmission of inspection data in a blockchain scenario, comprising:
[0063] S1. Obtain inspection data and blockchain transaction data at monitoring frequency f to obtain real-time inspection data and real-time blockchain transaction data; frequency f is modified and formulated by professional technicians according to actual conditions;
[0064] S2. Based on the real-time inspection data and the blockchain inspection data classification compression model, the inspection compressed data is obtained, and the inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data;
[0065] The blockchain inspection data classification and compression model includes classification preprocessing layer, data classification layer, data compression layer and data output layer.
[0066] The classification preprocessing layer is used to preprocess the real-time inspection data to obtain the inspection data to be classified;
[0067] The data classification layer is used to use the inspection data classification model to obtain the target label value of the inspection data to be classified, and classify the inspection data to be classified into normal inspection data or abnormal inspection data according to the target label value;
[0068] Build an inspection data classification model. Specific steps:
[0069] C1. Obtain some inspection data to be classified, annotate the inspection data to be classified by target label value, obtain inspection data classification data set, and divide the inspection data classification data set into inspection data classification training set and inspection data classification test set;
[0070] C2. Input the inspection data classification training set into the SVM model for training, with the target label value as the target. After the training is completed, the initial model of inspection data classification is obtained; SVM is a powerful machine learning algorithm that achieves high-accuracy classification effects by effectively constructing classification boundaries and being insensitive to outliers. It performs well in processing high-dimensional data and nonlinear problems, has good generalization ability, and is suitable for data classification tasks in various fields, including but not limited to text classification, image recognition, and bioinformatics;
[0071] C3. Input the inspection data classification test set into the inspection data classification initial model for accuracy evaluation, and take the target label value as the target to obtain the test accuracy; if the test accuracy is within the error standard range, the inspection data classification initial model is the inspection data classification model; if the test accuracy exceeds the error standard range, adjust the hyperparameters and repeat steps C2 and C3; the error standard range is determined by experienced technicians based on actual conditions;
[0072] The data compression layer is used to use a lossy compression algorithm to compress normal inspection data to obtain normal inspection compressed data, and to use a lossless compression algorithm to compress abnormal inspection data to obtain abnormal inspection compressed data;
[0073] The lossy compression algorithm DPCM algorithm is used to compress the normal inspection data to obtain normal inspection compressed data, and the lossless compression algorithm LZ78 algorithm is used to compress the abnormal inspection data to obtain abnormal inspection compressed data;
[0074] For normal inspection data, lossy compression algorithms can be used to reduce storage requirements. For data with continuity and similarity, some irrelevant information can be deleted to reduce the file size. At the same time, the transmission rate is fast, which reduces operating costs.
[0075] The use of lossless compression algorithm for abnormal inspection data can completely retain the abnormal part of the inspection data, making it easier to view and operate the abnormal inspection data later;
[0076] The data output layer is used to output normal inspection compressed data and abnormal inspection compressed data to the blockchain inspection data encryption storage model;
[0077] S3. Based on the inspection compression data and blockchain inspection data encryption storage model, the encrypted inspection data and the inspection data digital signature are obtained, and the inspection data key set is output. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data;
[0078] The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an attack-intensive period. If it is in an attack-intensive period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as 1; otherwise, the ordinary encryption algorithm is used to obtain the ordinary encrypted inspection data, and the inspection data target value is recorded as 0;
[0079] Real-time blockchain transaction data can immediately provide information about the current network status, allowing for quick discovery of abnormalities or attacks. Real-time blockchain transaction data contains all the latest transaction records, covering the activities of the entire network, so that a comprehensive understanding of the network's operating status can be achieved. By monitoring changes in real-time blockchain transaction data, possible attacks can be identified, such as large-scale transaction congestion, malicious node attacks, etc., and encryption algorithms can be changed in a timely manner to protect the security of inspection data;
[0080] The inspection data key set includes multiple keys, including an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data;
[0081] The keys of the inspection data key set are dispersedly added to the network protocol using data steganography to obtain the inspection data key protocol, and the key location information of each key is recorded. The inspection data sender uses the key exchange protocol to send the inspection data key protocol and key location information to the inspection data receiver in the private network; the keys of the inspection data key set are wrapped in the network protocol. The network protocol has no direct association with the inspection data. Even if it is intercepted, the interceptor will not associate it with the inspection data. It can be used for data transmission security and privacy protection, while reducing the risk of being detected, and is suitable for various key information transmissions;
[0082] Add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the inspection data block; add the inspection data block to the blockchain network to obtain the inspection blockchain;
[0083] The blockchain inspection data encryption storage model includes encryption preprocessing layer, attack judgment layer, advanced encryption layer, ordinary encryption layer, digital signature layer, key transmission layer, data block storage layer,
[0084] The encryption preprocessing layer is used to preprocess the inspection compression data to obtain the inspection data to be encrypted; and use the hash function to calculate the inspection data to be encrypted to obtain the inspection data hash value;
[0085] The attack judgment layer is used to use the inspection data security prediction model and real-time blockchain transaction data to determine whether the current period is an intensive attack period. If it is an intensive attack period, the inspection data to be encrypted will be transmitted to the advanced encryption layer for encryption processing, and the inspection data target value will be recorded as 1; if it is not an intensive attack period, the inspection data to be encrypted will be transmitted to the ordinary encryption layer for encryption processing, and the inspection data target value will be recorded as 0;
[0086] Build a security prediction model for inspection data. Specific steps:
[0087] P1. Obtain some historical blockchain transaction data, perform preprocessing, obtain preprocessed blockchain transaction data, and annotate the preprocessed blockchain transaction data with a target value to obtain a preprocessed blockchain transaction data set, and divide the preprocessed blockchain transaction data set into a preprocessed blockchain transaction training set and a preprocessed blockchain transaction test set;
[0088] P2. Input the pre-processed blockchain transaction training set into the CNN model, train with the target value as the target, and obtain the initial model for inspection data security judgment; input the pre-processed blockchain transaction test set into the initial model for inspection data security judgment for testing, obtain the test target value, evaluate the test target value and the target value, and obtain the judgment accuracy; if the judgment accuracy is within the error standard range, the initial model for inspection data security judgment is the inspection data security judgment model; otherwise, adjust the hyperparameters and then conduct model training;
[0089] CNN models can help identify abnormal patterns in Internet transaction data and detect potential attack activities in advance, allowing timely defensive measures to reduce losses. At the same time, they can learn and identify more complex attack patterns, reduce false positives and false negatives, and improve the accuracy of predictions.
[0090] The advanced encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a hybrid encryption algorithm to obtain advanced encrypted inspection data, and record the inspection data initial composite key, inspection data composite key and inspection data composite decryption private key used for decryption;
[0091] In the advanced encryption layer, a random number generation algorithm is used to generate a random number of fixed length to obtain the initial random number of the inspection data. The initial random number of the inspection data is organized into a matrix to obtain the initial matrix of the inspection data. The inspection key matrix and the initial matrix of the inspection data are used to calculate to obtain the initial composite key of the inspection data. Through matrix operations, the complexity of the key generation process can be increased, making the key more difficult to be predicted or cracked.
[0092] The encrypted inspection data is calculated using the inspection data initial composite key to obtain the initial encrypted inspection data; the initial encrypted inspection data is calculated using the lattice cryptographic algorithm to obtain the advanced encrypted inspection data and record the lattice cryptographic inspection key; the lattice cryptographic algorithm can effectively resist quantum computing attacks and has a high degree of security and flexibility;
[0093] The ECC algorithm is used to calculate the lattice cipher inspection key to obtain the inspection data composite key, and the inspection data composite encryption public key used for encryption and the inspection data composite decryption private key used for decryption are recorded at the same time; the ECC algorithm can provide the same level of security as the RSA algorithm, but uses a shorter key length, which can reduce the cost of storage and transmission, and the encryption and decryption speed is fast, which improves the transmission efficiency;
[0094] The common encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a common encryption algorithm to obtain common encrypted inspection data, and record the inspection data common key for decryption and the inspection data common decryption private key;
[0095] In the common encryption layer, a random number generation algorithm is used to generate a random number of a fixed length to obtain the initial key of the inspection data, and the inspection data to be encrypted is calculated using the initial key of the inspection data to obtain the common encrypted inspection data; the inspection data initial key is calculated using the RSA algorithm to obtain the common key of the inspection data, and the common encryption public key of the inspection data used for encryption and the common decryption private key of the inspection data used for decryption are recorded;
[0096] The digital signature layer is used to calculate the hash value of the inspection data using the digital signature technology to obtain the digital signature of the inspection data;
[0097] The key transmission layer is used to combine the inspection data initial composite key, the inspection data composite key, the inspection data composite decryption private key, the inspection data common key and the inspection data common decryption private key into an inspection data key set, and use the network steganography method to disperse and add multiple keys of the inspection data key set to the network protocol to obtain the inspection data key protocol and record the key location information of each key. The inspection data sender uses the key exchange protocol to transmit the inspection data key protocol and key location information to the inspection data receiver in the private network. The private network is a private network established separately by the inspection data sender and the inspection data receiver.
[0098] The data block storage layer is used to add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the encrypted inspection data block, and add the encrypted inspection data block to the blockchain network to obtain the inspection blockchain;
[0099] The data block storage layer is used to store encrypted inspection data blocks. The specific steps are as follows:
[0100] T1. Submit a transaction application to the blockchain network to obtain the storage target node and storage data block;
[0101] T2. Obtain the hash value of the storage data block of the previous node of the storage target node, obtain the hash value of the previous node, add the encrypted inspection data, the inspection data target value, the inspection data digital signature and the hash value of the previous node to the storage data block, and obtain the encrypted inspection data block;
[0102] T3. Broadcast the blockchain network, obtain the transaction confirmation application, add the encrypted inspection data block to the blockchain network, and obtain the inspection blockchain;
[0103] S4. The inspection data receiver accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, uses the key location information to find the required key in the inspection data key protocol and decrypts it, obtains the received inspection data, calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the inspection data digital signature to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is valid; otherwise, the inspection data to be encrypted has been tampered with, and the secure transmission is invalid; when the secure transmission is valid, the encrypted inspection data is decompressed to obtain the real-time inspection data;
[0104] S41. The inspection data recipient accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, and receives the inspection data key protocol and key location information in the private network, and searches for the required key in the inspection data key protocol according to the key location information;
[0105] Private network transmission uses a dedicated network channel to transmit data. Compared with the public network, private network transmission can provide higher security. This is because private networks usually have stricter access control and encryption measures, which can effectively prevent unauthorized access and data leakage;
[0106] Select the decryption method according to the inspection data target value on the inspection data block. If it is 1, jump to step S42; if it is 0, jump to step S43;
[0107] S42. Decrypt the inspection data composite key using the ECC algorithm through the inspection data composite decryption private key to obtain the grid password inspection key; decrypt the advanced encrypted inspection data by the grid password inspection key to obtain the initial encrypted inspection data received; decrypt the initial inspection data by the inspection data initial composite key using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44;
[0108] S43. The inspection data is decrypted by the inspection data ordinary key using the RSA algorithm to obtain the inspection data initial key; the inspection data initial key is used to decrypt the ordinary encrypted inspection data using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44;
[0109] S44. The inspection data receiver calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the inspection data digital signature to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is valid; otherwise, the inspection data to be encrypted has been tampered with, and the secure transmission is invalid; when the secure transmission is valid, the encrypted inspection data is decompressed to obtain the real-time inspection data; the digital signature technology can verify the integrity of the inspection data and ensure that the inspection data has not been tampered with during transmission or storage. The inspection data receiver can use the signature and The original data is compared to confirm the integrity of the data. The digital signature is generated by the sender of the inspection data, so it can be used to verify the identity of the signer. The receiver of the inspection data can use the signer's public key to verify the validity of the signature, thereby ensuring that the inspection data comes from a legitimate sender of the inspection data. Once the digital signature of the inspection data is generated and verified, the signer cannot deny his signing behavior, which provides irrefutable evidence and ensures the credibility and traceability of data transmission. Digital signature technology can protect the security of inspection data during transmission. The digital signature of inspection data is transmitted together with the inspection data to ensure that the data will not be tampered with or forged during transmission.
[0110] Example 2
[0111] A secure transmission system for inspection data in a blockchain scenario, see Figure 1 As shown, including:
[0112] A data capture module is used to capture inspection data and blockchain transaction data at a monitoring frequency f to obtain real-time inspection data and real-time blockchain transaction data;
[0113] The data compression module is used to deploy the blockchain inspection data classification and compression model, classify and characterize the real-time inspection data, and then compress it using different compression algorithms to obtain the inspection compressed data. The inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data;
[0114] The data encryption storage module is used to deploy the blockchain inspection data encryption storage model, obtain the encrypted inspection data and the inspection data digital signature based on the inspection compression data and the blockchain inspection data encryption storage model, and output the inspection data key set. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data. The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an intensive attack period. If it is in an intensive attack period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as dangerous; otherwise, the ordinary encryption algorithm is used to obtain the ordinary encrypted inspection data, and the inspection data target value is recorded as safe; the inspection data key set package The invention includes an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data; the inspection data key set is dispersedly added to the network protocol by using data steganography to obtain the inspection data key protocol, and the key location information is recorded; the inspection data sender uses the key exchange protocol to send the inspection data key protocol and the key location information to the inspection data receiver in the private network; the encrypted inspection data, the inspection data target value and the inspection data digital signature are added to the storage data block to obtain the inspection data block; the inspection data block is added to the blockchain network to obtain the inspection blockchain;
[0115] The data receiving module is used for the inspection data receiver to access the inspection data block through the inspection blockchain node, obtain the encrypted inspection data, the inspection data target value and the inspection data digital signature in the inspection data block, use the key location information to find the required key in the inspection data key protocol and decrypt and decompress it, obtain the received inspection data, calculate the hash value of the received inspection data, obtain the verification hash value, and use the digital signature technology to decrypt the digital signature of the inspection data to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is real-time inspection data, and the real-time inspection data has not been tampered with, and the secure transmission is valid; otherwise, the real-time inspection data has been tampered with and the secure transmission is invalid.
[0116] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention. Parts not described in detail in this specification belong to the prior art known to those skilled in the art.
Claims
1. A method for secure transmission of inspection data in a blockchain scenario, characterized in that: Specific steps: S1. Obtain inspection data and blockchain transaction data at a monitoring frequency of f to obtain real-time inspection data and real-time blockchain transaction data; S2. Based on the real-time inspection data and the blockchain inspection data classification compression model, the inspection compressed data is obtained, and the inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data; S3. Based on the inspection compression data and blockchain inspection data encryption storage model, the encrypted inspection data and the inspection data digital signature are obtained, and the inspection data key set is output. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data; The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an attack-intensive period. If it is in an attack-intensive period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as 1; Otherwise, use the common encryption algorithm to obtain the common encrypted inspection data, and record the inspection data target value as 0; The inspection data key set includes multiple keys, including an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data; The key of the inspection data key set is dispersedly added to the network protocol by using data steganography to obtain the inspection data key protocol, and the key position information of each key is recorded. The inspection data sender uses the key exchange protocol to send the inspection data key protocol and key position information to the inspection data receiver in the private network; Add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the inspection data block; Add the inspection data block to the blockchain network to obtain the inspection blockchain; S4. The inspection data receiver accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, uses the key location information to find the required key in the inspection data key protocol and decrypts it, obtains the received inspection data, calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the inspection data digital signature to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is effective; Otherwise, the encrypted inspection data will be tampered with and the secure transmission will be invalid; When the secure transmission is effective, the encrypted inspection data is decompressed to obtain the real-time inspection data; The blockchain inspection data classification and compression model includes classification preprocessing layer, data classification layer, data compression layer and data output layer; The classification preprocessing layer is used to preprocess the real-time inspection data to obtain the inspection data to be classified; The data classification layer is used to use the inspection data classification model to obtain the target label value of the inspection data to be classified, and classify the inspection data to be classified into normal inspection data or abnormal inspection data according to the target label value; The data compression layer is used to use a lossy compression algorithm to compress normal inspection data to obtain normal inspection compressed data, and to use a lossless compression algorithm to compress abnormal inspection data to obtain abnormal inspection compressed data; The data output layer is used to output normal inspection compressed data and abnormal inspection compressed data to the blockchain inspection data encryption storage model; The blockchain inspection data encryption storage model includes encryption preprocessing layer, attack judgment layer, advanced encryption layer, ordinary encryption layer, digital signature layer, key transmission layer, and data block storage layer; The encryption preprocessing layer is used to preprocess the inspection compression data to obtain the inspection data to be encrypted; And use the hash function to calculate the inspection data to be encrypted to obtain the inspection data hash value; The attack judgment layer is used to use the inspection data security prediction model and real-time blockchain transaction data to determine whether the current period is an intensive attack period. If it is an intensive attack period, the inspection data to be encrypted will be transmitted to the advanced encryption layer for encryption processing, and the inspection data target value will be recorded as 1; If it is not a period of intensive attack, the inspection data to be encrypted will be transmitted to the common encryption layer for encryption processing, and the inspection data target value will be recorded as 0; The advanced encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a hybrid encryption algorithm to obtain advanced encrypted inspection data, and record the inspection data initial composite key, inspection data composite key and inspection data composite decryption private key used for decryption; The common encryption layer is used to perform encryption calculation on the inspection data to be encrypted using a common encryption algorithm to obtain common encrypted inspection data, and record the inspection data common key for decryption and the inspection data common decryption private key; The digital signature layer is used to calculate the hash value of the inspection data using the digital signature technology to obtain the digital signature of the inspection data; The key transmission layer is used to combine the inspection data initial composite key, the inspection data composite key, the inspection data composite decryption private key, the inspection data common key and the inspection data common decryption private key into an inspection data key set, and use the network steganography method to disperse and add multiple keys of the inspection data key set to the network protocol to obtain the inspection data key protocol and record the key location information of each key. The inspection data sender uses the key exchange protocol to transmit the inspection data key protocol and key location information to the inspection data receiver in the private network. The private network is a private network established separately by the inspection data sender and the inspection data receiver. The data block storage layer is used to add the encrypted inspection data, the inspection data target value and the inspection data digital signature to the storage data block to obtain the encrypted inspection data block, and add the encrypted inspection data block to the blockchain network to obtain the inspection blockchain; Build a security prediction model for inspection data. Specific steps: P1. Obtain some historical blockchain transaction data, perform preprocessing, obtain preprocessed blockchain transaction data, and annotate the preprocessed blockchain transaction data with a target value to obtain a preprocessed blockchain transaction data set, and divide the preprocessed blockchain transaction data set into a preprocessed blockchain transaction training set and a preprocessed blockchain transaction test set; P2. Input the pre-processed blockchain transaction training set into the CNN model, train it with the target value as the target, and obtain the initial model for inspection data security judgment; The preprocessed blockchain transaction test set is input into the inspection data security judgment initial model for testing to obtain the test target value, and the test target value and the target value are evaluated to obtain the judgment accuracy; if the judgment accuracy is within the error standard range, the inspection data security judgment initial model is the inspection data security judgment model; otherwise, after adjusting the hyperparameters, the model training is performed again.
2. According to a method for secure transmission of inspection data in a blockchain scenario according to claim 1, it is characterized in that: Build an inspection data classification model. Specific steps: C1. Obtain some inspection data to be classified, annotate the inspection data to be classified by target label value, obtain inspection data classification data set, and divide the inspection data classification data set into inspection data classification training set and inspection data classification test set; C2. Input the inspection data classification training set into the SVM model for training, with the target label value as the target. After the training is completed, the initial inspection data classification model is obtained; C3. Input the inspection data classification test set into the inspection data classification initial model for accuracy evaluation, taking the target label value as the target, and obtain the test accuracy; If the test accuracy is within the error standard range, the inspection data classification initial model is the inspection data classification model. If the test accuracy exceeds the error standard range, the hyperparameters are adjusted and steps C2 and C3 are repeated.
3. According to a method for secure transmission of inspection data in a blockchain scenario according to claim 2, it is characterized in that: The lossy compression algorithm DPCM algorithm is used to compress the normal inspection data to obtain normal inspection compressed data, and the lossless compression algorithm LZ78 algorithm is used to compress the abnormal inspection data to obtain abnormal inspection compressed data.
4. According to a method for secure transmission of inspection data in a blockchain scenario according to claim 3, it is characterized in that: Use the advanced encryption layer or the common encryption layer to encrypt the inspection data to be encrypted. The specific steps are as follows: In the advanced encryption layer, a random number generation algorithm is used to generate a random number of a fixed length to obtain an initial random number for inspection data, the initial random number for inspection data is organized into a matrix to obtain an initial matrix for inspection data, the inspection key matrix and the inspection data initial matrix are used to calculate to obtain an initial composite key for inspection data, the inspection data to be encrypted is calculated using the initial composite key for inspection data to obtain initial encrypted inspection data; The initial encrypted inspection data is calculated using the lattice cipher algorithm to obtain the advanced encrypted inspection data and record the lattice cipher inspection key; the lattice cipher inspection key is calculated using the ECC algorithm to obtain the inspection data composite key, and the inspection data composite encryption public key used for encryption and the inspection data composite decryption private key used for decryption are recorded at the same time; In the common encryption layer, a random number generation algorithm is used to generate a random number of fixed length to obtain the initial key of the inspection data, and the inspection data to be encrypted is calculated using the initial key of the inspection data to obtain the common encrypted inspection data; The inspection data initial key is calculated using the RSA algorithm to obtain the inspection data common key, and the inspection data common encryption public key used for encryption and the inspection data common decryption private key used for decryption are recorded.
5. According to a method for secure transmission of inspection data in a blockchain scenario according to claim 4, it is characterized in that: The data block storage layer is used to store encrypted inspection data blocks. The specific steps are as follows: T1. Submit a transaction application to the blockchain network to obtain the storage target node and storage data block; T2. Obtain the hash value of the storage data block of the previous node of the storage target node, obtain the hash value of the previous node, add the encrypted inspection data, the inspection data target value, the inspection data digital signature and the hash value of the previous node to the storage data block, and obtain the encrypted inspection data block; T3. Broadcast to the blockchain network, obtain the transaction confirmation application, add the encrypted inspection data block to the blockchain network, and obtain the inspection blockchain.
6. The method for secure transmission of inspection data in a blockchain scenario according to claim 5 is characterized in that: step The specific steps of S4 include: S41. The inspection data recipient accesses the inspection data block through the inspection blockchain node, obtains the encrypted inspection data, inspection data target value and inspection data digital signature in the inspection data block, and receives the inspection data key protocol and key location information in the private network, and searches for the required key in the inspection data key protocol according to the key location information; Select the decryption method according to the inspection data target value on the inspection data block. If it is 1, jump to step S42; if it is 0, jump to step S43; S42. Decrypt the inspection data composite key using the ECC algorithm through the inspection data composite decryption private key to obtain the grid password inspection key; decrypt the advanced encrypted inspection data by the grid password inspection key to obtain the initial encrypted inspection data received; decrypt the initial inspection data by the inspection data initial composite key using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44; S43. The inspection data is decrypted by the inspection data ordinary key using the RSA algorithm to obtain the inspection data initial key; the inspection data initial key is used to decrypt the ordinary encrypted inspection data using a symmetric encryption algorithm to obtain the received inspection data, and jump to step S44; S44. The inspection data receiver calculates the hash value of the received inspection data, obtains the verification hash value, and uses the digital signature technology to decrypt the digital signature of the inspection data to obtain the hash value of the inspection data. If the verification hash value and the inspection data hash value are the same, the received inspection data is the inspection data to be encrypted, and the inspection data to be encrypted has not been tampered with, and the secure transmission is valid; otherwise, the inspection data to be encrypted has been tampered with, and the secure transmission is invalid; when the secure transmission is valid, the inspection data to be encrypted is decompressed to obtain real-time inspection data.
7. A secure transmission system for inspection data in a blockchain scenario, characterized in that: The system applies a method for secure transmission of inspection data in a blockchain scenario as described in any one of claims 1 to 6, including: A data capture module is used to capture inspection data and blockchain transaction data at a monitoring frequency f to obtain real-time inspection data and real-time blockchain transaction data; The data compression module is used to deploy the blockchain inspection data classification and compression model, classify and characterize the real-time inspection data, and then compress it using different compression algorithms to obtain the inspection compressed data. The inspection compressed data includes normal inspection compressed data and abnormal inspection compressed data; The data encryption storage module is used to deploy the blockchain inspection data encryption storage model, obtain the encrypted inspection data and the inspection data digital signature based on the inspection compression data and the blockchain inspection data encryption storage model, and output the inspection data key set. The encrypted inspection data includes advanced encrypted inspection data and ordinary encrypted inspection data. The inspection data security prediction model built into the blockchain inspection data encryption storage model and the real-time blockchain transaction data are used to determine whether it is in an intensive attack period. If it is in an intensive attack period, the hybrid encryption algorithm is used to obtain the advanced encrypted inspection data, and the inspection data target value is recorded as dangerous; otherwise, the ordinary encryption algorithm is used to obtain the ordinary encrypted inspection data, and the inspection data target value is recorded as safe; the inspection data key set package The invention includes an inspection data initial composite key, an inspection data composite key and an inspection data composite decryption private key for decrypting advanced encrypted inspection data, and also includes an inspection data common key and an inspection data common decryption private key for decrypting common encrypted inspection data; the inspection data key set is dispersedly added to the network protocol by using data steganography to obtain the inspection data key protocol, and the key location information is recorded; the inspection data sender uses the key exchange protocol to send the inspection data key protocol and the key location information to the inspection data receiver in the private network; the encrypted inspection data, the inspection data target value and the inspection data digital signature are added to the storage data block to obtain the inspection data block; the inspection data block is added to the blockchain network to obtain the inspection blockchain; The data receiving module is used for the inspection data receiver to access the inspection data block through the inspection blockchain node, obtain the encrypted inspection data, the inspection data target value and the inspection data digital signature in the inspection data block, use the key location information to find the required key in the inspection data key protocol and decrypt and decompress it, obtain the received inspection data, calculate the hash value of the received inspection data, obtain the verification hash value, and use the digital signature technology to decrypt the digital signature of the inspection data to obtain the inspection data hash value. If the verification hash value and the inspection data hash value are the same, the received inspection data is real-time inspection data, and the real-time inspection data has not been tampered with, and the secure transmission is valid; otherwise, the real-time inspection data has been tampered with and the secure transmission is invalid.
