Microservice deployment method, system, device and storage medium based on vehicle-road collaboration

By using the entropy reinforcement learning algorithm to optimize microservice deployment in the vehicle-road collaboration system, the problems of low request processing rate and high energy cost in the roadside edge system are solved, and efficient and environmentally friendly edge computing is achieved.

CN118316968BActive Publication Date: 2024-08-27湖北省楚天云有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410739394.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-27
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

In the roadside edge system of vehicle-road collaboration, complex data communication and user mobility between microservices lead to low request processing rate and increased energy costs and carbon emissions. It is difficult for existing technologies to effectively solve these problems.

Method used

Adopt a microservice deployment method based on vehicle-road collaboration, combine the policy network and value network, and use the reward-improved entropy reinforcement learning algorithm to optimize microservice deployment and request routing, balance request processing delay and system energy consumption, and realize green edge computing .

Benefits of technology

In a massive request environment, it effectively balances the end-to-end response delay of vehicle requests and system energy consumption, improves the request processing rate, and simultaneously implements green edge computing to reduce energy costs and carbon emissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118316968B
    Figure CN118316968B
Patent Text Reader

Abstract

The present invention discloses a microservice deployment method, system, device and storage medium based on vehicle-road collaboration. The method includes: obtaining a microservice deployment action through a policy network in a vehicle-road collaboration service deployment model according to a first vehicle request and a first spatial state information; obtaining a microservice deployment cumulative reward through a value network in the vehicle-road collaboration service deployment model according to the microservice deployment action and the first spatial state information; putting the microservice deployment cumulative reward and the microservice deployment action into an experience pool for reward sharing; randomly selecting a quadruple from the experience pool, and obtaining a target value through a policy entropy function formula based on the quadruple based on an evaluation network in the vehicle-road collaboration service deployment model; and updating the value network and the policy network respectively based on the target value. The present invention can improve the request processing rate and realize green edge computing in a roadside edge system of vehicle-road collaboration where massive requests are constantly arriving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile edge computing technology, and in particular to a microservice deployment method, system, device and storage medium based on vehicle-road collaboration. Background Art

[0002] With the continuous development and popularization of driverless driving and vehicle networking, vehicle-road cooperative technology, as a key component of intelligent transportation systems, has received increasing attention. Vehicle-road cooperative technology enables real-time sharing of traffic information through communication between vehicles and road infrastructure, thereby improving road safety, traffic efficiency and driving experience.

[0003] In the vehicle-road cooperative system, the roadside edge system plays a vital role. It can receive requests from vehicles, process them and return them in real time, providing real-time traffic information and guidance to vehicles and drivers. In addition, the use of microservice architecture and container technology allows monolithic applications to be split into multiple independent service units that communicate with each other through APIs. Therefore, the transportation department can flexibly deploy microservices according to different road conditions to achieve efficient response and make full use of limited resources.

[0004] However, microservice-based applications are usually accompanied by complex data dependencies and numerous inter-service communications, which is particularly significant in resource-limited roadside edge systems, which severely restricts performance. In addition, frequent data communications may also lead to increased energy costs and carbon emissions. Therefore, it is still a challenging task to develop an energy-efficient microservice deployment and routing strategy to reduce inter-service communications, reduce response time and energy consumption, and thus build an efficient and environmentally friendly roadside edge system.

[0005] Although microservice deployment for edge systems has been widely studied, most current studies usually only consider microservice deployment or request routing, and do not fully address the challenges of multi-instance and multi-queue orchestration in edge scenarios. In the context of a large number of requests with different needs and dynamic user mobility, fine-grained microservice orchestration can effectively reduce queuing delays, processing delays, and transmission delays to ensure user QoS. A few studies have considered joint optimization problems at a coarse-grained level, but have ignored complex service dependencies and instance-level request routing. In the roadside edge system of vehicle-road collaboration, there is complex and large-scale data communication between microservices, and user mobility and the dynamic and random properties of edge networks pose great challenges to service deployment and request routing. Therefore, how to improve the request processing rate while achieving green edge computing has become an urgent problem to be solved.

[0006] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0007] The main purpose of the present invention is to provide a microservice deployment method, system, device and storage medium based on vehicle-road collaboration, aiming to solve the technical problem of how to improve the request processing rate while realizing green edge computing.

[0008] To achieve the above object, the present invention provides a microservice deployment method based on vehicle-road collaboration, and the microservice deployment method based on vehicle-road collaboration includes:

[0009] Obtaining a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial state information, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state;

[0010] Obtaining a microservice deployment cumulative reward through a value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first space state information;

[0011] Put the microservice deployment cumulative reward and the microservice deployment action into the experience pool for reward sharing;

[0012] Randomly select a quadruple from the experience pool, the quadruple including a spatial state, an action, an action reward, and a future spatial state, and obtain a target value according to the quadruple through a policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model;

[0013] The value network and the policy network are updated respectively based on the target value, and the second vehicle request is processed by microservice deployment through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model.

[0014] Optionally, the step of obtaining a microservice deployment cumulative reward through a value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first spatial state information includes:

[0015] Determine the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node according to the microservice deployment action;

[0016] Determine the total delay according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node;

[0017] Determining the energy consumption of a roadside edge system according to the power consumption of the roadside edge node and the data transmission energy consumption of the roadside edge node;

