Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the following description will be made by way of specific embodiments with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flow chart of a method for dynamically allocating edge computing resources and optimizing energy consumption in an environment of internet of vehicles according to an embodiment of the present application, where the method includes:
s101, acquiring a first vehicle group in a first lane, and predicting a first movement track of the first vehicle group in a future preset time period.
In this embodiment, the physical lanes served by the current internet of vehicles may be divided, for example, the physical lanes may be divided according to lane numbers of the physical lanes, and each physical lane obtained after division is determined as the first lane. The lane number is identification information which is preset for each physical lane and uniquely indicates the physical lane in the road planning process, and the identification information can be obtained from a file which is stored in advance and is related to the physical lane. The first lane represents a first lane with definite boundaries, functions and directions corresponding to each physical number in the Internet of vehicles environment.
In this embodiment, the operation data of each of the divided physical lanes, that is, the respective vehicles of the first lane in the preset period may be acquired in parallel every preset period, and the operation data includes the position information, the speed, and the heading angle of the vehicle.
In this embodiment, a first vehicle group in a first lane may be acquired. The method comprises the steps of determining a first vehicle group, wherein the first vehicle group can be used for representing that the space distance is similar, the running speed is similar, the running direction is basically consistent in the first vehicle, no larger interval exists on the first lane, and the number of the vehicles reaches the threshold value. The clustering result of the first lanes may be updated every a preset period of time, and a new first vehicle group may be determined. The preset time period and the number threshold value can be determined according to practical situations, and the application is not limited.
In this embodiment, the first vehicle group may include one or more first vehicle groups, and after obtaining the first vehicle groups, the same processing manner may be adopted for each first vehicle group, and the first movement track of each first vehicle group in a future preset period of time may be predicted based on the operation characteristics of each first vehicle group. The first motion trail of the first vehicle group may include coordinates of a central position of the first vehicle group in each time step in a preset time period, the first motion trail may represent an overall moving path of the first vehicle group in a future preset time period, and may be formed by connecting central positions of the first vehicle group corresponding to each time step in series, the time steps are used for representing divided minimum time units, and are used for splitting the future preset time period into a plurality of continuous and equal-length time segments, and the time steps may be determined according to actual conditions.
By the method, the motion trail of the first vehicle group can be accurately predicted, and accurate basis of time and space dimension is provided for matching and resource allocation of the subsequent edge nodes.
Step S102, a corresponding computing node set of the first lane in the car networking environment is determined, and a target node sequence corresponding to the first motion trail is determined according to load information and coverage of each node in the computing node set.
In this embodiment, a set of computing nodes corresponding to the first lane in the internet of vehicles environment may be determined. As an example, a relational database of the lanes and the edge nodes in the internet of vehicles environment may be invoked, where the database stores the mapping relation between the identification information of each lane and the corresponding edge computing node, and by retrieving the identification information of the first lane, all the edge computing nodes associated with the lane with space coverage may be obtained, so as to form a computing node set. The signal coverage of the spatial coverage correlation node is actually overlapped with the physical road section of the first vehicle road, and the length of the overlapped road section is not smaller than a length threshold value, so that the node can provide stable service for the vehicle in the first vehicle road, the length threshold value can be determined according to the actual situation, and the method is not limited.
In this embodiment, after the set of computing nodes corresponding to the first lane is obtained, load information and coverage of each node in the set may be collected. The load information may include a current CPU (central processing unit ) usage rate, a remaining memory capacity, a task queue length, a data transmission delay, and the like of the node, and the coverage area may include a geographic coordinate boundary that can be covered by the node signal, a corresponding coverage start mileage and a corresponding coverage stop mileage on the first lane, and the like.
In this embodiment, after load information and coverage of each node in the computing node set are obtained, a corresponding target node sequence may be determined according to a first motion track corresponding to the first vehicle group. The position of the center position coordinate on the first lane corresponding to the center position coordinate of the first vehicle group corresponding to each time step in the first movement track can be determined. Then, for each location, a node whose coverage includes the mileage location is selected from the computing node set as a candidate node for the time step.
In this embodiment, after obtaining the candidate node for each time step, the candidate node may be screened. As an example, a filtering condition may be set, such as the CPU usage rate not exceeding a load rate threshold, the remaining memory capacity not being smaller than a memory requirement corresponding to the first vehicle group, the task queue length not exceeding a queue length threshold, the data transmission delay not exceeding a delay threshold, and so on. And determining the candidate nodes meeting all the screening conditions as valid nodes. If a plurality of effective nodes exist in one time step, the comprehensive score of each effective node can be calculated, the comprehensive score can be calculated according to weights based on indexes such as CPU utilization rate, residual memory capacity, task queue length, data transmission delay and the like, and the effective node with the highest comprehensive score is selected as a target node of the time step. The load rate threshold, the queue length threshold, the time delay threshold and the like can be determined according to actual conditions, and the application is not limited.
In this embodiment, after determining the target node of each time step, the target nodes of each time step may be arranged in time order to form an initial node sequence. After the initial node sequence is obtained, a continuity check may be performed on the initial node sequence. Specifically, the coverage sections of the target nodes corresponding to two adjacent time steps in the initial node sequence on the first lane can be determined, the overlapping distance of the coverage sections corresponding to the two adjacent time steps on the first lane is determined, if the overlapping distance is not smaller than a second distance threshold, smooth switching between the two target nodes can be achieved, if the overlapping distance is smaller than the second distance threshold and the target nodes corresponding to the two time steps are different, whether one of the two target nodes simultaneously meets the screening conditions corresponding to the first vehicle group in the two time steps is further determined, and if one node meets the conditions, the node meeting the conditions can be determined as the target node corresponding to the two time steps. And the node sequence formed after the adjustment of the continuity check sum is the target node sequence corresponding to the first motion trail.
By determining the computing node set and screening out the target node sequence, the first vehicle group can be ensured to be provided with the service by the appropriate edge computing nodes all the time within the future preset time period, the continuity and stability of the service are ensured, and the reliability of edge computing resource allocation in the environment of the Internet of vehicles is improved.
Step S103, if the energy consumption value of the first node in the target node sequence exceeds the energy consumption threshold, determining a migration task of the first node and a target migration node corresponding to the first node, and migrating the migration task to the target migration node.
In this embodiment, the energy consumption value of each node in the target node sequence may be monitored in real time, and when it is monitored that the energy consumption value of the first node exceeds the energy consumption threshold, the task migration mechanism may be started. As an example, the energy consumption value of the first node may include calculating a sum of energy consumption, data transmission energy consumption and device standby energy consumption, and the energy consumption threshold may be determined based on a hardware parameter, an energy efficiency level and historical operation data of the first node, which is not limited by the present application.
In this embodiment, after determining that the startup task migration mechanism needs to be performed, the migration task of the first node may be determined. All tasks currently operated by the first node can be prioritized according to real-time performance, and the prioritization can be based on factors such as response time requirements of the tasks, influence degree on running safety of the vehicle group and the like. For example, tasks such as real-time position calculation of a vehicle group, emergency brake signal processing, etc. may be classified as high priority tasks, and tasks such as historical track data backup, non-critical performance statistics, etc. may be classified as low priority tasks. The low-priority tasks with priorities lower than the preset priority threshold can be determined as migration tasks, and the total calculation force requirements of the migration tasks do not exceed the preset percentage of the current total calculation force requirements of the first node, so that the influence of migration of a large number of tasks on the processing efficiency of the first node on the high-priority tasks is avoided. The preset percentage can be determined according to practical situations, for example, the preset percentage can be 30%.
In this embodiment, after determining the migration task, the target migration node corresponding to the first node may be determined. The target migration nodes can be preferentially screened from the target node sequence, so that stability of data transmission is guaranteed, the target migration nodes have enough resources to accept migration tasks, storage requirements of the migration tasks can be met, and data transmission delay in the task migration process is reduced.
In this embodiment, after determining the target migration node, the migration task may be migrated to the target migration node. After the migration is completed, the computing resources, the storage resources and the communication resources corresponding to the migration task in the first node can be released, so that the energy consumption of the first node is reduced.
Through the task migration process, partial tasks can be migrated to the proper target migration nodes in time under the condition that the energy consumption of the first node exceeds the standard, so that the continuity and reliability of vehicle group service are ensured, the energy consumption of the first node is effectively reduced, and the dynamic allocation and energy consumption optimization of edge computing resources in the environment of the Internet of vehicles are realized.
In one embodiment of the application, acquiring a first vehicle group in a first lane includes:
acquiring running data of a vehicle in a first lane, wherein the running data comprises position information, speed and course angle of the vehicle;
Determining Euclidean distance, speed difference and course angle difference between any two adjacent vehicles in a first lane according to the operation data, and clustering the vehicles in the first lane according to a first constraint condition to obtain class clusters;
Wherein the first constraint comprises:
the Euclidean distance is smaller than or equal to a first distance threshold, the speed difference value is smaller than or equal to a speed threshold, the course angle difference value is smaller than or equal to an angle threshold, and the number of vehicles in the cluster is larger than or equal to a number threshold.
In this embodiment, the operation data of all the vehicles in the first lane may be collected in real time. Wherein the operational data includes position information, speed and heading angle of the vehicle, and the position information of the vehicle may include longitude and latitude coordinates of the vehicle.
In the present embodiment, after the operation data is acquired, the euclidean distance, the speed difference value, and the heading angle difference value between any two adjacent vehicles in the first lane may be calculated based on the operation data. Specifically, the Euclidean distance refers to the linear distance of the coordinates of the two vehicles on the first lane, the speed difference refers to the difference between the absolute values of the real-time speeds of the two vehicles, and the heading angle difference refers to the difference between the absolute values of the heading angles of the two vehicles.
In this embodiment, the clustering processing may be performed on the vehicles in the first lane according to the first constraint condition, to obtain the class cluster. The first constraint condition comprises that the Euclidean distance between any two vehicles is smaller than or equal to a first distance threshold, for example, the first distance threshold can be 10 meters, the vehicles are ensured to be in a relatively close range in space, the speed difference value between any two vehicles is smaller than or equal to a speed threshold so as to ensure that the running speeds of the vehicles are similar, the heading angle difference value between any two vehicles is smaller than or equal to an angle threshold so as to ensure that the running directions of the vehicles are basically consistent, the number of the vehicles in a cluster is larger than or equal to a number threshold, for example, the number threshold can be 3, and the vehicles with a certain scale are ensured to be formed. The first distance threshold, the speed difference value, the angle threshold and the quantity threshold can be determined according to the actual condition of the first road, and the application is not limited.
In the present embodiment, the vehicle group corresponding to each of the class clusters satisfying the first constraint condition may be determined as the first vehicle group. If a plurality of class clusters meeting the conditions exist in the first lane, each class cluster corresponds to an independent first vehicle group, and then motion trail prediction and edge node matching are carried out on each first vehicle group independently.
Through the clustering processing based on the multidimensional constraint condition, the vehicle group with the cooperative motion characteristic in the first lane can be accurately identified, and an accurate service object division basis is provided for the targeted distribution of the edge computing resources of the follow-up internet of vehicles.
In one embodiment of the present application, predicting a first motion profile of a first vehicle group over a predetermined time period in the future includes:
Determining operation characteristics of a first vehicle group, wherein the operation characteristics comprise average speed, speed standard deviation, average course angle, course angle standard deviation, average inter-vehicle distance, inter-vehicle distance standard deviation, lane keeping probability, vehicle density and length of the first vehicle group of each vehicle in the first vehicle group in each time step;
And determining a first movement track of the first vehicle group in a future preset time period according to the pre-trained first graph neural network, wherein the first movement track comprises the central position coordinates of the first vehicle group in each time step in the future preset time period.
In this embodiment, the operation characteristics of the first vehicle group may be determined, and the operation characteristics may include an average speed, a standard deviation of speed, an average heading angle, a standard deviation of heading angle, an average inter-vehicle distance, a standard deviation of inter-vehicle distance, a lane keeping probability, a vehicle density, and a length of the first vehicle group of each vehicle in each time step, and are used to comprehensively characterize the overall motion state characteristics of the first vehicle group. The running characteristics of the first vehicle group can be determined by calculating the average speed of each vehicle in the first vehicle group in each time step in the preset time period monitored currently, the overall running speed of the first vehicle group can be reflected, calculating the speed standard difference corresponding to the deviation degree of all the vehicle speeds and the average speed in each time step, which means that the vehicle speeds are consistent, calculating the average value of all the vehicle heading angles in the first vehicle group in each time step to obtain the average heading angle, reflecting the overall running direction of the vehicle group, calculating the deviation degree of all the vehicle heading angles and the average heading angle in each time step to obtain the heading angle standard difference, which means that the running direction is more uniform, calculating the average value of the Euclidean distance between adjacent vehicles in the first vehicle group in each time step to obtain the average vehicle distance, reflecting the overall density of the vehicle group, calculating the deviation degree of the adjacent vehicles in the first vehicle group in each time step from the average vehicle distance, which means that the vehicle heading distance is more uniform, calculating the vehicle heading distance between the adjacent vehicles in the first vehicle group is more than the first vehicle group, calculating the vehicle heading distance between the vehicles in the first vehicle group is more than the lane, and the vehicle in the vehicle group is more than the lane length, and the vehicle in which the vehicle is kept in the lane is more than the lane, and the vehicle is calculated, and the vehicle in which the vehicle position is kept in the lane is more than 10 is calculated, and the vehicle position is kept according to the vehicle in the first lane is more than the first lane, and the vehicle position is calculated, and the vehicle position is more than the vehicle in the length is more than the vehicle is calculated, and the vehicle is kept, and the distance is kept, the distance is stable.
In this embodiment, after the above-mentioned running characteristic is obtained, it may be input to the first graph neural network to be trained so as to predict the first movement track of the first vehicle group in a future preset period. The first graphic neural network is trained based on vehicle group operation sample data in a first lane. The operation features can be input into a pre-trained first graphic neural network, the first graphic neural network comprises an input layer, a first hiding layer, a second hiding layer and an output layer, the input layer is used for receiving the operation features corresponding to the continuous time steps, the first hiding layer is 64-dimensional, the internal association features of the first vehicle group are extracted by adopting a graph rolling network, the second hiding layer is 32-dimensional and is embedded into an attention mechanism to strengthen the influence weight of a head vehicle in the first vehicle group on a first vehicle group track, the output layer outputs a first motion track of the first vehicle group in a future preset time period, and the first motion track comprises the central position coordinates of the first vehicle group in each time step in the future preset time period.
By combining the multidimensional operation characteristics of the first vehicle group and the time sequence prediction capability of the first neural network, the overall motion trend of the first vehicle group can be accurately captured, so that the predicted first motion trail not only accords with the running characteristics of individual vehicles, but also reflects the cooperative rule of the vehicle group, and a reliable time-space basis is provided for the dynamic matching of the follow-up edge nodes.
In one embodiment of the present application, determining a target node sequence corresponding to a first motion trail according to load information and coverage of each node in a computing node set includes:
For each time step in a future preset time period, determining the central position coordinate of a first vehicle group corresponding to the first movement track in the time step; the method comprises the steps of determining a first position range of a first vehicle group corresponding to a time step according to a central position coordinate, selecting at least one first candidate node with coverage area containing the first position range from a calculation node set, and determining a target node corresponding to the time step according to the load rate, the residual memory capacity, the task queue length and the average data packet delay of the first candidate node;
according to the sequence of time steps in a preset time period in the future, sequentially arranging target nodes corresponding to the time steps to obtain a target node sequence;
if the target nodes corresponding to two adjacent time steps in the target node sequence are different, and the overlapping distance of the coverage areas of the target nodes corresponding to two adjacent time steps is smaller than a second distance threshold, selecting a second position range of which the coverage areas comprise the first vehicle group and correspond to two adjacent time steps from the target nodes corresponding to two adjacent time steps, wherein the load rate is smaller than or equal to a load rate threshold, the residual memory capacity is larger than or equal to the memory requirement corresponding to the first vehicle group, the task queue length is smaller than or equal to a queue length threshold, and the average data packet delay is smaller than or equal to the node of the delay threshold.
In this embodiment, for each time step within the future preset time period, the center position coordinates of the first vehicle group corresponding to the first movement locus in the time step may be determined. As an example, if the time step is 1 second and the future preset time period is 5 seconds, the center position coordinate corresponding to the 5 th time step, that is, the center position coordinate of the first vehicle group at the 5 th second after the start of the prediction.
In this embodiment, a first location range corresponding to the time step of the first vehicle group may be determined according to the center location coordinate. Specifically, the central position coordinate is taken as a reference point, the running characteristics of the first vehicle group are combined, if the length of the first vehicle group is 80 meters, the maximum transverse width of all vehicles of the first vehicle group is 5 meters, the central position coordinate is taken as the center, the first vehicle group extends forwards and backwards for 40 meters respectively, the first vehicle group extends leftwards and rightwards for 2.5 meters respectively, the transverse width of the first vehicle group is covered, a rectangular area is formed, a certain fluctuation threshold value can be added on the basis of the rectangular area for dealing with possible small lane changes or speed fluctuation of the vehicles, for example, the fluctuation threshold value can be set to be a 10% redundancy range, the length of the rectangular area can be respectively extended forwards and backwards for 4 meters respectively based on the center according to the fluctuation threshold value, the rectangular area extends leftwards and rightwards for 0.25 meter respectively based on the center, and finally the formed area is the first position range of the time step, and the first position range can cover possible positions of all vehicles in the first vehicle group in the time step.
In this embodiment, at least one first candidate node whose coverage includes a first location range may be selected from the set of computing nodes. If the circular area of the first location range falls completely within the coverage of a node, the node is selected as a first candidate node.
In this embodiment, the target node corresponding to the time step is determined according to the load rate, the remaining memory capacity, the task queue length, and the average packet delay of the first candidate node. The target nodes can be screened according to the following rules, wherein the nodes with the load rate smaller than or equal to a preset load rate threshold, the residual memory capacity larger than or equal to the memory requirement corresponding to the single time step of the first vehicle group, the task queue length smaller than or equal to a preset queue length threshold and the average data packet time delay smaller than or equal to a preset time delay threshold can be reserved. If a plurality of nodes exist, the comprehensive score of each node is calculated, if the weighted sum of the respective scores of the load rate, the residual memory capacity, the task queue length and the average data packet delay of each node can be determined as the comprehensive score, and the node with the highest comprehensive score can be selected as the target node. The load rate, the remaining memory capacity, the task queue length, and the weight of the average data packet delay can be determined according to actual situations, which is not limited by the present application.
In this embodiment, the target nodes of each time step may be sequentially arranged according to the sequence of the time steps in the preset time period in the future, so as to obtain an initial target node sequence.
If two adjacent time steps in the target node sequence are respectively corresponding to different target nodes, and the overlapping distance of the coverage areas of the two target nodes is smaller than a second distance threshold, whether the target node sequence is updated or not needs to be determined. In particular, a second range of positions for the first group of vehicles in the two adjacent time steps may be determined first. The second position range may be defined according to the center position coordinates of the first vehicle group respectively corresponding to the two time steps and the maximum lateral width of the first vehicle group, where the position ranges respectively corresponding to the two time steps may be determined based on the method of defining the first position range, and the aggregate of the position ranges respectively corresponding to the two time steps may be determined as the second position range. From the two target nodes, whether the coverage area of one node contains the second position range or not can be determined, and the condition that the load rate is smaller than or equal to a load rate threshold value, the residual memory capacity is larger than or equal to a memory requirement corresponding to a first vehicle group, the task queue length is smaller than or equal to a queue length threshold value, and the average data packet delay is smaller than or equal to a delay threshold value is met; if one node meets the above screening conditions, the node can be determined to be the updated target node corresponding to the two adjacent time steps respectively, and if both nodes meet the above conditions, one node with a larger load rate can be selected to be determined to be the updated target node corresponding to the two adjacent time steps respectively. For example, if the target nodes corresponding to adjacent time steps are the edge node R1 and the edge node R2, respectively, the second distance threshold is 35 meters, if the overlapping distance of the two coverage areas is 30 meters, and is smaller than the second distance threshold, if the coverage area of R2 includes the second position range corresponding to the first vehicle group, and R2 satisfies the memory requirement corresponding to the first vehicle group, the task queue length is smaller than or equal to the queue length threshold, and the average packet delay is smaller than or equal to the delay threshold, the target nodes of the two time steps are updated to R2, and then the whole target node sequence is adjusted based on the updated target nodes.
Through the steps, the target node sequence can be ensured to be attached to the motion track of the first vehicle group, service continuity can be maintained during node switching, and stable node support is provided for dynamic resource allocation calculated by the edge of the Internet of vehicles.
In one embodiment of the present application, determining a target node corresponding to a time step according to a load rate, a remaining memory capacity, a task queue length, and an average packet delay of a first candidate node includes:
determining nodes with the load rate smaller than or equal to a load rate threshold value, the residual memory capacity larger than or equal to the memory requirement corresponding to the first vehicle group, the task queue length smaller than or equal to a queue length threshold value and the average data packet delay smaller than or equal to a delay threshold value in the first candidate nodes as second candidate nodes;
and if the second candidate node comprises a plurality of nodes, calculating the resource fitness score of each second candidate node, and determining the second candidate node with the highest resource fitness score as the target node corresponding to the time step.
In this embodiment, the second candidate node corresponding to the time step may be determined according to the load rate, the remaining memory capacity, the task queue length, and the average packet delay of the first candidate node. Specifically, the nodes meeting the screening conditions in the first candidate nodes can be determined as the second candidate nodes, wherein the screening conditions can include that the load rate is smaller than or equal to a load rate threshold, the residual memory capacity is larger than or equal to the memory requirement corresponding to the first vehicle group, the task queue length is smaller than or equal to a queue length threshold, and the average data packet delay is smaller than or equal to a delay threshold.
In this embodiment, after the second candidate node is obtained, the target node corresponding to the time step may be determined according to the number of second candidate nodes. If the second candidate node comprises a plurality of nodes, the resource adaptation degree score of each second candidate node can be calculated, and the node with the highest resource adaptation degree score is determined as the target node. The calculation of the resource fitness score may be performed in combination with the weights of the parameters. For example, the weights corresponding to the parameters may be determined according to the actual situation, for example, the weight of the load factor may be set to 30%, the weight of the remaining memory capacity is set to 20%, the weight of the task queue length is set to 20%, and the weight of the average packet delay is set to 30%. In the concrete calculation, the difference between the value 1 and the first ratio can be determined as a score of the load rate by determining the first ratio between the current load rate and the load rate threshold, the ratio of the current residual memory capacity to the residual memory capacity required by the vehicle group memory is determined as a score of the residual memory capacity, the second ratio between the current queue length and the queue length threshold is determined, the difference between the value 1 and the second ratio is determined as a score of the task queue length, the third ratio between the average data packet delay and the delay threshold is determined, the difference between the value 1 and the third ratio is determined as a score of the average data packet delay, and the weighted sum of the scores and the weights corresponding to each other can be determined as a resource fitness score.
By determining the second candidate node and the target node in the above manner, the screened nodes can be ensured to meet the requirements of the first vehicle group in the aspects of load, memory, task processing capacity, transmission delay and the like, meanwhile, the optimal solution is selected from the plurality of candidate nodes through the resource adaptation degree scoring, accurate and stable edge computing service is provided for the vehicle group, and the rationality and reliability of resource allocation in the vehicle networking environment are improved.
In one embodiment of the present application, if the energy consumption value of the first node in the target node sequence exceeds the energy consumption threshold, determining a migration task of the first node and a target migration node corresponding to the first node, and migrating the migration task to the target migration node includes:
Monitoring energy consumption values corresponding to all nodes in the target node sequence in all time steps;
if the energy consumption value of the first node in the continuous first number of time steps exceeds the energy consumption threshold, determining a non-real-time task with the priority lower than a preset threshold in the first node as a migration task;
determining a node meeting a second constraint condition in the target node sequence as a candidate migration node, and determining a node with the minimum load rate in the candidate migration node as a target migration node, wherein the second constraint condition is as follows:
the overlapping distance corresponding to the coverage of the first node is greater than or equal to a third distance threshold;
the current load rate is less than or equal to the load rate threshold;
the residual memory capacity is larger than or equal to a first multiple of the memory corresponding to the migration task;
the communication delay corresponding to the migration path between the first nodes is less than or equal to the delay threshold.
In this embodiment, the energy consumption value corresponding to each node in the target node sequence at each time step may be monitored. The energy consumption value can be the sum of energy consumption corresponding to the calculated energy consumption, the data transmission energy consumption and the equipment standby energy consumption. The energy consumption generated by the CPU, GPU (graphic processor, graphics Processing Unit) and other computing components when the energy consumption finger node processes the task can be calculated according to the power of the computing components and the task processing time, the energy consumption generated by the communication module when the data transmission energy consumption finger node performs data interaction with the first vehicle group and other nodes can be determined based on the data transmission quantity, the transmission rate and the power of the communication module, and the basic energy consumption when the equipment waits for the energy consumption finger node to be in an operation state but does not process the task is determined by the hardware parameters of the equipment. The three types of energy consumption can be collected in real time, and the sampling frequency is consistent with the time step.
And if the energy consumption value of the first node in the continuous first number of time steps exceeds the energy consumption threshold, starting a determining flow of the migration task. As an example, the first number may be set to 3 time steps and the energy consumption threshold may be set based on the power rating and energy efficiency criteria of the first node. When the energy consumption values of the first node in the 5 th, 6 th and 7 th continuous time steps are respectively exceeding the energy consumption threshold values, a task migration mechanism can be started. At this time, the non-real-time task with the priority lower than the preset threshold in the first node may be determined as the migration task. Tasks may be classified according to service types, for example, tasks directly related to driving safety, such as real-time navigation data processing of a vehicle, emergency braking signal response and the like, are high priority, tasks such as historical track storage, non-critical performance statistics and the like are low priority, the low priority tasks are determined to be migration tasks, the total calculation force requirement of the migration tasks does not exceed a preset percentage of the current total calculation force of the first node, the processing of the high priority tasks is prevented from being influenced, the preset percentage may be determined according to actual conditions, and for example, the preset percentage may be set to 30%.
In this embodiment, after determining the migration task, a node that satisfies the second constraint condition may be selected from the target node sequence as a candidate migration node, and a node in which the load rate is minimum may be determined as the target migration node. The second constraint condition comprises that the overlapping distance corresponding to the coverage area of the first node is larger than or equal to a third distance threshold, enough overlapping exists between a service area of the node and the position range of the first vehicle group, service interruption risk of the first vehicle group is reduced, the current load rate is smaller than or equal to a load rate threshold, sufficient redundant resources of candidate nodes are guaranteed to accept a migration task, the residual memory capacity is larger than or equal to a first multiple of a memory corresponding to the migration task, such as 1.2 times, if the migration task needs 1GB of memory, the residual memory of the candidate nodes is larger than or equal to 1.2GB, storage requirements of the migration task are met, communication time delay corresponding to a migration path between the candidate nodes is smaller than or equal to a time delay threshold, such as 30ms, rapid transmission of task data is guaranteed, and migration time consumption is reduced.
After the target migration node is determined, related data of the migration task, including a task program, an intermediate calculation result, a progress mark and the like, can be transmitted to the target migration node through the encrypted data transmission channel, and after the target migration node completes environment deployment and confirms that the task can be taken over, the operation of the migration task on the first node is stopped, and the migration task is continuously executed by the target migration node. After the migration is completed, the energy consumption value of the first node can be obviously reduced, and the service continuity is ensured while the energy consumption optimization is realized.
Through the process, the migration task and the target node can be accurately screened under the condition that the energy consumption of the node exceeds the standard, so that the high-priority task is prevented from being influenced, the stability of the target node after migration is ensured through the load rate minimization principle, and the requirements of the service quality and the energy consumption control of the Internet of vehicles are effectively balanced.
In one embodiment of the present application, if there is no candidate migration node satisfying the second constraint condition in the target node sequence, selecting a node satisfying the second constraint condition from a standby node pool whose overlapping distance corresponding to the coverage area of the first node is greater than or equal to a third distance threshold, and determining the node as the candidate migration node;
If the candidate migration nodes meeting the second constraint condition do not exist in the standby node pool, the migration task is split into a plurality of subtasks, and the subtasks are respectively migrated to the adjacent nodes of the first node with the load rate smaller than or equal to the load rate threshold value.
In this embodiment, the standby node pool may be invoked when no node in the target node sequence satisfies the second constraint. The standby node pool is a pre-deployed redundant edge node set, and comprises a temporary deployed mobile edge terminal, a road side unit of a peripheral non-main road and the like, wherein the coverage area of the standby node pool needs to be overlapped with the first node to a certain extent. Nodes with overlapping distance with the coverage of the first node greater than or equal to a third distance threshold can be screened from the standby node pool, whether the nodes meet other requirements in the second constraint condition, such as load rate, memory, time delay and the like, and the nodes which are met simultaneously are determined to be candidate migration nodes.
If the candidate migration nodes meeting the second constraint condition still do not exist in the standby node pool, splitting processing can be carried out on the migration task. The migration tasks are split into a plurality of subtasks according to the calculation force demand proportion, the calculation force demand of each subtask does not exceed a preset proportion threshold value, such as 30%, of the total demand of the original migration tasks, after the migration tasks are split, the subtasks are respectively migrated to adjacent nodes of the first node, and the adjacent nodes are required to meet the load rate which is smaller than or equal to the load rate threshold value. Wherein the adjacent node characterizes an edge node which overlaps with the coverage area of the first node by a distance greater than or equal to a third distance threshold and has a geographic distance less than or equal to a preset fourth distance threshold. During migration, the subtask computing force received by each adjacent node is required to be ensured not to exceed the preset percentage, such as 30%, of the remaining computing force, so that overload of load caused by excessive receiving is avoided, the third distance threshold and the fourth distance threshold can be determined according to actual conditions, and the method is not limited.
In this embodiment, in the subtask migration process, an independent encrypted data channel may be established for each subtask, corresponding task data is synchronized, and after the adjacent nodes complete the environmental deployment, the subtask execution is respectively started. After migration is completed, all the subtasks run in parallel on adjacent nodes, and finally, the calculation results are summarized and fed back to the first node or the first vehicle group, so that the service logic is ensured to be complete. For example, the split 3 sub-tasks are respectively migrated to the adjacent nodes N-1, N-2 and N-3, and after the completion, the results are summarized and returned by the node N-1, so that the overall effect of the migrated tasks is not affected.
Through the hierarchical processing strategy, when the target node sequence and the standby node pool are not provided with proper nodes, migration can still be realized through task splitting, so that not only is the risk of overhigh single node load avoided, but also the continuity of migration tasks is ensured, the robustness of the internet-of-vehicles edge computing energy consumption optimization scheme is further improved, and the method is suitable for complex and changeable road scenes.
In one embodiment of the application, if a condition that cluster aggregation is not satisfied or a first constraint condition that a divided cluster does not satisfy a first vehicle group exists in a first lane, the vehicles can be used as independent individuals to establish independent identification files, operation data such as position information, speed and course angle of the vehicles are collected and updated in real time, data sampling frequency is consistent with that of the first vehicle group, monitoring granularity is guaranteed to be equivalent, a prediction model suitable for the individuals such as a single vehicle track prediction algorithm based on Kalman filtering is adopted, the central position of the group is not required to be calculated, individual motion tracks of each vehicle in a preset time period are directly predicted, time steps are kept synchronous with the time steps of the first vehicle group, and when edge nodes are matched, the constraint condition that space coverage is relaxed is that for the independent vehicles, the node coverage only needs to contain individual position coordinates, and the overlapping length of the coverage and a vehicle running path is larger than or equal to a preset path threshold, the path threshold can be determined through actual conditions, the method is not limited, such as 30m, on resource allocation, the load quantity is calculated according to actual requirements of the individuals, and the node coverage rate is improved by the node threshold, and the load is guaranteed to be suitable for a load rate, such as a load rate is guaranteed by the load rate of the threshold.
In this embodiment, all vehicles in the first lane may be classified again at preset time intervals, and meanwhile, the vehicles that do not form the effective clusters are dynamically tracked, and if the first constraint condition is satisfied, the vehicles are clustered into a first vehicle group, and the first vehicle group management flow is included, and if the first constraint condition is not satisfied, the individual management is kept until the vehicles leave the first lane.
Through the processing, not only can all vehicles in the first lane be ensured to obtain edge calculation service, but also resource waste can be avoided through a differentiated management strategy, so that the scheme can still operate efficiently under the scene of sparse traffic flow or scattered vehicle distribution, and the service requirements of all vehicles in the road are covered.
It should be further noted that one or more first lanes may exist in the present application, one or more first vehicle groups may also exist in the first lanes, each first vehicle group in each first lane corresponds to a first motion track in a preset future time period, each first motion track corresponds to a target node sequence, energy consumption thresholds corresponding to each target node sequence may be the same or different, it may be determined whether an energy consumption value in each target node sequence exceeds an energy consumption threshold corresponding to the target node sequence, and if an energy consumption value of one first node existing in one target node sequence exceeds the energy consumption threshold, a migration task of the first node and a target migration node corresponding to the first node may be determined, and the migration task may be migrated to the target migration node.
Corresponding to the method for dynamically allocating and optimizing the edge computing resources in the internet of vehicles according to the above embodiment, fig. 2 is a block diagram of a system for dynamically allocating and optimizing the edge computing resources in the internet of vehicles according to an embodiment of the present application. For convenience of explanation, only portions relevant to the embodiments of the present application are shown. Referring to fig. 2, the system 20 for dynamically allocating and optimizing edge computing resources in an internet of vehicles environment comprises a prediction module 21, a determination module 22 and a migration module 23.
The prediction module 21 is configured to obtain a first vehicle group in a first lane, and predict a first motion track of the first vehicle group in a future preset time period;
The determining module 22 is configured to determine a corresponding computing node set of the first lane in the internet of vehicles environment, and determine a target node sequence corresponding to the first motion trail according to load information and coverage of each node in the computing node set;
the migration module 23 is configured to determine a migration task of the first node and a target migration node corresponding to the first node if the energy consumption value of the first node in the target node sequence exceeds the energy consumption threshold, and migrate the migration task to the target migration node.
In one embodiment of the present application, the prediction module 21 is further configured to obtain operation data of vehicles in the first lane, where the operation data includes position information, speed and heading angle of the vehicles, determine operation data to determine a euclidean distance, a speed difference value and a heading angle difference value between any two adjacent vehicles in the first lane, perform clustering processing on the vehicles in the first lane according to a first constraint condition to obtain clusters, and determine a vehicle group corresponding to each cluster as a first vehicle group, where the first constraint condition includes that the euclidean distance is less than or equal to a first distance threshold, the speed difference value is less than or equal to a speed threshold, the heading angle difference value is less than or equal to an angle threshold, and the number of vehicles in the clusters is greater than or equal to a number threshold.
The prediction module 21 is further configured to determine an operation characteristic of the first vehicle group, where the operation characteristic includes an average speed, a standard deviation of speed, an average heading angle, a standard deviation of heading angle, an average distance between vehicles, a standard deviation of distance between vehicles, a lane keeping probability, a vehicle density, and a length of the first vehicle group, and determine a first movement track of the first vehicle group in a future preset time period according to the first graph neural network, where the first movement track includes coordinates of a center position of the first vehicle group in each time step in the future preset time period.
The determining module 22 is further configured to determine, for each time step in a preset time period in the future, a center position coordinate of a first vehicle group corresponding to the first motion track in the time step, determine a first position range corresponding to the first vehicle group in the time step according to the center position coordinate, select at least one first candidate node whose coverage range includes the first position range from the computing node set, determine a target node corresponding to the time step according to a load rate, a remaining memory capacity, a task queue length and an average packet delay of the first candidate node, sequentially arrange second candidate nodes of each time step according to a sequence of time steps in the preset time period in the future, and obtain a target node sequence, wherein if the target nodes corresponding to two adjacent time steps in the target node sequence are different, and an overlapping distance of the coverage ranges of the target nodes corresponding to the two adjacent time steps is smaller than a second distance threshold, select the target node corresponding to the coverage range including the first vehicle group corresponding to the two adjacent time steps from the target nodes corresponding to the two adjacent time steps, and the load rate is smaller than or equal to the load rate threshold, the remaining memory capacity is greater than or equal to the first queue length and the average packet delay is smaller than or equal to the target queue length, and the time delay is determined to be equal to the target packet length after the target queue length is smaller than the target queue is equal to the threshold is updated to the target node.
The determining module 22 is further configured to determine, as a second candidate node, a node in the first candidate node having a load rate less than or equal to a load rate threshold, a remaining memory capacity greater than or equal to a memory requirement corresponding to the first vehicle group, a task queue length less than or equal to a queue length threshold, and an average packet delay less than or equal to a delay threshold, determine the second candidate node as a target node of a time step if the second candidate node includes only one node, and calculate a resource fitness score of each second candidate node if the second candidate node includes a plurality of nodes, and determine a second candidate node with a highest resource fitness score as a target node corresponding to the time step.
The migration module 23 is further configured to monitor energy consumption values corresponding to each node in the target node sequence in each time step, determine that a non-real-time task with a priority lower than a preset threshold in the first node is a migration task if the energy consumption value of the first node in a continuous first number of time steps exceeds an energy consumption threshold, determine that a node meeting a second constraint condition in the target node sequence is a candidate migration node, and determine that a node with a minimum load rate in the candidate migration node is a target migration node, where the second constraint condition is that an overlapping distance corresponding to a coverage area of the first node is greater than or equal to a third distance threshold, a current load rate is less than or equal to a load rate threshold, a remaining memory capacity is greater than or equal to a first multiple of a memory corresponding to the migration task, and a communication delay corresponding to a migration path between the first nodes is less than or equal to a delay threshold.
The migration module 23 is further configured to select, from a standby node pool having an overlapping distance greater than or equal to a third distance threshold corresponding to a coverage area of the first node, a node satisfying the second constraint condition as a candidate migration node if there is no candidate migration node satisfying the second constraint condition in the target node sequence, split the migration task into a plurality of subtasks, and migrate the subtasks to neighboring nodes of the first node having a load rate less than or equal to the load rate threshold, respectively, if there is no candidate migration node satisfying the second constraint condition in the standby node pool.
Referring to fig. 3, fig. 3 is a schematic block diagram of an electronic device according to an embodiment of the present application. The electronic device 300 in this embodiment as shown in fig. 3 may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processor 301, the input device 302, the output device 303, and the memory 304 communicate with each other via a communication bus 305. The memory 304 is used to store a computer program comprising program instructions. The processor 301 is configured to execute program instructions stored in the memory 304. Wherein the processor 301 is configured to invoke program instructions to perform the functions of the modules/units of the system embodiments described above, such as the functions of the prediction module 21, the determination module 22, and the migration module 23 shown in fig. 2.
It should be appreciated that in embodiments of the present application, the Processor 301 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), off-the-shelf Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 302 may include a touch pad, a fingerprint collection sensor (for collecting fingerprint information of a user and direction information of a fingerprint), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
The memory 304 may include read only memory and random access memory and provides instructions and data to the processor 301. A portion of memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store information of device type.
In a specific implementation, the processor 301, the input device 302, and the output device 303 described in the embodiments of the present application may execute an implementation manner described in an embodiment of the method for dynamically allocating and optimizing edge computing resources and energy consumption in an environment of internet of vehicles provided in the embodiments of the present application, and may also execute an implementation manner of the electronic device described in the embodiments of the present application, which is not described herein again.
In another embodiment of the present application, a computer readable storage medium is provided, where the computer readable storage medium stores a computer program, where the computer program includes program instructions, where the program instructions, when executed by a processor, implement all or part of the procedures in the method embodiments described above, or may be implemented by instructing related hardware by the computer program, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by the processor, implements the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include any entity or device capable of carrying computer program code, recording medium, USB flash disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, among others.
The computer readable storage medium may be an internal storage unit of the electronic device of any of the foregoing embodiments, such as a hard disk or a memory of the electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk provided on the electronic device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the electronic device. The computer-readable storage medium is used to store a computer program and other programs and data required for the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the electronic device and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed electronic device and method may be implemented in other manners. For example, the system embodiments described above are merely illustrative, e.g., the partitioning of elements is merely a logical functional partitioning, and there may be additional partitioning in actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via some interfaces or units, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present application.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The present application is not limited to the above embodiments, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the present application, and these modifications and substitutions are intended to be included in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.