Micro-service container selection method and device based on terminal time delay

By constructing a gravity model based on multi-terminal delay and iteratively training the terminal gravity constant network model, the problem of ignoring the influence of terminal delay in the selection of microservice containers in the existing technology is solved, and the efficiency of microservice container selection and the stability of the power system are improved. , which enhances the evaluation of source-charge-reservoir interaction performance.

CN118798045APending Publication Date: 2024-10-18GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410932370.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing microservice container selection methods ignore the dynamic and nonlinear impact of terminal delay on source-load-storage interaction performance, resulting in resource waste, performance bottlenecks and system failures, and are difficult to accurately reflect the actual role of different terminals in the power system.

Method used

Build a gravity model based on multi-terminal delay and time slot models, iteratively train the initial terminal gravity constant network model through historical delay data, output the terminal gravity constant prediction value, update the gravity model, solve the delay influence model, and calculate microservice data processing priority, and then select the container.

Benefits of technology

It improves the efficiency and effectiveness of microservice container selection, optimizes the operating efficiency and stability of the power system, and enhances the accuracy and comprehensiveness of the dynamic and nonlinear effects of source-load-storage interaction performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798045A_ABST
    Figure CN118798045A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-service container selection method and device based on terminal time delay, and the method comprises the steps: building a gravitation model based on multi-terminal time delay and a time slot model according to a responded container selection signal, carrying out the iterative training and parameter adjustment of an initial terminal gravitation constant network model through historical time delay data, and obtaining a final gravitation constant network model; outputting a terminal gravitation constant predicted value, and updating the gravitation model into a time delay influence model according to the predicted value; and solving the time delay influence model to obtain a differentiated terminal gravitation constant, calculating a micro-service data processing priority according to the differentiated terminal gravitation constant obtained by solving, and performing micro-service container selection based on the priority. The accuracy and comprehensiveness of measuring the dynamic and nonlinear influence of the terminal time delay on the source-load-storage interaction performance are improved through the time delay influence model; and the micro-service with high priority at the current moment is submitted to the container with richer computing resources for selection, so that the selection efficiency and effectiveness of the micro-service container and the source-load-storage interaction performance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microservice technology, and in particular to a method and device for selecting a microservice container based on terminal latency. Background Art

[0002] With the rapid development of smart grid technology, the management and operation of power systems are facing unprecedented challenges and opportunities. The interaction between power sources, loads and energy storage devices in the substation area, that is, the intelligent interaction between power sources, loads and energy storage devices, has become a key technology to improve the efficiency of power grid operation, enhance system stability and promote energy optimization configuration. This interaction can not only achieve the optimal allocation of power resources, but also improve the adaptability of the power grid to renewable energy and the response speed to demand changes, thus providing strong support for the sustainable development of energy. In this context, the microservice architecture is widely used in the management and optimization of power systems due to its modularity, scalability and flexibility. The selection and management of microservice containers are directly related to the stability and efficiency of the power system. The correct container selection can ensure the efficient operation of microservices, while improper selection may lead to resource waste, performance bottlenecks and even system failures. Therefore, how to accurately select and manage microservice containers in view of the unique needs and limitations of the power system has become a key issue in improving the efficiency of the interaction between power sources, loads and energy storage devices in the substation area.

[0003] Existing microservice container selection methods mainly rely on static resource allocation strategies, but ignore the dynamic and nonlinear impact of terminal delay on the source-load-storage interaction performance. In addition, due to the diversity and complexity of terminal devices in the power system, a single delay model is difficult to accurately reflect the actual role of different terminals in the source-load-storage interaction. Summary of the invention

[0004] The present invention provides a method and device for selecting a microservice container based on terminal latency, so as to achieve the technical effect of improving the efficiency and effectiveness of microservice container selection and simultaneously improving the source-load-storage interaction performance.

[0005] In order to solve the above technical problems, an embodiment of the present invention provides a microservice container selection method based on terminal latency, comprising the following steps:

[0006] In response to the container selection signal, a corresponding gravity model is constructed based on a multi-terminal delay and time slot model;

[0007] Iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update parameters of the gravity model according to the terminal gravity constant prediction value to obtain a delay influence model;

[0008] The delay influence model is solved to obtain a differentiated terminal gravity constant, and a microservice data processing priority is calculated according to the differentiated terminal gravity constant, and then a microservice container is selected based on the microservice data processing priority.

[0009] After responding to the container selection signal, the microservice container selection method provided by the present invention first constructs a corresponding gravity model based on multi-terminal delays and a time slot model preset in the system to reflect the degree of influence of multi-terminal delays on the source-load-storage interaction performance and the subsequent update of the delay influence model.

[0010] At the same time, the system will also iteratively train and update the parameters of the preset initial terminal gravity constant network model through the historical delay data stored in the system. By repeating the training and updating the model parameters according to the data output by the trained model, the model can more accurately and comprehensively measure the relationship between the terminal delay and the source-load-storage interaction performance, and update the gravity model parameters according to the terminal gravity constant prediction value output by the trained model to obtain the corresponding delay influence model, which improves the accuracy and comprehensiveness of the model in measuring the dynamic and nonlinear effects of terminal delay on the source-load-storage interaction performance. If this model is applied to the container selection process of the subsequent system, the operating efficiency and stability of the power system can be optimized, and parameter support can be provided for the subsequent microservice container selection.

