Edge server task cache model training and caching method and device

Through the alternating training strategy and value network of edge server status samples, an effective task caching strategy is generated, which solves the problem of wasting edge server task caching resources and improves resource utilization and user experience.

CN118567807APending Publication Date: 2024-08-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410703429.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, edge servers fail to effectively cache tasks when executing user tasks, resulting in a waste of memory and computing resources, reducing user experience, and making it difficult to cache tasks reasonably.

Method used

By obtaining the edge server status sample, input the policy network in the preset task cache model, output the action sample information, and collect the reward information to form an experience quadruple, which is stored in the experience replay pool, randomly sampled for value network training, and alternate training Policy and value network to generate effective task caching policies.

Benefits of technology

Learn effective task caching strategies in complex environments, maintain a balance between exploration and utilization, improve edge server resource utilization, and enhance user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567807A
    Figure CN118567807A
Patent Text Reader

Abstract

The invention provides an edge server task cache model training and caching method and device, and relates to the technical field of data processing, and the method comprises the steps: obtaining an edge server state sample of a target region; for any edge server state sample, inputting a strategy network in a preset edge server task cache model, outputting action sample information corresponding to the edge server state sample, and collecting reward information obtained after the action sample information is executed and a next state sample of the target area; taking the edge server state sample, the action sample information, the reward information and the next state sample of the target area as an experience tetrad of the target area, and storing the experience tetrad of the target area into an experience playback pool; and training a value network in a preset edge server task cache model according to the experience tetrad randomly sampled in the experience playback pool until a first preset training condition is met, and stopping training to obtain a trained edge server task cache model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an edge server task cache model training, caching method and device. Background Art

[0002] With the continuous development of digital technology, cloud computing services have also been more widely used. However, in related technologies, edge servers can execute all types of computing tasks offloaded by users, but do not consider whether the corresponding tasks are cached on the edge servers. In addition, due to the limited memory capacity and computing power of edge servers, all users' tasks cannot be cached. If redundant tasks are cached on edge servers, the memory and computing resources of the edge servers will be wasted, thereby reducing the user experience.

[0003] Therefore, how to reasonably cache tasks on edge servers has become an urgent problem to be solved in the industry. Summary of the invention

[0004] The present invention provides an edge server task cache model training, a cache method and a device, which are used to solve the problem of how to reasonably perform task cache of an edge server in the prior art.

[0005] The present invention provides an edge server task cache model training method, comprising:

[0006] Get edge server status samples in the target area;

[0007] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0008] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0009] Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0010] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0011] According to a method for training an edge server task cache model provided by the present invention, the value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool, including:

[0012] The first value sub-network in the value network performs a first value evaluation on the experience quadruple to obtain a first target Q value that minimizes the Bellman error;

[0013] The second value sub-network in the value network performs a second value evaluation on the experience quadruple to obtain a second target Q value that minimizes the Bellman error;

[0014] Calculating a first loss value of the value network according to the first target Q value, and calculating a second loss value of the value network according to the second target Q value;

[0015] Using the first loss value and the second loss value to perform back propagation on the first value sub-network and the second value sub-network in the value network respectively, and updating the network parameters in the first value sub-network and the second value sub-network;

[0016] Traversing each experience quadruple in the experience replay pool until a second preset iteration stop condition is met, stopping the training of the value network, and obtaining a trained value network;

[0017] Among them, the first value sub-network and the second value sub-network are two independent Q value networks; the first value sub-network and the second value sub-network after updating the network parameters are used to evaluate the action sample information in the policy network in the preset edge server task cache model.

[0018] According to a method for training an edge server task cache model provided by the present invention, the method for training a policy network in a preset edge server task cache model includes:

[0019] Input the edge server state sample into the policy network in the preset edge server task cache model, and output action sample information corresponding to the edge server state sample;

[0020] The action sample information is evaluated by the first value sub-network and the second value sub-network after updating the network parameters to obtain a first evaluation Q value and a second evaluation Q value;

[0021] Calculating a third loss value of the policy network according to a minimum value of the first evaluation Q value and the second evaluation Q value, and an evaluation value of the edge server state sample;

[0022] When the third loss value converges, the policy network stops training to obtain a trained policy network.

