Decision-making method for resisting default attack based on reinforcement learning in shared automobile scene

By building a distributed trust management and deep reinforcement learning decision-making mechanism in the car-sharing scenario, the user trust value is evaluated and the optimal strategy is generated, which solves the problem of evaluating and responding to malicious breaches, and improves service provider revenue and user experience.

CN118537086APending Publication Date: 2024-08-23宁波市镇海区科技服务中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311693587.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

There is a lack of effective methods to evaluate and respond to malicious breaches in car-sharing scenarios, which results in service resources being occupied and user experience reduced. The trust management decision-making mechanism of existing technologies is insufficient in flexibility and adaptability.

Method used

Adopt a decision-making method based on reinforcement learning to build a distributed trust management mechanism for shared cars and a defense decision-making mechanism based on deep reinforcement learning. Through Bayesian probability estimation and deep Q network algorithm, the user trust value is evaluated and the optimal strategy is generated to maximize Cumulative benefits mitigate the impact of malicious breaches.

Benefits of technology

Effectively assessing and responding to malicious breaches has significantly increased the average revenue of application service providers, improved the ability to identify malicious users, and reduced resource occupation and negative impacts on user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537086A
    Figure CN118537086A
Patent Text Reader

Abstract

The invention relates to a decision-making method for resisting default attacks based on reinforcement learning in a shared automobile scene. The decision-making method comprises the following steps: step 1, constructing a shared automobile distributed trust management mechanism; 2, constructing a deep reinforcement learning-based defense decision-making mechanism of the shared automobile; and step 3, obtaining the expectation of the optimal strategy of the shared automobile to maximize the cumulative income based on a deep Q network algorithm. The method has the advantages that a distributed trust management architecture and mechanism are provided for a shared automobile scene, a Bayesian statistics method is utilized to construct an evaluation model of a user trust value, and historical interaction records of a user are regarded as prior information to be used for estimating the credibility of keeping honest behaviors in the future; the base stations of the edge layer are jointly responsible for maintaining and storing trust information and executing a trust updating process; on the basis of trust evaluation, a defense decision-making mechanism based on deep reinforcement learning is provided to realize an optimal decision in a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a decision-making method for shared cars to resist breach of contract attacks, and in particular to a decision-making method for resisting breach of contract attacks based on reinforcement learning in a shared car scenario. Background Art

[0002] With the rapid development of IoT technology, a variety of emerging IoT applications have brought huge market potential, among which the sharing economy based on IoT has become one of the fastest growing business forms. As a novel and environmentally friendly service interaction model, the sharing economy specifically refers to the application provider sharing the right to use idle resources with users for a fee without transferring ownership. Common sharing applications (including: shared cars, shared bicycles, shared power banks, etc.) have brought many conveniences to people's lives.

[0003] However, due to the lack of necessary supervision during the service process, shared application scenarios also have specific security issues, such as malicious breach of contract of service orders. Taking the shared car scenario as an example, there may be malicious users created by competitors or attackers in the application. Specifically, the attacker uses the stolen legitimate identity to initiate a false car rental request, but does not honestly fulfill the car rental agreement. On the contrary, the order is canceled within the reserved time period or the vehicle is not used on time, resulting in the service order being forced to be canceled due to timeout. This breach of contract attack deliberately occupies limited service resources and disrupts the normal operation of the application, reducing the user experience for other users and affecting the interests of the application provider to a certain extent. Therefore, it is urgent to evaluate the malicious breach of contract in the shared car scenario and implement necessary action strategies.

[0004] Trust management is considered to be one of the effective solutions for evaluating participating entities and preventing internal attacks, and it also plays an important role in IoT applications. Trust can be defined as the degree of trust between entities for a specific task or behavior. The trust value can be used to convert specific historical behaviors into objective quantitative evaluation indicators and provide a theoretical basis for subsequent defense strategies. At present, trust-based decision-making mechanisms can be divided into two types: empirical models and non-empirical models.

[0005] This type of decision-making method uses empirical models to summarize specific situations in the IoT system and formulate specific strategies based on them. While the empirical model represents the facts of the scene as much as possible, it has a strong subjective standard. For example, if the trust value of a user or device exceeds the normal range, it is considered that there may be an abnormal situation. For example, in document 1 (Li W., Song H., Zeng F., Policy-based secure and trustworthy sensing for Internet of Things insmart cities[J]. IEEE Internet of Things, 2018, 5(2): 716-723), the authors proposed a trust perception scheme based on specific policies to detect malicious devices in the IoT system. For the perception data of IoT devices (such as speed, temperature, and location), the decision-making method will determine whether it is abnormal based on a predetermined empirical threshold. In order to ensure accuracy, the scheme also uses multiple policy settings to evaluate the trust status of devices in different environments. Similarly, Reference 2 (Asuquo P, Cruickshank H, Ogah CPA, et al. A distributed trust management scheme for data forwarding in satellite DTN emergency communications [J]. IEEE Journal on Selected Areas in Communications, 2018, 36 (2): 246-256) proposed a trust management scheme to assist in data forwarding selection in multi-hop scenarios. The overall trust value of the forwarding node consists of direct trust and recommended trust. The decision-making mechanism is to filter malicious nodes by setting an empirical trust threshold, that is, only nodes with an overall trust value higher than the threshold can become the forwarding target of the next hop.

[0006] From the above existing studies, it can be seen that the decision-making mechanism based on the empirical model lacks flexibility and adaptability. First, the empirical model can usually only make binary decisions and cannot distinguish trust relationships more finely. This is because more decision options will greatly increase the complexity of the empirical model and may cause a higher probability of misjudgment. Secondly, the empirical model is limited by fixed judgment parameters, which makes it difficult for the decision-making mechanism to expand its scope of application to adapt to more scenarios. Although the predetermined rules or thresholds perform well in specific environments, the accuracy of the established strategy cannot be guaranteed if the environment changes.

[0007] Decision-making methods based on non-empirical models: In non-empirical models, specific execution strategies are usually inferred by relevant algorithms, among which game theory and reinforcement learning methods are widely used. Game theory helps entities make the best decisions by constructing different types of games and analyzing all possible results based on evaluation indicators (such as trust values). For example, in order to reduce invalid transmissions caused by malicious nodes, reference 3 (Rani R, Kumar S, Dohare U. Trust evaluation for light weight security in sensor enabled Internet of Things: Game theory oriented approach [J]. IEEE Internet of Things Journal, 2019, 6 (5): 8421-8432) proposes a lightweight trust evaluation method based on game theory. This method includes trust evaluation within and between clusters. Using the calculated trust value, the authors constructed three dilemma game models to calculate Nash equilibrium, which are used for cluster generation, cluster size optimization, and malicious node detection. In addition, reference 4 (Xu O, Su Z, Zheng Q, et al. Game theoretical secure caching scheme in multihoming edge computing-enabled heterogeneous networks [J]. IEEE Internet of Things Journal, 2019, 6 (3): 4536-4546) proposes a secure caching mechanism for small cellular base stations. Based on the trust evaluation of base stations, the authors construct the interaction between mobile users and base stations through Stackelberg game to select trusted base stations to provide cache resources for mobile users. The decision model includes the optimal decision of each mobile user on the size of the leased cache space. Then, based on the decisions of all mobile users, the optimal price strategy of each cellular base station is analyzed.

[0008] In order to reinforce learning through the continuous interaction between entities and the environment, so that entities can gradually learn and optimize decisions to achieve the optimal goal, the authors of Reference 5 (Zhang D, Yu FR, Yang R, et al. Software-defined vehicular networks with trust management: A deep reinforcement learning approach [J]. IEEE Transactions on Intelligent Transportation Systems, 2022, 23 (2): 1400-1414) proposed a trust model and decision-making scheme for vehicular ad-hoc networks to avoid the impact of malicious vehicles on data transmission. The trust model estimates the trust value of neighboring vehicles by controlling and applying the forwarding rate of data packets. The transmission path optimization problem takes into account the vehicle trust value and the back propagation rate, and is modeled as a Markov decision process with a state space, an action space, and a reward function. The intelligent agent built based on software-defined network technology is responsible for interacting with the environment model, and then the deep Q-learning method is used to solve the optimal communication link strategy. Reference 6 (Deng S, Xiang Z, Zhao P, et al. Dynamical resource allocation in edge for trustable Internet-of-Things systems: A reinforcement learning method [J]. IEEE Transactions on Industrial Informatics, 2020, 16 (9): 6103-6113) also models the research problem as a Markov decision process and uses reinforcement learning methods to train the resource allocation strategy of edge nodes. This study quantifies the credibility of the resource allocation strategy by service turnaround time and uses it as part of the reward function. The trained strategy can always dynamically generate an appropriate resource allocation plan based on the system state, thereby maximizing the credibility benefit of the service.