[0011] By solving the delay influence model obtained after the above update to obtain the differentiated terminal gravity constant, the microservice output processing priority can be calculated according to the parameter, and the microservice container can be selected based on the calculated priority, so as to ensure that the microservices with high microservice data processing priority at the current moment will be allocated to containers with richer computing resources for selection, so that the terminal microservices with great influence on the source-load-storage interaction performance will have smaller and more stable delays, thereby improving the efficiency and effectiveness of microservice container selection, and thus improving the source-load-storage interaction performance.

[0012] As a preferred example, the preset initial terminal gravity constant network model is iteratively trained and parameterized by using historical delay data, a corresponding terminal gravity constant prediction value is output, and the gravity model is parameterized and updated according to the terminal gravity constant prediction value to obtain a delay influence model, specifically:

[0013] Inputting the microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance as the historical delay data into the initial terminal gravity constant network model for prediction, and outputting the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot;

[0014] The average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the predicted value of the gravity constant of the first terminal, and the average predicted value of the terminal gravity constant is used as the second terminal gravity constant predicted value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model.

[0015] In order to more accurately and comprehensively consider the impact of terminal delay on the source-load-storage interaction performance, the microservice container selection method provided by the present invention uses historical delay data as training data when training the initial terminal gravity constant network model, including the microservice delays of several terminals in the first time slot and the influence of each microservice delay on the source-load-storage interaction performance. The above historical delay data is input into the network model, and the model extracts and learns the key influencing factors between terminal delay and source-load-storage interaction performance, and then outputs the first terminal gravity constant prediction value of each terminal in the first time slot, that is, the degree of influence of the delay of each terminal in the first time slot on the source-load-storage interaction performance.

[0016] Then, the average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the output predicted value of the gravity constant of the first terminal, and it is used as the predicted value of the second terminal gravity constant of the first terminal in the second time slot. The gravity model is iteratively updated according to the second predicted value to obtain the corresponding delay influence model, which provides reference data for the subsequent system to select containers.

[0017] As a preferred example, the iterative updating of the gravity model according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model is specifically as follows:

[0018] Substituting the predicted value of the gravity constant of the second terminal into the gravity model for solution processing, and outputting a first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance;

[0019] Calculate and obtain a loss function between the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and parameter updated until the calculated loss function is less than a preset loss threshold, and then use the corresponding adjusted model as the terminal gravity constant network model;

[0020] The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

[0021] The error parameter of the terminal gravity constant network model is determined according to the predicted value of the second terminal gravity constant and the first influence predicted value output by the gravity model solution and the corresponding actual value. The model is adjusted according to the error parameter, and the original input data is input into the adjusted model to retrain the model until the loss function, i.e., the error parameter, output by the model calculation is less than the preset error threshold. The corresponding model is used as the determined terminal gravity constant network model. The predicted value output after solving the determined network model can be used as input parameter data to adjust the gravity model, thereby obtaining the corresponding delay influence model for subsequent system calls.

[0022] As a preferred example, the step of calculating and obtaining the microservice data processing priority according to the differentiated terminal gravity constant specifically includes:

[0023] Collect and obtain information of microservice containers to be selected, sort the microservice containers to be selected in descending order according to the container computing resources in the microservice container information to be selected, and output a queue of containers to be selected;

[0024] The microservice data processing priority corresponding to each microservice is obtained based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computational complexity of each microservice, and the microservice data processing priority of each microservice is sorted from high to low according to the microservice data processing priority, and the queue of microservices to be processed is output.

[0025] The containers are sorted from large to small according to their corresponding computing resources to obtain the queue of containers to be selected. At the same time, the data processing priority of all microservices to be processed is determined according to the differentiated terminal gravitational constant, that is, the degree of influence of each terminal on the source-load-storage interaction performance, the amount of data of each microservice in the terminal, and the computational complexity of each microservice. All microservices to be processed are sorted from high to low according to the priority determined by calculation to obtain the corresponding queue of microservices to be processed, providing a data basis for subsequent container selection.

[0026] As a preferred example, the microservice container selection based on the microservice data processing priority is specifically:

[0027] Allocate the first microservice to be processed that is ranked first in the microservice to be processed queue to the first microservice container that is ranked first in the container to be selected queue, and allocate the microservices to be processed except the first microservice to be processed to the first microservice container according to the order of the microservice to be processed queue;

[0028] Until the maximum processing limit of the first microservice container is reached, the second to-be-selected container is selected for allocation according to the order of the to-be-selected container queue, until all the to-be-processed microservices in the to-be-processed service queue are allocated.

[0029] When selecting containers, the system will allocate the microservices to be processed in the order of the queues of microservices to be processed, and allocate the microservice with the highest priority to the first-ranked container in the queue of containers to be selected until the maximum output limit of the first-ranked microservice container is reached, and then allocate the remaining microservices to the remaining containers to be selected in the order of the queue of containers to be selected until all microservices are allocated, that is, all microservices have completed their container selection. The above allocation method can realize the allocation of the microservice with the highest processing priority to the container with the largest computing resources for processing, thereby ensuring that the terminal microservice with a large impact on the source-load-storage interaction performance has a smaller and more stable latency.