[0018] Determine the cumulative reward for microservice deployment through a reward plasticity strategy based on the value network in the vehicle-road cooperative service deployment model according to the total delay and the energy consumption of the roadside edge system;

[0019] The reward plasticity strategy is:

[0020] ;

[0021]

[0022] In the formula, is the cumulative reward for microservice deployment, T is the total latency, P is the energy consumption of the roadside edge system, and is the importance coefficient, and [-C, C] is the reward limit.

[0023] Optionally, the step of determining the total delay according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node includes:

[0024] Determining a request processing delay based on a processing efficiency of the microservice for the request;

[0025] Determine the service request processing speed according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node;

[0026] Determine the queuing waiting time according to the number of microservice instances on the edge node, the arrival rate of the request to the roadside edge node, the service request processing speed, and the processing efficiency of the microservice for the request;

[0027] Determine the request information transmission time according to the required transmission information data volume corresponding to the to-be-processed vehicle request and the data transmission rate between nodes;

[0028] The total delay is determined according to the request processing delay, the queuing waiting time and the request information transmission time.

[0029] Optionally, before the step of determining the energy consumption of the roadside edge system according to the power consumption of the roadside edge node and the data transmission energy consumption of the roadside edge node, the step further includes:

[0030] Determine the data transmission power between nodes, node full load energy consumption, server startup energy consumption and CPU load;

[0031] Calculating the power consumption of the roadside edge node according to the full load energy consumption of the node, the server startup energy consumption and the CPU load using a roadside edge node power consumption calculation formula;

[0032] The power consumption calculation formula of the roadside edge node is:

[0033]

[0034] In the formula, is the power consumption of the roadside edge node, Start energy consumption for the server, is the energy consumption of the node at full load, For CPU load;

[0035] According to the data transmission power between the nodes, the request transmission time and the arrival rate of the request to the roadside edge node, the data transmission energy consumption of the roadside edge node is obtained by using a transmission energy consumption formula;

[0036] The transmission energy consumption formula is:

[0037]

[0038] In the formula, is the data transmission energy consumption of the roadside edge node, is the data transmission power between nodes.

[0039] Optionally, the step of obtaining the target value according to the quadruple by using a policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model includes:

[0040] Input the four-tuple into the evaluation network in the vehicle-road cooperative service deployment model, and calculate the target value of the value network through the policy entropy function formula in the evaluation network;

[0041] The strategy entropy function formula is:

[0042]

[0043] In the formula, is the target value of the i-th batch, is the action reward for the i-th batch, is the expected future reward for the i+1th batch, is the expected entropy value of the future i+1 batch, is the action of the i+1th batch, is the spatial state of the i-th batch, is the action of the i-th batch, is the future spatial state of the i+1th batch.

[0044] Optionally, the step of updating the value network and the strategy network respectively based on the target value includes:

[0045] Determine the estimated value, current state expected reward, and current state entropy of the value network;

[0046] Obtaining a loss function of the value network according to the estimated value of the value network and the target value through a loss function formula, and updating the value network based on the loss function of the value network;

[0047] The loss function of the policy network is obtained according to the current state expected reward and the current state entropy value through the loss function formula, and the policy network is updated based on the loss function of the policy network.

[0048] Optionally, the step of updating the value network based on the loss function of the value network includes:

[0049] Determining whether the loss function of the value network is greater than a preset value loss threshold;

[0050] If the loss function of the value network is greater than the preset value loss threshold, updating the value network based on the loss function of the value network;

[0051] The step of updating the policy network based on the loss function of the policy network comprises:

[0052] Determine whether the loss function of the strategy network is greater than a preset strategy loss threshold;

[0053] If the loss function of the updated policy network is greater than the preset policy loss threshold, the policy network is updated based on the loss function of the policy network.

[0054] In addition, to achieve the above-mentioned purpose, the present invention further proposes a microservice deployment system based on vehicle-road collaboration, and the microservice deployment system based on vehicle-road collaboration includes:

[0055] A deployment module, configured to obtain a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial state information, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state;

[0056] A reward module, configured to obtain a microservice deployment cumulative reward through a value network in the vehicle-road cooperative service deployment model according to the microservice deployment action and the first spatial state information;

[0057] A sharing module, used to put the accumulated rewards of the microservice deployment and the microservice deployment actions into an experience pool for reward sharing;

[0058] A calculation module, used for randomly selecting a quadruple from the experience pool, the quadruple including a spatial state, an action, an action reward, and a future spatial state, and obtaining a target value according to the quadruple through a policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model;

[0059] An updating module is used to update the value network and the strategy network respectively based on the target value, and perform microservice deployment processing on the second vehicle request through the updated strategy network and the updated value network in the vehicle-road collaborative service deployment model.

[0060] In addition, to achieve the above-mentioned objectives, the present invention also proposes a microservice deployment device based on vehicle-road collaboration, the device comprising: a memory, a processor, and a microservice deployment program based on vehicle-road collaboration stored on the memory and executable on the processor, the microservice deployment program based on vehicle-road collaboration being configured to implement the steps of the microservice deployment method based on vehicle-road collaboration as described above.

[0061] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a microservice deployment program based on vehicle-road collaboration is stored. When the microservice deployment program based on vehicle-road collaboration is executed by a processor, the steps of the microservice deployment method based on vehicle-road collaboration as described above are implemented.