[0009] It can be seen that the non-empirical model uses game theory to mathematically model multiple entities, mainly to prevent uncooperative behavior and maintain a trusted environment; the use of reinforcement learning methods can help entities choose appropriate strategies to obtain the best long-term returns. However, in the IoT scenario, there is no explicit benefit relationship between participating entities. The establishment of a game theory model requires artificial pricing for transmission, caching, services, etc., which is often difficult to meet actual application needs. In addition, the decision-making mechanism based on reinforcement learning methods is usually oriented to a semi-idealized interactive environment, considering only limited factors of change, so the specific solution strategy also has certain limitations. At present, the reinforcement learning decision-making mechanism based on trust management is still in its infancy, especially for solutions for shared application scenarios, which need further research.

[0010] In the existing public invention patent application documents, for example, the Chinese invention patent application number CN202210741334.9 discloses a distributed Internet of Vehicles dynamic trust management method based on origin information. The nodes in the Internet of Vehicles are mainly based on entity trust evaluation, supplemented by data trust, and trust evaluation is performed on participating nodes and messages through multiple indicators. In the entity trust evaluation stage, the message receiver uses the Bayesian method to perform direct trust calculation on the sender, and aggregates it into a combined trust value based on the suggestions of neighboring nodes. On the basis of determining that the sender is trustworthy, the message receiving node calculates the data-centric trust value of the message based on the origin information. The trust value of the received message is evaluated in two dimensions: the credibility of the message origin node and the credibility of the message forwarding path. Finally, the method distinguishes benign nodes from malicious nodes based on the dynamic update mechanism of the global threshold.

[0011] For another example, the Chinese invention patent application number is 202011022232.9, a management system based on staggered parking space sharing, including a background database, characterized in that it also includes: a parking space management module, used to obtain the status information of shared car parking spaces and manage and maintain the status information of shared car parking spaces; a mobile terminal, used to support car owners to initiate shared parking space reservation orders, respond to car owners' reservation orders and record car owners' reservation orders in the background database; an order allocation module, used to allocate parking spaces to car owners with staggered conditions according to shared parking space reservation orders initiated by car owners and send the allocated parking spaces to the corresponding car owners' mobile terminals; a near-field positioning recognition module, used to identify the location of the shared parking spaces in the car Provide guidance services to car owners when they arrive near the shared parking lot; access control module, used to provide access identification and release services to car owners when the car arrives at the shared parking lot; control scheduling module, used to manage the timing and scheduling between various interactive modules; the parking space management module, mobile terminal, order allocation module, near-field positioning and identification module, access control module are all connected to the control scheduling module; the order allocation module includes a location acquisition unit for acquiring the car owner's location data, a past order recording unit for acquiring the car owner's past order data, and a priority allocation unit that automatically assigns priorities to the car owner's orders based on the car owner's location data and the car owner's past order data. Automatically assigning priorities to car owners' orders and optimizing the structure of parking demand orders can more reasonably arrange car owners' parking space sharing needs.

[0012] The technical solution of the above-mentioned invention patent application also failed to propose a technical solution for evaluating malicious breach of contract and implementing necessary action strategies in the shared car scenario. Summary of the invention

[0013] The present invention mainly proposes a decision-making method for resisting breach attacks based on reinforcement learning for shared car scenarios.

[0014] The decision-making method for resisting breach of contract attacks based on reinforcement learning in a shared car scenario of the present invention comprises the following steps:

[0015] Step 1. Build a distributed trust management mechanism for shared cars;

[0016] Step 2. Build a defense decision mechanism based on deep reinforcement learning for shared cars;

[0017] Step 3. Obtain the optimal strategy π for car-sharing based on the deep Q-network algorithm * (s) Maximize the expected cumulative return.

[0018] Furthermore, in step 1, a shared car distributed trust management mechanism system is constructed, including:

[0019] Step 1.1 Based on the actual scenario of shared cars, the cloud layer, edge layer, terminal layer and user layer are constructed:

[0020] Step 1.1.1 Build the cloud layer. The cloud layer mainly includes the registration and management of users and vehicles. Before using the shared car application, the user generates a personal account address, as well as the corresponding public key and private key through the cloud layer's authentication center. The account address is the user's identification, which is composed of a fixed-length hash code and can protect privacy. The account's private key is the only identity credential, and the account's public key is used by the cloud server and edge devices to encrypt communications with users and verify digital signatures. The cloud layer can also provide the necessary service interface for edge devices to query user historical information. When a vehicle joins a shared application, it registers in this layer to generate information such as vehicle identification and device key pairs to obtain a legal identity during application operation.

[0021] Step 1.1.2: Build the edge layer. The edge layer is mainly composed of base stations or roadside units, which are jointly responsible for trust management and the execution of decision-making mechanisms. The trust information of all users will be stored as state variables in the lightweight database of the base station. The base station will regularly query the database to count the historical behaviors of users within a certain period of time, and then calculate and update the user trust value. Based on the trust information and environmental status, the base station will select and allocate service requests through a defense decision-making mechanism to prevent malicious attacks from ineffectively occupying system resources.

[0022] Step 1.1.3: Build the device layer. The device layer consists of shared vehicles. The shared vehicles are equipped with on-board sensing modules, communication modules, and computing units. They can establish communication connections with edge layer infrastructure through the 6G network. The shared vehicles can send requests to the base station to call various services, such as querying the identity of the current authorized user and reporting the current service status.

[0023] Step 1.1.4: Architect the user layer. In the shared car scenario, the user is the initiator of the service request and the user of the vehicle. The user can communicate with the edge layer base station through the mobile terminal. Using the application's service interface, the user can query the vehicle's status information, such as the available quantity, vehicle type, and usage price, and initiate a vehicle request as needed. If the service request is accepted, the base station will grant the user's account the right to use the vehicle. Finally, the user completes the access and control of the shared vehicle through the application on the terminal.

[0024] Step 1.2 establishes a shared car breach attack model. In some cases, attackers intentionally occupy service resources and disrupt the normal operation of the application for some purpose, thereby affecting the interests of other users and application providers. This invention defines this behavior as a breach attack. Considering the actual service scenario of shared cars, a user's car order may include two time stages, including the time to reserve a vehicle and the time to use the vehicle. Therefore, this invention defines the corresponding time length in the order as t p and t s The attacker sends a fake car request as a legitimate user and p The default probability p of the user is calculated based on the user's trust value. u .

[0025] Step 1.3 The base station calculates the user trust value based on the statistical data of the user's historical interaction behavior. After the base station obtains the statistical data of the user's historical interaction behavior, it infers the possibility of the user continuing to be honest in the future based on the Bayesian probability estimation method. This method is based on the sample set and uses the Bayesian formula to correct the prior distribution of the parameter to obtain the posterior distribution of the parameter. The specific derivation is as follows. Assume that the probability of user u's real car request is φ u , and φ u ∈(0, 1), then among the n service requests of the household's historical behavior, the number of normal car use m follows a binomial distribution. This event is defined as y, and its likelihood function is expressed as follows (1):

[0026]

[0027] For the binomial distribution, the beta distribution is its conjugate prior. In order to facilitate the calculation of the posterior distribution, it is assumed that the user maintains an honest probability φ u The prior distribution of follows the Beta distribution, that is, Beta(a, b), then φ u The density function is as follows (2):

[0028]

[0029] Where Γ(·) is the gamma function, and the initial value is assumed for the newly added user The uniform distribution is expressed as: Then φ is derived u The posterior density function of also obeys the Beta distribution Beta(a+m, b+nm), which is the following formula (3):

[0030]

[0031] Its mean is expressed as the following formula (4):

[0032]

[0033] In the above formula, the user's trust evaluation result is used as the basis for his / her future honesty, so based on φ u The posterior mean of the user trust value w u , in actual scenarios, the user's trust value may be different from recent behavior due to identity theft. If the historical records and recent behaviors are given the same weight, the change of trust value cannot be detected quickly, resulting in poor time sensitivity. In addition, as the number of historical records increases, the proportion of recent interactive behaviors decreases, and thus cannot affect the update of trust value. Therefore, an adaptive forgetting factor λ is added to achieve a moderate reduction in the weight of historical records, which is expressed as the following formula (5):