[0030] Correspondingly, an embodiment of the present invention further provides a microservice container selection device based on terminal delay, wherein the microservice container selection device includes a signal response module, a model prediction module and a container selection module;

[0031] The signal response module is used to respond to the container selection signal and construct a corresponding gravity model based on the multi-terminal delay and time slot model;

[0032] The model prediction module is used to iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update the gravity model parameters according to the terminal gravity constant prediction value to obtain a delay influence model;

[0033] The container selection module is used to solve the delay influence model to obtain a differentiated terminal gravity constant, calculate the microservice data processing priority according to the differentiated terminal gravity constant, and then select a microservice container based on the microservice data processing priority.

[0034] As a preferred example, the model prediction module iteratively trains and adjusts parameters of a preset initial terminal gravity constant network model through historical delay data, outputs a corresponding terminal gravity constant prediction value, and updates the gravity model parameters according to the terminal gravity constant prediction value to obtain a delay influence model, specifically:

[0035] Inputting the microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance as the historical delay data into the initial terminal gravity constant network model for prediction, and outputting the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot;

[0036] The average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the predicted value of the gravity constant of the first terminal, and the average predicted value of the terminal gravity constant is used as the second terminal gravity constant predicted value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model.

[0037] As a preferred example, the model prediction module iteratively updates the gravity model according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model, specifically:

[0038] Substituting the predicted value of the gravity constant of the second terminal into the gravity model for solution processing, and outputting a first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance;

[0039] Calculate and obtain a loss function between the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and parameter updated until the calculated loss function is less than a preset loss threshold, and then use the corresponding adjusted model as the terminal gravity constant network model;

[0040] The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

[0041] As a preferred example, the container selection module calculates and obtains the microservice data processing priority according to the differentiated terminal gravity constant, specifically including:

[0042] Collect and obtain information of microservice containers to be selected, sort the microservice containers to be selected in descending order according to the container computing resources in the microservice container information to be selected, and output a queue of containers to be selected;

[0043] The microservice data processing priority corresponding to each microservice is obtained based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computational complexity of each microservice, and the microservice data processing priority of each microservice is sorted from high to low according to the microservice data processing priority, and the queue of microservices to be processed is output.

[0044] As a preferred example, the container selection module selects a microservice container based on the microservice data processing priority, specifically:

[0045] Allocate the first microservice to be processed that is ranked first in the microservice to be processed queue to the first microservice container that is ranked first in the container to be selected queue, and allocate the microservices to be processed except the first microservice to be processed to the first microservice container according to the order of the microservice to be processed queue;

[0046] Until the maximum processing limit of the first microservice container is reached, the second to-be-selected container is selected for allocation according to the order of the to-be-selected container queue, until all the to-be-processed microservices in the to-be-processed service queue are allocated. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 : A flow chart of an embodiment of a method for selecting a microservice container based on terminal latency provided by the present invention;

[0048] Figure 2 : A structural schematic diagram of an embodiment of a microservice container selection device based on terminal latency provided by the present invention;

[0049] Figure 3 : A structural schematic diagram of an embodiment of a terminal delay-based area source-load-storage interactive micro-service container selection device provided by the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Embodiment 1

[0052] Please refer to Figure 1 , which is a flow chart of an embodiment of a method for selecting a microservice container based on terminal latency provided by the present invention, including steps 101 to 103, each of which is specifically as follows:

[0053] Step 101: In response to a container selection signal, a corresponding gravity model is constructed based on a multi-terminal delay and time slot model.

[0054] The microservice container selection method provided in an embodiment of the present invention, after responding to a container selection signal, first constructs a corresponding gravity model based on multi-terminal delays and a time slot model preset in the system, so as to reflect the influence of multi-terminal delays on the source-load-storage interaction performance and subsequently update the delay influence model.

[0055] In this embodiment, taking into account the influence of terminal delay on the source-load-storage interaction performance of the substation and the interaction between the delays of all terminals participating in the interaction, a gravity model is constructed based on the universal gravitation embodiment of the present invention to describe the relationship between the source-load-storage interaction performance of the substation and the terminal delay, and the terminal gravity constant output by the gravity model is defined to describe the degree of influence of the delay of different terminals on the source-load-storage interaction performance of the substation, that is, the larger the terminal gravity constant, the greater the influence of the terminal delay on the source-load-storage interaction performance of the substation.

[0056] Since the source-load-storage interaction effect is not only related to the microservice delay of a single terminal, but also has a nonlinear and complex relationship with the delay of all terminals participating in the interaction, the present invention adopts the time slot model as the basic model for constructing the gravity model. The relationship between the source-load-storage interaction effect of each time slot and the delay of different terminals is measured by the time slot model. Specifically, consider T time slots, the length of each time slot is τ0, that is, Then define that there are N terminals in the area, the set is Terminal d n The microservice latency in time slot t is τ n (t), and define the terminal source-load-storage interaction indicator variable as x n (t), then when terminal d n When participating in the source-charge-storage interaction at time slot t, x n (t) = 1, otherwise, terminal d n When x does not participate in the source-charge-storage interaction at time slot t, n (t) = 0. Therefore, considering the gravitational relationship between the time delays of all terminals participating in the source-charge-storage interaction and the above definitions, a gravitational model between the source-charge-storage interaction performance and the terminal time delay is constructed as follows:

[0057]

[0058] Where F(t) is the influence of the delay of time slot t on the source-load-storage interaction performance, G n For terminal d n The terminal gravitational constant G in formula (1) is defined as: when the input value is 0, the output is 1, and when the input value is not 0, the output is the input value. n It is an unknown value and needs to be further solved by the system.

[0059] Step 102: Iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update parameters of the gravity model according to the terminal gravity constant prediction value to obtain a delay influence model.

[0060] At the same time, the system will also iteratively train and update the parameters of the preset initial terminal gravity constant network model through the historical delay data stored in the system. By repeating the training and updating the model parameters according to the data output by the trained model, the model can more accurately and comprehensively measure the relationship between the terminal delay and the source-load-storage interaction performance, and update the gravity model parameters according to the terminal gravity constant prediction value output by the trained model to obtain the corresponding delay influence model, which improves the accuracy and comprehensiveness of the model in measuring the dynamic and nonlinear effects of terminal delay on the source-load-storage interaction performance. If this model is applied to the container selection process of the subsequent system, the operating efficiency and stability of the power system can be optimized, and parameter support can be provided for the subsequent microservice container selection.

[0061] In this embodiment, the initial terminal gravity constant network model called by the system will design its input layer neuron structure according to the data type contained in the historical delay data used for training, design its output layer neuron structure according to the prediction results required by the system, and design its hidden layer neuron structure according to the adopted mapping function. Then, the network model parameters are continuously adjusted using a large amount of historical delay data, so that the network model can truly reflect the relationship between input data and output results. Therefore, the initial terminal gravity constant network model can process historical delay data, receive the data of terminal delay and source-load-storage interaction performance influence through the input layer, and store the input delay of each terminal and the data of the source-load-storage interaction performance influence of the substation as the input value for calculation in the input layer neurons.

[0062] At the same time, different neurons have different calculation weights. The mapping relationship between neurons in different layers is used to calculate and map the input values ​​layer by layer to the neurons in the output layer, and then the predicted value of the terminal gravity constant of each terminal is obtained in the output layer. At the same time, the error is controlled by the loss function of the model. The loss function is the calculated difference between the actual interactive performance influence and the interactive performance influence calculated using the predicted value. The model parameters are adjusted by the calculated loss function to obtain a new terminal gravity constant prediction value, so that the error function reaches an acceptable error threshold, thereby ensuring the accuracy and adaptability of the model.

[0063] By using the trained neural network to predict the terminal gravity constant of each terminal in a specific time slot, and substituting the predicted terminal gravity constant into the gravity model, a complete gravity model, that is, a delay influence model, can be obtained. By applying it to the selection process of microservice containers, the operation efficiency and stability of the power system can be optimized.

[0064] Specifically, in this embodiment, the preset initial terminal gravity constant network model is iteratively trained and parameterized by using historical delay data, a corresponding terminal gravity constant prediction value is output, and the gravity model is parameterized and updated according to the terminal gravity constant prediction value to obtain the delay influence model, specifically:

[0065] Inputting the microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance as the historical delay data into the initial terminal gravity constant network model for prediction, and outputting the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot;

[0066] The average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the predicted value of the gravity constant of the first terminal, and the average predicted value of the terminal gravity constant is used as the second terminal gravity constant predicted value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model.

[0067] In order to more accurately and comprehensively consider the impact of terminal delay on the source-load-storage interaction performance, the microservice container selection method provided in the embodiment of the present invention uses historical delay data as the training data when training the initial terminal gravity constant network model, including the microservice delays of several terminals in the first time slot and the influence of each microservice delay on the source-load-storage interaction performance. The above historical delay data is input into the network model, and the model extracts and learns the key influencing factors between terminal delay and source-load-storage interaction performance, and then outputs the first terminal gravity constant prediction value of each terminal in the first time slot, that is, the degree of influence of the delay of each terminal in the first time slot on the source-load-storage interaction performance.

[0068] Then, the average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the output predicted value of the gravity constant of the first terminal, and it is used as the predicted value of the second terminal gravity constant of the first terminal in the second time slot. The gravity model is iteratively updated according to the second predicted value to obtain the corresponding delay influence model, which provides reference data for the subsequent system to select containers.

[0069] In this embodiment, first, the constructed gravitational constant network model of the area source-load-storage interactive terminal includes three parts: input layer, hidden layer and output layer. The number of neurons in the input layer is defined as Q=N+1, the number of neurons in the hidden layer is C, and the number of neurons in the output layer is N; the network parameters of the gravitational constant network of the area source-load-storage interactive terminal are defined as P(W,B), where W is the weight matrix of the gravitational constant network of the area source-load-storage interactive terminal, and B is the threshold matrix of the gravitational constant network of the area source-load-storage interactive terminal.

[0070] After completing the definition part, for any time slot t′ before time slot t, the input matrix of the input layer of the source-load-storage interaction terminal gravity constant network of the substation area, that is, the initial terminal gravity constant network model, includes the microservice delay of N terminals in time slot t′ and the influence of the delay of time slot t′ on the source-load-storage interaction performance F(t′). After inputting the above data into the network model, the model will extract the influencing factors of the terminal delay on the source-load-storage interaction performance of the substation area through the hidden layer function, and the mapping function between the hidden layer and the output layer is the Softmax[·] function, which is used to output the terminal gravity constant.