[0023] According to an edge server task cache model training method provided by the present invention, the first preset training condition includes at least one of the following: the policy network stops training and the value network stops training, a preset number of training times is met, and a preset training duration is met.

[0024] According to a method for training an edge server task cache model provided by the present invention, before the step of training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool, the method further includes:

[0025] According to the positioning information of the target area, acquiring other areas whose distance from the target area is less than a preset distance;

[0026] The experience quadruple corresponding to the edge server state samples of the other regions is obtained, and the experience quadruple of the other regions is stored in the experience replay pool.

[0027] According to a method for training an edge server task cache model provided by the present invention, before the step of inputting a policy network in a preset edge server task cache model for any edge server state sample, the method further includes:

[0028] Initialize the network parameters of the policy network, and initialize the first value sub-network, the second value network and their corresponding first target network and second target network.

[0029] The present invention also provides an edge server task caching method, comprising:

[0030] Get the edge server status information of the current area;

[0031] Inputting the edge server status information of the current area into the trained edge server task caching model, and outputting the edge server task caching strategy of the current area;

[0032] The training method of the trained edge server task cache model includes:

[0033] Get edge server status samples in the target area;

[0034] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0035] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0036] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0037] An edge server task cache model training device provided by the present invention includes:

[0038] A first acquisition module is used to acquire edge server status samples in a target area;

[0039] A first output module is used to input a policy network in a preset edge server task cache model for any edge server state sample, output action sample information corresponding to the edge server state sample, and collect reward information obtained after executing the action sample information and a next state sample of a target area;

[0040] A storage module, used to take the edge server state sample, the action sample information, the reward information and the next state sample of the target area as an experience quadruple of a target area, and store the experience quadruple of the target area in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0041] A training module, used for training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0042] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0043] An edge server task caching device provided according to the present invention includes:

[0044] The second acquisition module is used to obtain the edge server status information of the current area;

[0045] A second output module is used to input the edge server status information of the current area into the trained edge server task cache model, and output the edge server task cache strategy of the current area;

[0046] The training method of the trained edge server task cache model includes:

[0047] Get edge server status samples in the target area;

[0048] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0049] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0050] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0051] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the edge server task cache model training method or the edge server task cache method as described above is implemented.

[0052] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the edge server task cache model training method or the edge server task cache method described above is implemented.

[0053] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the edge server task cache model training methods or the edge server task cache methods described above.

[0054] The edge server task cache model training, caching method and device provided by the present invention, by alternately training the policy network and the value network in the preset edge server task cache model, the policy network generates new actions, the value network evaluates the value of these actions, and provides feedback to improve the policy network. In this way, effective strategies can be learned in a complex environment while maintaining a balance between exploration and utilization, and the experience quadruplets of other areas adjacent to the target area are introduced into the experience replay pool, so that more sufficient training samples can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A flow chart of a method for training an edge server task cache model provided in an embodiment of the present application;

[0057] Figure 2 An algorithm framework diagram provided for an embodiment of the present application;

[0058] Figure 3 The algorithm flow chart provided for the embodiment of the present application;

[0059] Figure 4 A schematic diagram of the process flow of the edge server task caching method provided in an embodiment of the present application;

[0060] Figure 5 A schematic diagram of the structure of an edge server task cache model training device provided in an embodiment of the present application;

[0061] Figure 6 A schematic diagram of the structure of an edge server task cache device provided in an embodiment of the present application;

[0062] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] Figure 1 A flow chart of the edge server task cache model training method provided in the embodiment of the present application is as follows: Figure 1 As shown, including:

[0065] Step 110, obtaining edge server status samples in the target area;

[0066] The target area described in the embodiments of the present application may be a pre-defined specific area, and may be an area determined according to the distribution of edge servers, or an area divided according to geographical location. State samples are collected from edge servers in the target area. These samples reflect the current state of the server, and may include resource usage, task queue status, network conditions, etc.

[0067] In an optional embodiment, the edge server status sample may be a sample carrying an edge server task cache policy tag.

[0068] Step 120: for any edge server state sample, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0069] In the embodiment of the present application, the state sample of each edge server is passed as input to the preset policy network, and a parameter is Strategy Network The role is to collect the task request of each time slot and the cache decision of the previous time slot as the input of the system by interacting with the environment. t , output task cache decision a through the policy network t .