[0034]

[0035] in, is the trust value before this update; τ is the calculation coefficient. From the above formula, we can see that the adaptive forgetting factor is defined as the sum of the previous trust value The monotonically decreasing function is Before the trust value When it is higher, the forgetting factor decreases, which means that the weight assigned to historical records is smaller, and when the trust value is When the trust value is low, historical records will have a higher weight. If you want to maintain a high trust value, the user must continue to show good behavior. Malicious breach of contract will cause the trust value to drop rapidly, that is, good behavior will be quickly forgotten. At the same time, it takes longer for users with low trust values ​​to increase, that is, malicious behavior will affect for a longer time, and the user's trust value w u The calculation formula is expressed as follows (6):

[0036]

[0037] Among them, a and b represent the parameters of the initial trust value beta distribution, x and y represent the number of normal car use and car request initiation in the user u's historical records, respectively, and m and n represent the number of normal car use and request initiation during the query time period. The trust value calculation method is implemented and executed by the base station, and the trust-related information is stored locally.

[0038] Furthermore, in step 2, a defense decision mechanism based on deep reinforcement learning is constructed for shared cars. The defense decision mechanism of shared cars is modeled using the Markov Decision Process, which mainly includes four parts: environment state, action space, state transfer, and benefit function:

[0039] Step 2.1, environment status: The environment status includes service status, idle status, and reserved status:

[0040] Assume definition status The environmental information in the shared car application is described by the five-tuple represented by the following formula (7):

[0041]

[0042] Among them, C represents the current operation status of all shared cars; W summarizes the trust value of each car service user; e u is the service request information arriving at the current moment; w u represents the trust value of the user who issued the service request; T represents the remaining available time of the system, and each column of the matrix C represents the operating status of a car i c ∈{1, 2, ..., n c}, where n c represents the total number of shared cars. The vehicle is initially idle. When a service order is assigned, it will enter the reserved state and change to the service state after the reserved time ends. The three state types of the vehicle are defined as {m f ,m p ,m s}, In addition, the running status The remaining time of the reservation and service phase is also included, denoted as t p and t s , which will continue to decrease as the service process progresses. Assuming that the time parameters involved in the model are discretized and are all integer multiples of the unit time, the operating state of the vehicle can be expressed as: idle state ( The current vehicle is in an idle and available state, waiting to be assigned a new vehicle order, which is represented by: reserved state The current vehicle has been assigned an order and is waiting for the user to arrive at the vehicle location. At this time, the vehicle is unavailable and can no longer be assigned an order;

[0043] Service Status The current vehicle is being used by the user and is in an unavailable state. After the service time is over, the vehicle will return to an idle state;

[0044] Idle state The current vehicle is idle and available, waiting to be assigned a new vehicle order;

[0045] Reservation Status The reserved state means that the shared vehicle has been assigned an order and is waiting for the user to arrive at the vehicle location. At this time, the vehicle is unavailable and can no longer be assigned an order.

[0046] Step 2.2, decision-making and scheduling actions for service requests:

[0047] In this step, the action The gateway is defined to be responsible for two decision-making functions, namely whether to accept the service request arriving at the current moment, and how to allocate the order to different types of vehicles. The action space can be separated into two action subspaces, which respectively include the decision on the order and the scheduling of the order. In addition, if no user initiates a car request at the current moment, no decision is required. It is expressed by the following formula (8):

[0048]

[0049] Among them, w0 and e0 represent the initial values ​​of service request and user trust respectively, which are used to confirm whether there are new requests arriving. Represents the action space of decision-making behavior, which will choose to accept or reject the service request that arrives. The decision-making behavior is defined as two values ​​{a accept , a refuse}, The action space of the dispatching behavior is represented by selecting from idle vehicles and assigning orders to specific vehicles. If there is no service request at the current moment, no action needs to be performed. Indicates that at time t, the new service request Arrives, at this time the decision action is to choose to accept and assign it to an idle vehicle That is a={a accept ,i c}, and at the same time, the user's trust value is added to the trust set W with the same index. At the next time t+1, the vehicle Entering the reserved state, no more orders can be assigned. The gateway chooses to reject the service request arriving at this time and thus does not perform scheduling behavior. At the subsequent time t+2, no new service request arrives, and the execution action is

[0050] Step 2.3 State transfer:

[0051] In the initial state of the system, all vehicles are in an idle state c0 = {m f , 0, 0}, then And since there is no vehicle currently serving the user, the corresponding user trust value set is also the initial value, that is, There is no service request at the initial moment, represented by e u =e0={0,0} and w u =w0=0, at the subsequent system time, the arrival of service requests is subject to the parameter p nThe Bernoulli distribution of , users are randomly selected and have a certain trust value, which can be expressed as the following formula (9):

[0052]

[0053] Among them, u * Represents the user ID that sends the service request; P is the arrival probability of a new service request. The state transition of the system is divided into the following two cases:

[0054] When no service request arrives at the current time, that is, w u =w0∧e u =e0, the gateway does not need to perform decision-making and scheduling actions, and the action space is The service status of all vehicles will change as the system progresses. The idle state remains unchanged, and the service state continues the current process. Vehicles in the reserved state may have two situations: user breach of contract or normal execution of orders. Breach of contract will cause the vehicle to be unable to continue service and return to the initial state. The trust value represents the probability that the user remains honest during the use of the shared car application. Assuming that the two events of breach of contract and non-breach of contract are mutually exclusive, when the user trust value is w u In the case of the reservation state, the probability of default at each system moment is defined as p u , then the calculation formula of default probability is as follows (10):

[0055]

[0056] in, It represents the total length of the reserved time in the service request. From formula (10), we can see that the higher the trust value, the lower the probability of the user's breach of contract. Given the different trust values ​​of users, the vehicles serving the users also correspond to different state transition probabilities. The state transition of any vehicle in the system can be expressed as the following formula (11):

[0057]

[0058] Among them, i c and i u The indexes representing the vehicles and their service users respectively; The default probability calculated for the corresponding user trust value is represented by the matrix W used to record the trust value of the current service user of each car. It will change due to default behavior or service completion, which is expressed as the following formula (12):

[0059]

[0060] If a new service request arrives at the current moment, that is, w u ≠w0∧eu ≠e0, the action space includes two parts: decision-making and scheduling. The state transition is related to the execution action. If the decision action is to reject, that is This action will not affect the vehicle's operating state and trust set at the next moment, so the state transition expression is consistent with the above formula. The state transition that occurs at time t+1 belongs to this situation. If you choose to accept the service request, that is, Then it is necessary to further perform scheduling actions to realize the allocation of current service requests. The scheduling action is expressed as That is, the incoming service request will be handled by the vehicle Responsible, it should be noted that only vehicles in idle state (i.e. ) will be assigned a service request. If all vehicles are unavailable, they can only choose to reject the newly arrived order. When they choose to accept the service request and execute the dispatch, that is, a={a accpet ,i c}, the state transition of the vehicle operation is as follows (13):

[0061]

[0062] At the same time, the trust value of the user who initiated the service request is added to the trust matrix W, and ... u Corresponding to the assigned vehicle, the following formula (14) is obtained:

[0063]

[0064] The number of available moments T in the environment state decreases as time progresses, as expressed in the following formula (15):

[0065] T′=T-1......(15).

[0066] Furthermore, in step 3, the optimal strategy π for car-sharing is obtained based on the deep Q network algorithm. * (s) Maximize the expected cumulative return:

[0067] Step 3.1 Establish the expected profit function:

[0068] The shared car service process includes three states, namely, idle state, reserved state and service state. In the actual scenario of shared cars, shared car services include idle state, reserved state and service state. Among them, idle state and reserved state will cause negative benefits such as parking fees and manual maintenance. Only in the service state will users pay fees and bring positive benefits. Therefore, after the selection and allocation decisions are made, positive feedback cannot be obtained immediately. The benefit function has the characteristics of delayed return. The benefits generated by ordinary vehicles in idle state, reserved state and service state per unit time are defined as vf , v p , v s , then the vehicle's revenue It can be expressed as the following formula (16):

[0069]

[0070] Among them, v a and v c Represents the additional rewards for accepting service requests and completing service requests respectively; v r It represents the profit penalty caused by the breach of contract; represents the profit calculation coefficient of different types of vehicles. In addition, the negative sign in the profit calculation is used for mathematical conversion to satisfy the fact that the greater the profit, the better the evaluation execution action. The sum of the profits of all vehicles is defined as the profit function of the system at that moment, which is the following formula (17):

[0071]

[0072] According to the definition of the profit function and the state transition, the cumulative profit G from the decision time t (t) It can be expressed as the following formula (18):

[0073]

[0074] Among them, γ is the discount coefficient, maximizing the expected cumulative return The goal is to minimize the impact of malicious default to ensure the maximization of the total revenue of vehicles in the system. Next, we need to solve the optimal strategy π * (s), so that the expected cumulative benefit in a limited time reaches the maximum value, where strategy π(s) represents the action taken under system state s; M represents the maximum number of available time of the system, and the expected cumulative benefit from the initial state can be expressed as follows (19):

[0075]

[0076] Step 3.2, solve the expected profit function:

[0077] The purpose of solving the profit function is to find an optimal strategy π * (s) Maximize the expected cumulative return. For any Markov decision process problem, there must be at least one optimal strategy π *(s) is better than other strategies or has the same performance, and can be solved by related reinforcement learning algorithms. Through the analysis of the constructed model, it can be seen that the state space of the system is high-dimensional and complex, and the action space is discrete and limited in number. The Deep Q Network (DQN) algorithm in reinforcement learning is used to solve the profit function, that is, a neural network is used as a function approximator to estimate the action value function, and a neural network is used to construct a nonlinear approximate function. The storage space required for storing parameters will be much smaller than the size of the action space and behavior space. The Q network usually includes an evaluation network Q(s, a; θ) and a target network Q(s, a; θ - ) The evaluation network Q(s, a; θ) takes as input the state of the system and outputs an estimate of the action value function for each actionable action; the target network Q(s, a; θ - ) is used to predict the target action value function. In order to ensure the stability of learning, although the evaluation network and the target network have the same network structure, a strategy of delayed target update is adopted. The specific steps of the deep Q network algorithm are as follows:

[0078] Step 3.2.1, initialize the weights, system states and related parameters of the evaluation network and target network:

[0079] In each training iteration, the execution action under the current system state is selected by the ∈-greedy strategy. The parameters ∈ t The initial value is ∈ init , and it decays as the training progresses. The decay rate is determined by the coefficient η. When the ratio of the current training step number t to the total step number N is equal to the decay coefficient, that is, t / N=η,∈ t Decay to minimum value∈ min , which is expressed by the following formula (20):

[0080]

[0081] Training with ∈ t The probability of randomly selecting an action is 1-∈ t The probability of selecting the action with the largest action value function is , This strategy is to solve the exploration-exploitation dilemma problem, so as to explore all possible behaviors and avoid falling into the local optimal solution. The following system states will be transferred according to the execution action and obtain immediate benefits:

[0082] The experience samples consisting of the current state, executed action, benefit, and next moment state are added to the experience replay pool, and then a batch of experience samples are randomly sampled from the experience replay pool and the loss function L(θ) is calculated;

[0083] Execute the optimizer and update the evaluation network weights θ. In addition, if the update interval of the target network is met, the weights of the current evaluation network need to be copied to the target network θ - ←θ;

[0084] When the algorithm converges, it is considered to have approximately obtained the optimal action value function And get the optimal strategy

[0085] The decision-making method for resisting breach of contract attacks based on reinforcement learning in the shared car scenario of the present invention has the following superior technical effects:

[0086] 1. Aiming at the shared car scenario, this paper proposes a distributed trust management architecture and mechanism, which uses Bayesian statistical methods to build a user trust value evaluation model. The user's historical interaction records are regarded as prior information to estimate the credibility of their future honest behavior. The base stations at the edge layer are jointly responsible for the maintenance and storage of trust information and execute the trust update process.

[0087] 2. Based on trust evaluation, this paper proposes a defense decision-making mechanism based on deep reinforcement learning to achieve optimal decision-making in complex environments. First, the service process and user behavior of the application are modeled as a Markov decision process. Then, a deep Q-network algorithm is proposed to solve the model. Through interactive learning of multi-dimensional information such as user trust value, vehicle service status, and service request, the optimal decision and allocation strategy are trained and generated.

[0088] 3. The decision-making mechanism proposed by the method described in the present invention is analyzed and compared with the benchmark strategy algorithm. The results show that the defense strategy proposed by the method described in the present invention can more effectively reduce the negative impact caused by malicious breach of contract in different scenarios and significantly improve the average revenue of application service providers. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] Figure 1 A schematic diagram of a distributed trust management architecture of the method of the present invention;