[0071] Furthermore, the terminal d of the gravitational constant network output of the source-load-storage interaction terminal in the time slot t′ is defined n The terminal gravitational constant is G n (t′), therefore, based on the above-mentioned network model of the terminal gravity constant of the source-load-storage interaction in the substation area, the terminal gravity constant prediction value of N terminals in time slot t′ can be obtained, that is, the first terminal gravity constant prediction value of this embodiment. For time slot t, based on the terminal delay data of the first t time slots and the data on the influence of the delay on the source-load-storage interaction performance, the terminal d n The average predicted value of the terminal gravitational constant at time slot t+1 It can be calculated according to the following formula:

[0072]

[0073] The terminal d can be calculated by the above formula (2) n The average predicted value of the terminal gravitational constant at time slot t+1 The system treats it as terminal d n The predicted value of the terminal gravity constant at time slot t+1 is the second predicted value of the terminal gravity constant in this embodiment.

[0074] Furthermore, in this embodiment, the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model, specifically:

[0075] Substituting the predicted value of the gravity constant of the second terminal into the gravity model for solution processing, and outputting a first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance;

[0076] Calculate and obtain a loss function between the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and parameter updated until the calculated loss function is less than a preset loss threshold, and then use the corresponding adjusted model as the terminal gravity constant network model;

[0077] The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

[0078] The error parameter of the terminal gravity constant network model is determined according to the predicted value of the second terminal gravity constant and the first influence predicted value output by the gravity model solution and the corresponding actual value. The model is adjusted according to the error parameter, and the original input data is input into the adjusted model to retrain the model until the loss function, i.e., the error parameter, output by the model calculation is less than the preset error threshold. The corresponding model is used as the determined terminal gravity constant network model. The predicted value output after solving the determined network model can be used as input parameter data to adjust the gravity model, thereby obtaining the corresponding delay influence model for subsequent system calls.

[0079] In this embodiment, the system substitutes the calculated predicted value of the gravity constant of the second terminal into the gravity model for solution, that is, the terminal d n Substituting the predicted value of the terminal gravity constant at time slot t+1 into formula (1) for solution, we can obtain the predicted value of the influence of the delay at time slot t+1 on the source-load-storage interaction performance F: pro (t+1), which can be expressed as:

[0080]

[0081] In order to obtain more accurate neural network prediction results, this embodiment uses a loss function, namely a Loss function, to represent the error between the predicted value and the actual value. The expression is as follows:

[0082] Loss(t+1)=F(t+1)-F pro (t+1) (4)

[0083] Among them, F(t+1) is the actual value of the influence of the delay of time slot t+1 on the source-load-storage interaction performance. The model is continuously trained and adjusted by the error parameters calculated by the above Loss function and the historical delay data until the Loss function reaches the preset acceptable error threshold, that is, the loss function described in this embodiment is less than the preset loss threshold, and the terminal gravity constant prediction value of N terminals can be obtained. Substituting the predicted gravity constant into formula (1), the gravity model can be updated to obtain the delay influence model, as shown in the following expression:

[0084]

[0085] The terminal d n The actual value of the terminal gravitational constant is By solving the above formula (5), the terminal gravity constant, i.e., the actual value of the terminal gravity constant described in the embodiment, can be obtained.

[0086] Step 103: Solve the delay influence model to obtain a differentiated terminal gravity constant, calculate the microservice data processing priority according to the differentiated terminal gravity constant, and then select a microservice container based on the microservice data processing priority.

[0087] By solving the delay influence model obtained after the above update to obtain the differentiated terminal gravity constant, the microservice output processing priority can be calculated according to the parameter, and the microservice container can be selected based on the calculated priority, so as to ensure that the microservices with high microservice data processing priority at the current moment will be allocated to containers with richer computing resources for selection, so that the terminal microservices with great influence on the source-load-storage interaction performance will have smaller and more stable delays, thereby improving the efficiency and effectiveness of microservice container selection, and thus improving the source-load-storage interaction performance.

[0088] In this embodiment, the microservice container selection based on differentiated terminal gravity first sorts the containers based on the container computing resources, and then calculates the processing priority of each microservice data based on the differentiated terminal gravity constant, as well as the data volume and computing complexity of each terminal microservice. Finally, according to the microservice data processing priority, container computing resources and the maximum limit of container processing microservices, the microservice container is selected to ensure that the microservices with high processing priority in the current time slot are allocated to containers with richer computing resources for processing, thereby making the terminal microservices with a large impact on the source-load-storage interaction performance have a smaller and more stable latency.

[0089] Specifically, the step of calculating and obtaining the microservice data processing priority according to the differentiated terminal gravity constant in this embodiment specifically includes:

[0090] Collect and obtain information of microservice containers to be selected, sort the microservice containers to be selected in descending order according to the container computing resources in the microservice container information to be selected, and output a queue of containers to be selected;

[0091] The microservice data processing priority corresponding to each microservice is obtained based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computational complexity of each microservice, and the microservice data processing priority of each microservice is sorted from high to low according to the microservice data processing priority, and the queue of microservices to be processed is output.

