Vehicle task unloading method and device based on multi-node cooperation and medium
By using multi-node collaboration and genetic algorithms to optimize resource allocation in vehicle task offloading, the delay and cost problems of task offloading in resource-constrained environments are solved, and the service quality and resource guarantee for emergency tasks are improved.
Patent Information
- Application Number
- CN202411054244.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-03
AI Technical Summary
The existing task unloading method optimizes global delay or energy consumption while meeting the delay constraints, making it difficult to meet the task requirements of peak periods in resource-constrained environments, and cannot distinguish the urgency and delay requirements of different tasks. This leads to poor service quality.
Using a multi-node collaboration method, by obtaining the information of the task vehicle and the service node, segmenting the task into a subtask, and allocating resources according to the dynamic preferences and resource constraints of the subtask and service nodes, optimizing resource allocation using genetic algorithms, combining Reverse learning and chaos mapping improve algorithms, optimize global delays and costs, and ensure task success rate.
It improves the service quality in resource-constrained environments, optimizes global delays and costs, ensures resource requirements for emergency tasks, and improves the utilization rate of edge resources and the overall utilization rate of resources.
Smart Images

Figure CN119071761A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a vehicle task unloading method, device and medium based on multi-node collaboration. Background Art
[0002] With the development of Internet of Vehicles technology, many new in-vehicle applications are constantly emerging. Relying solely on the capabilities of the vehicle can no longer meet the computing and storage requirements of these applications. The task offloading method has the advantages of low latency and strong reliability, and has become an effective solution to this problem.
[0003] Most existing task offloading methods aim to optimize global latency or energy consumption under the premise of satisfying task latency constraints. However, in actual scenarios, edge resources are usually not abundant. Faced with a large number of task offloading requests during peak periods, limited resources may not be able to meet the offloading needs of all tasks. In addition, on-board tasks usually have different urgency and latency requirements. For example, tasks such as pedestrian detection are directly related to vehicle driving safety and have high real-time requirements, while tasks such as audio recognition have a relatively small impact and do not have strict latency constraints, so simply optimizing the global situation is not feasible. Summary of the invention
[0004] The embodiments of the present invention provide a vehicle task offloading method, device and medium based on multi-node collaboration to solve the above technical problems.
[0005] In a first aspect, an embodiment of the present invention proposes a task offloading method based on multi-node collaboration, comprising:
[0006] Obtain information about a task vehicle and multiple service nodes on a certain road section, wherein the service nodes include edge nodes and cloud nodes, and the edge nodes include service vehicles, wireless access points, and roadside units;
[0007] According to the capability and task characteristics of the edge node, the task of the task vehicle is divided into at least one subtask;
[0008] According to the dynamic preferences of each subtask and service node, as well as the resource constraints of each service node, each subtask is assigned an offload service node;
[0009] Genetic algorithms are used to optimize the resource allocation of each edge node to each offloaded subtask, so as to reduce the global delay and cost while ensuring the task success rate.
[0010] In a second aspect, an embodiment of the present invention provides an electronic device, including:
[0011] one or more processors;
[0012] a memory for storing one or more programs,
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned vehicle task unloading method based on multi-node collaboration.
[0014] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned vehicle task unloading method based on multi-node collaboration.
[0015] The embodiment of the present invention proposes a vehicle task unloading method based on multi-node collaboration, which allocates appropriate unloading locations and resource quantities for vehicle-mounted tasks by comprehensively considering the regional computing power and the heterogeneity of tasks. The method not only considers the optimization of global delay and cost, but also considers the problem of task success rate, gives priority to ensuring the resource requirements of urgent tasks, and improves the service quality in a resource-constrained environment. Specifically, the method first uses a random unloading method to determine the adaptation problem between task complexity and regional resources, divides complex tasks into subtasks of appropriate size, and improves the utilization rate of edge resources; secondly, the subtasks and nodes are matched by a multi-round matching method. In each round of matching, the user will dynamically change his or her preferences and select the optimal unloading node to send a request to improve the utilization rate of resources. The service party will give priority to accepting tasks with high urgency and reject tasks that cannot meet resource requirements based on the accepted task unloading requests and the total amount of its own resources. Finally, this embodiment uses a genetic algorithm to solve the resource allocation problem. Since the genetic algorithm has the problems of slow convergence and easy to fall into local optimality, this embodiment combines reverse learning and chaotic mapping to improve the optimization effect of the algorithm. In order to ensure the rationality of resource allocation, the fitness function is composed of the number of task successes and the target value. While ensuring the task success rate, the global delay and cost are optimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is a network architecture diagram of a vehicle network traffic scenario provided by an embodiment of the present invention;
[0018] Figure 2 is a flow chart of a vehicle task unloading method based on multi-node collaboration provided by an embodiment of the present invention;
[0019] Figure 3 is a flowchart of task segmentation and offloading provided by an embodiment of the present invention;
[0020] Figure 4 is a flow chart of resource allocation provided by an embodiment of the present invention;
[0021] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0023] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0024] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] An embodiment of the present invention provides a vehicle task offloading method based on multi-node collaboration. In order to illustrate the method, a vehicle network traffic scenario to which the method is applicable is first introduced. Figure 1 is a network architecture diagram of a vehicle network traffic scenario provided by an embodiment of the present invention, such as Figure 1As shown, the scenario includes TaVs (Task Vehicles), RSU (Rode Site Unit), Cloud (Cloud Node) and CCNs (Crowd Computing Nodes). Among them, the cloud node can be a cloud server. RSU refers to the roadside infrastructure, which is responsible for centralized and unified task scheduling. TaVs refer to task vehicles, and each TaV carries a vehicle application task. CCNs include SeVs (Service Vehicles) and roadside APs (Access Points). This type of node joins the task offloading process in the form of crowdsourcing and provides additional computing resources. Among them, service vehicles refer to other vehicles that can provide computing resources for task vehicles. In order to accurately describe the characteristics of each vehicle, it can be modeled in a two-dimensional way, defining the road as the x-axis, the right as the positive direction, the direction of the RSU as the y-axis, and the upward direction as the positive direction, such as Figure 1 The above parts together constitute a vehicle task unloading system based on multi-node collaboration, and the system adopts a centralized decision-making method to make unified decisions.
[0026] Based on the above system architecture, the following describes the problem to be solved by this embodiment, as well as some basic parameters and calculation methods. Optionally, in the above system architecture, a set may be defined: Represents TaVs, set Represents CCNs. Each TaV will carry a vehicle mission, and the mission characteristics can be represented as a tuple Where D m is the data size of the task, including algorithm data and calculate data There are two parts: algorithm data represents the technical support required for the task, such as relevant codes or models, and computational data refers to the data that the vehicle needs to process, such as data collected by on-board sensors. m is the number of CPU cycles required for the task, represents the delay requirement of the task, θ m To meet the urgency of the task In this embodiment, the calculation data is segmented and the task is segmented into multiple subtasks. The subtask set of TaV m can be expressed as Subtasks The amount of data and computational complexity can be expressed as D r and C r , all subtasks need to be The calculation frequency of RSU can be recorded as F R , the calculation frequency of CCN n is recorded as F n .
[0027] Based on the above parameters, the vehicle position and motion mode, channel rate calculation method and resource constraints used in this embodiment are further described. Specifically, the antenna height of the RSU is recorded as h, and the coordinates are represented as (0, h). TaV m is driving at a constant speed on a horizontal road, and the initial position is represented as The speed relative to RSU is The right direction is the positive direction of velocity. Similarly, the initial position of CCN n can be expressed as The speed relative to RSU is The speed of APs is constant 0. Since the relative distance is constantly changing due to the movement of the vehicle, the variable d is defined as mn (t) represents the distance between TaV m and CCN n at time t. Similarly, the variable d mR (t) is represented by the distance between TaV m and RSU.
[0028] According to the kinematic formula, the variable d mn The calculation method of (t) is:
[0029]
[0030] Combining the Pythagorean theorem, we get d mR The calculation method of (t) is:
[0031]
[0032] Optionally, network communication uses OFDM (Orthogonal Frequency Division Multiplexing) technology, R rn (t) is the instantaneous data transmission rate when TaV m transmits subtask r to CCN n, R rR (t) is the instantaneous data transmission rate of subtask r to RSU, which can be obtained from Shannon's formula:
[0033]
[0034]
[0035] Where ρ is the channel power gain at the distance, α is the path loss exponent, P is the transmission power, and σ 2 is the noise power, B nr and B Rr are the channel bandwidths allocated by CCN n and RSU to subtask r respectively.
[0036] If subtask r of TaV m is offloaded to CCN n, define variable a rn =1, otherwise arn = 0. Similarly, if the task r of TaV m is unloaded to RSU, the variable b r =1, otherwise 0. If task r of TaV m is offloaded to Cloud, variable c r =1, otherwise c r =0.
[0037] Since the vehicle is constantly moving, the communication duration of the vehicle is limited. Define τ mn is the maximum duration that TaV m and CCN n can maintain connection. According to the kinematic formula, τ mn The calculation method of is defined as:
[0038]
[0039] Where R is the V2V transmission range under a fixed transmission power P. Q is an indicator function, which is 1 when the discriminant is true, otherwise it is 0. Sign is a sign function, a positive value indicates that the two nodes are gradually separating, otherwise it indicates that they are approaching. Since the result data of the task is relatively small, the return delay of the task is not considered.
[0040] When the task is offloaded to RSU, define is the delay of transmitting subtask r to RSU by TaV m, is the computation delay of subtask r in RSU, f Rr is the CPU resource allocated by RSU to subtask r, B Rr is the bandwidth allocated by RSU to subtask r. The sum of allocated resources cannot be greater than the total resource B R and F R , so we have:
[0041]
[0042]
[0043] When tasks are offloaded to CCNs, we define is the delay for sending subtask r to CCN n by TaV m, is the computation delay of subtask r of TaV m at CCN n, f nr is the CPU frequency assigned to r by CCN n, B nr is the bandwidth allocated to r by CCN n. The sum of the allocated resources cannot be greater than the total resources B of CCN n. n and F n , so we have:
[0044]
[0045]
[0046] When task r is offloaded to the Cloud, we define is the transmission delay of sending subtask r to Cloud by TaV m, is the computation delay of subtask r of TaV m in Cloud, f cr is the computing resource allocated by the cloud server to the task, R c is the uplink channel data rate of the task transmitted from the cellular interface to the Cloud, so we can get:
[0047]
[0048]
[0049] Combining the three cases of offloading tasks to RSU, CCN, and Cloud, the offloading delay and computing delay of subtask r can be expressed as:
[0050]
[0051]
[0052] Furthermore, in order to constrain the proportion of communication resource allocation, this embodiment clarifies the transmission costs of different nodes. Optionally, the cost of transmitting unit data to RSU, CCNs and Cloud is recorded as and Each CCN can have different cost sizes, so the transmission cost of subtask r is for:
[0053]
[0054] Similarly, to constrain the allocation of computing resources, the unit computing resource costs of RSU, CCN, and Cloud are and So we can get the computational cost of subtask r for:
[0055]
[0056] Among them, the transmission and computing costs of the cloud are much higher than the other two. In summary, the total offloading delay of subtask r and cost It can be expressed as:
[0057]
[0058]
[0059] Based on the above basic parameters and calculation methods, this embodiment aims to minimize the delay and cost of the task. The final optimization problem can be expressed in the form of P1:
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066] in, μ is the weight of the cost, C1 is the unloading action constraint of the task, C2 is the transmission delay constraint of the task, C3 is the RSU resource allocation constraint, C4 is the CCN resource allocation constraint, and C5 is the cloud server resource allocation constraint. This problem belongs to a mixed integer nonlinear programming problem, which is usually NP-hard, and the complexity increases exponentially with the increase in the number of tasks. Therefore, this embodiment uses a vehicle task unloading method based on multi-node collaboration to decompose the problem into two parts: unloading decision and resource allocation, and solves them separately.
[0067] Figure 2 This is a flowchart of a vehicle task unloading method based on multi-node collaboration provided by an embodiment of the present invention. This method is mainly used for vehicle task unloading problems in resource-constrained scenarios, aiming to optimize global latency and cost while ensuring a certain task success rate. This method not only considers the heterogeneity of tasks, but also the dynamic network topology of vehicles. This method can be executed by the RSU in the above system architecture, or by other electronic devices in the traffic scene, such as Figure 2 As shown, the method comprises the following steps:
[0068] S110, obtaining information of a task vehicle and multiple service nodes on a certain road section, wherein the service nodes include edge nodes and cloud nodes, and the edge nodes include service vehicles, wireless access points, and roadside units.
[0069] The certain road section here refers to the area that can be covered by the execution subject of the entire method (RSU or other electronic equipment). The task vehicles and service nodes in this area meet the above system architecture. This embodiment will make unloading decisions on vehicle tasks in this area based on the system architecture.
[0070] In a specific implementation, this step first obtains the basic information of the task vehicle and various service nodes in the area, including the task vehicle identification, node identification, pre-allocated resources, etc. Based on this basic information, the current TaVs set of the road section can be determined. CCNs Collection RSU and Cloud, at this time, the pre-allocated resources of RSU for the vehicle task r are f Rr =F R , B Rr =B R , the pre-allocated resources of CCN n to r are f nr =F n , B nr =B n .
[0071] S120: Divide the task of the task vehicle into at least one subtask according to the capability of the edge node and the task characteristics.
[0072] Due to the heterogeneity of onboard tasks and edge nodes, the complexity of the task may exceed the computing power of the edge node, resulting in insufficient utilization of resources. To solve this problem, this embodiment proposes a task pre-segmentation method to improve the utilization of edge resources. In a specific implementation, for any task r in TaV m, the specific segmentation process is represented by the following steps:
[0073] Step 1: Randomly select an edge node i as the unloading node of task r, that is, a ri =1 or b r =1); and according to the capacity of the offloading node, calculate the expected delay T of the task pre :
[0074]
[0075] Step 2: Based on the expected delay and the maximum tolerable delay of the task Calculate the segmentation mark. The calculation process is as follows:
[0076]
[0077] Step 3: If the segmentation mark is less than the segmentation threshold δ, the task is not segmented and the task is directly treated as a subtask. If the segmentation mark is greater than or equal to the segmentation threshold δ, the task is segmented into subtasks, and each segmented subtask is treated as a new task, and the operations of step 1 to step 3 are re-executed on it. This cycle is repeated until the segmentation marks of all minimum tasks are less than the segmentation threshold. The formula for subtask segmentation is as follows:
[0078]
[0079]
[0080] in, and Respectively represent the data volume and computational complexity of the segmented tasks, and They represent the algorithm data size and computational data size of the task before segmentation respectively.
[0081] Step 4: Use at least one minimum task that cannot be further divided as at least one subtask, including subtasks where ω<δ after each calculation of the division mark and subtasks obtained by performing a second division on the task where ω≥δ.
[0082] S130 , allocating an offloaded service node to each subtask according to the dynamic preferences of each subtask and service node, and the resource constraints of each service node.
[0083] This embodiment solves the task offloading decision for each subtask based on dynamic preferences and resource constraints. The task preference for the service node is used to describe the degree of demand for computing resources by the task generator. The preference values for CCN n, RSU and Cloud are denoted as P r (n), P r (RSU) and P r (Cloud), for users, the more computing resources are expected to be allocated and the shorter the distance with the vehicle during communication, the more users prefer this node. Due to the high transmission delay and cost of cloud servers, P r (Cloud) is always a minimum value, so the following calculation formula can be obtained:
[0084]
[0085]
[0086]
[0087] Among them, β is the weight coefficient of distance, which measures the communication status by the relative distance between the user and the node. The service node will make a comprehensive evaluation of the incoming offloading request from the two aspects of task level and task complexity. For tasks of different levels, the node will give priority to tasks with high urgency to ensure the resource requirements of critical tasks; for tasks of the same level, the node will give priority to more complex tasks to improve resource utilization. Therefore, the preference calculation method of CCN n, RSU and Cloud for subtask r is as follows:
[0088]
[0089]
[0090] P Cloud (r) = K (27)
[0091] Among them, θ m is the urgency of the task, and the property of the exponential function is used to increase the preference for urgent tasks. ξ is the adjustment coefficient, which makes the second part occupy the secondary component. The cloud server has unlimited resources and will accept all incoming tasks, so a constant K is used to represent the preference value for the task.
[0092] Since edge nodes have limited resources, in order to ensure service quality, the service provider (i.e., service node) cannot accept too many tasks and needs to meet certain computing resource requirements, which are as follows:
[0093]
[0094]
[0095] in, is the expected transmission delay of task r, calculated by bandwidth averaging. At the same time, to avoid idle nodes, each node is allowed to accept at least one task. In subsequent operations, edge node resources will selectively accept and reject tasks based on their total resources and the specific characteristics of the tasks. The cloud server has unlimited resources and will accept all tasks.
[0096] Based on the above preference calculation and resource condition constraints, S130 may include the following steps:
[0097] Step 1: Use the subtask set obtained by S120 as Initialize the rejected subtask collection The subtasks in the set are the subtasks to be uninstalled.
[0098] Step 2: For each subtask to be offloaded, a preference list consisting of each service node is constructed. Specifically, traverse Neutron tasks, for each subtask, Cloud, RSU and satisfaction The CCNs construct the preference list List1 and calculate the corresponding ranking according to the preference.
[0099] Step 3: For each service node, a preference list consisting of each subtask is constructed. Specifically, each CCN, RSU, and Cloud constructs a reverse preference list List2 for subtask r and ranks r according to the preference value.
[0100] Step 4: Each subtask to be offloaded and the service node are matched bidirectionally according to their respective preference lists and the resource constraints of each service node, and the successfully matched service node is used as the offloading node of the corresponding subtask. Optionally, each subtask to be offloaded sends a task offloading request to the service node with the highest preference in the preference list. Each service node retains the requests with the highest preference value and that meet the resource constraints according to the preference list and the total amount of resources, and rejects the remaining requests. Specifically, the set can be traversed Each subtask sends an unload request to the most preferred node; then clears the collection The service provider will accept the task offloading requests in order of preference values from high to low, and reject the tasks that cannot meet the resource constraints. If the node is fully loaded and there is a subsequent offloading request with a higher preference value, the accepted low preference value request will be replaced. Furthermore, for any service node, the incoming requests can be sorted from high to low according to the preference value; any service node traverses each sorted request and determines whether it meets the resource requirements of the current request in turn; if the resource requirements of the current request are met, the current request is accepted; otherwise, a subtask with a lower preference than the current request is extracted, and if the resource requirements of the subtask are met, the current request is replaced with the subtask, otherwise it is rejected.
[0101] Step 5: After each successful match, update each preference list according to the matching result, and perform the next match according to the new preference list; repeat this cycle until all subtasks are successfully matched. Optionally, each rejected subtask updates the preference list of each rejected subtask according to the node resources occupied by the successfully matched subtask, and resends the uninstall request according to the updated preference list; repeat this cycle until each subtask is matched to the uninstall node. Specifically, after each successful match, all rejected subtasks are added to the collection In, if The algorithm ends; otherwise, for the subtasks to be offloaded in set Q, according to the formula and Update of expected resources for CCNs and RSUs: Rebuild List1 of candidate nodes based on the updated expected resources and return to step 4. and They are used to represent the impact of tasks accepted by the service node on the remaining resources of the node. The candidate nodes refer to other nodes after excluding the nodes that have rejected the task. Since the task will not send repeated requests to the node, and the cloud server will accept all incoming tasks, the algorithm will eventually converge. The overall process is as follows Figure 3 shown.
[0102] S140. Optimize resource allocation of each service node to each offloaded subtask, so as to reduce global delay and cost while ensuring task success rate.
[0103] After completing the offloading decision, this embodiment allocates an appropriate amount of computing resources and communication resources to each task to further optimize latency and cost. Depending on the offloading node, this embodiment may include the following two situations:
[0104] Case 1: For subtasks offloaded to cloud nodes, the optimization problem of cloud-side resource allocation can be expressed as:
[0105]
[0106] This problem is a convex optimization problem. By taking the derivative, we can get the optimal resource allocation solution.
[0107] Case 2: For subtasks offloaded to edge nodes, any edge node can be represented as in Then the optimization objective of node i can be expressed as V i :
[0108]
[0109] Among them, when subtask r is offloaded to RSU, there is a rRsU =1 and b r =1. The optimization problem at this time can be reconstructed as follows:
[0110]
[0111]
[0112]
[0113] This problem has high computational complexity and no explicit analytical solution. This embodiment will be based on the genetic algorithm and improved by reverse learning and chaotic mapping to improve its solution speed and search ability. Since the resource allocation between nodes is not related, the resource allocation problem can be solved for each node separately, so that the search space is smaller and the convergence speed is faster.
[0114] In a specific implementation, each edge node may be traversed, and the following operations may be performed on each edge node in turn according to the accepted tasks:
[0115] Step 1: According to the tasks currently accepted by the edge node, the communication and computing resources are divided into fine-grained categories, and the optional resource allocation solution is defined using binary coding, that is, the basic structure of the individual sequence in the genetic algorithm is determined. Optionally, assuming that each channel is transmitted in OFDM mode, the bandwidth resources to be allocated can be composed of multiple sub-bandwidths, and the CPU resources can be allocated in time slices. Therefore, the optional bandwidth allocation ratio is defined as B ij ∈{B1,B2,...,B l}, the proportion of allocable computing resources is F ij ∈{F1,F2,...,F c}, the value range of each element is in the interval (a, b) (hereinafter, a=0, b=1 is used as an example).
[0116] Step 2: Randomly generate a certain number of individuals as the initial population. Optionally, define individual X = {x1, x2, ..., x k} represents a resource allocation solution for node i, where any element x q ∈X is represented by a binary string, which means that node i has The number of resources allocated to a task, if q%2=0, then x q represents the bandwidth allocation solution, whereas represents the computing resource allocation solution.
[0117] Step 3: Use the reverse learning method to generate the anti-individual of each individual. Optionally, in order to optimize the quality of the initial population, use the reverse learning method to obtain the anti-individual X corresponding to X = {x1, x2, ..., x3}. k}, and any element x′ in X′ q =a+bx q .
[0118] Step 4: By comparing the fitness, retain the better of the original individual and the anti-individual to form the optimized population. Optionally, retain the best one in a pair of positive individuals and anti-individuals as a population member according to the size of the fitness. In addition, in order to optimize the global delay and cost and ensure the task success rate in the process of resource allocation, the following fitness function can be constructed for node i:
[0119]
[0120] Among them, χ is the indicator function, which is 1 when the discriminant is established, otherwise it is 0; In the formula, Indicates the number of subtasks that have successfully allocated resources on the current edge node. Correspondingly, when using a custom fitness function for individual screening, first input the individual resource allocation representation into the target problem, and obtain the first part V by taking the inverse i; At the same time, compare the unloading delay of each task and the maximum tolerable delay to calculate the number of successful tasks to obtain the second part; multiply the two parts as the individual fitness size.
[0121] Step 3: Use the roulette wheel method to select a portion of excellent individuals from the optimized population. That is, based on the population obtained in step 2, the probability of being selected is further obtained according to the fitness of each individual, and a portion of them are selected as excellent individuals using the roulette wheel method.
[0122] Step 4: Perform chaotic crossover. With a given hybridization probability, exchange some chromosome fragments of each individual. When the probability hits, perform a crossover operation on the individual, where Logistics mapping is used to select the crossover point. Optionally, for each excellent individual, use Logistics mapping to obtain a chaotic sequence, map the sequence to the corresponding gene point, and exchange the gene value of the gene point according to a certain crossover probability. Specifically, first select an initial value o n ∈(0,1), according to the formula o n+1 =4o n (1-o n ) to get the chaotic sequence, and then follow Map the sequence to the chromosome gene position space so that crossover occurs at this position to form new offspring. This method only replaces some point genes, with minor changes, and can avoid the problem of optimal chattering in the population during the generation of offspring.
[0123] Step 5: Perform chaotic mutation. Use the Logistic mapping method to obtain the corresponding gene position, and randomly change the gene value at the gene position according to the mutation probability. Specifically, with a given mutation probability, randomly change some gene values from 1 to 0, or from 0 to 1. This step is similar to the previous step, and also uses the chaotic sequence method to obtain the mutation point and change the value at the point.
[0124] Step 6: Eliminate individuals that do not meet the resource constraints of the edge nodes. When the mixed threshold is met, exit the algorithm and output the individual with the highest fitness. Otherwise, return to the operation of selecting excellent individuals using the roulette wheel method. Repeat this cycle until the set termination condition is reached. In order to meet the resource allocation constraints, this step eliminates individuals that exceed the total resources, and records the best individual of this cycle. Optionally, due to the timeliness requirements of the vehicle network, the algorithm iteration process can be terminated when a certain number of cycles are met, and the best individual is used as an approximate solution for resource allocation.
[0125] In general, this embodiment improves the IGA algorithm according to the characteristics of vehicle task unloading. Its iterative process mainly includes the steps of encoding, population optimization, selection, chaotic crossover, chaotic mutation and elimination. The specific process can also be combined with Figure 4 Understand.
[0126] After S140 is completed, the unloading nodes of all subtasks in the vehicle-mounted task and the resources allocated on each unloading node can be obtained, and these information together constitute the unloading strategy of the current vehicle-mounted task. The RSU or electronic device distributes the strategy to each service node, and each service node receives each subtask according to the unloading strategy, allocates resources to each subtask and executes the subtask.
[0127] In summary, the embodiment of the present invention proposes a vehicle task unloading method based on multi-node collaboration, which allocates appropriate unloading locations and resource quantities for vehicle-mounted tasks by comprehensively considering the regional computing power and the heterogeneity of tasks. The method not only considers the optimization of global delay and cost, but also considers the problem of task success rate, gives priority to ensuring the resource requirements of urgent tasks, and improves the service quality in a resource-constrained environment. Specifically, the method first uses a random unloading method to determine the adaptation problem between task complexity and regional resources, divides complex tasks into subtasks of appropriate size, and improves the utilization rate of edge resources; secondly, the subtasks and nodes are matched by a multi-round matching method. In each round of matching, the user will dynamically change his or her preferences and select the optimal unloading node to send a request to improve the utilization rate of resources. The service party will give priority to accepting tasks with high urgency and reject tasks that cannot meet resource requirements based on the accepted task unloading requests and the total amount of its own resources. Finally, this embodiment uses a genetic algorithm to solve the resource allocation problem. Since the genetic algorithm has the problems of slow convergence and easy to fall into local optimality, this embodiment combines reverse learning and chaotic mapping to improve the optimization effect of the algorithm. In order to ensure the rationality of resource allocation, the fitness function is composed of the number of task successes and the target value. While ensuring the task success rate, the global delay and cost are optimized.
[0128] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device includes a processor 50, a memory 51, an input device 52 and an output device 53; the number of processors 50 in the device can be one or more. Figure 5 A processor 50 is taken as an example; the processor 50, memory 51, input device 52 and output device 53 in the device can be connected by a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0129] The memory 51, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for removing image motion blur based on GAN in the embodiment of the present invention. The processor 50 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 51, that is, realizing the above-mentioned method for removing image motion blur based on GAN.
[0130] The memory 51 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 51 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 51 may further include a memory remotely arranged relative to the processor 50, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] The input device 52 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 53 may include a display device such as a display screen.
[0132] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the vehicle task unloading method based on multi-node collaboration of any embodiment.
[0133] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
[0134] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0135] The program code contained on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle task unloading method based on multi-node collaboration, characterized in that: include: Obtain information about a task vehicle and multiple service nodes on a certain road section, wherein the service nodes include edge nodes and cloud nodes, and the edge nodes include service vehicles, wireless access points, and roadside units; According to the capability and task characteristics of the edge node, the task of the task vehicle is divided into at least one subtask; According to the dynamic preferences of each subtask and service node, as well as the resource constraints of each service node, each subtask is assigned an offload service node; Genetic algorithms are used to optimize the resource allocation of each edge node to each offloaded subtask, so as to reduce the global delay and cost while ensuring the task success rate.
2. The method according to claim 1, characterized in that The task of the task vehicle is divided into at least one subtask according to the capability and task characteristics of the edge node, including: Randomly select an edge node as the unloading node of the task of the task vehicle; Calculating the expected delay of the task according to the capability of the offloading node; Calculate a segmentation flag according to the expected delay and the maximum tolerable delay of the task; If the split flag is greater than or equal to the split threshold, the task is split, and the operation of randomly selecting an edge node as an unloading node is returned for the split task; this cycle is repeated until the split flags of all minimum tasks are less than the split threshold; At least one smallest task that cannot be further divided is used as at least one subtask.
3. The method according to claim 1, characterized in that The method of allocating an unloaded service node to each subtask according to the dynamic preference of each subtask and service node and the resource constraint of each service node includes: For each subtask to be offloaded, a preference list consisting of each service node is constructed, where the more resources the service node is expected to allocate and the closer the distance during communication, the higher the preference of the subtask for the service node; For each service node, a preference list consisting of each subtask is constructed, wherein the higher the urgency and complexity of the subtask, the higher the service node's preference for the subtask; Each subtask to be offloaded and the service node are matched bidirectionally according to their respective preference lists and the resource constraints of each service node, and the successfully matched service node is used as the offloading node of the corresponding subtask; After each successful match, each preference list is updated according to the matching result, and the next match is performed according to the new preference list; this cycle repeats until all subtasks are successfully matched.
4. The method according to claim 3, characterized in that: The subtasks to be offloaded and the service nodes perform bidirectional matching according to their respective preference lists and resource constraints of each service node, including: each subtask to be offloaded sends a task offloading request to the service node with the highest preference in its respective preference list; each service node retains the requests with the highest preference value and satisfying the resource constraints according to its respective preference list and the total amount of resources, and rejects the remaining requests; Accordingly, after each successful match, each preference list is updated according to the matching result, and the next match is performed according to the new preference list, including: each rejected subtask updates the preference list of each rejected subtask according to the node resources occupied by the successfully matched subtask, and resends the unloading request according to the updated preference list; this cycle is repeated until each subtask is matched to the unloading node.
5. The method according to claim 4, characterized in that The step of updating the preference list of each rejected subtask according to the node resources occupied by the successfully matched subtask includes: For any rejected subtask, according to the formula and Update the expected resources of each edge node: in, Indicates the number of subtasks that successfully matched the crowdsourcing node with index n in the previous round. The crowdsourcing nodes include service vehicles and wireless access points. Indicates the number of subtasks successfully matched with the roadside unit in the previous round; F n and B n represents the total computation frequency and channel bandwidth of the crowdsourcing node with index n, f nr and B nr represents the computing frequency and channel bandwidth assigned to subtask r by the crowdsourcing node with index n; F R and B R represents the total computation frequency and channel bandwidth of the roadside unit, f Rr and B Rr represents the computation frequency and channel bandwidth allocated by the roadside unit to subtask r; The preference list of the subtask is updated according to the updated expected resources, wherein the updated preference list only includes service nodes that have not rejected the subtask.
6. The method according to claim 4, characterized in that The service nodes retain the requests with the highest preference values and satisfying the resource constraints according to their own preference lists and total resources, and reject the remaining requests, including: For any service node, the incoming requests are sorted from high to low according to the preference value; Traverse each sorted request and determine whether the resource requirements of the current request are met; If the resource requirement of the current request is met, the current request is accepted; otherwise, a subtask with a preference lower than that of the current request is extracted, and if the resource requirement of the subtask is met, the current request is replaced with the subtask, otherwise it is rejected.
7. The method according to claim 1, characterized in that The method of optimizing the resource allocation of each edge node to each offloaded subtask by using a genetic algorithm so as to reduce the global delay and cost while ensuring the task success rate includes: For any edge node, a certain number of individuals are randomly generated as an initial population, wherein each individual is arranged by the resources allocated by any edge node for each subtask to be offloaded; Use the reverse learning method to generate the anti-individual of each individual; and by comparing the fitness, retain the better of the original individual and the anti-individual to form the optimized population; where the fitness function is constructed based on the task success rate, reducing the global delay and cost; Using the roulette wheel method, a portion of excellent individuals are selected from the optimized population; For each excellent individual, we use logistics mapping to obtain a chaotic sequence, map the sequence to the corresponding gene point, and exchange the gene value of the gene point according to a certain crossover probability; we also use logistics mapping to obtain the corresponding gene position, and randomly change the gene value at the gene position according to the mutation probability; Eliminate individuals that do not meet the edge node resource constraints. When the mixed threshold is met, exit the algorithm and output the individual with the highest fitness. Otherwise, return to the operation of selecting excellent individuals using the roulette wheel method. Repeat this cycle until the set termination condition is reached.
8. The method according to claim 1, characterized in that The method of optimizing the resource allocation of each edge node to each offloaded subtask by using a genetic algorithm so as to reduce the global delay and cost while ensuring the task success rate includes: Construct the following fitness function J i : Among them, V i represents the global delay of any edge node, N i Indicates the number of subtasks to which resources are successfully allocated on any edge node.
9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle task offloading method based on multi-node collaboration as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the vehicle task offloading method based on multi-node collaboration as described in any one of claims 1-8 is implemented.
Citation Information
Cited By
Vehicle infrastructure collaborative heterogeneous scene data optimization method based on sparse disturbance federated learning
CN119830129A
