Multi-user layer-aware container scheduling method and terminal in edge-assisted vehicular networks
By establishing a task completion time model and gradient strategy in the edge vehicle network to optimize container scheduling, using mirror sharing features, the problem of high container scheduling costs is solved, and efficient container migration and task completion is achieved.
Patent Information
- Application Number
- CN202410948839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-16
AI Technical Summary
The prior art container scheduling costs in edge vehicle networking are high, mainly due to the insufficient utilization of the complex layers of the container and the mirror sharing information, resulting in an increase in the duration of repeated downloads and initialization, which affects the task completion efficiency.
By establishing a task completion time model, only the writable layer of the container is scheduled, and based on the mirror sharing characteristics and task characteristics, a gradient strategy is used to optimize the container scheduling strategy to reduce the task completion time, and efficient scheduling of the container between edge roadside units is achieved.
It effectively reduces the latency and scheduling costs of container migration, improves the efficiency of container migration in the edge network of vehicles, and significantly reduces the task completion time compared with the existing technology.
Smart Images

Figure CN118502920B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin technology, and in particular to a multi-user layer perception container scheduling method, terminal and readable storage medium in an edge-assisted vehicle network. Background Art
[0002] With the rapid development of 5G and Internet of Vehicles technologies, vehicles with intelligent sensors generate a large amount of raw data every day. These vehicle data need to be processed, feature extracted and fused in real time to achieve applications such as target detection, path planning, and intelligent warning to provide services for the stable operation of vehicles. Since these tasks need to be processed and responded to in real time while the vehicle is driving, a low-duration and reliable edge computing platform is required to provide edge cloud computing and communication functions. Based on the support of cellular Internet of Vehicles wireless technology, a large amount of interactive data can be quickly switched at the communication level.
[0003] Existing technologies use lightweight and easy-to-deploy containers to support applications in edge vehicle networks and achieve fast and scalable vehicle network services. Containers are a technology used for software development and deployment that provides a lightweight, portable, and scalable way to package and run applications and their dependencies. The core concept of container technology is to encapsulate an application and everything it needs, including code, runtime, libraries, environment variables, and configuration files, in a single unit. This allows applications to run in the same way on different environments and platforms.
[0004] As vehicles travel at high speeds, mobile users' service requests and containers supporting applications need to be scheduled following the user's vehicle trajectory. Large-scale scheduling will cause service time problems. Therefore, in the field of Internet of Vehicles technology, fast scheduling of containers and vehicle data is an urgent problem to be solved. This problem needs to solve the following two challenges. First, in the edge Internet of Vehicles scenario, many users will request the same container, such as road information processing tasks. A large number of repeated container requests will cause a high image download and container initialization time. For this reason, the container scheduling of the prior art mainly includes the scheduling of writable container layers and read-only images. Among them, read-only images can be shared among users. When many vehicles move at the same time, if shared images are considered, the multiple repeated download time in the scheduling process can be reduced. Second, the image consists of multiple layers, and different images can share common layers. By deciding which layers need to be scheduled and which layers need to be downloaded, online scheduling decisions are made based on the extracted layer and image sharing information to obtain long-term benefits in less task completion time.
[0005] However, when considering the container scheduling overhead, the container scheduling algorithms in the prior art obviously ignore the fact that making full use of the complex layers of containers and the image sharing information can significantly reduce the scheduling cost. Therefore, the scheduling cost of the container scheduling methods in the prior art is usually high. Summary of the invention
[0006] The object of the present invention is to provide a multi-user layer-aware container scheduling method, terminal and readable storage medium in an edge-assisted vehicle network to reduce the container scheduling cost.
[0007] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0008] The present invention provides a multi-user layer-aware container scheduling method in an edge-assisted vehicle network, and the multi-user layer-aware container scheduling method in an edge-assisted vehicle network includes:
[0009] Acquire an edge auxiliary vehicle network including multiple mobile users and edge roadside units, and acquire tasks issued by multiple mobile users, and establish a task completion duration model according to the tasks and the edge auxiliary vehicle network, wherein the task completion duration model includes a container scheduling duration of a container scheduling for executing the task, wherein the container scheduling only schedules a writable layer of a container, and multiple containers on the same edge roadside unit share an image;
[0010] According to the task completion time model, a container scheduling strategy is established to reduce the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle network;
[0011] According to the container scheduling strategy, the containers are controlled to be scheduled between the edge roadside units.
[0012] Furthermore, the task completion time model is established according to the task and the edge auxiliary vehicle network, specifically including:
[0013] Calculate the communication time of task k in transmitting to edge roadside unit e:
[0014] ;
[0015] in, is the data size of task k, is the wireless uplink transmission rate of task k to edge roadside unit e at time t, is the communication time of task k in transmitting to edge roadside unit e;
[0016] Calculate the container download time of task k:
[0017] ;
[0018] in, is the container download size of task k, is the bandwidth resource allocated by the edge roadside unit e to task k at time t, is the container download duration of task k;
[0019] The initialization duration of task k is calculated based on the container download duration and communication duration of task k:
[0020] ;
[0021] in, is the initialization duration of task k;
[0022] The computation time of computing task k on edge roadside unit e is:
[0023] ;
[0024] in, is the computation time of task k, is the CPU cycles required to process task k, is the workload of edge roadside unit e at time t, is the computing power of the edge roadside unit e at time t;
[0025] Calculate the container scheduling download duration of container c corresponding to task k:
[0026] ;
[0027] in, is the container scheduling download duration of task k, is the size of data that needs to be downloaded when scheduling the container of task k;
[0028] The container scheduling duration of task k is calculated based on the container scheduling download duration of container c corresponding to task k:
[0029] ;
[0030] in, is the container scheduling duration of task k, is the data size of the writable layer, is the wired transmission rate between edge roadside units, It is a two-dimensional state mapping of the shortest path from the original edge roadside unit to the target edge roadside unit. The duration caused by the path;
[0031] A task completion duration model for task k is established based on the container scheduling duration, the calculation duration, and the initialization duration of task k:
[0032] ;
[0033] in, is the task completion time of task k;
[0034] The resource constraints and scheduling constraints of the task completion time model are established.
[0035] Furthermore, according to the task completion time model, establishing a container scheduling strategy for reducing the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle network specifically includes:
[0036] Extracting the image sharing characteristics of the edge auxiliary vehicle network, and establishing a container initial scheduling strategy that reduces the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle networks according to the image sharing characteristics;
[0037] The negative number of the task completion time of the task completion time model is used as a reward, and the initial container scheduling strategy is iteratively updated using a gradient strategy to obtain the container scheduling strategy.
[0038] Furthermore, controlling the dispatching of the container between the edge roadside units according to the container dispatching strategy specifically includes:
[0039] Get the latest position of task k , according to the latest position of task k Calculate task k and the corresponding edge roadside unit The distance between ;
[0040] Determine the distance Is it greater than the set distance threshold? If the distance is greater than the distance threshold, the target edge roadside unit of task k is selected according to the container scheduling strategy, and task k is scheduled to the target edge roadside unit.
[0041] Furthermore, selecting the target edge roadside unit of task k according to the container scheduling strategy specifically includes:
[0042] Extracting mirror sharing features of the edge-assisted vehicle network;
[0043] A target edge roadside unit for task k is selected according to the container scheduling strategy and the image sharing feature.
[0044] Furthermore, the extracting of the mirror sharing feature of the edge-assisted vehicle network specifically includes:
[0045] Extracting action features and task features of the task, and extracting edge roadside unit features of the edge-assisted vehicle network;
[0046] The action feature, the task feature and the edge roadside unit feature are fused to obtain a fused feature;
[0047] The fused features are input into a long short-term memory neural network, and the long short-term memory neural network outputs the mirror shared features.
[0048] Furthermore, the extracting edge roadside unit features of the edge-assisted vehicle network specifically includes:
[0049] Obtaining layer information and position information of each edge roadside unit, and embedding the layer information according to the position information to obtain an input sequence;
[0050] Inputting the input sequence into a self-attention encoder, the self-attention encoder outputting a feature representation;
[0051] The feature representation is reduced in dimension to obtain the edge roadside unit feature.
[0052] Furthermore, the method of controlling the container to be dispatched between the edge roadside units according to the container dispatching strategy, after the dispatching task k to the target edge roadside unit, further includes:
[0053] Obtain the task completion time of task k returned by the edge-assisted vehicle network, and calculate the loss function according to the task completion time of task k;
[0054] The container scheduling strategy is updated according to the loss function.
[0055] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, which includes: a memory, a processor, and a multi-user layer-aware container scheduling program in an edge-assisted vehicle network stored in the memory and run on the processor. When the multi-user layer-aware container scheduling program in the edge-assisted vehicle network is executed by the processor, the terminal is controlled to implement the steps of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network as described above.
[0056] In addition, to achieve the above-mentioned purpose, the present invention also provides a readable storage medium, which stores a multi-user layer-aware container scheduling program in an edge-assisted vehicle network. When the multi-user layer-aware container scheduling program in the edge-assisted vehicle network is executed by a processor, the steps of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network as described above are implemented.
[0057] The present invention adopts the above technical solution to achieve the following effects:
[0058] The present invention establishes a task duration completion model that fully utilizes the complex layers of containers and image sharing information, fully considers the overall task duration of container migration, and reasonably balances the container layer download duration, migration duration and communication duration, effectively solving the delay problem of container migration in edge vehicle networks. Compared with the existing technology, the cost of migration scheduling is effectively reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a flowchart of the steps of a method for scheduling multi-user layer-aware containers in an edge-assisted vehicle network in a preferred embodiment of the present invention;
[0060] Figure 2 is a system schematic diagram of container scheduling in an edge-assisted vehicle network in a preferred embodiment of the present invention;
[0061] Figure 3 is a flow chart of a container scheduling algorithm in a preferred embodiment of the present invention;
[0062] Figure 4 It is a schematic diagram of the convergence of different algorithms;
[0063] Figure 5 It is a schematic diagram of the performance of algorithms in vehicle edge computing and networks under different numbers of tasks for different algorithms;
[0064] Figure 6 It is a schematic diagram of the performance of different algorithms in edge-assisted vehicle networks with different numbers of nodes;
[0065] Figure 7 It is a schematic diagram of the performance of different algorithms in edge-assisted vehicle networks with different edge storage capacities;
[0066] Figure 8 It is a schematic diagram of the performance of different algorithms in edge-assisted vehicle networks with different numbers of containers;
[0067] Fig. 9 It is a schematic diagram of the performance of different algorithms in edge-assisted vehicle networks at different bandwidths;
[0068] Fig.10 This is a schematic diagram showing the average task completion time of different algorithms;
[0069] Fig.11 This is a diagram of the average container scheduling frequency of different algorithms;
[0070] Fig.12 It is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0072] Embodiment 1
[0073] See also Figure 1 , Embodiment 1 of the present application is a method for scheduling multi-user layer-aware containers in an edge-assisted vehicle network, comprising the steps of:
[0074] S1. Obtain an edge-assisted vehicle network including multiple mobile users and edge roadside units, and obtain tasks issued by multiple mobile users, and establish a task completion duration model based on the tasks and the edge-assisted vehicle network. The task completion duration model includes a container scheduling duration for executing the task. The container scheduling only schedules the writable layer of the container, and multiple containers on the same edge roadside unit share an image.
[0075] Specifically, the container scheduling problem in the edge-assisted vehicle network is first modeled. Since the overall optimization goal of the present invention is to find the best strategy to reduce the total time to complete the task while complying with the constraints. Therefore, it is necessary to consider such a scenario when modeling: the edge roadside units are deployed on the roadside, and their number and capacity will be upgraded according to user needs. New user tasks will arrive at any time and need to be unloaded to the RSU (Road Side Unit) in the edge-assisted vehicle network for real-time processing, such as real-time navigation information, real-time traffic information processing and other tasks.
[0076] Please refer to Figure 2 In edge computing, users generate different tasks and request different containers. Each container requires an image file to run. Each image file requires several layer files, which can be shared by different image files. If the requested image file does not exist locally, it needs to be downloaded from the warehouse in the cloud.
[0077] The containers required for task processing will be initialized on the edge roadside unit before the task is executed. Each task is run in the corresponding container. During the task execution, as the task vehicles move, the containers they request must also be scheduled along the moving trajectory, thereby reducing the communication time of the task. The scheduling of containers will bring certain scheduling costs. At this time, considering multi-user layer sharing, the scheduling cost can be effectively reduced.
[0078] In this embodiment, for the edge auxiliary vehicle network, represents the set of mobile users, where Indicates the number of users. Indicates tasks generated by different users, Represents the number of generated tasks, and the data volume of task k is , these tasks will be offloaded to the edge roadside unit for processing. Task k is represented by the two-dimensional coordinate value at time t. Indicates. represents a set of edge roadside units, represents the number of edge roadside units, which can provide computing power and provide services to users through containers. The bandwidth of edge roadside unit e is , storage capacity is , the maximum number of running containers is In addition, considering the cloud edge roadside unit, its computing power is much greater than that of the edge roadside unit. In this embodiment, the computing power of the cloud edge roadside unit is considered to be infinite, expressed as .use Represents a container deployed on an edge roadside unit. represents the number of containers, and the bandwidth requirement of container c is Each container needs to be composed of image files, and the image is represented as , Indicates the number of images. Requesting a container during task execution is equivalent to requesting the corresponding image. The difference between a container and an image lies only in the writable layer of the container, i.e. . When a new container is created, a new writable layer is added on top of the underlying layer, often called the "container layer". All changes made to the running container, such as writing new files or modifying existing files, are written to this writable container layer. Therefore, multiple containers can share access to the same underlying image, but have their own data. This means that only the container layer needs to be transferred when scheduling. Each image consists of multiple layers, and the collection of layers is represented as , Indicates the number of layers, and the size of each layer is The container is being scheduled, and the node to which the task is assigned is represented by .
[0079] In order to ensure satisfactory service quality, containers are scheduled as vehicles move. The initialization duration, calculation duration, and scheduling duration need to be considered comprehensively during the scheduling process. The initialization duration includes the communication duration between the mobile user and the roadside unit and the container startup duration in the edge roadside unit. Each mobile user u is associated with the roadside unit nearby, and tasks such as real-time traffic information processing are deployed to the roadside unit.
[0080] The amount of data is The wireless uplink transmission rate of the task to the edge roadside unit e is:
[0081] ;
[0082] in, is the bandwidth resource allocated by the edge roadside unit e to task k at time t, is the transmission power of task k. is the channel gain between the mobile device and the corresponding edge roadside unit e, and the channel gain The calculation formula is:
[0083] ;
[0084] in, is the path loss coefficient, is the distance between the mobile device of task k and the edge roadside unit e at time t, is the power spectral density of Gaussian white noise.
[0085] The communication duration between task k and edge roadside unit e can be calculated as:
[0086] ;
[0087] When task k is dispatched to edge roadside unit e, container c will be requested. The present invention needs to define several binary variables to represent the relationship between tasks, containers, images and layers. ,if , then container c is assigned to task k, otherwise, container c is not assigned. Define binary variables ,if , then image i is contained in container c, otherwise, the opposite is true. Define binary variables ,if , it means that layer l is located on the edge roadside unit e at time t, otherwise, the opposite is true.
[0088] After the above definition, the download size required to initialize task k can be expressed as:
[0089] ;
[0090] Compared with the transmission time of large data volume, the communication propagation time and queuing time are negligible. Therefore, the download time can be defined as:
[0091] ;
[0092] Data communication and layer downloading can be done simultaneously, so the final initialization time can be expressed as:
[0093] ;
[0094] The mobile task is offloaded to the edge roadside unit for execution. By defining the initialization duration, when the scheduling strategy is subsequently established based on the duration model, the scheduling strategy can learn to select the appropriate edge roadside unit when the container is first deployed.
[0095] Multiple mobile users share the computing resources of the edge roadside unit to process application tasks. The processing density of the offloaded task at time t is expressed as , therefore, the CPU cycles required to process the task can be calculated as:
[0096] ;
[0097] In addition, the marginal roadside unit e workload is defined as , the total computing power is defined as Consider adopting a weighted resource allocation strategy on each edge roadside unit, allocating computing resources in proportion to the CPU cycles required for the task. Therefore, the computing time of executing a task on the edge roadside unit e can be expressed as:
[0098] ;
[0099] For the scheduling duration of container scheduling, the maximum communication distance between the task and the edge roadside unit is expressed as , if at time t , then task k needs to be scheduled. Since the container contains a read-only layer list and writable layer The writable layer is located at the top of the container and records the changes of the running container. The other underlying read-only layers can be downloaded from the cloud registration center. Therefore, when scheduling the container, only the writable layer needs to be scheduled. Define binary variables ,when , indicating that container c needs to be dispatched to the edge roadside unit e at time t, and the size of the layer downloaded from the cloud server is expressed as:
[0100] ;
[0101] The download time required for container c can be expressed as:
[0102] ;
[0103] In addition, the writable layer of the container must be scheduled from the original edge roadside unit to the target edge roadside unit. Since the download from the cloud and the scheduling of the writable layer can be performed at the same time, the calculation formula for the scheduling can be expressed as:
[0104] ;
[0105] in, is the data size of the writable layer, is the wired transmission rate between edge roadside units, It is a two-dimensional state mapping of the shortest path from the original edge roadside unit to the target edge roadside unit. In the scheduling process, in addition to the transmission time caused by scheduling, the switching time and the startup time are ignored because these times are negligible compared with the transmission time.
[0106] Finally, the total time to complete the task is expressed as:
[0107] ;
[0108] In addition, there are some physical and software limitations for online container scheduling.
[0109] Specifically, the dispatcher is located in the cloud and on the main roadside unit. When the vehicle moves, the decision made by the algorithm must meet the resource capacity and storage capacity constraints of the edge roadside unit. Indicates the resource situation on the edge roadside unit, using The storage situation of the representation layer on the edge roadside unit. As the container is scheduled on the edge roadside unit, the resources and storage situation are constantly changing. The resource capacity limit can be expressed as .use represents the storage capacity of the edge roadside unit. The storage capacity limit can be expressed as:
[0110] ;
[0111] In addition, each task can only be dispatched to one edge roadside unit or cloud. represents the cloud, then the scheduling result can be expressed as:
[0112] ;
[0113] If task k is dispatched to edge roadside unit e, then ,otherwise, . Then the task scheduling constraints can be expressed as:
[0114] ;
[0115] S2. According to the duration model, establish a container scheduling strategy for reducing the duration caused by scheduling by controlling the scheduling of the containers between the edge auxiliary vehicle networks.
[0116] After establishing the above duration model and restrictions, we can finally model and solve the online container scheduling problem under the auxiliary edge vehicle network and obtain the final container scheduling strategy. In this embodiment, the problem is modeled as follows:
[0117] ;
[0118] ;
[0119] ;
[0120] ;
[0121] ;
[0122] ;
[0123] ;
[0124] After modeling the above problem, the online scheduling problem of containers is solved by using a policy gradient reinforcement learning algorithm. Reinforcement learning mainly includes several aspects such as state space, action space, reward function, and strategy.
[0125] First, the state space is used to fully describe the vehicle network, which mainly includes three aspects: tasks, nodes, and actions.
[0126] The state space of task k can be expressed as:
[0127] ;
[0128] Among them, the position of the task at time t , the size of the task , CPU request and memory requests These are characteristics that influence decision making. is the characteristic of the requested layer, Indicates the total size of the layers that need to be downloaded, where In addition, the distance between task k and all edge roadside units is also important for decision making. The distance between task k and all edge roadside units is expressed as:
[0129] ;
[0130] Among them, each task are all different, which has a big impact on the initialization time.
[0131] Each edge roadside unit e has a corresponding position , Available storage capacity , Available CPU capacity and available memory capacity As the node state of the corresponding edge roadside unit e.
[0132] in, It can be used to calculate the distance between nodes and affect the initialization time and scheduling time. May vary with the location of the edge roadside unit e.
[0133] In addition, the state of the edge roadside unit e also includes the state of the layer, and the state of the layer is expressed as:
[0134] .
[0135] In summary, the state of the edge roadside unit e can be expressed as:
[0136] ;
[0137] In this way, the resource capacity adjustment of the state of the edge roadside unit e will only affect the remaining resources of the state of the edge roadside unit e, but will not affect the state representation and feature extraction.
[0138] In addition, in order to fully explore the layer sharing situation on each node and consider the computing resources, the present invention estimates the download size by calculating The estimated computation time of task k in all edge roadside units is recorded as .
[0139] Due to the influence of continuous actions, the action at the last moment is also considered as part of the state. The present invention uses a trainable embedding matrix Added to the overall state of the model.
[0140] Therefore, the state at time t can be expressed as:
[0141] ;
[0142] Afterwards, for the definition of the action space, the present invention defines the action space as any valid edge roadside unit e or remote cloud server, so the action space can be expressed as:
[0143] .
[0144] Finally, for the reward function, the present invention defines it as .
[0145] After completing the definition of the action space, state space and reward function, the present invention proposes an online container scheduling algorithm to solve the modeling problem and obtain a scheduling algorithm with the shortest duration.
[0146] It extracts the shared features of the image, and then inputs the shared features extracted by LSTM (Long Short Term Memory) into a policy network, and finally obtains a random strategy, which is used as the initial container scheduling strategy. An action is selected based on this strategy. After the action is taken, the reward function of the action is obtained from the environment and input into a value function. The value function calculates a value and the reward function to obtain a loss function, and updates the policy network based on the loss function until a satisfactory container scheduling strategy is obtained.
[0147] S3. According to the container scheduling strategy, control the scheduling of the container between the edge roadside units.
[0148] Specifically, first add all tasks to the priority queue and use the task start time as the key pointer to start in chronological order. Take out the task for scheduling, and initialize an empty priority queue To record the running tasks, so that You can then determine whether the task is still running or has completed.
[0149] The agent selects the priority queue in turn Get task k and schedule it. At time t, observe the status , and then according to the strategy and the filtered action set Choose Action For example, at the beginning, from the priority queue Get the first task , then get the task Location ) and the filtered edge roadside unit set , that is, with the task The set of all edge roadside units within the communication distance is initialized, and the hidden parameters of the policy network are initialized, and then the action is selected Deployment tasks .
[0150] The scheduled task k forms a key-value tuple , and is placed in is processed in, where represents the completion time of task k, which is the sum of the start time of task k and the task completion time. Then, when the queue When not empty, the agent will Sorted time order processing If , then task k is completed, and then the node resources are released. Otherwise, get the latest position Then, we calculate the task k and the corresponding edge roadside unit The distance between , and determine whether the task needs to be scheduled based on the strategy. If the task needs to be scheduled, put it into the task queue , for subsequent scheduling. Otherwise, the task will return .
[0151] Then, get the queue The first task in the new filter set , and update the reinforcement learning environment, extract mirror shared features through the encoder network based on the attention mechanism and the recurrent neural network based on LSTM, and the extracted features are integrated into the policy network. Finally, the policy is adjusted by the policy gradient method. Train and update.
[0152] Please refer to Figure 3 ,In order to fully extract the layer information, we first use the ,feature extraction algorithm based on the self-attention mechanism to extract the ,location distribution and mutual dependency features of each layer on different nodes based on ,the geographical location information of the layer and the container. Then by using LSTM, ,the scheduling decision of each time slot is input into the state of the ,next time slot, and the mirroring requests and ,movement trajectories of multiple vehicles are combined to extract the ,shared features of the mirroring.
[0153] Specifically, this embodiment designs an encoder network based on self-attention, and the layer shared feature encoding mainly includes three parts: action feature, task feature and edge roadside unit feature encoding.
[0154] Specifically, the action feature and task feature embedding vectorizes the final action feature and task feature mapping into two embedding vectors. For the edge roadside unit feature, it receives the input one-dimensional feature sequence ,in is the number of edge roadside units, and L is the length of the sequence. Specifically, in order to encode the state space information, the position of each edge roadside unit is embedded in Add to all states To form the final sequence input This input is fed into a self-attention encoder to learn feature representations ,Afterwards, CNN and linear layers are used to reduce the dimension of encoder features to obtain the final edge roadside unit features.
[0155] Afterwards, the action feature, the task feature and the edge roadside unit feature are fused to obtain a fused feature, and the fused feature is input into a linear layer for dimensionality reduction and then input into a subsequent network.
[0156] In order to extract multi-user features, this embodiment inputs the fused features into the LSTM and uses the structure of the LSTM to learn the temporal interdependence between state columns.
[0157] In the vehicle network, task scheduling decisions are made in sequence, and the order of each task scheduling decision forms a decision sequence. Through LSTM, the decision sequence of past tasks can be embedded into the current state, so as to take into account the influence of multiple users at different times. LSTM inputs the scheduling decision of each time slot into the state of the next time slot, combines the mirroring requests and motion trajectories of multiple vehicles, and extracts the shared features of the mirroring.
[0158] In addition, LSTM can better capture state changes, including the mobility of multiple vehicle locations, layer distribution changes, etc., which cannot be obtained from a single state in the current time slot.
[0159] Afterwards, the shared features extracted by LSTM are input into a policy network. The policy selects an action based on the shared features extracted by LSTM. After the action is taken, the reward function of the action is obtained from the environment and input into a value function. The value function calculates a value and the reward function to obtain a loss function, and updates the policy network based on the loss function.
[0160] Specifically, in the auxiliary vehicle edge network, the scheduling process is based on a policy optimization model, whose probability is defined as:
[0161] ;
[0162] This formula is used to estimate the probability of the entire process from the initial state to the final state. A state-action sequence representing decisions and state transitions from an initial state to an end state, such as the movement, dispatch, or communication of a vehicle, represents the initial state distribution, represents the state transition probability, that is, in state Take action After transfer to state probability; Is a policy function, which means that at time t, in state In case of probability.
[0163] The goal of reinforcement learning is to maximize the long-term benefit. The long-term discounted benefit can be defined as:
[0164] ;
[0165] This formula defines the strategy The expected return under Represents all possible large state-action sequences To perform integration, It is in strategy The following sequence is generated The probability of Is a sequence The total return obtained under the strategy Under the guidance of The expected value of return .
[0166] The goal of the present invention is to obtain the best strategy In order to train reinforcement learning to obtain an optimal strategy, a policy optimization algorithm is required. For the policy gradient algorithm, an advantage function is very important. In this embodiment, the advantage function can be defined as:
[0167] ;
[0168] in, is to execute action a in state s and continue to follow the policy The action value function in the case of , which means starting from state s, first perform action a, and then follow the strategy The total expected return that may be obtained. is the value function, given that the agent starts in state s and follows policy The expected return when taking an action can be defined as:
[0169] ;
[0170] This formula represents the conditional expected value, that is, given the starting state s, according to the strategy All possible paths to immortality The Return This maximizes the expected return when starting from any state.
[0171] Therefore, the advantage function This means following the strategy In the case of , the advantage of performing action a in state s over other actions.
[0172] In this embodiment, the definition As a commonly used gradient estimate, it is expressed as:
[0173] ;
[0174] This formula is used to update the method strategy parameters The gradient formula is, represents the expected value at time t, which is the average of a series of samples. It’s a strategy About its parameters The log-likelihood gradient of , which represents the policy parameters For the state at time t In this case, select a specific action The sensitivity of the probability of is a specific action at time t The advantage function estimate of Benefits relative to the average strategy.
[0175] The loss function of the policy gradient is:
[0176] ;
[0177] By differentiating the loss function of the policy gradient, we can get the final loss function that needs to be optimized:
[0178] ;
[0179] in, That is, select the action under the current strategy The ratio of the probability of selecting the same action under the old strategy reflects the degree of policy change caused by the update of policy parameters.
[0180] The loss function can be further simplified as:
[0181] ;
[0182] in is a clipping function that limits the importance sampling ratio to a range (usually arrive ),in Is a small positive number (such as 0.1 or 0.2). The purpose of choosing this loss function is to prevent training instability caused by excessive policy updates.
[0183] The present invention uses Python for programming, simulates the vehicle roadside unit, task, container, scheduler and other classes in the auxiliary edge vehicle network, and implements a simulated edge vehicle network computing environment based on these classes. The vehicle motion data in the experimental data comes from the movement trajectory of taxis in a certain area generated by real data cleaning. The area with relatively high data density in the data set is selected, and the movement path is limited to 7km × 7km. In order to better compare the performance, different numbers of nodes and tasks are set. In this embodiment, when comparing different numbers of nodes, the number of tasks is fixed to 500. The main parameters of some experiments are set as follows, and the number of nodes is set to 16, 36, 64, 100 and 144 respectively. When comparing different numbers of tasks, the number of nodes is fixed to 36, the node interval is 1km, and the communication distance between base stations is fixed to 1.2km. In addition, for heterogeneous nodes, the CPU frequency range is [64, 96] GHz, and the CPU clock speed of the task is (0,1]GHz.
[0184] In order to better compare the algorithm effects, the following baseline algorithms are selected as comparison references. The first one is the image-based scheduling algorithm Kube (Kubernetes), which selects the container migration node based on the score calculated by the distribution of the requested image. The second algorithm is the Greedy algorithm that selects the edge node with the smallest layer download volume. The third algorithm is a traditional DRL (deep reinforcement learning) algorithm based on behavior criticism. The fourth algorithm, DRL-MU (deep reinforcement learning Multi-User) is a deep reinforcement learning algorithm that only uses LSTM networks to extract multi-user features. The fifth algorithm, DRL-VLS, is a deep reinforcement learning algorithm that uses a self-attention-based encoder to extract single-layer shared features.
[0185] The final experimental results are as follows Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Fig. 9 , Fig.10 and Fig.11 shown.
[0186] Embodiment 2
[0187] See also Fig.12 Based on the above method, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Fig.12Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0188] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a multi-user layer-aware container scheduler 40 in an edge-assisted vehicle network, and the multi-user layer-aware container scheduler 40 in the edge-assisted vehicle network can be executed by the processor 10, thereby realizing the platform in the present application.
[0189] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing relevant programs of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network.
[0190] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0191] In one embodiment, when the processor 10 executes the multi-user layer-aware container scheduling program 40 in the edge-assisted vehicle network in the memory 20, the steps of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network described above are implemented.
[0192] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a multi-user layer-aware container scheduling program in an edge-assisted vehicle network, which can be executed by the processor 10, thereby realizing the multi-user layer-aware container scheduling method in an edge-assisted vehicle network in the present application.
[0193] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the multi-user layer-aware container scheduling method in the edge-assisted vehicle network.
[0194] Embodiment 3
[0195] This embodiment provides a storage medium, which stores a multi-user layer-aware container scheduling program in an edge-assisted vehicle network. When the multi-user layer-aware container scheduling program in the edge-assisted vehicle network is executed by a processor, the steps of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network are implemented as described above.
[0196] In summary, the present invention establishes a task duration completion model that fully utilizes the complex layers of containers and image sharing information, fully considers the overall task duration of container migration, and reasonably balances the container layer download duration, migration duration, and communication duration. It effectively solves the delay problem of container migration in edge vehicle networks and effectively reduces the cost of migration scheduling compared to the prior art.
[0197] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0198] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, an optical disk, etc.
[0199] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A multi-user layer-aware container scheduling method in an edge-assisted vehicular network, characterized in that: The multi-user layer-aware container scheduling method in the edge-assisted vehicle network includes: Acquire an edge auxiliary vehicle network including multiple mobile users and edge roadside units, and acquire tasks issued by multiple mobile users, and establish a task completion duration model according to the tasks and the edge auxiliary vehicle network, wherein the task completion duration model includes a container scheduling duration of a container scheduling for executing the task, wherein the container scheduling only schedules a writable layer of a container, and multiple containers on the same edge roadside unit share an image; According to the task completion time model, a container scheduling strategy is established to reduce the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle network; According to the container scheduling strategy, controlling the scheduling of the container between the edge roadside units; The step of establishing a task completion time model according to the task and the edge auxiliary vehicle network specifically includes: Calculate the communication time of task k in transmitting to edge roadside unit e: ; in, is the data size of task k, is the wireless uplink transmission rate of task k to edge roadside unit e at time t, is the communication time of task k in transmitting to edge roadside unit e; Calculate the container download time of task k: ; in, is the container download size of task k, is the bandwidth resource allocated by the edge roadside unit e to task k at time t, is the container download duration of task k; The initialization duration of task k is calculated based on the container download duration and communication duration of task k: ; in, is the initialization duration of task k; The computation time of computing task k on edge roadside unit e is: ; in, is the computation time of task k, is the CPU cycles required to process task k, is the workload of edge roadside unit e at time t, is the computing power of the edge roadside unit e at time t; Calculate the container scheduling download duration of container c corresponding to task k: ; in, is the container scheduling download duration of task k, is the size of data that needs to be downloaded when scheduling the container of task k; The container scheduling duration of task k is calculated based on the container scheduling download duration of container c corresponding to task k: ; in, is the container scheduling duration of task k, is the data size of the writable layer, is the wired transmission rate between edge roadside units, It is a two-dimensional state mapping of the shortest path from the original edge roadside unit to the target edge roadside unit. The duration caused by the path; A task completion duration model for task k is established based on the container scheduling duration, the calculation duration, and the initialization duration of task k: ; in, is the task completion time of task k; The resource constraints and scheduling constraints of the task completion time model are established.
2. The method for multi-user layer-aware container scheduling in an edge-assisted vehicle network according to claim 1, characterized in that: The establishing, according to the task completion time model, of a container scheduling strategy for reducing the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle network specifically includes: Extracting the image sharing characteristics of the edge auxiliary vehicle network, and establishing a container initial scheduling strategy that reduces the task completion time by controlling the scheduling of the container between the edge auxiliary vehicle networks according to the image sharing characteristics; The negative number of the task completion time of the task completion time model is used as a reward, and the initial container scheduling strategy is iteratively updated using a gradient strategy to obtain the container scheduling strategy.
3. The method for multi-user layer-aware container scheduling in an edge-assisted vehicle network according to claim 1, characterized in that: The controlling the dispatching of the container between the edge roadside units according to the container dispatching strategy specifically includes: Get the latest position of task k , according to the latest position of task k Calculate task k and the corresponding edge roadside unit The distance between ; Determine the distance Is it greater than the set distance threshold? If the distance is greater than the distance threshold, the target edge roadside unit of task k is selected according to the container scheduling strategy, and task k is scheduled to the target edge roadside unit.
4. The method for scheduling multi-user layer-aware containers in an edge-assisted vehicle network according to claim 3, characterized in that: The step of selecting a target edge roadside unit for task k according to the container scheduling strategy specifically includes: Extracting mirror sharing features of the edge-assisted vehicle network; A target edge roadside unit for task k is selected according to the container scheduling strategy and the image sharing feature.
5. The method for scheduling multi-user layer-aware containers in an edge-assisted vehicle network according to claim 2 or 4, characterized in that: The extracting of the mirror sharing feature of the edge-assisted vehicle network specifically includes: Extracting action features and task features of the task, and extracting edge roadside unit features of the edge-assisted vehicle network; The action feature, the task feature and the edge roadside unit feature are fused to obtain a fused feature; The fused features are input into a long short-term memory neural network, and the long short-term memory neural network outputs the mirror shared features.
6. The method for multi-user layer-aware container scheduling in an edge-assisted vehicle network according to claim 5, characterized in that: The step of extracting edge roadside unit features of the edge-assisted vehicle network specifically includes: Obtaining layer information and position information of each edge roadside unit, and embedding the layer information according to the position information to obtain an input sequence; Inputting the input sequence into a self-attention encoder, the self-attention encoder outputting a feature representation; The feature representation is reduced in dimension to obtain the edge roadside unit feature.
7. The method for multi-user layer-aware container scheduling in an edge-assisted vehicle network according to claim 3, characterized in that: The controlling the scheduling of the container between the edge roadside units according to the container scheduling strategy, after the scheduling task k to the target edge roadside unit, further comprises: Obtain the task completion time of task k returned by the edge-assisted vehicle network, and calculate the loss function according to the task completion time of task k; The container scheduling strategy is updated according to the loss function.
8. A terminal, characterized in that: The terminal includes: a memory, a processor, and a multi-user layer-aware container scheduling program in an edge-assisted vehicle network stored in the memory and executable on the processor. When the multi-user layer-aware container scheduling program in the edge-assisted vehicle network is executed by the processor, the terminal is controlled to implement the steps of the multi-user layer-aware container scheduling method in an edge-assisted vehicle network as described in any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores a multi-user layer-aware container scheduling program in an edge-assisted vehicle network. When the multi-user layer-aware container scheduling program in the edge-assisted vehicle network is executed by a processor, the steps of the multi-user layer-aware container scheduling method in the edge-assisted vehicle network as described in any one of claims 1-7 are implemented.