[0092] The containers are sorted from large to small according to their corresponding computing resources to obtain the queue of containers to be selected. At the same time, the data processing priority of all microservices to be processed is determined according to the differentiated terminal gravitational constant, that is, the degree of influence of each terminal on the source-load-storage interaction performance, the amount of data of each microservice in the terminal, and the computational complexity of each microservice. All microservices to be processed are sorted from high to low according to the priority determined by calculation to obtain the corresponding queue of microservices to be processed, providing a data basis for subsequent container selection.

[0093] In this embodiment, the system first defines the time slot t terminal d n Yes K n microservices need to be processed, represented as in The time slot t terminal d n The kth microservice of . Considering L containers, the container set is where g l Represents the lth container, container g l The maximum limit of microservice processing is A l , that is, each time slot container g l A maximum of A can be processed from the terminal l microservices. l The available computing resources at time slot t are ψ l (t), the larger the computing resources of the container, the faster it processes microservices and the lower the latency, which can more effectively improve the source-load-storage interaction performance. Therefore, by sorting the container computing resources from large to small to generate the corresponding queue of containers to be selected, it is convenient for subsequent microservices to select containers.

[0094] Based on the gravity constant of the differentiated terminal, the data volume and computational complexity of each microservice of the terminal, the processing priority of each microservice data is calculated, and the microservice Processing priority The specific calculation formula is as follows:

[0095]

[0096] in, is the actual value of the terminal gravitational constant, i.e. the differentiated terminal gravitational constant value, For Microservices The amount of data, For Microservices The computational complexity of the terminal. The larger the terminal gravity constant of the terminal to which the microservice belongs, the greater its influence on the source-load-storage interaction performance, and the processing of the microservice should be given priority. At the same time, the larger the amount of microservice data and the greater the computational complexity, the higher its processing priority should be. It is necessary to ensure that the container has sufficient computing resources to complete the processing of microservice data. Therefore, the larger the terminal gravity constant, the larger the amount of microservice data, and the greater the computational complexity of the microservice, the higher its processing priority should be. Therefore, the microservice data processing priority calculated according to the above formula (6) is sorted from high to low to form a queue of microservices to be processed, which is convenient for the subsequent system to allocate containers.

[0097] Furthermore, the microservice container selection based on the microservice data processing priority described in this embodiment is specifically as follows:

[0098] Allocate the first microservice to be processed that is ranked first in the microservice to be processed queue to the first microservice container that is ranked first in the container to be selected queue, and allocate the microservices to be processed except the first microservice to be processed to the first microservice container according to the order of the microservice to be processed queue;

[0099] Until the maximum processing limit of the first microservice container is reached, the second to-be-selected container is selected for allocation according to the order of the to-be-selected container queue, until all the to-be-processed microservices in the to-be-processed service queue are allocated.

[0100] When selecting containers, the system will allocate the microservices to be processed in the order of the queues of microservices to be processed, and allocate the microservice with the highest priority to the first-ranked container in the queue of containers to be selected until the maximum output limit of the first-ranked microservice container is reached, and then allocate the remaining microservices to the remaining containers to be selected in the order of the queue of containers to be selected until all microservices are allocated, that is, all microservices have completed their container selection. The above allocation method can realize the allocation of the microservice with the highest processing priority to the container with the largest computing resources for processing, thereby ensuring that the terminal microservice with a large impact on the source-load-storage interaction performance has a smaller and more stable latency.

[0101] In order to better implement the microservice container selection method provided by the embodiment of the present invention, the embodiment of the present invention also provides a corresponding selection device, see Figure 3 , Figure 3 The schematic diagram of the structure of an embodiment of the terminal delay-based source-load-storage interactive microservice container selection device provided by the present invention. Figure 3As shown, the said area source-load-storage interactive microservice container selection device includes a gravity model construction module, an area source-load-storage interactive terminal gravity constant network module, a data storage module, a terminal gravity constant solution module, a processing priority calculation module and a microservice container selection decision module. Among them, the functions of each module are as follows:

[0102] Gravitational model construction module: Based on the gravitational relationship between the delays of all terminals participating in the source-load-storage interaction in each time slot, the influence of each delay on the source-load-storage interaction performance is calculated.

[0103] The gravitational constant network module of the source-load-storage interactive terminal in the substation area includes three parts: input layer, hidden layer, and output layer. The number of neurons in the input layer is Q=N+1, the number of neurons in the hidden layer is C, and the number of neurons in the output layer is N, where N is the number of terminals. The network parameters of the gravitational constant network of the source-load-storage interactive terminal in the substation area are P(W,B).

[0104] Data storage module: responsible for storing historical delays, terminal gravitational constants and other data for training the source-load-storage interaction terminal gravitational constant network module in the substation area.

[0105] Terminal gravitational constant solution module: Based on the data in the data storage module, the network model in the terminal gravitational constant network module of the source-load-storage interaction in the substation is trained to solve the terminal gravitational constant.

[0106] Processing priority calculation module: Based on the differentiated terminal gravity constant, as well as the data volume and computational complexity of each microservice of the terminal, the processing priority of each microservice data is calculated.

[0107] Microservice container selection decision module: completes container selection based on microservice data processing priority, container computing resources, and the maximum limit of container processing microservices.