[0062] The present invention first obtains a microservice deployment action according to a first vehicle request and a first spatial state information through a policy network in a vehicle-road collaborative service deployment model, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state, and then obtains a microservice deployment cumulative reward through a value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first spatial state information, and then puts the microservice deployment cumulative reward and the microservice deployment action into an experience pool for reward sharing, and randomly selects a quadruple from the experience pool, the quadruple including a spatial state, an action, an action reward, and a future spatial state, and obtains a target value according to the quadruple through a policy entropy function formula based on an evaluation network in the vehicle-road collaborative service deployment model, and finally updates the value network and the policy network based on the target value, and performs microservice deployment processing on the second vehicle request through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model. The present invention solves the problem through an entropy reinforcement learning algorithm based on reward improvement, uses reward sharing and reward plasticity to assign rewards, continuously learns and provides feedback, and finds the deployment plan with the best comprehensive performance indicators. In the roadside edge system of vehicle-road collaboration where massive requests are constantly arriving, the present invention can effectively balance the end-to-end response delay of vehicle requests and the system energy consumption, thereby improving the request processing rate and realizing green edge computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a structural diagram of a microservice deployment device based on vehicle-road collaboration in a hardware operating environment involved in an embodiment of the present invention;

[0064] Figure 2 This is a flow chart of a first embodiment of a microservice deployment method based on vehicle-road collaboration according to the present invention;

[0065] Figure 3 This is a schematic diagram of the structure of a roadside edge system according to the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention;

[0066] Figure 4 A schematic diagram of microservice deployment according to a first embodiment of a microservice deployment method based on vehicle-road collaboration of the present invention;

[0067] Figure 5 A schematic diagram of an entropy reinforcement learning algorithm based on reward improvement according to the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention;

[0068] Figure 6 This is a structural block diagram of the first embodiment of the microservice deployment system based on vehicle-road collaboration of the present invention.

[0069] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0070] 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.

[0071] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a microservice deployment device based on vehicle-road collaboration in the hardware operating environment involved in an embodiment of the present invention.

[0072] like Figure 1As shown, the microservice deployment device based on vehicle-road collaboration may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RandomAccess Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage system independent of the aforementioned processor 1001.

[0073] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the microservice deployment device based on vehicle-road collaboration, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0074] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a microservice deployment program based on vehicle-road collaboration.

[0075] exist Figure 1 In the microservice deployment device based on vehicle-road collaboration shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the microservice deployment device based on vehicle-road collaboration of the present invention can be set in the microservice deployment device based on vehicle-road collaboration, and the microservice deployment device based on vehicle-road collaboration calls the microservice deployment program based on vehicle-road collaboration stored in the memory 1005 through the processor 1001, and executes the microservice deployment method based on vehicle-road collaboration provided by an embodiment of the present invention.

[0076] The embodiment of the present invention provides a microservice deployment method based on vehicle-road collaboration, referring to Figure 2 , Figure 2 This is a flow chart of the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention.

[0077] In the specific implementation, the microservice deployment system based on vehicle-road collaboration includes multiple roadside edge nodes. These nodes are usually located near the road and are responsible for receiving requests sent by vehicles, performing request processing and storage. Different roadside edge nodes can communicate through wireless channels to forward requests to adjacent nodes. Microservices can be deployed on roadside edge nodes through container technology. Each microservice is responsible for a specific task and allows multiple identical instances to exist. Multiple microservices are connected in a logical order to form a microservice chain to complete a task together. Each microservice chain corresponds to a specific request from a vehicle.

[0078] Based on this system, this paper uses Jackson queuing theory to analyze and model the complex data dependencies between microservices in a fine-grained manner, and further analyzes the impact of multi-instance microservice deployment and multi-queue request scheduling on request latency and energy consumption through microservice characteristics and complex application structures; then solves it through the reward-based improved entropy reinforcement learning algorithm, uses reward sharing and reward plasticity to assign rewards, continuously learns feedback, and finds the optimal microservice deployment solution. The present invention comprehensively considers the resource limitations of the roadside edge system and the request requirements of the vehicle, and adopts a joint optimization method to simultaneously optimize the energy consumption and latency problems in the microservice deployment. It can effectively balance the end-to-end response latency and energy consumption of vehicle requests in the roadside edge system where massive requests are constantly arriving, and improves the user experience while protecting the environment.

[0079] In this embodiment, reference Figure 3 , Figure 3 This is a schematic diagram of the roadside edge system structure of the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention, which is composed of multiple roadside edge nodes. These roadside edge nodes have computing and storage capabilities similar to those of cloud computing centers, and can implement microservice instances through container technology to receive and process requests from vehicles. Roadside edge nodes can communicate with each other through wireless links to forward requests to adjacent nodes, thereby maximizing the use of their resources. Based on the idea of ​​building edge computing with microservices, the functions in the system can be split into a series of microservices. Each microservice is responsible for a specific task, and multiple identical instances are allowed to exist. Each instance runs independently in a separate container without resource conflicts. Multiple microservices are connected in a logical order and are called a microservice chain, which can complete a task together. Each microservice chain corresponds to a specific request from a vehicle. In order to complete the task, the request must pass through these microservices in a specified order within the maximum tolerable time.

[0080] In this embodiment, the microservice deployment method based on vehicle-road collaboration includes the following steps:

[0081] Step S10: Obtain a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial status information, wherein the first spatial status information includes a vehicle request status, a roadside edge system resource status, and a deployed service status.