[0070] The policy network outputs action sample information based on the input state samples. In the edge server task caching model, the action may involve deciding which tasks should be cached, which tasks should be pushed to the cloud or other servers, or which tasks should be processed first.

[0071] Execute the actions output by the policy network in the actual edge server environment. This may involve actual task scheduling, resource allocation, or cache management. After executing the actions, collect reward information related to these actions. The reward is usually based on the result of executing the action, which may be reduced task completion time, improved resource utilization, reduced energy consumption, etc. After executing the action and collecting the reward, obtain the next state sample of the target area. This may involve updating the server state, including new task arrival, task completion, or resource state change.

[0072] Step 130, taking the edge server state sample, the action sample information, the reward information and the next state sample of the target area as an experience quadruple of a target area, and storing the experience quadruple of the target area in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0073] In the embodiment of the present application, Experience Replay Buffer (ERB) is an important component that allows the agent to store and reuse past experiences.

[0074] Combine the current state sample, the action performed, the reward collected, and the next state sample into an experience quadruple (st, at, rt, st+1). st is the state sample at time step t.

[0075] Among them, at is the action sample taken in state st, rt is the reward obtained after taking action at; st+1 is the next state sample at time step t+1.

[0076] The experience quadruple (st, at, rt, st+1) is stored in the experience replay pool. The experience replay pool usually has a maximum capacity. When the capacity limit is reached, the oldest experience will be replaced by the new experience.

[0077] The experience replay pool stores not only the experience quadruple of the target area, but also the experience quadruple of other areas adjacent to the target area. The purpose of this is to enable the agent to learn the mutual influence and synergy between different areas.

[0078] Step 140, training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0079] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0080] In the embodiment of the present application, when training the value network, a batch of experience quadruplets are randomly sampled from the experience playback pool. Random sampling helps to break the correlation of time series data and improve the stability of the learning process.

[0081] The sampled experience quadruple is used to train the value network, and the trained value network is used to participate in the training of the strategy network. Through continuous iteration, the training of the edge server task cache model is effectively realized.

[0082] In the embodiment of the present application, by alternately training the policy network and the value network in the preset edge server task cache model, the policy network generates new actions, the value network evaluates the value of these actions, and provides feedback to improve the policy network. In this way, effective strategies can be learned in complex environments while maintaining a balance between exploration and utilization, and the experience quadruplets of other areas adjacent to the target area are introduced into the experience replay pool, so that more sufficient training samples can be obtained.

[0083] Optionally, training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool includes:

[0084] The first value sub-network in the value network performs a first value evaluation on the experience quadruple to obtain a first target Q value that minimizes the Bellman error;

[0085] The second value sub-network in the value network performs a second value evaluation on the experience quadruple to obtain a second target Q value that minimizes the Bellman error;

[0086] Calculating a first loss value of the value network according to the first target Q value, and calculating a second loss value of the value network according to the second target Q value;

[0087] Using the first loss value and the second loss value to perform back propagation on the first value sub-network and the second value sub-network in the value network respectively, and updating the network parameters in the first value sub-network and the second value sub-network;

[0088] Traversing each experience quadruple in the experience replay pool until a second preset iteration stop condition is met, stopping the training of the value network, and obtaining a trained value network;

[0089] Among them, the first value sub-network and the second value sub-network are two independent Q value networks; the first value sub-network and the second value sub-network after updating the network parameters are used to evaluate the action sample information in the policy network in the preset edge server task cache model.

[0090] In the embodiment of the present application, the Critic part of the value network includes two independent Q-value networks, usually represented as the first value sub-network Q1 and the second value sub-network Q2. The two networks respectively learn the value functions of the state-action pair, namely Q1(s,a;θ1) and Q2(s,a;θ2), where θ and θ2 are the parameters of the two networks respectively.

[0091] To increase the stability of the learning process, each Q-value network has a corresponding target network, denoted as the first target network Qtarget,1 and the second target network Qtarget,2. The parameters θ1target and θ2target of the target network are moving averages of the main network parameters, which helps smooth the learning process because they are updated more slowly.

[0092] The goal is to make the Bellman error J Q (θ) minimum:

[0093]