[0108] In order to better illustrate the working principle and step flow of a method and device for selecting a microservice container based on terminal latency of the present invention, it is possible but not limited to refer to the relevant records above.

[0109] Accordingly, see Figure 2 , Figure 2 This is a schematic diagram of the structure of an embodiment of a microservice container selection device based on terminal latency provided by the present invention. Figure 2 As shown, the microservice container selection device includes a signal response module 201, a model prediction module 202 and a container selection module 203.

[0110] The signal response module 201 is used to respond to the container selection signal and build a corresponding gravity model based on the multi-terminal delay and time slot model.

[0111] The model prediction module 202 is used to iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update the parameters of the gravity model according to the terminal gravity constant prediction value to obtain a delay influence model.

[0112] Furthermore, the model prediction module 202 iteratively trains and adjusts parameters of the preset initial terminal gravity constant network model through historical delay data, outputs a corresponding terminal gravity constant prediction value, and updates the gravity model parameters according to the terminal gravity constant prediction value to obtain a delay influence model, specifically:

[0113] The microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance are input as the historical delay data into the initial terminal gravity constant network model for prediction, and the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot are output; the average terminal gravity constant prediction value of the first terminal in the second time slot is calculated according to the first terminal gravity constant prediction value, and the average terminal gravity constant prediction value is used as the second terminal gravity constant prediction value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the second terminal gravity constant prediction value to obtain the delay influence model.

[0114] Furthermore, the model prediction module 202 iteratively updates the gravity model according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model, specifically:

[0115] Substitute the predicted value of the second terminal gravity constant into the gravity model for solution processing, and output the first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance; calculate the loss function of the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and the parameters are updated until the calculated loss function is less than a preset loss threshold, and the corresponding adjusted model is used as the terminal gravity constant network model;

[0116] The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

[0117] The container selection module 203 is used to solve the delay influence model to obtain a differentiated terminal gravity constant, calculate the microservice data processing priority according to the differentiated terminal gravity constant, and then select a microservice container based on the microservice data processing priority.

[0118] Furthermore, the container selection module 203 calculates the microservice data processing priority according to the differentiated terminal gravity constant, specifically including:

[0119] The information of the microservice containers to be selected is collected, and the microservice containers to be selected are sorted in descending order according to the container computing resources in the microservice container information to be selected, and a queue of containers to be selected is output; the microservice data processing priority corresponding to each microservice is calculated based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computing complexity of each microservice, and the microservice data processing priority is sorted from high to low according to the microservice data processing priority, and a queue of microservices to be processed is output.

[0120] Furthermore, the container selection module 203 selects a microservice container based on the microservice data processing priority, specifically:

[0121] The first to-be-processed microservice ranked first in the to-be-processed microservice queue is allocated to the first microservice container ranked first in the to-be-selected container queue, and the to-be-processed microservices except the first to-be-processed microservice are allocated to the first microservice container in the order of the to-be-processed microservice queue; until the maximum processing limit of the first microservice container is reached, the to-be-selected container ranked second is selected in the order of the to-be-selected container queue for allocation, until all the to-be-processed microservices in the to-be-processed service queue are allocated.

[0122] In summary, the embodiment of the present invention provides a method and device for selecting microservice containers based on terminal delay. According to the response container selection signal, a gravity model is constructed based on multi-terminal delay and time slot models, and the initial terminal gravity constant network model is iteratively trained and parameterized through historical delay data, and the terminal gravity constant prediction value is output, and the gravity model is updated to a delay influence model according to the prediction value; the delay influence model is solved to obtain a differentiated terminal gravity constant, and the microservice data processing priority is calculated according to the differentiated terminal gravity constant obtained by the solution, and the microservice container is selected based on the priority. The delay influence model improves the accuracy and comprehensiveness of measuring the dynamic and nonlinear effects of terminal delay on the source-load-storage interaction performance; the microservices with high priority at the current moment are handed over to containers with richer computing resources for selection, which improves the efficiency and effectiveness of microservice container selection and the source-load-storage interaction performance.

[0123] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for selecting a microservice container based on terminal latency, characterized in that: The following steps are involved: In response to the container selection signal, a corresponding gravity model is constructed based on a multi-terminal delay and time slot model; Iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update parameters of the gravity model according to the terminal gravity constant prediction value to obtain a delay influence model; The delay influence model is solved to obtain a differentiated terminal gravity constant, and a microservice data processing priority is calculated according to the differentiated terminal gravity constant, and then a microservice container is selected based on the microservice data processing priority.

2. A method for selecting a microservice container based on terminal latency as claimed in claim 1, characterized in that: The preset initial terminal gravity constant network model is iteratively trained and parameterized by using historical delay data, and the corresponding terminal gravity constant prediction value is outputted. The gravity model is parameterized and updated according to the terminal gravity constant prediction value to obtain the delay influence model, specifically: Inputting the microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance as the historical delay data into the initial terminal gravity constant network model for prediction, and outputting the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot; The average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the predicted value of the gravity constant of the first terminal, and the average predicted value of the terminal gravity constant is used as the second terminal gravity constant predicted value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model.