[0090] Figure 2 A schematic diagram of a malicious breach of contract attack in a shared car scenario according to the method of the present invention;

[0091] Figure 3 A schematic diagram of the architecture of a defense decision-making mechanism based on deep reinforcement learning according to the method of the present invention;

[0092] Figure 4 A schematic diagram of an example of a decision action and a scheduling action for a service request of the method of the present invention;

[0093] Figure 5A schematic diagram showing the comparison of the impact of the service arrival probability of the method of the present invention on the performance of various strategies;

[0094] Figure 6a , 6b A schematic diagram showing the performance comparison between the reinforcement learning strategy and the benchmark strategy in a malicious user scenario of the method of the present invention;

[0095] Figure 7 Schematic diagram of service request arrival probability. DETAILED DESCRIPTION

[0096] Now combined with the instruction manual Figure 1 -6 introduces in detail a specific embodiment of the method of the present invention, the method comprising the following steps:

[0097] Step 1. Figure 1-2 As shown in the figure, a distributed trust management mechanism for shared cars is constructed:

[0098] Step 1.1 Based on the actual scenario of shared cars, the cloud layer, edge layer, terminal layer and user layer are constructed:

[0099] Step 1.1.1 Build the cloud layer. The cloud layer mainly includes the registration and management of users and vehicles. Before using the shared car application, the user generates a personal account address, as well as the corresponding public key and private key through the cloud layer's authentication center. The account address is the user's identification, which is composed of a fixed-length hash code and can protect privacy. The account's private key is the only identity credential, and the account's public key is used by the cloud server and edge devices to encrypt communications with users and verify digital signatures. The cloud layer can also provide corresponding service interfaces for edge devices to query user history information. When a vehicle joins a shared application, it generates information such as vehicle identification and device key pairs by registering at this layer to obtain a legal identity in the actual application operation.

[0100] Step 1.1.2: Build the edge layer. The edge layer is mainly composed of base stations or roadside units, which are jointly responsible for trust management and the execution of decision-making mechanisms. The trust information of all users will be stored as state variables in the lightweight database of the base station. The base station will regularly query the database to count the historical behaviors of users within a certain period of time, and then calculate and update the user trust value. Based on the trust information and environmental status, the base station will select and allocate service requests through a defense decision-making mechanism to prevent malicious attacks from ineffectively occupying system resources.

[0101] Step 1.1.3: Build the device layer. The device layer consists of shared vehicles. The shared vehicles are equipped with on-board sensing modules, communication modules, and computing units. They can establish communication connections with edge layer infrastructure through the 6G network. The shared vehicles can send requests to the base station to call various services, such as querying the identity of the current authorized user and reporting the current service status.

[0102] Step 1.1.4: Architect the user layer. In the shared car scenario, the user is the initiator of the service request and the user of the vehicle. The user can communicate with the edge layer base station through the mobile terminal. Using the application's service interface, the user can query the vehicle's status information, such as the available quantity, vehicle type, and usage price, and initiate a vehicle request as needed. If the service request is accepted, the base station will grant the user's account the right to use the vehicle. Finally, the user completes the access and control of the shared vehicle through the application on the terminal.

[0103] Step 1.2 establishes a shared car default attack model. The specific attack process is shown in 2. Considering the actual service scenario of shared cars, the user's car order may include two time stages, including the time to reserve the car and the time to use the car. Therefore, the present invention defines the corresponding time length in the order as t p and t s , the attacker sends a fake car request as a legitimate user and p If the user cancels the order within 10 days or fails to use the vehicle on time, a default occurs. A default attack causes the malicious occupation of limited vehicle resources, affecting the revenue of the application provider. The user's default probability is defined as p u , which is calculated based on the user's trust value, will be introduced in detail in step 2.3 state transfer.