[0094] Among them, E represents expectation, and the state value function V θ (s t ) is expressed as:

[0095] V θ (s t )=π(s t ) T [Q(s t )-αln(π(s t ))]

[0096] Among them, π(s t ) means in s t The probability set of each action in the state, Q(s t ) means s t The set of Q values ​​for each action in the state, so V can be directly calculated θ (s t ) value.

[0097] The Critic part has two independent Q value networks and Each Q value network also corresponds to a target Q value network and Its function is to stabilize the learning effect of the Q value network and use the minimum value of the two Q value network outputs as the Q value network output of the Critic part:

[0098]

[0099] Next, use this target Q value Y to calculate the loss function of the Critic network. Usually, the mean square error (MSE) is used as the loss function. The formula is as follows: L=12(Q1(s,a;θ1)-Y)2+12(Q2(s,a;θ2)-Y)2L=2; This loss function L measures the difference between the values ​​predicted by the two Q value networks and the target Q value Y.

[0100] Then, the network parameters in the first value sub-network and the second value sub-network are updated according to the loss value; new experience quadruplets are continuously randomly obtained from the experience replay pool for training until the preset number of training times is met, or the model converges, then the connection is stopped to obtain a trained value network.

[0101] In the embodiment of the present application, the two value sub-networks Q1 and Q2 learn independently and complement each other, which helps to reduce the over-estimation problem and improve the stability of value estimation. Ultimately, the trained value network can provide accurate action value evaluation for the policy network, thereby guiding the policy network to output a better task caching strategy.

[0102] Optionally, the training method of the policy network in the preset edge server task cache model includes:

[0103] Input the edge server state sample into the policy network in the preset edge server task cache model, and output action sample information corresponding to the edge server state sample;

[0104] The action sample information is evaluated by the first value sub-network and the second value sub-network after updating the network parameters to obtain a first evaluation Q value and a second evaluation Q value;

[0105] Calculating a third loss value of the policy network according to a minimum value of the first evaluation Q value and the second evaluation Q value, and an evaluation value of the edge server state sample;

[0106] When the third loss value converges, the policy network stops training to obtain a trained policy network.

[0107] In the embodiment of the present application, the goal of the algorithm optimization is to find the optimal edge server task caching strategy π * :

[0108]

[0109] Among them, E represents the mean, T is the number of time steps, r(s t ,a t ) is the agent in state s t Next, perform action a t The reward obtained, γ∈[0,1] is the discount factor, s t ,a t are the state and action of the agent at time t. π is the strategy π under (s t ,a t ) trajectory distribution. α determines the importance of the entropy term relative to the reward and is the temperature coefficient. H(π(·|s t ))=-lnπ(·|s t), H(π(·|s t ) indicates that the strategy is in state s t The entropy at .

[0110] In the embodiment of the present application, the policy network Actor part observes the edge server status sample s t Then output action sample information a t , execute action sample information a t After that, collect the reward r t And observe the next state s t+1 . Experience Group(s) t ,a t ,r t ,s t+1 ) will be collected and stored in the experience replay pool D.

[0111] For each state-action pair (st, at), Q1 and Q2 calculate the first evaluation Q value Q1(st, at; θ1) and the second evaluation Q value Q2(st, at; θ2) respectively.

[0112] According to the evaluation Q value of the two value networks, the minimum value of the two is selected as the evaluation value of the action. This can increase stability and reduce estimation errors: Qmin = min(Q1(st,at;θ1),Q2(st,at;θ2)); The evaluation value of the edge server state sample may be the action probability distribution determined by the policy network π(a|s;φ).

[0113] Combining the minimum evaluation Q value and the evaluation value of the state sample, the third loss value LActor of the policy network is calculated. The loss function in the SAC algorithm usually includes an entropy term to encourage exploration, expressed as follows: LActor = -αlogπ(at|st;φ)-Qmin(st,at) where α is a coefficient that adjusts the importance of the entropy term.

[0114] Use the third loss value LActor for back propagation to update the policy network's parameter φ. Continue to update the policy network and check whether the third loss value converges after each iteration, that is, whether the loss value is stable in a small range. When the third loss value converges or meets other preset stop conditions, stop training the policy network.

