LSTM risk prediction access control method based on blockchain
By deploying the LSTM risk prediction model on the entire blockchain node, the risk prediction and consensus mechanism verification of the information to be uploaded in the Internet of Vehicles system is carried out, and access control is achieved in combination with smart contracts, the problem of information security threats in the Internet of Vehicles system is solved and the problem of information security threats in the Internet of Vehicles system is improved. network security.
Patent Information
- Application Number
- CN202111307102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-11-05
AI Technical Summary
There are security threats such as information theft and tampering in the Internet of Vehicles system, resulting in low network security.
Adopt the blockchain-based LSTM risk prediction access control method, and deploy the LSTM risk prediction model on the entire blockchain node to conduct risk prediction of information to be uploaded, use the consensus mechanism to ensure the accuracy of the prediction results, and realize it through smart contracts. Access control.
It improves the security of data and information in the Internet of Vehicles network, effectively prevents information theft and tampering, and enhances the system's ability to resist attacks.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an LSTM risk prediction access control method based on blockchain. Background Art
[0002] The Internet of Vehicles technology is based on wireless communication technology. It uses sensors to receive vehicle information sent by vehicle-mounted terminal devices; classifies vehicle information and converts the classified vehicle information into vehicle information that meets communication standards; and uploads the converted vehicle information to the target platform. Information will face various security threats during the upload and download process, such as information theft and tampering.
[0003] In vehicle network communications, malicious attacks from illegal nodes may cause losses, seriously threatening people's lives and property. Summary of the invention
[0004] In view of this, the present invention provides an LSTM risk prediction access control method based on blockchain to improve the security of data information in the Internet of Vehicles network.
[0005] To this end, the present invention provides the following technical solutions:
[0006] The present invention provides a blockchain-based LSTM risk prediction access control method, which is applicable to a vehicle networking system. In the vehicle networking system, a blockchain network is deployed between a base station and a vehicle. The base station serves as a full node of the blockchain network, that is, the base station is used to store blockchain public keys, vehicle information data, consensus mechanisms, smart contracts, and LSTM risk prediction models. The vehicle is a lightweight node responsible for the construction, operation and maintenance of the blockchain, uploading information, and accessing and downloading resources. The method comprises:
[0007] Each full node of the blockchain obtains the risk prediction result of the information to be uploaded based on the LSTM risk prediction model deployed on the node; based on the risk prediction results of the information to be uploaded obtained by each full node, the final risk prediction result of the information to be uploaded is obtained through the consensus mechanism of the full node of the blockchain; the LSTM risk prediction model is a model built based on the LSTM neural network, and the LSTM risk prediction model takes the information to be uploaded as input and outputs the risk prediction result of whether the information to be uploaded is correct information or incorrect information;
[0008] If the final risk prediction result is correct information, the information to be uploaded is published, and the blockchain marks the information as correct information;
[0009] If the final risk prediction result is erroneous information, the information to be uploaded will not be released, and the blockchain will mark the information to be uploaded as erroneous information.
[0010] Furthermore, if the final risk prediction result is inconsistent with the result obtained by the lightweight node, the consensus mechanism of the lightweight node is used to obtain the correct risk prediction result, and the mark of the information to be uploaded is modified, the modification of the erroneous information is marked as correct information, and the modification of the correct information is marked as erroneous information, and the release of the information will be modified at the same time.
[0011] Furthermore, each full node of the blockchain obtains the risk prediction results of the information to be uploaded based on the LSTM risk prediction model deployed on the node, including:
[0012] When the prediction conditions of the LSTM risk prediction model are met, the LSTM risk prediction model is started to perform risk prediction to obtain the risk prediction results of the information to be uploaded; the prediction condition is that the amount of information collected by each node in the blockchain is greater than a preset value.
[0013] Furthermore, the access control logic of the method is written into a smart contract and stored on the blockchain for execution.
[0014] Furthermore, the method also includes: performing a reputation evaluation on each vehicle in the Internet of Vehicles, and controlling the information download access rights of the vehicle according to the reputation score level of each vehicle.
[0015] Furthermore, the credit rating of each vehicle in the Internet of Vehicles is evaluated, including:
[0016] The LSTM risk prediction model is used to conduct risk prediction and evaluation on the uploaded information of each vehicle to obtain the risk prediction result. If the risk prediction result is that the correct information is uploaded, points are added on the basis of the initial credit score. If the risk prediction result is that the wrong information is uploaded, points are subtracted on the basis of the initial credit score.
[0017] Furthermore, if the risk prediction result obtained by the LSTM risk prediction model is inconsistent with the result obtained by the lightweight node, the consensus mechanism of the lightweight node is used to obtain the correct risk prediction result, and the credit score is corrected.
[0018] Advantages and positive effects of the present invention:
[0019] The present invention proposes an LSTM risk prediction access control method based on blockchain, combines LSTM with blockchain, and uses the LSTM risk prediction model to predict the risks of information samples uploaded by Internet of Vehicles clients, so as to deal with possible threats in the Internet of Vehicles environment and improve the security of data information in the Internet of Vehicles network. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0021] Figure 1 This is a schematic diagram of a blockchain security communication framework for Internet of Vehicles in an embodiment of the present invention;
[0022] Figure 2 This is a flowchart of the LSTM risk prediction access control method based on blockchain in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] like Figure 1 As shown, the present invention designs a blockchain security communication framework for the Internet of Vehicles, deploys the blockchain network between the base station and the vehicle, the base station is used as the full node (RSU) of the blockchain network, and the vehicle is a lightweight node (OBU), that is, the base station is used to store the blockchain public key, vehicle information data, consensus mechanism, smart contract and LSTM risk prediction model, etc., responsible for the construction, operation and maintenance of the blockchain, and the vehicle is responsible for uploading information and accessing download resources. The vehicle uses various sensors to obtain its own information and external information through new communication technology and quickly uploads and stores it in the blockchain. This information is traceable, that is, it can be queried which vehicle uploaded it. At the same time, the vehicle can also apply to obtain information in the blockchain, and know the upcoming traffic conditions in advance, which is convenient for planning its own driving route. The framework uses the decentralized advantages of the blockchain distributed system, forms an access control mechanism through consensus algorithms and smart contracts, and uses the vehicle's historical behavior data. After the LSTM risk prediction model predicts the risks that the vehicle may cause, it decides whether to give the vehicle the right to upload information and access resources. At the same time, due to the existence of the consensus mechanism, unless the attacker controls more than half of the full nodes, it cannot affect the results obtained by the consensus mechanism, which increases the difficulty of attack and improves the security of the system.
[0025] like Figure 2As shown, it shows a flowchart of a blockchain-based LSTM risk prediction access control method in an embodiment of the present invention. The method is applicable to the Internet of Vehicles system. The method dynamically adjusts the permissions for uploading and downloading information of the Internet of Vehicles system based on the prediction results obtained by the risk prediction model to ensure the information security of the Internet of Vehicles system. The details are as follows:
[0026] The access control method of the present invention is divided into two parts: information upload access control mechanism and information download access control mechanism. Finally, the access control logic is written into a smart contract and stored on the blockchain for operation.
[0027] Information upload access control mechanism:
[0028] When a vehicle wants to upload information to the blockchain network, the LSTM risk prediction model predicts whether the information uploaded by the vehicle is correct or not. Each full node (RSU) of the blockchain will deploy the LSTM risk prediction model, and each RSU will get its own prediction result. Finally, the final prediction result is obtained through the consensus mechanism of the blockchain RSU. If the prediction result is "1" (correct information), the vehicle upload information will be released to other vehicles, that is, other vehicles can access this information, and the information will be marked as correct information; if the prediction result is "0" (wrong information), the vehicle upload information will not be released to other vehicles, that is, other vehicles will not access this information, and the blockchain will also mark the information as wrong information. If the prediction result is "0", the vehicle upload information will not be released to other vehicles, that is, other vehicles will not access this information, and the blockchain will also mark the information as wrong information. If the risk prediction model makes a wrong judgment and the consensus mechanism of the lightweight node (OBU) obtains the correct result, the mark of the original information will be modified, the information marked as wrong information will be modified to correct information, and the information marked as correct information will be modified to wrong information, and the release of the information will be modified at the same time.
[0029] S101. At the beginning, due to insufficient information data, prediction is impossible, so the risk prediction model is not started temporarily. The node vehicles of the blockchain directly publish information. After the information collected by each node in the blockchain meets the consensus mechanism of the blockchain RSU to obtain the final prediction conditions, the LSTM risk prediction model will be started for risk prediction.
[0030] S102. Each RSU in the blockchain will deploy an LSTM risk prediction model. The LSTM risk prediction model is a model built based on the LSTM neural network. It takes the information to be uploaded as input and outputs a risk prediction result of whether the information to be uploaded is correct information or incorrect information. Each RSU will obtain the prediction result of the information to be uploaded, and finally obtain the final prediction result through the consensus mechanism of the blockchain RSU. If the prediction result is "1", the uploaded information will be published to other node vehicles in the blockchain, that is, the information can be accessed, and the information is marked as correct information.
[0031] S103. If the prediction result is "0", the uploaded information will not be published, that is, the information will not be accessed, and the blockchain will also mark the information as wrong information.
[0032] S104. If the LSTM risk prediction model makes a wrong judgment (if the final risk prediction result is inconsistent with the result of the lightweight node, it is an error), and the OBU consensus mechanism (this node and other nodes jointly transmit this information, and several nodes jointly deduce the correctness) obtains the correct result, the mark of the original information will be modified, and the modification of the wrong information will be marked as correct information, and the modification of the correct information will be marked as wrong information. At the same time, the release of the information will be modified.
[0033] Information download access control mechanism:
[0034] S201. The consensus mechanism of blockchain OBU evaluates the reputation of the vehicle, that is, it starts with 5 points, and one point is added for uploading correct information, and one point is subtracted for uploading wrong information. The highest score is 9 points, and the lowest score is 0 points. Each score segment corresponds to a different level of information, and the resource level that can be accessed is ≤ the reputation score level. The corresponding table of reputation level resources is shown in Table 1.
[0035] Table 1
[0036]
[0037]
[0038] S202: Assuming that the risk prediction model makes a mistake at the beginning, it will add or subtract points. After the lightweight node corrects the prediction result, the credit score will also be reprocessed. Figure 2 It is a program flow chart.
[0039] The LSTM risk prediction model is described in detail below.
[0040] First, we need to establish an LSTM risk prediction model. The details are as follows:
[0041] (1) The LSTM neural network unit has multiple "Gate" structures, namely input, output and forget. When the neural network unit processes information, it controls the proportion of information flow passing through, so that the neural network can learn long-term memory in a controlled manner. The following is the expression of the three gate structures:
[0042] f t =sigm(W f ·[h t-1 , x t ]+b f )
[0043] i t =sigm(W i ·[h t-1 , x t ]+b i )
[0044] o t =sigm(W o ·[h t-1 , x t ]+b o
[0045] (2) The input of the LSTM neural network unit is x t and h t-1 Composition, x t Input for the current time, h t-1 This is the output of the previous moment. The following is a detailed introduction to the information processing process:
[0046] First, the activation function tanh is applied to the two parts of the input x t and h t-1 Fusion to obtain data stream
[0047]
[0048] Next, the input gate (Input Gate) Processing and control of its entry into cells t Ratio:
[0049]
[0050] After two gates, the cells c t The output data stream is:
[0051]
[0052] (3) The output gate performs the final processing on the data stream to ensure that the output information is valid. The final output of the LSTM neural network unit is:
[0053]
[0054] After establishing the LSTM risk prediction model, relevant prediction experiments are carried out to predict the risks of uploaded information samples and obtain comparison results between the prediction results and the real data.
[0055] The experimental environment of the prediction experiment is as follows:
[0056] (1) Operating system: Window 10 (64-bit)
[0057] (2) Hardware environment: Processor Intel(R) Core(TM) i7-7500U
[0058] CPU@2.70GHz; RAM 8G; Graphics card NVIDIA GeForce 940MX
[0059] (3) Development environment: Anaconda, an integrated Python development environment
[0060] (4) Development language: Python
[0061] (5) Development framework: Pytorch
[0062] The specific process of the prediction experiment is as follows:
[0063] S301. First, preprocess the data. The preprocessed data set contains 100 arrays with values of 1 or 0. Each array has 1010 values. The first 70 arrays are normal data, and the last 30 arrays are malicious data. The generated data is saved as an Excel file.
[0064] S302, use the program to read the data in Excel and construct it into an array, merge the first 70 groups of data into one group, merge the last 30 groups of data into another group, and then construct a value array and a label array according to the set time step.
[0065] The data set used is derived from a network intrusion simulation project conducted by MIT in 2018. 101,000 data were selected as the data used in this experiment. First, the data was preprocessed. The preprocessed data set has 100 groups of arrays with values of 1 or 0, each array has 1010 values. The first 70 groups are normal vehicle data, and the last 30 groups are malicious vehicle data. The generated data is saved as an Excel file.
[0066] Use the program to read the data in Excel and build an array. Merge the first 70 groups of data into one group and the last 30 groups of data into another group. Then build a numerical array and a label array according to the set time step, and convert the original data into ndarray type data. After testing, in order to achieve better training results, when training the normal vehicle prediction model, use the function to split the first 70680 data of each group as the training set training data, the last 10 as the test set, and the remaining 10 as the verification set; when training the malicious vehicle prediction model, use the function to split the first 30280 data of each group as the training set training data, the last 10 as the test set, and the remaining 10 as the verification set. Call the function in the Pytorch library to build the LSTM neural network, set the input and output of the network and the hidden layer dimension parameters, and then call the GPU to accelerate the calculation. Clear the loss function and optimizer, then convert the ndarray data into a tensor and send it to the network for training and calculate the loss function. Then call the optimizer according to the loss function to optimize the network, iterate 3000 times, and judge whether the model converges. After convergence, save the trained model as a pkl file for testing. After the test set data is transformed into a new format, it is input into the network model to obtain the predicted value and plotted together with the validation set in the graph for comparison to see the difference between the predicted result and the real data. Since normal vehicles and malicious vehicles have different characteristics, different prediction results are obtained by training two network models. The training method of the second model is the same as the first one.
[0067] S303, converting the original data into ndarray type data. After testing, in order to achieve better training effect, the first 70680 data of each group are split into training set data, the last 10 are test sets, and the remaining 10 are validation sets when training the normal prediction model.
[0068] S304. When training the malicious prediction model, use a function to split the first 30,280 data of each group as training set data, the last 10 as test sets, and the remaining 10 as verification sets.
[0069] S305. Call the function in the Pytorch library to build an LSTM neural network, set the network's input, output and hidden layer dimension parameters, and then call the GPU to accelerate the calculation.
[0070] S306, indicating the loss function and optimizer, then converting the ndarray data into a tensor and sending it into the network for training and calculating the loss function, and then calling the optimizer to optimize the network according to the loss function, iterating 3000 times, judging whether the model converges, and after convergence, saving the trained model into a pkl file for calling during testing.
[0071] S307, after the test set data is transformed in format, it is input into the LSTM neural network model to obtain the predicted value and plot it together with the validation set in the graph for comparison to check the difference between the predicted result and the actual data.
[0072] In the embodiment of the present invention, an LSTM neural network risk prediction model is constructed, and the risks of information samples uploaded by the data set are predicted. The prediction results are compared with the real data, which proves the feasibility of LSTM neural network in predicting information risks.
[0073] The embodiment of the present invention provides a new access control mechanism suitable for the Internet of Vehicles. It combines LSTM with blockchain, uses the results of the LSTM risk prediction model to evaluate information risks, and decides whether to allow the Internet of Vehicles client to publish information. At the same time, it performs reputation rating. Different reputation levels can access different levels of resources, and access restrictions are imposed on malicious nodes, ensuring that the Internet of Vehicles is in a highly secure state.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A LSTM risk prediction access control method based on blockchain, characterized in that: Applicable to the Internet of Vehicles system, in which the blockchain network is deployed between the base station and the vehicle. The base station serves as a full node of the blockchain network, that is, the base station is used to store the blockchain public key, vehicle information data, consensus mechanism, smart contract and LSTM risk prediction model. The vehicle is a lightweight node responsible for the construction, operation and maintenance of the blockchain, uploading information and accessing and downloading resources; The access control method is divided into two parts: information upload access control mechanism and information download access control mechanism. Finally, the access control logic is written into a smart contract and stored on the blockchain for operation. Information upload access control mechanism: When a vehicle wants to upload information to the blockchain network, the LSTM risk prediction model predicts whether the information uploaded by the vehicle is correct or not; each full node of the blockchain will deploy the LSTM risk prediction model, and each full node will get its own prediction result. Finally, the final prediction result is obtained through the consensus mechanism of the blockchain full nodes. If the prediction result is "1", the uploaded information of the vehicle will be published to other vehicles, that is, other vehicles can access this information, and the information will be marked as correct; if the prediction result is "0", the uploaded information of the vehicle will not be published to other vehicles, that is, other vehicles will not access this information, and the blockchain will also mark the information as wrong information; if the prediction result is "0", the uploaded information of the vehicle will not be published to other vehicles, that is, other vehicles will not access this information, and the blockchain will also mark the information as wrong information; If the risk prediction model makes a mistake and the lightweight node consensus mechanism comes up with a correct result, the mark of the original information will be modified, and the information marked as wrong will be modified to correct information, and the information marked as correct will be modified to wrong information. At the same time, the release of the information will be modified; Conduct reputation evaluation on each vehicle in the Internet of Vehicles, and control the information download access rights of each vehicle according to its reputation score level; Conduct reputation assessment on each vehicle in the Internet of Vehicles, including: The LSTM risk prediction model is used to conduct risk prediction and evaluation on the uploaded information of each vehicle to obtain the risk prediction result. If the risk prediction result is that the correct information is uploaded, points are added on the basis of the initial reputation score. If the risk prediction result is that the wrong information is uploaded, points are deducted on the basis of the initial reputation score. Information download access control mechanism: The consensus mechanism of blockchain lightweight nodes evaluates the reputation of vehicles, that is, starting with 5 points, uploading correct information adds one point, uploading wrong information subtracts one point, the highest score is 9 points, and the lowest score is 0 points. Each score segment corresponds to a different level of information, and the resource level that can be accessed is ≤ the reputation score level; If the risk prediction result obtained by the LSTM risk prediction model is inconsistent with the result obtained by the lightweight node, the consensus mechanism of the lightweight node is used to obtain the correct risk prediction result, and the credit score is corrected.
2. The LSTM risk prediction access control method based on blockchain according to claim 1 is characterized in that: Each full node of the blockchain obtains the risk prediction results of the information to be uploaded based on the LSTM risk prediction model deployed on this node, including: When the prediction conditions of the LSTM risk prediction model are met, the LSTM risk prediction model is started to perform risk prediction to obtain the risk prediction results of the information to be uploaded; the prediction condition is that the amount of information collected by each node in the blockchain is greater than a preset value.
3. The LSTM risk prediction access control method based on blockchain according to claim 1 is characterized in that: The access control logic of the method is written into a smart contract and stored on the blockchain for execution.
Citation Information
Patent Citations
Transaction information verification method and related device
CN110060064A
Internet of vehicles data secure storage and sharing method based on hybrid architecture
CN112929333A