[0082] It is easy to understand that the execution subject of this embodiment can be a microservice deployment system based on vehicle-road collaboration with functions such as data processing, network communication and program running, or it can be other computer devices with similar functions, etc., and this embodiment is not limited.

[0083] It should be noted that the vehicle-road collaborative service deployment model includes a policy network, a value network and an evaluation network. The initial vehicle-road collaborative service deployment model needs to be trained with sample data in advance, and the vehicle-road collaborative service deployment model is obtained after the training is completed.

[0084] The training process of the vehicle-road cooperative service deployment model is to first build the policy network and value network architecture, and then assign parameters. Then use the initialized network to interact with the simulated roadside edge system to collect samples. First, observe the state, select actions through the policy network, interact with the environment, and observe the next state returned by the environment. If all service requests are processed, it is considered that a round is completed, and the reward is calculated. And the reward of the previous action is assigned through reward sharing. Then the obtained batch of quadruple Store in the experience pool. Repeat this step multiple times to obtain sufficient training samples. When the experience pool reaches the minimum number of training starts, randomly sample a batch of experience samples from the experience replay cache. Input the sample into the evaluation network to calculate the target value, and then use the minimum mean square error formula to calculate the loss of the value network and the loss of the policy network, and update the parameters of the value network and the policy network. At the same time, adaptively update the entropy coefficient, and use the target value to update the value network and the policy network every fixed round. When the sampling and training steps are repeated until the predetermined number of training rounds or convergence conditions are reached, the optimal action can be selected according to the trained policy network to make microservice deployment decisions. That is, select an optimal microservice deployment plan based on the current request flow and roadside edge system status, and execute the deployment to obtain the optimal microservice deployment plan.

[0085] It should also be noted that the main goal of traditional reinforcement learning is to maximize the cumulative reward, but this approach often falls into local optimality. The algorithm we proposed solves this problem by adding an entropy term to the objective function. Entropy represents a measure of the randomness of a random variable. The idea of ​​this algorithm is to make the strategy more random in addition to maximizing the expected reward and.

[0086] The role of the policy network is to map the state space to the action space and output the probability distribution of each possible action under a given state. The goal of the policy network is to learn a good strategy to maximize the expected cumulative reward. The input of the value network is the state and action, and the output is the corresponding reward estimate, which can predict the cumulative reward that can be obtained under a given state and action. The evaluation is a copy of the value network, which can ensure the instability caused by too frequent value updates during training. The update is achieved by copying the value network at regular intervals.

[0087] In the vehicle-road cooperative service deployment model, it is necessary to define the state space S, including the vehicle request state, the roadside edge system resource state and the deployed service state; define the action space A. Since there are many types of microservices in the problem under study and a large space to choose from, it is not necessary to deploy all microservices at once, but to deploy the microservices required by the request in sequence. Each action represents the deployment of a microservice; define the reward space R. The reward of the problem under study is the inverse of the weighted sum of latency and energy consumption. At the same time, considering that the request latency of the roadside edge system can only be calculated when all microservices are deployed, the reward plasticity and reward sharing methods are used to improve the reward; then a reinforcement learning network model is built, and the roadside edge system state is input for deployment training, and finally a microservice deployment plan is obtained.

[0088] It should also be understood that the microservice deployment action is a microservice deployment solution corresponding to the first vehicle request. The microservice deployment solution includes determining the specific number of microservice instances in the roadside edge system and the deployment location of each microservice instance on the edge node. Figure 4 , Figure 4 This is a schematic diagram of microservice deployment according to the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention.

[0089] Understandably, the phenomenon of overestimation of value is easy to occur in the strategy improvement step. To avoid this problem, we parameterize two value networks with neural network parameters as , and train them independently. Then, we use the minimum between the two for stochastic gradient descent and policy network improvement. In addition, two value networks can also speed up training.

[0090] The spatial status information mainly includes vehicle request status, deployed service status, and roadside edge system resource status. It can be expressed as follows:

[0091]

[0092] in Represents the vehicle request status, which describes the status of the service request received by the system, including information such as the request type, size, and tolerable delay. Indicates the status of deployed services and describes the information of microservice instances that have been deployed on edge nodes. Represents the resource status of the roadside edge system, including the CPU status of the roadside edge node, the memory status of the roadside edge node, and the bandwidth status between the roadside edge nodes. In order to ensure the stability of policy training, we standardize the three separately, dividing each element in the state space by the corresponding maximum value to make it range between [0,1].

[0093] It is understandable that due to the large variety of microservices and the large space for selection in the research problem, we do not pursue the deployment of all microservices at once, but deploy the microservices required by the request in sequence, and each action represents the deployment of a microservice. We use To represent the action of selecting a microservice deployed on a roadside edge node, it is represented as:

[0094]

[0095] in Indicates that the microservice is deployed in At each roadside edge node, Indicates the number of microservice instances that need to be deployed.

[0096] It should also be noted that the sampling and training steps are repeated until the predetermined number of training rounds or convergence conditions are reached. Then, the optimal action can be selected based on the trained policy network to make microservice deployment decisions. That is, an optimal microservice deployment solution is selected based on the current request and roadside edge system status, and the deployment is executed. Figure 5 , Figure 5 This is a schematic diagram of an entropy reinforcement learning algorithm based on reward improvement in the first embodiment of the microservice deployment method based on vehicle-road collaboration of the present invention.

[0097] The algorithm is:

[0098] 1. Randomly initialize the policy network and two value networks , Parameters , and

[0099] 2. Initialize and evaluate network parameters ,

[0100] 3. Initialize the experience replay pool M

[0101] 3. for round number e=1 to E do

[0102] 4.For each microservice deployment do:

[0103] 5. Obtain the initial environment status of the roadside edge system

[0104] 6. Select deployment actions based on policy network

[0105] 7. Execute actions , the environment state changes to

[0106] 8. end for

[0107] 9. Get the reward for the last interaction with the environment , and assign the previous reward

[0108] 10. Deploy the experience data of this deployment Put into experience replay pool M

[0109] 11.For each training do:

[0110] 12. Sample N four-tuple training data from the experience replay pool M

[0111] 13. Input the tuple into the evaluation network to calculate

[0112] ,

[0113] 14. According to Update Q network parameters separately and

[0114] 15. According to Update Policy Network Parameters ;

[0115] 16. Update the entropy coefficient

[0116] 17. Update evaluation network parameters ,

[0117] 18. end for

[0118] 19.end for

[0119] Step S20: Obtain a microservice deployment cumulative reward through the value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first spatial state information.

[0120] After the first vehicle requests the optimal microservice deployment action, the experience needs to be stored in the experience buffer playback area. The agent will randomly select a set of data from it to update the neural network parameters. The above process is continuously iterated to find the microservice deployment solution that can achieve the minimum latency and energy consumption.

[0121] It is understandable that in deep reinforcement learning algorithms, rewards represent the evaluation of reinforcement learning actions. For the model in this problem, the reward is the inverse of the weighted sum of latency and energy consumption. , this is because the model in this paper believes that the smaller the latency and energy consumption, the better, while reinforcement learning will learn the strategy with the largest reward, so the opposite number needs to be taken to balance. However, due to the particularity and complexity of multi-instance microservice deployment, the user latency of the entire edge network can only be calculated when all microservices are deployed. This is the only way to judge whether the previous decision is beneficial and excellent, so it is impossible to give a reward for an action. Specifically, the optimal service orchestration strategy is the trajectory with the largest reward in the last step, not the trajectory with the largest sum of rewards for all steps. To achieve this goal, we use reward plasticity and reward sharing to improve rewards.

[0122] Understandably, we use reward plasticity to restrict the reward space and ensure that the reward value is within a reasonable range. By limiting the reward value between [-C, C] by segmented rewards, we can avoid extreme reward values ​​from having too much impact on training while maintaining the balance and stability of rewards. This reward plasticity method can prevent the agent from being disturbed by excessively high or low reward values, so as to better explore and learn various deployment strategies.

[0123] Furthermore, the processing efficiency of the microservice for requests, the arrival rate of requests to the roadside edge nodes, and the number of microservice instances on the edge nodes are determined according to the microservice deployment action; the total delay is determined according to the processing efficiency of the microservice for requests, the arrival rate of requests to the roadside edge nodes, and the number of microservice instances on the edge nodes; the energy consumption of the roadside edge system is determined according to the power consumption of the roadside edge nodes and the data transmission energy consumption of the roadside edge nodes; the cumulative reward for microservice deployment is determined through a reward plasticity strategy based on the total delay and the energy consumption of the roadside edge system based on the value network in the vehicle-road collaborative service deployment model;

[0124] The reward plasticity strategy is:

[0125] ;

[0126]

[0127] In the formula, is the cumulative reward for microservice deployment, T is the total latency, P is the energy consumption of the roadside edge system, and is the importance coefficient, and [-C, C] is the reward limit.

[0128] Furthermore, the processing method for determining the total delay according to the microservice's request processing efficiency, the arrival rate of the request to the roadside edge node and the number of microservice instances on the edge node is as follows: determining the request processing delay according to the microservice's request processing efficiency, the arrival rate of the request to the roadside edge node and the number of microservice instances on the edge node; determining the service request processing speed according to the microservice's request processing efficiency, the arrival rate of the request to the roadside edge node and the number of microservice instances on the edge node; determining the queuing waiting time according to the number of microservice instances on the edge node, the arrival rate of the request to the roadside edge node, the service request processing speed and the microservice's request processing efficiency; determining the request information transmission time according to the required transmission information data volume corresponding to the vehicle request to be processed and the data transmission rate between nodes; and determining the total delay according to the request processing delay, the queuing waiting time and the request information transmission time.

[0129] In this embodiment, after the request sent by the vehicle reaches the edge node, the edge system will select a suitable route for it to traverse the corresponding microservices to complete the service. If a request needs to be completed by microservice 1, microservice 2, and microservice 3, then it must be processed by these three microservices in sequence. If the edge node does not have all the required microservices, the request will be forwarded to other edge nodes for processing. Therefore, the total delay of the request is It can be expressed as request processing delay, i.e. processing delay , waiting time in queue is called queue delay and the request information transmission time, i.e., the transmission delay sum.

[0130]

[0131] It is understandable that the same microservice allows multiple instances to exist, and the instances are independent of each other. They can be deployed on the same roadside edge node or on different roadside edge nodes. When a vehicle request arrives at a roadside edge node, if there is an idle microservice instance, the service can be processed immediately. If there is no idle instance, it will queue in the cache until an available microservice instance is processed. Therefore, a queuing model based on M / M / S waiting can be used for description and calculation. The processing speed of service requests can be expressed as:

[0132]

[0133] Then the processing delay of the request being processed by the microservice is:

[0134]

[0135] The waiting time in the queue is:

[0136]

[0137] in represents the arrival rate of requests, Represents the processing rate of the microservice for the request. Represents the number of microservice instances on the edge node.

[0138] It is understandable that for requests that cannot be completed at a roadside edge node, the node will forward them, which adds additional transmission delay. From the Rayleigh fading channel model, it can be seen that the data transmission rate between nodes can be expressed as follows:

[0139]

[0140] in is the transmission channel bandwidth. is the transmission power of the server. h and are the channel fading coefficient and the channel Gaussian white noise respectively. D is the amount of information data to be transmitted, and ω is the channel path loss index. Therefore, the transmission time of information data between roadside edge nodes can be calculated as follows:

[0141]

[0142] It is understandable that the energy consumption of the roadside edge system is mainly composed of two parts: the energy consumption of the roadside edge nodes that undertake the service and the transmission energy consumption:

[0143]

[0144] The power consumption of roadside edge nodes mainly consists of static power consumption and dynamic power consumption. Static power consumption refers to the energy consumption required to maintain the server startup in the node under stable working state. The dynamic power consumption depends on the CPU load. represents the full load energy consumption of the node, Indicates the CPU load.

[0145] It should also be noted that before the step of determining the energy consumption of the roadside edge system according to the power consumption of the roadside edge node and the data transmission energy consumption of the roadside edge node, the data transmission power between the nodes, the node full load energy consumption, the server startup energy consumption and the CPU load are determined; the power consumption of the roadside edge node is calculated by the roadside edge node power consumption calculation formula according to the node full load energy consumption, the server startup energy consumption and the CPU load;

[0146] The power consumption calculation formula of roadside edge nodes is:

[0147]

[0148] In the formula, is the power consumption of the roadside edge node, Start energy consumption for the server, is the energy consumption of the node at full load, Indicates the CPU load.

[0149] Due to the frequent communication of microservices, the transmission energy consumption of data transmission between nodes cannot be ignored. The data transmission energy consumption of the roadside edge node is obtained by the transmission energy consumption formula according to the data transmission power between nodes, the request transmission time and the arrival rate of the request to the roadside edge node;

[0150] The transmission energy consumption formula is:

[0151]

[0152] In the formula, is the data transmission energy consumption of the roadside edge node, is the data transmission power between nodes.

[0153] Step S30: putting the microservice deployment cumulative reward and the microservice deployment action into an experience pool for reward sharing.

[0154] Understandably, we will eventually reward Shared with other actions in each deployment. That is, the reward of each action in each deployment is the same as the last step, which means that the reward of the last step will affect the previous decision. This way of reward sharing can make the agent pay more attention to the overall performance indicators rather than just the local rewards. Indicates the The reward for an action is , then the reward sharing can be expressed as .

[0155]

[0156] Step S40: Randomly select a quadruple from the experience pool, the quadruple including spatial state, action, action reward and future spatial state, and obtain the target value according to the policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model.

[0157] Furthermore, the processing method of obtaining the target value according to the four-tuple through the policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model is to input the four-tuple into the evaluation network in the vehicle-road cooperative service deployment model, and calculate the target value of the value network through the policy entropy function formula in the evaluation network;

[0158] The policy entropy function formula is:

[0159]

[0160] In the formula, is the target value of the i-th batch, is the action reward for the i-th batch, is the expected future reward for the i+1th batch, is the expected entropy value of the future i+1 batch, is the action of the i+1th batch, is the spatial state of the i-th batch, is the action of the i-th batch, is the future spatial state of the i+1th batch.

[0161] Step S50: Based on the target value, the value network and the policy network are updated respectively, and microservice deployment processing is performed on the second vehicle request through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model.

[0162] Furthermore, the processing method for updating the value network and the policy network respectively based on the target value is to determine the estimated value of the value network, the expected reward of the current state, and the entropy value of the current state; obtain the loss function of the value network through the loss function formula according to the estimated value and the target value of the value network, and update the value network based on the loss function of the value network; obtain the loss function of the policy network through the loss function formula according to the expected reward of the current state and the entropy value of the current state, and update the policy network based on the loss function of the policy network.

[0163] The method for updating the value network based on the loss function of the value network is to determine whether the loss function of the value network is greater than the preset value loss threshold; if the loss function of the value network is greater than the preset value loss threshold, the value network is updated based on the loss function of the value network.

[0164] The method for updating the policy network based on the loss function of the policy network is to determine whether the loss function of the policy network is greater than the preset policy loss threshold; if the loss function of the updated policy network is greater than the preset policy loss threshold, the policy network is updated based on the loss function of the policy network.

[0165] In this embodiment, the loss of the value network and the loss of the policy network are calculated according to the minimum mean square error formula, and the parameters of the value network and the policy network are updated.

[0166] The loss function of the value network is:

[0167]

[0168] Represents the current target value, Represents the value estimated by the current value network. The parameters are updated through the loss function to minimize the difference between the two, that is, the output of the value network is as equal to the target value as possible. It represents the average of the empirical samples taken out.

[0169] The loss function of the policy network is:

[0170]

[0171] The smaller value of the two estimated values ​​of the value network represents the expected reward of the current state, is the entropy value of the current state, and the sum of the two is the target value of the current state. The neural network will be trained in the direction of reducing the loss function, that is, in the direction of increasing the target value and obtaining a better deployment plan.