[0115] Figure 2 The algorithm framework diagram provided in the embodiment of the present application is as follows: Figure 2 As shown, it includes the policy network Actor, the value network Critic, and the experience replay pool. After the policy network obtains the environment state information, it generates the experience quadruple and stores it in the experience replay pool for the value network to randomly sample from the experience replay pool, and the adjacent edge servers will also share the experience quadruple in the experience replay pool.

[0116] Figure 3 The algorithm flow chart provided in the embodiment of the present application is as follows: Figure 3 As shown in the figure, the training process of the Actor network and the Critic network is carried out alternately, forming an iterative optimization cycle:

[0117] Initialization: Initialize the policy network π(a|s; φ). Initialize two value networks Q1(s,a;θ1) and Q2(s,a;θ2) and their corresponding target networks Qtarget,1 and Qtarget,2.

[0118] Collect data: The agent performs actions in the environment according to the current policy network ππ, collects experience data (s, a, r, s′), and stores the experience data in the experience replay pool.

[0119] Training the value network (Critic): Randomly sample a batch of experience quads from the experience replay pool. Use the sampled data to calculate the target value Y of the two value networks and take the minimum value of the output of the two target networks. Calculate the loss function (e.g., mean square error) of the two value networks. Perform backpropagation and update the network parameters θ1 and θ2 of Q1 and Q2.

[0120] Update the target network: Update the parameters of the target network using a slow update rule, such as an exponential moving average: θ1target←τθ1target+(1-τ)θ1; where τ is a small positive number, such as 0.005.

[0121] Training the policy network (Actor): Use the current policy network π to sample new actions and execute them to obtain new experience data. Use the updated value networks Q1 and Q2 to evaluate the value of the sampled actions. Calculate the loss function of the policy network, including an entropy term to encourage exploration. Perform backpropagation and update the parameters φ of the policy network.

[0122] Repeat the above steps of training the value network, updating the target network, and training the policy network to train the value network and the policy network. In each iteration, the policy network tries to find a better action policy, and the value network provides an evaluation of these policies.

[0123] Evaluate the agent's performance periodically during training. Adjust the learning rate, temperature parameter α, or other hyperparameters based on performance feedback.

[0124] Through this alternating training method, a balance can be achieved between exploration and exploitation, so that effective strategies can be learned in complex environments. This process is adaptive, and as experience data accumulates, the strategy of the agent will gradually improve, thereby effectively implementing the edge server task caching strategy.

[0125] Optionally, before the step of training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool, the method further includes:

[0126] According to the positioning information of the target area, acquiring other areas whose distance from the target area is less than a preset distance;

[0127] The experience quadruple corresponding to the edge server state samples of the other regions is obtained, and the experience quadruple of the other regions is stored in the experience replay pool.

[0128] In the embodiment of the present application, the geographical location or network topological location of the target area is first determined, and based on the location information of the target area, all other areas whose distance from the target area is less than a preset distance are searched and identified. The preset distance can be a geographical distance or other related metrics such as network delay.

[0129] Obtain edge server status samples from these neighboring regions. These samples may include server resource usage, task queue status, network conditions, and other information. For each state sample of the neighboring region, perform actions and collect corresponding reward information and the next state sample to construct an experience quadruple.

[0130] The experience quadruplets of these neighboring regions are stored in the experience replay pool. This allows the agent to learn the mutual influence and synergy between different regions.

[0131] Figure 4 A flow chart of the edge server task caching method provided in the embodiment of the present application is as follows: Figure 4 As shown, including:

[0132] Step 410, obtaining edge server status information of the current area;

[0133] Step 420, inputting the edge server status information of the current area into the trained edge server task cache model, and outputting the edge server task cache strategy of the current area;

[0134] The training method of the trained edge server task cache model includes:

[0135] Get edge server status samples in the target area;

[0136] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0137] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0138] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0139] In an embodiment of the present application, the preprocessed current region edge server status information is provided as input to a trained edge server task cache model.

[0140] The model uses the learned strategy based on the input state information to output the edge server task caching strategy for the current area.

[0141] The edge server task caching strategy in the embodiment of the present application includes: specific strategies of task caching, offloading, and transfer.

[0142] The task caching strategy output by the model is applied to the actual edge server management to perform corresponding task scheduling and resource allocation.