3. A method for selecting a microservice container based on terminal latency as described in claim 2, characterized in that: The iterative updating of the gravity model according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model is specifically: Substituting the predicted value of the gravity constant of the second terminal into the gravity model for solution processing, and outputting a first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance; Calculate and obtain a loss function between the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and parameter updated until the calculated loss function is less than a preset loss threshold, and then use the corresponding adjusted model as the terminal gravity constant network model; The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

4. A method for selecting a microservice container based on terminal latency as claimed in claim 1, characterized in that: The step of calculating the microservice data processing priority according to the differentiated terminal gravity constant specifically includes: Collect and obtain information of microservice containers to be selected, sort the microservice containers to be selected in descending order according to the container computing resources in the microservice container information to be selected, and output a queue of containers to be selected; The microservice data processing priority corresponding to each microservice is obtained based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computational complexity of each microservice, and the microservice data processing priority of each microservice is sorted from high to low according to the microservice data processing priority, and the queue of microservices to be processed is output.

5. A method for selecting a microservice container based on terminal latency as claimed in claim 1, characterized in that: The microservice container selection based on the microservice data processing priority is specifically as follows: Allocate the first microservice to be processed that is ranked first in the microservice to be processed queue to the first microservice container that is ranked first in the container to be selected queue, and allocate the microservices to be processed except the first microservice to be processed to the first microservice container according to the order of the microservice to be processed queue; Until the maximum processing limit of the first microservice container is reached, the second to-be-selected container is selected for allocation according to the order of the to-be-selected container queue, until all the to-be-processed microservices in the to-be-processed service queue are allocated.

6. A microservice container selection device based on terminal latency, characterized in that: The microservice container selection device includes a signal response module, a model prediction module and a container selection module; The signal response module is used to respond to the container selection signal and build a corresponding gravity model based on the multi-terminal delay and time slot model; The model prediction module is used to iteratively train and adjust parameters of a preset initial terminal gravity constant network model through historical delay data, output a corresponding terminal gravity constant prediction value, and update the gravity model parameters according to the terminal gravity constant prediction value to obtain a delay influence model; The container selection module is used to solve the delay influence model to obtain a differentiated terminal gravity constant, calculate the microservice data processing priority according to the differentiated terminal gravity constant, and then select a microservice container based on the microservice data processing priority.

7. A microservice container selection device based on terminal latency as claimed in claim 6, characterized in that: The model prediction module iteratively trains and adjusts parameters of the preset initial terminal gravity constant network model through historical delay data, outputs the corresponding terminal gravity constant prediction value, and updates the gravity model parameters according to the terminal gravity constant prediction value to obtain the delay influence model, specifically: Inputting the microservice delays of several terminals in the first time slot and the influence of the microservice delays on the source-load-storage interaction performance as the historical delay data into the initial terminal gravity constant network model for prediction, and outputting the first terminal gravity constant prediction values ​​of the corresponding several terminals in the first time slot; The average predicted value of the terminal gravity constant of the first terminal in the second time slot is calculated based on the predicted value of the gravity constant of the first terminal, and the average predicted value of the terminal gravity constant is used as the second terminal gravity constant predicted value of the first terminal in the second time slot, and then the gravity model is iteratively updated according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model.

8. A microservice container selection device based on terminal latency as claimed in claim 7, characterized in that: The model prediction module iteratively updates the gravity model according to the predicted value of the gravity constant of the second terminal to obtain the delay influence model, specifically: Substituting the predicted value of the gravity constant of the second terminal into the gravity model for solution processing, and outputting a first influence prediction value of the influence of the delay of the corresponding second time slot on the source-load-storage interaction performance; Calculate and obtain a loss function between the first influence prediction value and the corresponding first influence actual value as an error parameter, adjust the terminal gravity constant network model according to the error parameter, and input the historical delay data into the adjusted model, so that the adjusted model is iteratively trained and parameter updated until the calculated loss function is less than a preset loss threshold, and then use the corresponding adjusted model as the terminal gravity constant network model; The terminal gravity constant network model is solved to obtain the terminal gravity constant prediction values ​​of several terminals, and the terminal gravity constant prediction values ​​are input into the gravity model so that the gravity model is updated to the time delay influence model.

9. A microservice container selection device based on terminal latency as claimed in claim 6, characterized in that: The container selection module calculates the microservice data processing priority according to the differentiated terminal gravity constant, specifically including: Collect and obtain information of microservice containers to be selected, sort the microservice containers to be selected in descending order according to the container computing resources in the microservice container information to be selected, and output a queue of containers to be selected; The microservice data processing priority corresponding to each microservice is obtained based on the differentiated terminal gravitational constant, the amount of data of each microservice of the terminal, and the computational complexity of each microservice, and the microservice data processing priority of each microservice is sorted from high to low according to the microservice data processing priority, and the queue of microservices to be processed is output.

10. A microservice container selection device based on terminal latency as claimed in claim 6, characterized in that: The container selection module selects a microservice container based on the microservice data processing priority, specifically: Allocate the first microservice to be processed that is ranked first in the microservice to be processed queue to the first microservice container that is ranked first in the container to be selected queue, and allocate the microservices to be processed except the first microservice to be processed to the first microservice container according to the order of the microservice to be processed queue; Until the maximum processing limit of the first microservice container is reached, the second to-be-selected container is selected for allocation according to the order of the to-be-selected container queue, until all the to-be-processed microservices in the to-be-processed service queue are allocated.