Internet of vehicles trusted task unloading method and system based on elite genetic algorithm
By applying the trusted task unloading method of elite genetic algorithm in the Internet of Vehicles system, the computing power limitations and security risks faced by the unloading of computing-intensive and real-time tasks in the Internet of Vehicles are solved, the reliability and security of tasks are achieved, and the utilization of system resources is optimized.
Patent Information
- Application Number
- CN202510612564.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-06-13
AI Technical Summary
The uninstallation of computing-intensive and real-time tasks in the Internet of Vehicles faces computing capacity limitations and security risks, and it is difficult for the existing technology to effectively identify and filter malicious or false tasks.
The Internet of Vehicles Trusted Task Offloading Method based on Elite Genetic Algorithm is adopted. By establishing a traffic environment model for the Internet of Vehicles, a trust evaluation function model is built, and the comprehensive trust value is calculated based on data privacy, request success rate and offload request frequency is used to optimize the offload decision to ensure the reliability and security of the task.
It improves the security and reliability of the Internet of Vehicles system, effectively identifies and filters malicious tasks, optimizes task offload decisions, reduces system overhead, and improves resource utilization.
Smart Images

Figure CN120144320A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of vehicle networking and edge computing, and in particular, to a vehicle networking trusted task offloading method and system based on an elite genetic algorithm. Background Art
[0002] Vehicle networking exchanges information among "people-vehicle-road-cloud", uses sensing technology to perceive vehicle status information, and realizes intelligent traffic management with the help of wireless communication networks and big data analysis technology. The continuous progress in vehicle networking marks the increase of data-intensive applications, which pose higher requirements for fast computing and low latency. Due to the limitation of in-vehicle computing power, how to effectively support these real-time and computing-intensive tasks has become a huge challenge.
[0003] Task offloading effectively alleviates the computing and storage problems existing in the cloud computing architecture by deploying computing resources around Internet of Things devices. Task offloading usually uses multi-access edge computing technology (MEC technology, Multi-access Edge Computing), which has the advantages of low latency and high efficiency. However, relying solely on MEC technology still cannot meet the computing requirements of the huge data volume in vehicle networking. Moreover, most task offloading methods only focus on issues such as task processing efficiency, latency, energy consumption, and edge node load balancing, without considering the possibility of offloading failure, and also ignoring factors such as malicious attacks or false tasks that may exist in the environment.
[0004] Personal and social sensitive data in vehicle networking are usually located at the edge of the system, and it becomes a problem to process data while ensuring security and privacy. For example, in highway vehicle scheduling, malicious or misbehaving vehicles may threaten the safety of user vehicles and endanger the stability of the system by transmitting low-quality or false information.
[0005] To solve the above problems, in the face of the reliable task offloading requirements in complex heterogeneous vehicle networking, a vehicle networking trusted task offloading method is needed to judge and filter false and malicious tasks, ensure the reliability of offloading, and minimize system overhead. Summary of the Invention
[0006] To solve the problems mentioned above, the present invention provides a vehicle networking trusted task offloading method and system based on an elite genetic algorithm.
[0007] In a first aspect, a vehicle networking trusted task offloading method based on an elite genetic algorithm provided by the present invention adopts the following technical solution: A vehicle networking trusted task offloading method based on an elite genetic algorithm includes: Establish an IoV traffic environment including vehicle nodes, edge nodes, cloud servers and super nodes, and build an IoV task offloading model based on the IoV traffic environment; Obtain the unloading tasks of the vehicle nodes, and build a trust evaluation function model for the unloading tasks by combining the data privacy, request success rate, and unloading request frequency of the unloading tasks. The comprehensive trust value is calculated through the trust evaluation function model, and the offloading task is added to the trust task queue according to the evaluation result of the comprehensive trust value, and the offloading decision sequence is obtained and waits for the offloading decision to be delegated; Genetic algorithm is used to iteratively obtain the unloading decision sequence of the trust task queue, and the chromosome is modified according to the priority of the unloading task to meet the constraint conditions to obtain the optimal unloading decision; The Internet of Vehicles task offloading model is used to realize the offloading of tasks in the Internet of Vehicles.
[0008] Furthermore, the super node is located between the vehicle node and the edge node, and is used to delegate decisions on the unloading tasks of the vehicle.
[0009] Furthermore, the establishment of a vehicle network traffic environment including vehicle nodes, edge nodes, cloud servers and super nodes includes establishing n vehicle nodes, m edge nodes, z super nodes and 1 cloud server, wherein the vehicle nodes are represented by a set as , the edge nodes are represented by a set , the cloud server is represented by a set .
[0010] Furthermore, the obtaining of the unloading task of the vehicle node includes obtaining a task set and a computing node set of the vehicle, wherein the task set is , each task The characteristics of It indicates that, is the data volume of the task, The number of CPU cycles required for the task calculation, Calculate the maximum tolerable delay for the task, For the task offloading decision, the set of computing nodes is represented as , ,in Represents the total computing power resources of the computing node, Represents the total data capacity of the compute node.
[0011] Furthermore, the computing node Collection .
[0012] Furthermore, the data privacy is expressed by the formula: ,in, Indicates the offloading task The amount of privacy data required, is the amount of data for the task.
[0013] Furthermore, the request success rate is expressed by the formula: , where, Indicates the number of successfully offloaded tasks, Indicates the number of failed offloading tasks. For Assign a neutral value .
[0014] Furthermore, the offloading request frequency is expressed by the formula: , where, Is the request frequency weight of the node, satisfying , Indicates the number of offloading requests of the node, Indicates the average number of offloading requests of the node.
[0015] Furthermore, the trust evaluation function model is expressed by the formula: , where, Is the weight parameter, satisfying .
[0016] Furthermore, adding the offloading task to the trusted task queue according to the evaluation result of the comprehensive trust value includes setting a trust threshold , and comparing the comprehensive trust value of the node with the trust threshold . If , the super node rejects the offloading request of the task and directly ends the process. If ≥ , the super node adds the task to the trusted task queue to wait for the offloading decision to be delegated, and at the same time updates the feature data of the offloading request frequency in the node feature database.
[0017] Furthermore, iteratively obtaining the offloading decision sequence of the trusted task queue by using the genetic algorithm includes: Initializing the population of the trusted task queue based on the trusted task queue, generating chromosomes, and each chromosome corresponds to an offloading decision sequence of a task; Constructing a fitness function, selecting chromosomes for iteration, and sorting the chromosomes in ascending order according to the fitness function; Execute the elitist strategy before each iteration, and retain the top β % of the individuals in the current population; Adopt the tournament selection method to select parental chromosomes from the population, and randomly select from the population Compare the chromosomes, keep the chromosome with the lowest fitness value to enter the parental set, and repeat this process until the size of the parental set is equal to the size of the original population.
[0018] Further, initializing the population of the trust task queue based on the trust task queue to generate chromosomes includes traversing the entire chromosome, using a random function to generate the value of the gene at the current position. If the node corresponding to the value of the gene at the current position has space and computing power, execute the current task; otherwise, regenerate the value of the gene at the current position until the gene is legal. Each gene in the chromosome represents the offloading destination of the corresponding task.
[0019] Further, the fitness function is expressed by the formula: , which is used to minimize the cost of task offloading, where represents the total number of tasks, is a weight parameter calculated according to the task characteristics, which is used to achieve the dynamic trade-off between task latency and system energy consumption, represents the total energy consumption cost of task i offloaded to node j for calculation, represents the total time delay of task i offloaded to node j.
[0020] Further, correcting the chromosome according to the priority of the offloading task to meet the constraint conditions includes using the uniform recombination method to perform crossover operations on the parental chromosomes to generate offspring chromosomes, and performing low-probability mutation operations. Correct the illegal solutions of the offspring chromosomes generated after crossover and mutation according to the task priority until all solutions meet the constraint conditions.
[0021] Further, the constraint conditions include task latency constraint, data capacity constraint, and computing node computing power constraint; The task latency constraint is expressed as , where represents the processing latency after task i is offloaded to node j, represents the maximum tolerable latency of task i, represents the i-th task in task set T, represents the task set; The data capacity constraint is expressed as , where represents the task set, represents the amount of data required when task i is offloaded to node j, represents the total data capacity of node j, represents the set of computing nodes the j-th node in, represents the set of computing nodes; The computing node computing power constraint is expressed as ,in, represents the number of CPU cycles required for task i to execute on node j, Represents the total computing resources of node j.
[0022] In the second aspect, a vehicle network trusted task offloading system based on elite genetic algorithm includes: The model building module is configured to build a vehicle networking task offloading model based on the vehicle networking traffic environment; The data evaluation module is configured to obtain the unloading task of the vehicle node and construct a trust evaluation function model of the unloading task by combining the data privacy, request success rate and unloading request frequency of the unloading task; The task screening module is configured to calculate the comprehensive trust value through the trust evaluation function model, add the offloading task to the trust task queue according to the evaluation result of the comprehensive trust value, obtain the offloading decision sequence and wait for the offloading decision to be delegated; The decision optimization module is configured to iteratively obtain the unloading decision sequence of the trust task queue using a genetic algorithm, and modify the chromosome according to the priority of the unloading task to meet the constraint condition, so as to obtain the optimal unloading decision; The unloading execution module is configured to use the Internet of Vehicles task unloading model to realize the unloading of unloading tasks in the Internet of Vehicles.
[0023] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for unloading trusted tasks in an Internet of Vehicles based on an elite genetic algorithm.
[0024] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor, a method for unloading trusted tasks in an Internet of Vehicles based on an elite genetic algorithm.
[0025] In summary, the present invention has the following beneficial technical effects: 1. The present invention proposes a method and system for trustworthy task offloading in the Internet of Vehicles based on an elite genetic algorithm. Through innovative technologies such as multi-dimensional trust evaluation, elite genetic algorithm optimization, constraint-based correction, and vehicle-side cloud collaborative computing, it has achieved significant improvements in security, efficiency, resource utilization, and system adaptability, thereby ensuring the safe and reliable operation of the Internet of Vehicles system.
[0026] 2. The trust evaluation function model of the present invention is constructed from multiple perspectives such as data privacy level, source node request success rate, and offloading request frequency to comprehensively evaluate the credibility of offloading tasks. By calculating the comprehensive trust value through this model and comparing it with the trust threshold, malicious tasks can be effectively identified and filtered, avoiding malicious or false tasks from occupying system resources, threatening the safety of user vehicles, and system stability.
[0027] 3. In the iterative optimization process of the genetic algorithm of the present invention, through reasonable chromosome operations and selection strategies, the obtained optimal offloading decision fully considers various characteristics of tasks and nodes, enabling tasks to be more reasonably allocated to computing nodes for processing. The genetic algorithm iteratively considers task latency and system energy consumption. During the iteration process, the elitist strategy and tournament selection method ensure that better chromosomes are selected in each generation, making the offloading decision continuously optimized. Eventually, the system overhead is effectively reduced. When the computing power or capacity of edge nodes is insufficient, low-priority tasks are offloaded to the cloud server to ensure that task computing nodes have sufficient resources to execute tasks, realizing the reasonable allocation of computing resources and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the network architecture applied to the present invention; Figure 2 It is the overall framework diagram of the implementation of the method of the present invention; Figure 3 It is a schematic diagram of chromosome encoding involved in implementing offloading decisions of the present invention; Figure 4 It is a schematic diagram of chromosome recombination involved in implementing offloading decisions of the present invention; Figure 5 It is a schematic diagram of chromosome mutation involved in implementing offloading decisions of the present invention; Figure 6 It is a schematic diagram of the comparison of system overheads when the method of the present invention and the comparative method are iterated continuously for 1000 times; Figure 7 It is a schematic diagram of the comparison of task overheads between the method of the present invention and the comparative method; Figure 8 Offloading success rate diagrams of the method of the present invention and the comparative method; Figure 9 It is a schematic diagram of the comparison of energy consumption between the method of the present invention and the comparative method; Figure 10 It is a schematic diagram of the comparison of time delays between the method of the present invention and the comparative method. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] The present invention will be further described in detail below with reference to the accompanying drawings.
[0030] Embodiment 1 In this embodiment, a trusted task offloading method for Internet of Vehicles based on an elite genetic algorithm is proposed. First, the task offloading problem is modeled as a joint minimization optimization problem of latency and energy consumption. Tasks are comprehensively evaluated from multiple dimensions such as data privacy, source node request frequency, and offloading quality, so as to effectively identify and filter false and malicious tasks. Then, the genetic algorithm is combined with elitism and tournament selection to redefine the fitness function, introduce an improved chromosome correction mechanism, and determine the task offloading decision through iteration.
[0031] The specific steps include: S1. Establish an IoV traffic environment including vehicle nodes, edge nodes, cloud servers and super nodes, and build an IoV task offloading model based on the IoV traffic environment.
[0032] S11. Reference Figure 1 , cloud servers are composed of large data centers with powerful task processing capabilities and huge storage capacity. They are responsible for global data collection, executing large-scale computing tasks, providing storage services, etc. Edge nodes are deployed at the edge of the network close to users. They are composed of small servers with certain computing and storage capabilities. By calculating and processing tasks nearby, response delays and central loads can be optimized. Super nodes are a layer of hardware devices between vehicle nodes and edge servers. During the task offloading process, super nodes are responsible for evaluating, filtering and delegating decisions on offloaded tasks. Vehicle nodes will generate various tasks. When tasks are difficult to calculate locally, they will be offloaded to the edge or cloud for execution. At the same time, it will also receive data from the server and return the calculation results to the user.
[0033] S12. Reference Figure 1 The establishment of a vehicle network traffic environment including vehicle nodes, edge nodes, cloud servers and super nodes includes establishing n vehicle nodes, m edge nodes, z super nodes and 1 cloud server, and the vehicle nodes are represented by a set as , the edge nodes are represented by a set , the cloud server is represented by a set .
[0034] S13. Reference Figure 2 The task offloading involved in this embodiment adopts a binary offloading mode. Each task can only be executed completely on the vehicle, edge server or cloud server as an independent whole and cannot be further divided. The acquisition of the offloading task of the vehicle node includes acquiring the task set and computing node set of the vehicle. The task set is , each task The characteristics of It indicates that, is the data volume of the task, The number of CPU cycles required for task calculation, The maximum tolerable latency for task calculation, For the offloading decision of the task, represent the set of computing nodes as , , where represents the total computing power resources of the computing node, represents the total data capacity of the computing node, and use to represent the set of task offloading decision vectors, , where indicates that the first task is executed locally, indicates that the task is offloaded to the th service node for execution, including edge nodes and cloud nodes, and the set of the computing nodes is .
[0035] S2. Obtain the offloading tasks of the vehicle nodes, and construct a trust evaluation function model for the offloading tasks by combining the data privacy degree, request success rate, and offloading request frequency of the offloading tasks.
[0036] S21. The data privacy degree is expressed by the formula: , where represents the amount of private data required for the offloading task , is the data volume of the task.
[0037] S22. The request success rate is expressed by the formula: , where represents the number of successfully offloaded tasks, represents the number of failed offloading tasks, and assign a neutral value to . While ensuring the privacy of the system, to improve the quality of tasks executed by edge nodes and improve the system operation efficiency, by analyzing the historical offloading situation of nodes, calculate and obtain the historical request success rate data of the source vehicle node .
[0038] S23. The offloading request frequency is expressed by the formula: , where is the request frequency weight of the node, satisfying , represents the offloading request number of the node, represents the average offloading request number of the node.
[0039] S24. Referring to Figure 2 , the trust evaluation function model is expressed by the formula: , where is the weight parameter, satisfying .
[0040] S3. Calculate the comprehensive trust value through the trust evaluation function model, add the offloading task to the trust task queue according to the evaluation result of the comprehensive trust value, obtain the offloading decision sequence and wait for the offloading decision to be delegated.
[0041] Reference Figure 2 , adding the offload task to the trust task queue according to the evaluation result of the comprehensive trust value, including setting the trust threshold , the comprehensive trust value of the node With trust threshold For comparison, if , the super node rejects the task's offloading request and ends the process directly. ≥ The super node will add the task to the trust task queue and wait for the offloading decision to be delegated. At the same time, it will update the feature data of the offloading request frequency in the node feature database and the trust threshold. The recommended value range is [0.5, 0.8], which can be adjusted according to the security requirements of the scenario. The typical value is 0.6 or 0.7.
[0042] S4. Use the genetic algorithm to iteratively obtain the unloading decision sequence of the trusted task queue, modify the chromosome according to the priority of the unloading task to meet the constraint conditions, and obtain the optimal unloading decision.
[0043] Reference Figure 2 , the iterative acquisition of the unloading decision sequence of the trusted task queue by using the genetic algorithm includes: S41. Initialize the population of the trust task queue based on the trust task queue and generate chromosomes. The chromosome set is expressed as This structure helps subsequent edge nodes to be mapped to the corresponding assigned tasks more quickly. Each chromosome corresponds to an unloading decision sequence of a task; the population of the trust task queue is initialized based on the trust task queue to generate chromosomes.
[0044] like Figure 3 The gene number 1 is , the value is 4, which means that task No. 1 needs to be unloaded to edge node No. 4. During the initialization process, the number of genes contained in the chromosome depends on the number of tasks. The genes are generated by traversing the random function of the known library function, and its value comes from the set of computing nodes. The initialization process includes traversing the entire chromosome and using a random function to generate the value of the gene at the current position. If the node corresponding to the value of the gene at the current position has space and computing power, the current task is executed. Otherwise, the value of the gene at the current position is regenerated until the gene is legal. For a population, the initialization size is fixed to 40 chromosomes, and each gene in the chromosome represents the offloading destination of the corresponding task.
[0045] S42. Construct a fitness function, select chromosomes for iteration, and sort the chromosomes in ascending order according to the fitness function; the fitness function is expressed by the formula: , which is used to minimize the overhead of task offloading, where represents the total number of tasks, is a weight parameter calculated according to task characteristics, which is used to achieve dynamic trade-off between task latency and system energy consumption, represents the total energy consumption overhead of task i offloaded to node j for calculation, represents the total time delay of task i offloaded to node j.
[0046] S43. Execute the elitist strategy before each iteration, and retain the top β % of the individuals in the current population. The value range of β is (0, 10%], and it is recommended that 2% ≤ β ≤ 5% in specific implementations, and the typical value is 3%.
[0047] S44. Use the tournament selection method to select parental chromosomes from the population. The tournament selection method (Tournament Selection) is a selection mechanism in genetic algorithms. It randomly selects a group of individuals, and then compares all the individuals in this group one by one to select the most suitable individual, generally the individual with the highest fitness. Here, it refers to the individual with the lowest fitness to participate in the genetic operation of the next generation. Repeat this process until the size of the parental set is equal to the size of the original population.
[0048] S45. Modify the chromosomes according to the priority of the offloading tasks until they meet the constraint conditions, including using the uniform recombination method to perform crossover operations on the parental chromosomes to generate offspring chromosomes, and performing low-probability mutation operations. Illegitimate solutions of the offspring chromosomes generated after crossover and mutation are corrected according to the task priority until all solutions meet the constraint conditions. The constraint conditions include task latency constraints, data capacity constraints, and computing node computing power constraints.
[0049] Use the uniform recombination method to iteratively generate a new population, which is a set of offloading decision sequences constructed based on task characteristics (task data volume, CPU cycles, maximum tolerable delay) and computing node resources (computing power, data capacity) node resource parameters. Randomly select values from 0 and 1 to generate a recombination sequence of the same length as the chromosome. 0 represents that no exchange is performed at the current position, and 1 represents that an exchange is required at the current position. Randomly select two chromosomes from the current parental chromosome set and perform chromosome recombination according to this sequence. The exchange schematic diagram is as Figure 4As shown in the figure. A gene on a randomly selected chromosome is modified to a random new value. Mutation is to try to break through the local optimal solution on the premise of ensuring that the original optimal solution is not destroyed. The mutation probability should be set low enough, otherwise it will affect the convergence of the entire algorithm. The process of chromosome mutation is as Figure 5 shown. The chromosome is corrected according to the priority until the solution is legal. Since the computing power and capacity resources of the edge nodes are limited, if there are illegal solutions after crossover and mutation, the solutions need to be corrected. Suppose the task has a priority of , and the task with the least resource requirements and the lowest tolerable latency is set to have the highest priority . Assume that under the current offloading strategy, an edge node that cannot meet the constraint conditions is , and the task set assigned to is . First, sort the tasks in descending order of task data volume, and record the subscript of each task in as the priority number indicating the relative task data volume size of each task; then sort the tasks in descending order of task tolerable latency, and record the subscript of each task in as the priority number indicating the relative task tolerable latency length of each task; then sort the tasks in descending order of the number of CPU cycles required for task calculation, and record the subscript of each task in as the priority number indicating the relative number of CPU cycles required for task calculation of each task. The priority is expressed by the formula: . Sort from high to low according to the priority , and modify the offloading strategy of the task with the lowest in to offload to the cloud server until can complete all tasks within the constraint conditions. For all edge nodes that cannot meet the constraint conditions, the above method is used for correction until the solution is legal. Iterate in a loop according to the above steps until convergence or the maximum number of iterations is reached.
[0050] The solution refers to the task offloading decision sequence corresponding to each chromosome in the genetic algorithm, that is, the scheme of which computing node (vehicle node, edge node or cloud server) each task is assigned to execute. A legal solution means that by correcting the offloading decision (chromosome) generated by the genetic algorithm, it meets all the constraint conditions of vehicle network task offloading, ensuring that the offloading scheme of each task is feasible in the actual system.
[0051] After obtaining the offloading decision, the offloading task is executed on the edge node or the cloud server, and the result is returned to the vehicle device after the task execution ends. Finally, the feature data of the offloading execution situation in the node feature database is updated, and the task processing efficiency is improved through vehicle-edge-cloud collaborative computing.
[0052] The task delay constraint is expressed as , where represents the processing delay after task i is offloaded to node j, represents the maximum tolerable delay of task i, represents the i-th task in the task set T, represents the task set; ensure that the actual processing time of each task does not exceed its maximum tolerable delay, and meet the delay requirements of real-time tasks in the vehicle network. For example, autonomous driving tasks need to complete calculations within a short time.
[0053] The data capacity constraint is expressed as , where represents the task set, represents the data volume required when task i is offloaded to node j, represents the total data capacity of node j, represents the j-th node in the computing node set X, represents the computing node set, ensuring that the total data volume of all tasks offloaded to node j does not exceed the storage capacity of this node, and avoiding task processing failures or node crashes caused by data overload.
[0054] The computing node computing power constraint is expressed as , where represents the number of CPU cycles required for task i to execute on node j, represents the total computing power resource of node j. Ensure that the total number of CPU cycles required for all tasks offloaded to node j does not exceed the computing power upper limit of this node, and avoid task processing delays or failures caused by computing power overload, and ensure the stable operation of the node.
[0055] S5. Use the vehicle network task offloading model to implement the offloading of offloading tasks in the vehicle network.
[0056] Next, the beneficial effects of the method in this embodiment are introduced, and the experimental comparison data of the method in this embodiment and the comparison method are provided.
[0057] The experimental scenario of this embodiment is set as follows: We use the dataset "parkingplacesofBeijing" to construct a compact distribution scenario of vehicle nodes and tasks, and use the dataset "T-drive" to construct a compact distribution scenario of edge nodes. In this embodiment, an experimental scenario consisting of 200 intelligent vehicles, 50 edge nodes, and 1 cloud server is built according to real datasets, and they are distributed within 25 kilometers centered on the longitude and latitude (116.41667, 39.91667). 10% of the malicious vehicles in the system generate malicious tasks. These tasks account for 10% of the total number of tasks, and they will preempt node resources, slow down the offloading response time, and interfere with the system.
[0058] The other experimental parameters of this embodiment are as follows: (1) Among the 200 vehicles, the available data capacity of each vehicle's on-board unit is 10 - 15 MB, the task processing rate is 0.5 - 3 GHz / s, the transmission power is 1.5 W, and the computing power is 0.5 W; (2) Among the 50 edge servers, the available computing resources of each edge server are 3 - 5 GHz, the task processing rate of the edge server is 2 - 5 GHz / s, and the task processing rate of the cloud server is 5 GHz / s; (3) Each vehicle node randomly generates 3 - 5 tasks, and the CPU cycles required for each task are 0.2 - 1.2 GHz, the data volume is 100 - 900 KB, and the maximum tolerable delay is 1 - 3 s. (4) When making offloading decisions, the number of chromosomes in each round of iteration is set to 40, and the maximum number of iterations is 100 times.
[0059] To objectively evaluate the effectiveness of the proposed method, this embodiment selects three comparison methods. The first is the comparison method Greedy (greedy algorithm). The greedy algorithm means that when solving a problem, it always makes the best choice at present. Therefore, it always preferentially selects high-priority tasks with the shortest tolerable time delay to make task offloading decisions to meet the time limit for offloading. The second is the comparison method GA (Genetic Algorithm), that is, the most basic genetic algorithm. It is a computational model that simulates the natural selection and genetic mechanism of Darwin's biological evolution theory. It includes the processes of population initialization, selection, crossover, and mutation. However, it does not consider the reliability of tasks, and the optimization goal is to minimize the energy consumption and time delay overhead of the system. The third is the comparison method DBA (Discrete Bat Algorithm), that is, the discrete bat algorithm. It is a new type of swarm intelligence bionic optimization algorithm inspired by the way bats search and prey through echolocation in nature. It does not consider the reliability of tasks, and an array of task offloading schemes is called a bat. By adjusting the bat position, generally referring to one or more specific element values in the array of offloading schemes, it explores the solution space and optimizes the system performance.
[0060] Figure 6 This is a schematic diagram comparing the system overheads of the method of this embodiment and the comparative method for 1000 consecutive iterations. As the number of iterations increases, the system cost gradually decreases and finally stabilizes. The results show that due to the interference of malicious tasks, the overhead of the method of this embodiment after 1000 iterations is significantly lower than that of the comparative method lacking task trust evaluation. Finally, compared with the comparative method DBA, the method of this embodiment reduces the overhead by an additional 14.99%.
[0061] Figure 7 This is a schematic diagram comparing the overheads of the method of this embodiment and the comparative method under different proportions of malicious tasks. For the comparative method, due to the destructive impact of malicious tasks on the normal offloading process, the total system overhead gradually increases as the proportion of malicious tasks increases. In contrast, as the proportion of malicious tasks increases, the method of this embodiment can effectively filter out these tasks, thereby gradually reducing the system overhead and minimizing interference. This shows that in the case of a relatively high proportion of malicious tasks, the method of this embodiment significantly improves the stability and reliability of the system while effectively reducing the system overhead.
[0062] Figure 8 This is a schematic diagram showing the offloading success rates of the method of this embodiment and the comparative method. The results show that even in the case of a relatively high proportion of malicious tasks, the method of this embodiment can maintain a relatively stable offloading success rate. In contrast, when faced with more malicious tasks, the success rate of the comparative method drops significantly. Specifically, when the proportion of malicious tasks is 50%, the success rate of the method of this embodiment is 46.3% higher than that of the comparative method DBA. This benefits from the comprehensive trust evaluation mechanism proposed in this embodiment, which accurately filters malicious tasks, thereby improving the overall offloading success rate of the system.
[0063] Figure 9 This is a schematic diagram comparing the energy consumption of the method of this embodiment and the comparative method. As the proportion of malicious tasks increases, the offloading energy consumption optimized by the comparative method shows an upward trend. In contrast, the method of this embodiment effectively identifies and filters false tasks through its trust evaluation mechanism, resulting in a decrease in offloading energy consumption as the proportion of malicious tasks increases. Generally speaking, compared with the comparative method DBA, the method of this embodiment exhibits superior energy consumption performance, with an average reduction in energy consumption overhead of 33%.
[0064] Figure 10It is a schematic diagram of the delay comparison between the method of this embodiment and the comparison method. When the amount of task data is less than 300KB, the delay of using each comparison method is equivalent. As the task scale continues to increase, the unloading delay of each method increases significantly. Especially in large-scale tasks, the performance difference between algorithms becomes more obvious. Specifically, the delay increase of the comparison method Greedy is the largest, followed by DBA. The method of this embodiment reduces the unloading delay by an average of 24.1% compared to the comparison method. In a large-scale task environment, the method of this embodiment exhibits superior delay performance and shows higher stability and efficiency than other methods.
[0065] Example 2 This embodiment provides a vehicle network trusted task offloading system based on elite genetic algorithm, including: The model building module is configured to build a vehicle networking task offloading model based on the vehicle networking traffic environment; The data evaluation module is configured to obtain the unloading task of the vehicle node and construct a trust evaluation function model of the unloading task by combining the data privacy, request success rate and unloading request frequency of the unloading task; The task screening module is configured to calculate the comprehensive trust value through the trust evaluation function model, add the offloading task to the trust task queue according to the evaluation result of the comprehensive trust value, obtain the offloading decision sequence and wait for the offloading decision to be delegated; The decision optimization module is configured to iteratively obtain the unloading decision sequence of the trust task queue using a genetic algorithm, and modify the chromosome according to the priority of the unloading task to meet the constraint condition, so as to obtain the optimal unloading decision; The uninstallation execution module is configured to realize the uninstallation of the uninstallation tasks in the Internet of Vehicles by utilizing the Internet of Vehicles task uninstallation model.
[0066] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for unloading trusted tasks in an Internet of Vehicles based on an elite genetic algorithm.
[0067] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor. The method for unloading trusted tasks in an Internet of Vehicles based on an elite genetic algorithm is disclosed.
[0068] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for offloading trusted tasks in Internet of Vehicles based on elite genetic algorithm, characterized in that: include: Establish an IoV traffic environment including vehicle nodes, edge nodes, cloud servers and super nodes, and build an IoV task offloading model based on the IoV traffic environment; Obtain the unloading tasks of the vehicle nodes, and build a trust evaluation function model for the unloading tasks by combining the data privacy, request success rate, and unloading request frequency of the unloading tasks. The comprehensive trust value is calculated through the trust evaluation function model, and the offloading task is added to the trust task queue according to the evaluation result of the comprehensive trust value, and the offloading decision sequence is obtained and waits for the offloading decision to be delegated; Genetic algorithm is used to iteratively obtain the unloading decision sequence of the trust task queue, and the chromosome is modified according to the priority of the unloading task to meet the constraint conditions to obtain the optimal unloading decision; The Internet of Vehicles task offloading model is used to realize the offloading of tasks in the Internet of Vehicles.
2. According to claim 1, a method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm is characterized in that: The obtaining of the unloading task of the vehicle node includes obtaining a task set and a computing node set of the vehicle, wherein the task set is , each task The characteristics of It indicates that, is the data volume of the task, The number of CPU cycles required for the task calculation, Calculate the maximum tolerable delay for the task, For the task offloading decision, the set of computing nodes is represented as , ,in Represents the total computing power resources of the computing node, Represents the total data capacity of the compute node.
3. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 1, characterized in that: The trust evaluation function model is expressed by the formula: ,in, is a weight parameter that satisfies ; The data privacy is expressed by the formula: ,in, Indicates uninstall task The amount of privacy data required, is the amount of data for the task; The request success rate is expressed by the formula: ,in, Indicates the number of successfully uninstalled tasks. Indicates the number of unloaded tasks. Assign neutral value ; The frequency of the unloading request is expressed by the formula: ,in, is the request frequency weight of the node, satisfying , Indicates the number of uninstall requests for the node. Indicates the average number of offload requests for the node.
4. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 1, characterized in that: The step of adding the offload task to the trust task queue according to the evaluation result of the comprehensive trust value includes setting the trust threshold. , the comprehensive trust value of the node With trust threshold For comparison, if , the super node rejects the task's offloading request and ends the process directly. ≥ The super node then adds the task to the trusted task queue and waits for the offloading decision to be delegated, and at the same time updates the feature data of the offloading request frequency in the node feature database.
5. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 1, characterized in that: The method of iteratively obtaining the unloading decision sequence of the trusted task queue by using a genetic algorithm includes: Initialize the population of the trusted task queue based on the trusted task queue and generate chromosomes, each chromosome corresponding to an offloading decision sequence of a task; Construct a fitness function, select chromosomes for iteration, and sort the chromosomes in ascending order according to the fitness function; Before each iteration, an elitist strategy is implemented to retain the top fitness in the current population. β % of individuals; The parent chromosome is selected from the population using the tournament selection method, and the parent chromosome is randomly selected from the population. The chromosomes are compared, and the chromosome with the lowest fitness value is retained to enter the parent set. This process is repeated until the size of the parent set is equal to the original population.
6. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 5, characterized in that: The population of the trusted task queue is initialized based on the trusted task queue to generate a chromosome, including traversing the entire chromosome and using a random function to generate the value of the gene at the current position. If the node corresponding to the value of the gene at the current position has space and computing power, the current task is executed. Otherwise, the value of the gene at the current position is regenerated until the gene is legal. Each gene in the chromosome represents the unloading destination of the corresponding task.
7. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 6 is characterized in that: The fitness function is expressed by the formula: , which is used to minimize the overhead of task offloading, where Represents the total number of tasks, It is a weight parameter calculated according to the task characteristics, which is used to achieve a dynamic trade-off between task delay and system energy consumption. represents the total energy consumption of task i offloaded to node j, Represents the total delay of offloading task i to node j.
8. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 1, characterized in that: The chromosome is corrected according to the priority of the unloading task to meet the constraint conditions, including using the uniform recombination method to perform a crossover operation on the parent chromosome to generate a child chromosome, and performing a low-probability mutation operation, and correcting the illegal solutions of the child chromosomes generated after the crossover mutation according to the task priority until all solutions meet the constraint conditions.
9. The method for unloading trusted tasks in Internet of Vehicles based on elite genetic algorithm according to claim 8, characterized in that: The constraints include task delay constraints, data capacity constraints and computing node computing power constraints; The task delay constraint is expressed as ,in, represents the processing delay after task i is offloaded to node j, represents the maximum tolerable delay of task i, represents the i-th task in the task set T, Represents a set of tasks; The data capacity constraint is expressed as ,in, Represents a set of tasks, represents the amount of data offloaded from task i to node j, represents the total data capacity of node j, Represents a collection of computing nodes The jth node in Represents a collection of computing nodes; The computing power constraint of the computing node is expressed as ,in, represents the number of CPU cycles required to execute task i on node j, Represents the total computing resources of node j.
10. A trusted task offloading system for Internet of Vehicles based on elite genetic algorithm, characterized in that: include: The model building module is configured to build a vehicle networking task offloading model based on the vehicle networking traffic environment; The data evaluation module is configured to obtain the unloading task of the vehicle node and construct a trust evaluation function model of the unloading task by combining the data privacy, request success rate and unloading request frequency of the unloading task; The task screening module is configured to calculate the comprehensive trust value through the trust evaluation function model, add the offloading task to the trust task queue according to the evaluation result of the comprehensive trust value, obtain the offloading decision sequence and wait for the offloading decision to be delegated; The decision optimization module is configured to iteratively obtain the unloading decision sequence of the trust task queue using a genetic algorithm, and modify the chromosome according to the priority of the unloading task to meet the constraint condition, so as to obtain the optimal unloading decision; The uninstallation execution module is configured to realize the uninstallation of the uninstallation tasks in the Internet of Vehicles by utilizing the Internet of Vehicles task uninstallation model.