[0143] More specifically, the training steps of the edge server task cache model in the embodiment of the present application are detailed in the description of the above embodiment and will not be repeated here.

[0144] The edge server task caching device and the edge server task caching model training device provided by the present invention are described below. The edge server task caching device and the edge server task caching model training device described below can correspond to each other with the edge server task caching method and the edge server task caching model training method described above.

[0145] Figure 5 A schematic diagram of the structure of the edge server task cache model training device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, including:

[0146] The first acquisition module 510 is used to acquire edge server status samples in a target area;

[0147] The first output module 520 is used to input the policy network in the preset edge server task cache model for any edge server state sample, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0148] The storage module 530 is used to take the edge server state sample, the action sample information, the reward information and the next state sample of the target area as an experience quadruple of a target area, and store the experience quadruple of the target area in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0149] The training module 540 is used to train the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until the first preset training condition is met, stop the training, and obtain the trained edge server task cache model;

[0150] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0151] Figure 6 A schematic diagram of the structure of the edge server task cache device provided in the embodiment of the present application is shown in FIG. Figure 6 As shown, including:

[0152] The second acquisition module 610 is used to obtain edge server status information of the current area;

[0153] The second output module 620 is used to input the edge server status information of the current area into the trained edge server task cache model, and output the edge server task cache strategy of the current area;

[0154] The training method of the trained edge server task cache model includes:

[0155] Get edge server status samples in the target area;

[0156] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0157] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0158] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0159] In the embodiment of the present application, the policy network and the value network in the preset edge server task cache model are alternately trained, the policy network generates new actions, the value network evaluates the value of these actions, and provides feedback to improve the policy network. In this way, effective strategies can be learned in complex environments while maintaining a balance between exploration and utilization, and the experience quadruplets of other areas adjacent to the target area are introduced into the experience replay pool, so that more sufficient training samples can be obtained.

[0160] Figure 7 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the edge server task cache model training method or the edge server task cache method, and the edge server task cache model training method includes: obtaining edge server status samples in the target area;

[0161] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0162] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0163] Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0164] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0165] The edge server task caching method includes:

[0166] Get the edge server status information of the current area;

[0167] Inputting the edge server status information of the current area into the trained edge server task caching model, and outputting the edge server task caching strategy of the current area;

[0168] The training method of the trained edge server task cache model includes:

[0169] Get edge server status samples in the target area;

[0170] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0171] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0172] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0173] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0174] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the edge server task caching method provided by the above methods, the edge server task caching model training method includes: obtaining edge server status samples in a target area;

[0175] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0176] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0177] Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0178] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0179] The edge server task caching method includes:

[0180] Get the edge server status information of the current area;

[0181] Inputting the edge server status information of the current area into the trained edge server task caching model, and outputting the edge server task caching strategy of the current area;

[0182] The training method of the trained edge server task cache model includes:

[0183] Get edge server status samples in the target area;

[0184] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0185] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0186] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0187] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the edge server task caching method provided by the above methods, and the edge server task caching model training method includes: obtaining edge server status samples in a target area;

[0188] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0189] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0190] Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model;

[0191] The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

[0192] The edge server task caching method includes:

[0193] Get the edge server status information of the current area;

[0194] Inputting the edge server status information of the current area into the trained edge server task caching model, and outputting the edge server task caching strategy of the current area;

[0195] The training method of the trained edge server task cache model includes:

[0196] Get edge server status samples in the target area;

[0197] For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area;

[0198] The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area;

[0199] The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

[0200] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0201] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for training an edge server task cache model, characterized in that: include: Get edge server status samples in the target area; For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area; The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area; Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model; The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

2. The edge server task cache model training method according to claim 1, characterized in that: Training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool includes: The first value sub-network in the value network performs a first value evaluation on the experience quadruple to obtain a first target Q value that minimizes the Bellman error; The second value sub-network in the value network performs a second value evaluation on the experience quadruple to obtain a second target Q value that minimizes the Bellman error; Calculating a first loss value of the value network according to the first target Q value, and calculating a second loss value of the value network according to the second target Q value; Using the first loss value and the second loss value to perform back propagation on the first value sub-network and the second value sub-network in the value network respectively, and updating the network parameters in the first value sub-network and the second value sub-network; Traversing each experience quadruple in the experience replay pool until a second preset iteration stop condition is met, stopping the training of the value network, and obtaining a trained value network; Wherein, the first value sub-network and the second value sub-network are two independent Q-value networks; The first value sub-network and the second value sub-network after updating the network parameters are used to evaluate the action sample information in the policy network in the preset edge server task cache model.