[0172] In a specific implementation, the entropy coefficient is adaptively updated, the value network and the policy network are updated with the target value at fixed intervals, and the microservice deployment processing is performed on the second vehicle request through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model.

[0173] In this embodiment, first, a microservice deployment action is obtained through the policy network in the vehicle-road collaborative service deployment model according to the first vehicle request and the first spatial state information, and the first spatial state information includes the vehicle request state, the roadside edge system resource state and the deployed service state. Then, the microservice deployment cumulative reward is obtained through the value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first spatial state information. Then, the microservice deployment cumulative reward and the microservice deployment action are put into the experience pool for reward sharing. A quadruple is randomly selected from the experience pool, and the quadruple includes a spatial state, an action, an action reward and a future spatial state. Based on the evaluation network in the vehicle-road collaborative service deployment model, the target value is obtained according to the quadruple through the policy entropy function formula. Finally, based on the target value, the value network and the policy network are updated respectively, and the second vehicle request is processed by the microservice deployment through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model. This embodiment solves the problem through a reward-based improved entropy reinforcement learning algorithm, uses reward sharing and reward plasticity to assign rewards, continuously learns and provides feedback, and finds the deployment solution with the best comprehensive performance indicators. In this way, in a roadside edge system of vehicle-road collaboration where massive requests are constantly arriving, it can effectively balance the end-to-end response delay and system energy consumption of vehicle requests, thereby improving the request processing rate and realizing green edge computing.

[0174] Reference Figure 6 , Figure 6This is a structural block diagram of the first embodiment of the microservice deployment system based on vehicle-road collaboration of the present invention.

[0175] like Figure 6 As shown, the microservice deployment system based on vehicle-road collaboration proposed in an embodiment of the present invention includes:

[0176] A deployment module 6001 is used to obtain a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial state information, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state;

[0177] Reward module 6002, used to obtain a microservice deployment cumulative reward through a value network in the vehicle-road cooperative service deployment model according to the microservice deployment action and the first space state information;

[0178] Sharing module 6003, used to put the microservice deployment cumulative reward and the microservice deployment action into the experience pool for reward sharing;

[0179] A calculation module 6004 is used to randomly select a quadruple from the experience pool, the quadruple including a space state, an action, an action reward, and a future space state, and obtain a target value according to the quadruple through a policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model;

[0180] The updating module 6005 is used to update the value network and the strategy network respectively based on the target value, and perform microservice deployment processing on the second vehicle request through the updated strategy network and the updated value network in the vehicle-road collaborative service deployment model.

[0181] In this embodiment, first, a microservice deployment action is obtained through the policy network in the vehicle-road collaborative service deployment model according to the first vehicle request and the first spatial state information, and the first spatial state information includes the vehicle request state, the roadside edge system resource state and the deployed service state. Then, the microservice deployment cumulative reward is obtained through the value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first spatial state information. Then, the microservice deployment cumulative reward and the microservice deployment action are put into the experience pool for reward sharing. A quadruple is randomly selected from the experience pool, and the quadruple includes a spatial state, an action, an action reward and a future spatial state. Based on the evaluation network in the vehicle-road collaborative service deployment model, the target value is obtained according to the quadruple through the policy entropy function formula. Finally, based on the target value, the value network and the policy network are updated respectively, and the second vehicle request is processed by the microservice deployment through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model. This embodiment solves the problem through a reward-based improved entropy reinforcement learning algorithm, uses reward sharing and reward plasticity to assign rewards, continuously learns and provides feedback, and finds the deployment solution with the best comprehensive performance indicators. In this way, in a roadside edge system of vehicle-road collaboration where massive requests are constantly arriving, it can effectively balance the end-to-end response delay and system energy consumption of vehicle requests, thereby improving the request processing rate and realizing green edge computing.

[0182] Other embodiments or specific implementation methods of the microservice deployment system based on vehicle-road collaboration of the present invention can refer to the above-mentioned method embodiments and will not be repeated here.

[0183] 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 system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0184] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0186] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A microservice deployment method based on vehicle-road collaboration, characterized in that: The microservice deployment method based on vehicle-road collaboration includes the following steps: Obtaining a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial state information, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state; Obtaining a microservice deployment cumulative reward through a value network in the vehicle-road collaborative service deployment model according to the microservice deployment action and the first space state information; Put the microservice deployment cumulative reward and the microservice deployment action into the experience pool for reward sharing; Randomly select a quadruple from the experience pool, the quadruple including a spatial state, an action, an action reward, and a future spatial state, and obtain a target value according to the quadruple through a policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model; The value network and the policy network are updated respectively based on the target value, and a microservice deployment process is performed on the second vehicle request through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model; The step of obtaining the microservice deployment cumulative reward through the value network in the vehicle-road cooperative service deployment model according to the microservice deployment action and the first space state information includes: Determine the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node according to the microservice deployment action; Determine the total delay according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node; Determining the energy consumption of a roadside edge system according to the power consumption of the roadside edge node and the data transmission energy consumption of the roadside edge node; Determine the cumulative reward for microservice deployment through a reward plasticity strategy based on the value network in the vehicle-road cooperative service deployment model according to the total delay and the energy consumption of the roadside edge system; The reward plasticity strategy is: ; In the formula, is the cumulative reward for microservice deployment, T is the total latency, P is the energy consumption of the roadside edge system, and is the importance coefficient, -C is the minimum limit of the reward, and C is the maximum limit of the reward.