[0104] Step 1.3 The base station calculates the user trust value based on the statistical data of the user's historical interaction behavior. After obtaining the statistical data of the user's historical interaction behavior, the base station infers the possibility of the user continuing to be honest in the future based on the Bayesian probability estimation method. This method is based on the sample set and uses the Bayesian formula to correct the prior distribution of the parameters to obtain the posterior distribution of the parameters. The specific derivation is as follows: Assume that the probability of user u's real car request is φ u , and φ u ∈(0, 1), then among the n service requests of the user's historical behavior, the number of normal car use m follows a binomial distribution. This event is defined as y, and its likelihood function is expressed as follows (1):

[0105]

[0106] For the binomial distribution, the beta distribution is its conjugate prior. In order to facilitate the calculation of the posterior distribution, it is assumed that the user maintains an honest probability φ uThe prior distribution of follows the Beta distribution, that is, Beta(a, b), then φ u The density function is as follows (2):

[0107]

[0108] Where Γ(·) is the gamma function, and the initial value is assumed for the newly added user The uniform distribution is expressed as: Then φ is derived u The posterior density function of also obeys the Beta distribution Beta(a+m, b+nm), which is the following formula (3):

[0109]

[0110] Its mean is expressed as the following formula (4):

[0111]

[0112] In the above formula, the user's trust evaluation result is used as the basis for his / her future honesty, so based on φ u The posterior mean of the user trust value is w u , in actual scenarios, the user's trust value may be different from recent behavior due to identity theft. If the historical records and recent behaviors are given the same weight, the change of trust value cannot be detected quickly, resulting in poor time sensitivity. In addition, as the number of historical records increases, the proportion of recent interactive behaviors decreases, which cannot affect the update of trust value. Therefore, an adaptive forgetting factor λ is added to achieve a moderate reduction in the weight of historical records, using the following formula (5):

[0113]

[0114] in, is the trust value before this update; τ is the calculation coefficient. From the above formula, we can see that the adaptive forgetting factor is defined as the sum of the previous trust value The monotonically decreasing function is Before the trust value When it is higher, the forgetting factor decreases, indicating that the weight assigned to historical records is smaller, and when the trust value When the trust value is low, historical records will have a higher weight. If you want to maintain a high trust value, the user must continue to show good behavior. Malicious breach of contract will cause the trust value to drop rapidly, that is, good behavior will be quickly forgotten. At the same time, it takes longer for users with low trust values ​​to increase, that is, malicious behavior will affect for a longer time, and the user's trust value w u The calculation formula is expressed as follows (6):

[0115]

[0116] Where a and b represent the parameters of the initial trust value beta distribution, x and y represent the number of normal car use and car request in the history of user u, respectively, and m and n represent the number of normal car use and request in the query time period. The trust value calculation method is implemented and executed by the base station, and the trust-related information is stored locally.

[0117] Step 2. Build a defense decision mechanism based on deep reinforcement learning for shared cars, such as Figure 3 As shown:

[0118] The Markov Decision Process is used to model the defense decision mechanism of shared cars, which mainly includes four parts: environmental state, action space, state transfer, and benefit function:

[0119] Step 2.1, environment status: The environment status includes service status, idle status, and reserved status:

[0120] Assume definition status The environmental information in the shared car application is described by the five-tuple represented by the following formula (7):

[0121]