3. The edge server task cache model training method according to claim 2, characterized in that: The training method of the policy network in the preset edge server task cache model includes: Input the edge server state sample into the policy network in the preset edge server task cache model, and output action sample information corresponding to the edge server state sample; The action sample information is evaluated by the first value sub-network and the second value sub-network after updating the network parameters to obtain a first evaluation Q value and a second evaluation Q value; Calculating a third loss value of the policy network according to a minimum value of the first evaluation Q value and the second evaluation Q value, and an evaluation value of the edge server state sample; When the third loss value converges, the policy network stops training to obtain a trained policy network.

4. The edge server task cache model training method according to claim 3, characterized in that: The first preset training condition includes at least one of the following: the policy network stops training and the value network stops training, a preset number of training times is met, and a preset training duration is met.

5. The edge server task cache model training method according to claim 1, characterized in that: Before the step of training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool, the method further includes: According to the positioning information of the target area, acquiring other areas whose distance from the target area is less than a preset distance; The experience quadruple corresponding to the edge server state samples of the other regions is obtained, and the experience quadruple of the other regions is stored in the experience replay pool.

6. The edge server task cache model training method according to claim 2, characterized in that: Before the step of inputting the policy network in the preset edge server task cache model for any edge server state sample, the method further includes: Initialize the network parameters of the policy network, and initialize the first value sub-network, the second value network and their corresponding first target network and second target network.

7. An edge server task caching method, characterized in that: include: Get the edge server status information of the current area; Inputting the edge server status information of the current area into the trained edge server task caching model, and outputting the edge server task caching strategy of the current area; The training method of the trained edge server task cache model includes: Get edge server status samples in the target area; For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area; The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area; The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

8. An edge server task cache model training device, characterized in that: include: A first acquisition module is used to acquire edge server status samples in a target area; A first output module is used to input a policy network in a preset edge server task cache model for any edge server state sample, output action sample information corresponding to the edge server state sample, and collect reward information obtained after executing the action sample information and a next state sample of a target area; A storage module, used to take the edge server state sample, the action sample information, the reward information and the next state sample of the target area as an experience quadruple of a target area, and store the experience quadruple of the target area in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area; A training module, used for training the value network in the preset edge server task cache model according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, stopping the training, and obtaining a trained edge server task cache model; The trained edge server task caching model is used to output the edge server task caching strategy of the target area according to the edge server status of the target area.

9. An edge server task cache device, characterized in that: include: The second acquisition module is used to obtain the edge server status information of the current area; A second output module is used to input the edge server status information of the current area into the trained edge server task cache model, and output the edge server task cache strategy of the current area; The training method of the trained edge server task cache model includes: Get edge server status samples in the target area; For any of the edge server state samples, input the policy network in the preset edge server task cache model, output the action sample information corresponding to the edge server state sample, and collect the reward information obtained after executing the action sample information and the next state sample of the target area; The edge server state sample, the action sample information, the reward information and the next state sample of the target area are used as an experience quadruple of a target area, and the experience quadruple of the target area is stored in an experience replay pool; wherein the experience replay pool also stores experience quadruple of other areas adjacent to the target area; The value network in the preset edge server task cache model is trained according to the experience quadruple randomly sampled from the experience replay pool until a first preset training condition is met, and the training is stopped to obtain a trained edge server task cache model.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the edge server task cache model training method as described in any one of claims 1 to 6 or the edge server task cache method as described in claim 7 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the edge server task cache model training method as described in any one of claims 1 to 6 or the edge server task cache method as described in claim 7 is implemented.

Citation Information

Cited By

  • Internet of Things edge server service caching method and device

    CN119544744A

  • Iot edge server service caching method and apparatus

    CN119544744B

  • Strategy model training method and device, computer equipment and storage medium

    CN120278215A

  • Training method, device, computer equipment and storage medium for strategy model

    CN120278215B