2. The method according to claim 1, characterized in that The step of determining the total delay according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node includes: Determining a request processing delay based on a processing efficiency of the microservice for the request; Determine the service request processing speed according to the processing efficiency of the microservice for the request, the arrival rate of the request to the roadside edge node, and the number of microservice instances on the edge node; Determine the queuing waiting time according to the number of microservice instances on the edge node, the arrival rate of the request to the roadside edge node, the service request processing speed, and the processing efficiency of the microservice for the request; Determine the request information transmission time according to the required transmission information data volume corresponding to the vehicle request to be processed and the data transmission rate between nodes; The total delay is determined according to the request processing delay, the queuing waiting time and the request information transmission time.

3. The method according to claim 2, characterized in that Before the step of determining the energy consumption of the roadside edge system according to the power consumption of the roadside edge node and the data transmission energy consumption of the roadside edge node, the step further includes: Determine the data transmission power between nodes, node full load energy consumption, server startup energy consumption and CPU load; Calculating the power consumption of the roadside edge node according to the full load energy consumption of the node, the server startup energy consumption and the CPU load using a roadside edge node power consumption calculation formula; The power consumption calculation formula of the roadside edge node is: In the formula, is the power consumption of the roadside edge node, Start energy consumption for the server, is the energy consumption of the node at full load, For CPU load; The data transmission energy consumption of the roadside edge node is obtained by using a transmission energy consumption formula according to the data transmission power between the nodes, the request information transmission time and the arrival rate of the request to the roadside edge node; The transmission energy consumption formula is: In the formula, is the data transmission energy consumption of the roadside edge node, is the data transmission power between nodes, To request information transmission time, is the arrival rate of requests to roadside edge nodes.

4. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining the target value according to the four-tuple through the policy entropy function formula based on the evaluation network in the vehicle-road cooperative service deployment model includes: Input the four-tuple into the evaluation network in the vehicle-road cooperative service deployment model, and calculate the target value of the value network through the policy entropy function formula in the evaluation network; The strategy entropy function formula is: In the formula, is the target value of the i-th batch, is the action reward for the i-th batch, is the expected future reward for the i+1th batch, is the expected entropy value of the future i+1 batch, is the action of the i+1th batch, is the spatial state of the i-th batch, is the action of the i-th batch, is the future spatial state of the i+1th batch, To evaluate the neural network parameters of the network, To assess the estimated value of the network, is the output of the policy network, are the neural network parameters of the policy network.

5. The method according to claim 4, characterized in that The step of updating the value network and the strategy network respectively based on the target value comprises: Determine the estimated value of the value network, the expected reward of the current state, the current state ; Obtaining a loss function of the value network according to the estimated value of the value network and the target value through a loss function formula, and updating the value network based on the loss function of the value network; According to the current state expected reward and the current state The loss function of the policy network is obtained through the loss function formula, and the policy network is updated based on the loss function of the policy network.

6. The method according to claim 5, characterized in that The step of updating the value network based on the loss function of the value network comprises: Determining whether the loss function of the value network is greater than a preset value loss threshold; If the loss function of the value network is greater than the preset value loss threshold, updating the value network based on the loss function of the value network; The step of updating the policy network based on the loss function of the policy network comprises: Determine whether the loss function of the strategy network is greater than a preset strategy loss threshold; If the loss function of the updated policy network is greater than the preset policy loss threshold, the policy network is updated based on the loss function of the policy network.

7. A microservice deployment system based on vehicle-road collaboration, characterized in that: The microservice deployment system based on vehicle-road collaboration includes: A deployment module, configured to obtain a microservice deployment action through a policy network in a vehicle-road collaborative service deployment model according to a first vehicle request and first spatial state information, wherein the first spatial state information includes a vehicle request state, a roadside edge system resource state, and a deployed service state; A reward module, configured to obtain a microservice deployment cumulative reward through a value network in the vehicle-road cooperative service deployment model according to the microservice deployment action and the first spatial state information; A sharing module, used to put the accumulated rewards of the microservice deployment and the microservice deployment actions into an experience pool for reward sharing; A calculation module, configured to randomly select a quadruple from the experience pool, the quadruple including a spatial state, an action, an action reward, and a future spatial state, and obtain a target value according to the quadruple through a policy entropy function formula based on an evaluation network in the vehicle-road cooperative service deployment model; An updating module, configured to update the value network and the policy network respectively based on the target value, and perform microservice deployment processing on the second vehicle request through the updated policy network and the updated value network in the vehicle-road collaborative service deployment model; Among them, the microservice deployment system based on vehicle-road collaboration implements the steps of the microservice deployment method based on vehicle-road collaboration as described in any one of claims 1 to 6.

8. A microservice deployment device based on vehicle-road collaboration, characterized in that: The device includes: a memory, a processor, and a microservice deployment program based on vehicle-road collaboration stored in the memory and executable on the processor, wherein the microservice deployment program based on vehicle-road collaboration is configured to implement the steps of the microservice deployment method based on vehicle-road collaboration as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a microservice deployment program based on vehicle-road collaboration. When the microservice deployment program based on vehicle-road collaboration is executed by the processor, the steps of the microservice deployment method based on vehicle-road collaboration as described in any one of claims 1 to 6 are implemented.