[0122] Among them, C represents the current operation status of all shared cars; W summarizes the trust value of each car service user; e u is the service request information arriving at the current moment; w u represents the trust value of the user who issued the service request; T represents the remaining available time of the system, and each column of the matrix C represents the operating status of a car i c ∈{1, 2, ..., n c}, where n c Represents the total number of shared cars, and the cars are initially in idle state m f , when a service order is assigned, it will enter the reserved state m p , and after the reserved time ends, it changes to service state m s , the three vehicle state types are defined as {m f , m p , m s},. In addition, the running status The remaining time of the reservation and service phase is also included, denoted as t p and t s, which will continue to decrease as the service process progresses. Assuming that the time parameters involved in the model are discretized and are all integer multiples of the unit time, the operating state of the vehicle can be expressed as: idle state ( The current vehicle is idle and available, waiting to be assigned a new vehicle order; reserved status Indicates that the current vehicle has been assigned an order and is waiting for the user to arrive at the vehicle location. At this time, the vehicle is unavailable and can no longer be assigned an order; service status That is, the current vehicle is being used by the user and is in an unavailable state. After the service time is over, the vehicle will re-enter the idle state;

[0123] It should be noted that in the environmental state, the important information is the trust value of the user that the vehicle is serving. The trust value represents the possibility that the user will not initiate malicious breach of contract, which will affect the state transition of the corresponding vehicle. The trust value of the user corresponding to each vehicle service order is represented by the matrix W. The dimension of the matrix W is consistent with that of C. The vehicle operation state is corresponded to the trust value of the current service user through the column index. The trust value of user u who is using the shared car application is represented as If the vehicle is in an idle state, the corresponding position is filled with 0. In addition, the e in the environment state u It indicates that user u has initiated a service request at the current moment. Service request e u Reserved time by car and service hours It represents the user's car rental demand, w u The trust value of user u is queried, and the remaining service time of the system is expressed as T, 0≤T≤M, where M represents the maximum number of available time, and the termination condition is triggered when T=0;

[0124] Step 2.2, decision-making and scheduling actions for service requests:

[0125] In this step, the action The gateway is defined to be responsible for two decision-making functions, namely whether to accept the service request arriving at the current moment and how to allocate the order to different types of vehicles. The action space can be separated into two action subspaces, which respectively include the decision on the order and the scheduling of the order. In addition, if no user initiates a vehicle request at the current moment, no decision is required, which is expressed by the following formula (8):

[0126]

[0127] Among them, w0 and e0 represent the initial values ​​of service request and user trust respectively, which are used to confirm whether there are new requests arriving. Represents the action space of decision-making behavior, which will choose to accept or reject the service request that arrives. The decision-making behavior is defined as two values ​​{a accept , a refuse}, The action space of the dispatching behavior is represented by selecting from idle vehicles and assigning orders to specific vehicles. If there is no service request at the current moment, no action needs to be performed. Indicated by Figure 4 It can be seen that at time t, the new service request Arrives, at this time the decision action is to choose to accept and assign it to an idle vehicle That is a={a accept ,i c}, and at the same time, the user's trust value is added to the trust set W with the same index. At the next time t+1, the vehicle Entering the reserved state, no more orders can be assigned. The gateway chooses to reject the service request arriving at this time and thus does not perform scheduling behavior. At the subsequent time t+2, no new service request arrives, and the execution action is

[0128] Step 2.3 State transfer:

[0129] In the initial state of the shared car, all vehicles are in an idle state c0 = {m f , 0, 0}, then And since there is no vehicle currently serving the user, the corresponding user trust value set is also the initial value, that is, There is no service request at the initial moment, represented by e u =e0={0,0} and w u =w0=0, at the subsequent system time, the arrival of service requests is subject to the parameter p n The Bernoulli distribution of , users are randomly selected and have a certain trust value, which is expressed as the following formula (9):

[0130]

[0131] Among them, u * Represents the user ID that sends the service request; P is the arrival probability of a new service request. The state transition of the system is divided into the following two cases:

[0132] When no service request arrives at the current time, that is, w u =w0∧e u =e0, the gateway does not need to perform decision-making and scheduling actions, and the action space is The service status of all vehicles will change as the system progresses. The idle state remains unchanged, and the service state continues the current process. Vehicles in the reserved state may have two situations: user breach of contract or normal execution of orders. Breach of contract will cause the vehicle to be unable to continue service and return to the initial state. The trust value represents the probability that the user remains honest during the use of the shared car application. Assuming that the two events of breach of contract and non-breach of contract are mutually exclusive, when the user trust value is w u In the case of the reservation state, the probability of default at each system moment is defined as p u , then the default probability is calculated as follows (10):

[0133]

[0134] in, It represents the total length of the reserved time in the service request. From formula (10), we can see that the higher the trust value, the lower the probability of the user's breach of contract. Given the different trust values ​​of users, the vehicles serving the users also correspond to different state transition probabilities. The state transition of any vehicle in the system is expressed as the following formula (11):

[0135]

[0136] Among them, i c and i u The indexes representing the vehicles and their service users respectively; The default probability calculated for the corresponding user trust value is represented by the matrix W used to record the trust value of each car's current service user. It will change due to default behavior or service completion, and its change is expressed as the following formula (12):

[0137]

[0138] If a new service request arrives at the current moment, that is, w u ≠w0∧e u ≠e0, the action space includes two parts: decision-making and scheduling. The state transition is related to the execution action. First, if the decision action is to reject, that is This action will not affect the vehicle's operating state and trust set at the next moment, so the state transition expression is consistent with the above formula. Figure 4 The state transition that occurs at time t+1 in belongs to this case. If you choose to accept the service request, that is Then it is necessary to further perform scheduling actions to realize the allocation of current service requests. The scheduling action is expressed as That is, the incoming service request will be handled by the vehicle Responsible, it should be noted that only vehicles in idle state (i.e. ) will be assigned a service request. If all vehicles are unavailable, they can only choose to reject the newly arrived order. When they choose to accept the service request and execute the dispatch, that is, a={a accpet ,i c}, the state transition of the vehicle operation is as follows (13):

[0139]

[0140] At the same time, the trust value of the user who initiated the service request is added to the trust matrix W, and ... u Corresponding to the assigned vehicle, the following formula (14) is obtained:

[0141]

[0142] like Figure 4 As shown, the state transition at time t shows this situation. Finally, the number of available moments T in the environment state will decrease as time advances, which is expressed as the following formula (15):

[0143] T′=T-1......(15);

[0144] Step 3. Obtain the optimal strategy π for car-sharing based on the deep Q-network algorithm * (s) Maximizing the expected cumulative return, including the following steps:

[0145] Step 3.1 Establish the expected profit function:

[0146] The shared car service process includes three states, namely, idle state, reserved state and service state. In the actual scenario of shared cars, shared car services include idle state, reserved state and service state. Among them, idle state and reserved state will cause negative benefits such as parking fees and manual maintenance. Only in the service state will users pay fees and bring positive benefits. Therefore, after the selection and allocation decisions are made, positive feedback cannot be obtained immediately. The benefit function has the characteristics of delayed return. The benefits generated by ordinary vehicles in idle state, reserved state and service state per unit time are defined as v f , v p , v s , then the vehicle's revenue It is expressed as the following formula (16):

[0147]

[0148] Among them, v a and v c Represents the additional rewards for accepting service requests and completing service requests respectively; v r It represents the profit penalty caused by the breach of contract; represents the profit calculation coefficient of different types of vehicles. In addition, the negative sign in the profit calculation is used for mathematical conversion to satisfy the fact that the greater the profit, the better the evaluation execution action. The sum of the profits of all vehicles is defined as the profit function of the system at that moment, which is the following formula (17):

[0149]

[0150] According to the definition of the profit function and the state transition, the cumulative profit G from the decision time t (t) It can be expressed as the following formula (18):

[0151]

[0152] Among them, γ is the discount coefficient, maximizing the expected cumulative return It is to minimize the impact of malicious default to ensure the maximization of the total revenue of vehicles in the system, and then solve the optimal strategy π * (s), so that the expected cumulative benefit in a limited time reaches the maximum value, where strategy π(s) represents the action taken under system state s; M represents the maximum number of available time of the system, and the expected cumulative benefit from the initial state can be expressed as follows (19):

[0153]

[0154] Step 3.2, solve the expected profit function:

[0155] The purpose of solving the profit function is to find an optimal strategy π * (s) Maximize the expected cumulative return. For any Markov decision process problem, there must be at least one optimal strategy π * (s) is better than other strategies or has the same performance, and can be solved by related reinforcement learning algorithms. Through the analysis of the constructed model, it can be seen that the state space of the system is high-dimensional and complex, and the action space is discrete and limited in number. The Deep Q Network (DQN) algorithm in reinforcement learning is used to solve the profit function, that is, a neural network is used as a function approximator to estimate the action value function, and a neural network is used to construct a nonlinear approximate function. The storage space required for storing parameters will be much smaller than the size of the action space and behavior space. The Q network usually includes an evaluation network Q(s, a; θ) and a target network Q(s, a; θ - ), the evaluation network Q(s, a; θ) takes as input the state of the system, and outputs an estimate of the action value function for each actionable action; the target network Q(s, a; θ -) is used to predict the target action value function. In order to ensure the stability of learning, although the evaluation network and the target network have the same network structure, a strategy of delaying the target update is adopted. The specific process of the deep Q network algorithm includes:

[0156] Step 3.2.1, initialize the weights, system states and related parameters of the evaluation network and target network:

[0157] In each training iteration, the execution action under the current system state is selected by the ∈-greedy strategy with parameters ∈ t The initial value is ∈ init , and it decays continuously as the training progresses. The decay rate is determined by the coefficient η. When the ratio of the current training step number t to the total step number N is equal to the decay coefficient, that is, t / N=η,∈ t Decay to minimum value∈ min , as shown in formula (20):

[0158]

[0159] In the method of the present invention, the training is based on ∈ t The probability of randomly selecting an action is 1-∈ t The probability of selecting the action with the largest action value function is , This strategy is to solve the exploration-exploitation dilemma problem, so as to explore all possible behaviors and avoid falling into the local optimal solution. The following system states will be transferred according to the execution action and obtain immediate benefits:

[0160] The experience samples consisting of the current state, executed action, benefit, and next moment state are added to the experience replay pool, and then a batch of experience samples are randomly sampled from the experience replay pool and the loss function L(θ) is calculated;

[0161] Execute the optimizer and update the evaluation network weights θ. In addition, if the update interval of the target network is met, the weights of the current evaluation network need to be copied to the target network θ - ←θ;

[0162] When the algorithm converges, it is considered to have approximately obtained the optimal action value function And get the optimal strategy

[0163] It should be noted that in the implementation process of the deep Q network algorithm, the evaluation network and the target network have the same network structure, mainly including the input layer, the fully connected layer and the output layer. Since the environment state s includes multiple multi-dimensional vector arrays, it is necessary to perform preprocessing operations before inputting the network. First, the operation status C of all shared cars in the state and the trust information W of the vehicle service users are converted into one-dimensional vectors by row, and then the converted one-dimensional vectors are combined with other parts (eu, wu , T) are concatenated in sequence to obtain the preprocessed state. The number of neurons in the input layer is consistent with the length of the concatenated one-dimensional vector. The preprocessed state will be input into the evaluation network and forward propagated through multiple fully connected layers. Finally, the number of neurons in the output layer and the size of the action space Similarly, each neuron outputs the value of an action.

[0164] Step 4. Display the training strategy results. Figure 5 The performance comparison of various strategies when there are malicious users is shown. In this experiment, the trust value of malicious users is set to 0.2, indicating that the service request initiated by this user has a high probability of default. Considering the actual car usage scenario, ordinary users also have a certain probability of canceling service requests, so the trust value of ordinary users is set to 0.8. Figure 5 It can be seen that although the threshold judgment strategy can improve the average return compared to the greedy strategy, there is still a large performance gap compared with the strategy based on reinforcement learning. Taking the malicious users accounting for 10% as an example, the average return of the DQN algorithm strategy is 161.45, while the average return of the greedy strategy and the threshold judgment strategy is only 83.05 and 86.71, and the performance is improved by 94% and 86% respectively. This shows that in a complex and uncertain environment, the strategy trained by the DQN algorithm can better identify users and effectively avoid the negative impact caused by potential malicious behavior.

[0165] Figure 6a , Figure 6b The performance effects of different service arrival rates on various strategies are compared. This experiment also divides user trust values ​​into 10 types, which are uniformly distributed. Figure 7 It can be seen that as the arrival rate of service requests increases, the average benefits of various strategies are increasing. This is because a higher service arrival rate means more users use shared car applications, and there are more opportunities to choose orders and make profits. At the same time, it can be found that the revenue growth of the DQN-based reinforcement learning strategy is much higher than that of the traditional strategy. Specifically, the revenue growth of the DQN algorithm strategy is 25.88, 30.02 and 22.68 respectively; while the threshold judgment strategy is only 10.79, 13.27 and 12.32 respectively. The reasons for the substantial increase in revenue are mainly two aspects. On the one hand, it reflects the accurate identification of users and avoids the invalid occupation of vehicle resources by malicious breach of contract. On the other hand, when facing resource-constrained scheduling tasks, high-trust users can be assigned to advanced types of vehicles to obtain higher benefits. Therefore, when the opportunities for service request selection and allocation increase, the gain effect of reinforcement learning decision-making will be more obvious.

[0166] The above experimental results show that the service request selection and allocation strategy obtained by the DQN algorithm can achieve the design goal of the present invention, that is, to maximize the cumulative revenue of the shared car application within a limited time period and minimize the impact of malicious users' default behavior.

[0167] The above description is only a specific implementation case of the method described in the present invention, and does not constitute any limitation on the content or application described in the present invention. For professionals in this field, after understanding the content and principles of the present invention, they may make various modifications and changes in form and details without departing from the principles and structures of the present invention. However, these modifications and changes based on the ideas of the present invention are still within the scope of protection of the present invention.

Claims

1. A decision-making method for resisting default attacks based on reinforcement learning in a shared car scenario. Features The following steps are involved: Step 1. Build a distributed trust management mechanism for shared cars; Step 2. Build a defense decision mechanism based on deep reinforcement learning for shared cars; Step 3. Based on the deep Q-network algorithm, obtain the optimal strategy π*(s) of shared cars to maximize the expected cumulative benefits.

2. According to the decision-making method for resisting breach of contract attacks based on reinforcement learning in the shared car scenario of claim 1, It is characterized in that In step 1, a shared car distributed trust management mechanism system is constructed, including: Step 1.1 Based on the actual scenario of shared cars, the cloud layer, edge layer, terminal layer and user layer are constructed: Step 1.1.1 Build the cloud layer. The cloud layer mainly includes the registration and management of users and vehicles. Before using the shared car application, the user generates a personal account address, as well as the corresponding public key and private key through the cloud layer's authentication center. The account address is the user's identification, which is composed of a fixed-length hash code and can protect privacy. The account's private key is the only identity credential, and the account's public key is used by the cloud server and edge devices to encrypt communications with users and verify digital signatures. The cloud layer can also provide the necessary service interface for edge devices to query user historical information. When a vehicle joins a shared application, it registers in this layer to generate information such as vehicle identification and device key pairs to obtain a legal identity during application operation. Step 1.1.2: Build the edge layer. The edge layer is mainly composed of base stations or roadside units, which are jointly responsible for trust management and the execution of decision-making mechanisms. The trust information of all users will be stored as state variables in the lightweight database of the base station. The base station will regularly query the database to count the historical behaviors of users within a certain period of time, and then calculate and update the user trust value. Based on the trust information and environmental status, the base station will select and allocate service requests through a defense decision-making mechanism to prevent malicious attacks from ineffectively occupying system resources. Step 1.1.3: Build the device layer. The device layer consists of shared vehicles. The shared vehicles are equipped with on-board sensing modules, communication modules, and computing units. They can establish communication connections with edge layer infrastructure through the 6G network. The shared vehicles can send requests to the base station to call various services, such as querying the identity of the current authorized user and reporting the current service status. Step 1.1.4: Architect the user layer. In the shared car scenario, the user is the initiator of the service request and the user of the vehicle. The user can achieve data communication with the edge layer base station through the mobile terminal. Using the service interface of the application, the user can query the status information of the vehicle and initiate a vehicle request as needed. If the service request is accepted, the base station will grant the vehicle usage rights to the user's account. Finally, the user completes the access and control of the shared vehicle through the application on the terminal. Step 1.2 establishes a shared car breach attack model. In some cases, the attacker intentionally occupies service resources and disrupts the normal operation of the application for some purpose. This behavior is defined as a breach attack. Considering the actual service scenario of shared cars, the user's car order can include two time stages, including the time to reserve the vehicle and the time to use the vehicle. The corresponding time length in the order is defined as t p and t s , the attacker sends a fake car request as a legitimate user and p If the user cancels the order within 10 days or fails to use the vehicle on time, a default will occur. The default probability p of the user is calculated based on the user's trust value. u ; Step 1.3 The base station calculates the user trust value based on the statistical data of the user's historical interaction behavior. After obtaining the statistical data of the user's historical interaction behavior, the base station infers the possibility of the user continuing to be honest in the future based on the Bayesian probability estimation method. This method is based on the sample set and uses the Bayesian formula to correct the prior distribution of the parameters to obtain the posterior distribution of the parameters. Assuming that the probability of user u's real car request is φ u , and φ u ∈(0, 1), then among the n service requests of the household's historical behavior, the number of normal car use m follows a binomial distribution. This event is defined as y, and its likelihood function is expressed as follows (1): For the binomial distribution, the beta distribution is its conjugate prior. In order to facilitate the calculation of the posterior distribution, it is assumed that the user maintains an honest probability φ u The prior distribution of follows the Beta distribution, that is, Beta(a, b), then φ u The density function is as follows (2): Where Γ(·) is the gamma function, and the initial value is assumed for the newly added user The uniform distribution is expressed as: Then φ is derived u The posterior density function of also obeys the Beta distribution Beta(a+m, b+nm), which is the following formula (3): Its mean is expressed as the following formula (4): In the above formula, the user's trust evaluation result is used as the basis for his / her future honesty, based on φ u The posterior mean of the user trust value w u , in actual scenarios, the user's trust value will be different from recent behavior due to identity theft. If the historical records and recent behaviors are given the same weight, the change of trust value cannot be detected quickly, resulting in poor time sensitivity. As the number of historical records increases, the proportion of recent interactive behaviors decreases, and thus cannot affect the update of trust value. By adding an adaptive forgetting factor λ, the weight of historical records can be moderately reduced, which is expressed as the following formula (5): in, is the trust value before this update; τ is the calculation coefficient. From the above formula, we can see that the adaptive forgetting factor is defined as the sum of the previous trust value The monotonically decreasing function is Before the trust value When it is higher, the forgetting factor decreases, which means that the weight assigned to historical records is smaller, and when the trust value is When the trust value is low, historical records will have a higher weight. If you want to maintain a high trust value, the user must continue to show good behavior. Malicious breach of contract will cause the trust value to drop rapidly, that is, good behavior will be quickly forgotten. At the same time, it takes longer for users with low trust values ​​to increase, that is, malicious behavior will affect for a longer time, and the user's trust value w u The calculation formula is expressed as follows (6): Among them, a and b represent the parameters of the initial trust value beta distribution, x and y represent the number of normal car use and car request initiation in the user u's historical records, respectively, and m and n represent the number of normal car use and request initiation during the query time period. The trust value calculation method is implemented and executed by the base station, and the trust-related information is stored locally.

3. According to the decision-making method for resisting breach of contract attacks based on reinforcement learning in the shared car scenario of claim 1, It is characterized in that In step 2, a defense decision mechanism based on deep reinforcement learning is constructed for shared cars. The defense decision mechanism of shared cars is modeled using the Markov decision process, which mainly includes four parts: environment state, action space, state transfer, and benefit function: Step 2.1, environment status: The environment status includes service status, idle status, and reserved status: Assume definition status The environmental information in the shared car application is described by the five-tuple represented by the following formula (7): Among them, C represents the current operation status of all shared cars; W summarizes the trust value of each car service user; e u is the service request information arriving at the current moment; w u represents the trust value of the user who issued the service request; T represents the remaining available time of the system, and each column of the matrix C represents the operating status of a car Among them, n c represents the total number of shared cars. The vehicle is initially idle. When a service order is assigned, it will enter the reserved state and change to the service state after the reserved time ends. The three state types of the vehicle are defined as {m f , m p , m s }, running status It also includes: the remaining time of the reservation and service phase, denoted as t p and t s , which will continue to decrease as the service process progresses. Assuming that the time parameters involved in the model are discretized and are all integer multiples of the unit time, the operating state of the vehicle can be expressed as: idle state ( The current vehicle is in an idle and available state, waiting to be assigned a new vehicle order, which is represented by: reserved state The current vehicle has been assigned an order and is waiting for the user to arrive at the vehicle location. At this time, the vehicle is unavailable and can no longer be assigned an order; Service Status The current vehicle is being used by the user and is in an unavailable state. After the service time is over, the vehicle will return to an idle state; Idle state The current vehicle is idle and available, waiting to be assigned a new vehicle order; Reservation Status The reserved state means that the shared vehicle has been assigned an order and is waiting for the user to arrive at the vehicle location. At this time, the vehicle is unavailable and can no longer be assigned an order. Step 2.2, decision-making and scheduling actions for service requests: In this step, the action The gateway is defined to be responsible for two decision-making functions, namely whether to accept the service request arriving at the current moment and how to allocate the order to different types of vehicles. The action space is separated into two action subspaces, which respectively include the decision on the order and the scheduling of the order. If no user initiates a vehicle request at the current moment, no decision is required, which is expressed by the following formula (8): Among them, w 0 and e 0 They represent the initial values ​​of service requests and user trust, respectively, and are used to confirm whether new requests have arrived. Represents the action space of decision-making behavior, which will choose to accept or reject the service request that arrives. The decision-making behavior is defined as two values ​​{a accept , a refuse }, The action space of the dispatching behavior is represented by selecting from idle vehicles and assigning orders to specific vehicles. If there is no service request at the current moment, no action needs to be performed. Indicates that at time t, the new service request Arrives, at this time the decision action is to choose to accept and assign it to an idle vehicle That is a={a accept ,i c }, and at the same time, the user's trust value is added to the trust set W with the same index. At the next time t+1, the vehicle Entering the reserved state, no more orders can be assigned. The gateway chooses to reject the service request arriving at this time and thus does not perform scheduling behavior. At the subsequent time t+2, no new service request arrives, and the execution action is Step 2.3 State transfer: In the initial state of the system, all vehicles are in idle state c 0 ={m f , 0, 0}, then And since there is no vehicle currently serving the user, the corresponding user trust value set is also the initial value, that is, There is no service request at the initial moment, represented by e u =e 0 ={0,0} and w u =w 0 = 0, at the subsequent system time, the arrival of service requests is subject to the parameter p n The Bernoulli distribution of , users are randomly selected and have a certain trust value, which is expressed as the following formula (9): Among them, u * Represents the user ID that sends the service request; P is the arrival probability of a new service request. The state transition of the system is divided into the following two cases: When no service request arrives at the current time, that is, w u =w 0 ∧e u =e 0 , the gateway does not need to perform decision-making and scheduling actions, and the action space is The service status of all vehicles will change as the system progresses. The idle state remains unchanged, and the service state continues the current process. Vehicles in the reserved state may have two situations: user breach of contract or normal execution of orders. Breach of contract will cause the vehicle to be unable to continue service and return to the initial state. The trust value represents the probability that the user remains honest during the use of the shared car application. Assuming that the two events of breach of contract and non-breach of contract are mutually exclusive, when the user trust value is w u In the case of the reservation state, the probability of default at each system moment is defined as p u , then the calculation formula of default probability is as follows (10): in, It represents the total length of the reserved time in the service request. From formula (10), we know that the higher the trust value, the lower the probability of the user's breach of contract. Given the different trust values ​​of users, the vehicles serving the users also correspond to different state transition probabilities. The state transition of any vehicle in the system can be expressed as the following formula (11): Among them, i c and i u The indexes representing the vehicles and their service users respectively; The default probability calculated for the corresponding user trust value is represented by the matrix W used to record the trust value of the current service user of each car. It will change due to default behavior or service completion, which is expressed as the following formula (12): If a new service request arrives at the current moment, that is, w u ≠w 0 ∧e u ≠e 0 ,The action space includes two parts: decision-making and scheduling. The state transition is related to the execution action. If the decision action chooses to reject, that is, This action will not affect the vehicle operation status and trust set at the next moment, so the state transition expression is consistent with the above formula. The state transition that occurs at time t+1 belongs to this situation. If you choose to accept the service request, that is, Then it is necessary to further perform scheduling actions to realize the allocation of current service requests. The scheduling action is expressed as That is, the incoming service request will be handled by the vehicle Responsible, only vehicles in idle state (i.e. ) will be assigned a service request. When all vehicles are unavailable, they can only choose to reject the newly arrived order. When they choose to accept the service request and execute the dispatch, that is, a={a accpet ,i c }, the state transition of the vehicle operation is as follows (13): At the same time, the trust value of the user who initiated the service request is added to the trust matrix W, and ... u Corresponding to the assigned vehicle, the following formula (14) is obtained: The number of available moments T in the environment state decreases as time progresses, as expressed in the following formula (15): T′=T-1......(15).

4. According to the decision-making method for resisting breach of contract attacks based on reinforcement learning in the shared car scenario of claim 1, It is characterized in that In step 3, the optimal strategy π for car sharing is obtained based on the deep Q network algorithm * (s) Maximize the expected cumulative return: Step 3.1 Establish the expected profit function: The shared car service process includes three states, namely, idle state, reserved state and service state. In the actual scenario of shared cars, shared car services include idle state, reserved state and service state. Among them, idle state and reserved state will cause negative benefits such as parking fees and manual maintenance. Only in the service state will users pay fees and bring positive benefits. After executing the selection and allocation decisions, positive feedback cannot be obtained immediately. The benefit function has the characteristics of delayed return. The benefits generated by ordinary vehicles in idle state, reserved state and service state per unit time are defined as v respectively. f , v p , v s , then the vehicle's revenue It is expressed as the following formula (16): Among them, v a and v c Represents the additional rewards for accepting service requests and completing service requests respectively; v r It represents the profit penalty caused by the breach of contract; represents the profit calculation coefficient of different types of vehicles. The negative sign in the profit calculation is used for mathematical conversion to satisfy the fact that the greater the profit, the better the evaluation execution action. The sum of the profits of all vehicles is defined as the profit function of the system at that moment, which is the following formula (17): According to the definition of the profit function and the state transition, the cumulative profit G from the decision time t (t) It can be expressed as the following formula (18): Among them, γ is the discount coefficient, maximizing the expected cumulative return The goal is to minimize the impact of malicious default to ensure the maximization of the total revenue of vehicles in the system. Next, we need to solve the optimal strategy π * (s), so that the expected cumulative benefit in a limited time reaches the maximum value, where strategy π(s) represents the action taken under system state s; M represents the maximum number of available time of the system, and the expected cumulative benefit from the initial state can be expressed as follows (19): Step 3.2, solve the expected profit function: The purpose of solving the profit function is to find an optimal strategy π * (s) Maximize the expected cumulative return. For any Markov decision process problem, there must be at least one optimal strategy π * (s) is better than other strategies or has the same performance, and can be solved by related reinforcement learning algorithms. Through the analysis of the constructed model, it can be seen that the state space of the system is high-dimensional and complex, and the action space is discrete and limited in number. The Deep Q Network (DQN) algorithm in reinforcement learning is used to solve the profit function, that is, a neural network is used as a function approximator to estimate the action value function, and a neural network is used to construct a nonlinear approximate function. The storage space required for storing parameters will be much smaller than the size of the action space and behavior space. The Q network usually includes an evaluation network Q(s, a; θ) and a target network Q(s, a; θ - ) The evaluation network Q(s, a; θ) takes as input the state of the system and outputs an estimate of the action value function for each actionable action; the target network Q(s, a; θ - ) is used to predict the target action value function. In order to ensure the stability of learning, although the evaluation network and the target network have the same network structure, a strategy of delaying the target update is adopted. The specific steps of the deep Q network algorithm are as follows: Step 3.2.1, initialize the weights, system states and related parameters of the evaluation network and target network: In each training iteration, the execution action under the current system state is selected by the ∈-greedy strategy. The parameters ∈ t The initial value is ∈ init , and it decays continuously as the training progresses. The decay rate is determined by the coefficient η. When the ratio of the current training step number t to the total step number N is equal to the decay coefficient, that is, t / N=η,∈ t Decay to minimum value∈ min , which is expressed by the following formula (20): Training with ∈ t The probability of randomly selecting an action is 1-∈ t The probability of selecting the action with the largest action value function is , This strategy is to solve the exploration-exploitation dilemma problem, so as to explore all possible behaviors and avoid falling into the local optimal solution. The following system states will be transferred according to the execution action and obtain immediate benefits: The experience samples consisting of the current state, executed action, benefit, and next moment state are added to the experience replay pool, and then a batch of experience samples are randomly sampled from the experience replay pool and the loss function L(θ) is calculated; Execute the optimizer and update the evaluation network weights θ. In addition, if the update interval of the target network is met, the weights of the current evaluation network need to be copied to the target network θ - ←θ; When the algorithm converges, it is considered to have approximately obtained the optimal action value function And get the optimal strategy