A method for optimizing microservice resource configuration parameters of power trading platform
By using the seq2seq model to process real-time parameter data on the power trading platform, and optimizing the microservice resource configuration parameters, the problem of insufficient or oversupply of system resources caused by fluctuations in user visits is solved, and system performance and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202210675324.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-06-15
AI Technical Summary
When the user visits fluctuate, it is difficult for the power trading platform to scientifically set microservice parameters, resulting in insufficient or oversupply of system resources, affecting system performance and energy consumption.
Using the sequence-to-sequence (seq2seq) model, by obtaining real-time network operation parameters, platform system operation parameters and microservice performance parameters, corresponding feature vectors are constructed, and computational inference is performed to optimize microservice resource configuration parameters.
It realizes dynamic optimization of microservice resource configuration parameters based on user visits and microservice performance status, improves the rationality and adaptability of system resource allocation, and avoids the problem of insufficient or oversupply of resources caused by changes in visits.
Smart Images

Figure CN114924887B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet microservice technology, and in particular to a method for optimizing microservice resource configuration parameters of an electric power trading platform. Background Art
[0002] The power trading platform must provide stable and reliable technical support services for power market transactions to its users. With the large-scale registration and participation of general industrial and commercial users in the market, the continuous operation of medium- and long-term power market transactions, and the continuous advancement of spot trading pilot projects, the access pressure on the power trading platform system when users participate in market transactions has become random and volatile, requiring dynamic adaptation of system resources.
[0003] In specific application scenarios, such as trade submissions, certain microservices on the power trading platform experience significant performance bottlenecks. Given the same input data, the best and worst-case completion efficiencies vary significantly. System performance is directly or indirectly related to hardware and software parameter settings, and may even lead to variations in energy consumption. Some parameter setting issues can lead to hardware overload, contention for shared resources, and reduced CPU frequency. In addition to performance degradation, microservice degradation and circuit breaking can also lead to premature job termination.
[0004] Typically, parameter setting for power trading platforms relies on the experience and expertise of operators. By continuously monitoring and analyzing system logs and observing application resource usage, system operators can assess system health. However, in today's highly complex cloud computing systems, this process translates to manual review of millions or even tens of millions of data points daily. As the system scales, the manual workload becomes increasingly complex. As the resource scale of power trading platforms grows, manual parameter setting becomes increasingly prone to errors. Furthermore, accurate estimation of user traffic on power trading platforms is difficult, as it is influenced by seasonality, operational factors, and electricity prices. Traditional methods of manually setting parameters based on user traffic are ineffective in addressing resource shortages or oversupply caused by sudden changes in traffic. Therefore, scientifically setting microservice parameters and continuously optimizing them based on application scenarios are key to efficient system operation. Summary of the Invention
[0005] The purpose of this invention is to provide a method for optimizing microservice resource coordination parameters for an electricity trading platform. This method can configure microservice parameters based on user traffic, microservice performance status, and other factors, thereby optimizing the platform's system resource configuration. The technical solution employed by this invention is as follows.
[0006] In one aspect, the present invention provides a method for optimizing microservice resource configuration parameters of an electric power trading platform, comprising:
[0007] Obtain real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data;
[0008] constructing a network configuration vector based on the network operation parameter data, constructing a system perception vector based on the platform system operation parameter data, and constructing a microservice performance observation vector based on the microservice performance parameter data;
[0009] Input the network configuration vector, system perception vector, and microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for computational reasoning;
[0010] Determine the optimized microservice resource configuration parameters based on the output of the seq2seq model;
[0011] Performing microservice resource parameter configuration on the power trading platform according to the optimized microservice resource configuration parameters;
[0012] Among them, the training samples of the seq2seq model are continuous time series data of the platform processing performance vector of the known microservice resource configuration vector, and the platform processing performance vector is obtained by merging the network configuration vector, the system perception vector and the microservice performance observation vector; the microservice resource configuration vector is constructed based on the set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances.
[0013] Optionally, the network operation parameter data includes current bandwidth and average microservice processing delay;
[0014] The method of constructing a network configuration vector based on network operation parameter data includes: using the current bandwidth and the average time delay data of microservice processing as text, performing word segmentation processing using the nltk toolkit, converting each word segmentation into a word vector using the word2vec model, and splicing multiple word vectors to obtain a two-dimensional network configuration vector V1.
[0015] Optionally, the platform system operation parameter data includes throughput, TPS, QPS, memory utilization and CPU utilization;
[0016] The method of constructing a system perception vector based on platform system operation parameter data includes: using word segmentation technology and word2vec to perform word segmentation and vector conversion processing on throughput, TPS, QPS, memory utilization, and CPU utilization to obtain multiple one-dimensional vectors, and splicing all one-dimensional vectors into a two-dimensional vector to obtain a system perception vector V2.
[0017] Optionally, the microservice performance parameters include the current number of threads and the average failure rate;
[0018] The method of constructing a microservice performance observation vector based on microservice performance parameters includes: using word segmentation technology and word2vec to perform word segmentation and vector conversion on the current number of threads and the average failure rate, and using the obtained word segmentation vectors as different column vectors to splice and obtain the microservice performance observation vector V3.
[0019] Optionally, the network configuration vector V1, the system perception vector V2, and the microservice performance observation vector V3 are linearly arranged and merged into the platform processing performance vector V, which is expressed as: V={V1|V2|V3};
[0020] In the training samples of the seq2seq model, the microservice resource configuration vector Y is obtained by using word segmentation technology and word2vec to process the known number of CPU cores, memory size, bandwidth, and number of instances to obtain word segmentation vectors, and then splicing the word segmentation vectors to obtain the microservice resource configuration vector Y;
[0021] The output of the seq2seq model is a microservice resource configuration vector Y corresponding to the input platform processing performance vector V; determining the optimized microservice resource configuration parameters based on the output of the seq2seq model includes: parsing the output microservice resource configuration vector Y to obtain the corresponding number of CPU cores, memory size, bandwidth and number of instances.
[0022] Optionally, the training of the seq2seq model includes:
[0023] Based on the historical platform processing performance vector V and microservice resource configuration vector Y, a system observation data model R is constructed, which can be expressed as: R = {(V,Y)} = {r1,r2,...,rm} = {(v1,y1),(v2,y2),...,(vm,ym)}, where r1,r2,...,rm represent m performance and resource configuration pairs, and vm and ym represent the platform processing performance vector V and microservice resource configuration vector Y in the mth performance and resource configuration pair respectively;
[0024] Initialize the training parameters, including learning rate, element retention probability, training epochs, batch size, and embedding size. Specifically, the following settings can be set: learning rate 0.001, element retention probability 0.8, training epochs 10, batch size 64, and embedding size 300;
[0025] Iteratively select a continuous time data sequence from [v1, v2, ..., vm] as the training sample sequence [v1, v2, ..., vn] and input it into the encoder of the seq2seq model, where n represents the batch size. The encoder uses the RNN network to encode the input sequence [v1, v2, ..., vn] into an implicit representation h = (h1, h2, ...hn). Based on the implicit representation h, the encoder calculates the semantic vector ci according to the set attention concentration mechanism, which serves as the input si of the decoder. Based on si, the decoder calculates the selection probability of the microservice resource configuration vector yi with the maximum selection probability at the decoding time i through the softmax function of the output layer.
[0026] In each iteration, based on [y1,y2,...,yn] corresponding to [v1,v2,...,vn], the seq2seq model is optimized through the preset loss function, and the parameters of the seq2seq model are adjusted until the iteration termination condition is reached, and the trained seq2seq model is determined.
[0027] Optionally, the preset attention focusing mechanism includes:
[0028] Determine the attention() function used to calculate the non-standard alignment score between the encoder hidden layer representation state hi and the decoder hidden layer representation state si; where si is the decoder hidden layer representation of the i-th token and hj is the encoder hidden layer representation of the j-th token;
[0029] Calculate the similarity coefficient a corresponding to all encoding moments ij , where i corresponds to the i-th token in the encoder output layer, and j corresponds to the j-th token in the encoder hidden layer:
[0030]
[0031] According to a ij The context c that the computational model is currently focusing on i , the formula is:
[0032] c i =∑ j a ij ×h j .
[0033] Optionally, at decoding time i, the probability of each word being selected in the word vector is calculated as:
[0034] P(yi|y <i,x)=softmax(W[si;ci]+b)
[0035] Where, W[si; ci] represents a matrix composed of si and ci, b represents the offset of the matrix value, and P(yi|y<i,x) represents: taking the word vector of the context word vector library x before the decoding time i as a condition, the probability that each word in the word vector at the decoding time i is selected.
[0036] In a second aspect, the present invention provides an optimization device for microservice resource configuration parameters of a power trading platform, including:
[0037] A data acquisition module, configured to acquire real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data;
[0038] A vector conversion module, configured to construct a network configuration vector based on the network operation parameter data, construct a system perception vector based on the platform system operation parameter data, and construct a microservice performance observation vector based on the microservice performance parameter data;
[0039] A calculation and inference module, configured to input the network configuration vector, system perception vector and microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for calculation and inference;
[0040] A microservice resource configuration parameter determination module, configured to determine optimized microservice resource configuration parameters according to the output of the seq2seq model;
[0041] And a parameter configuration module, configured to perform microservice resource parameter configuration on the power trading platform according to the optimized microservice resource configuration parameters;
[0042] Wherein, the training sample of the seq2seq model is continuous time series data of a platform processing performance vector with a known microservice resource configuration vector, and the platform processing performance vector is obtained by combining the network configuration vector, system perception vector and microservice performance observation vector; the microservice resource configuration vector is constructed based on set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances.
[0043] Optionally, the training of the seq2seq model includes:
[0044] Based on the historical platform processing performance vector V and microservice resource configuration vector Y, a system observation data model R is constructed, which can be expressed as: R = {(V,Y)} = {r1,r2,...,rm} = {(v1,y1),(v2,y2),...,(vm,ym)}, where r1,r2,...,rm represent m performance and resource configuration pairs, and vm and ym represent the platform processing performance vector V and microservice resource configuration vector Y in the mth performance and resource configuration pair respectively;
[0045] Initialize the training parameters, including learning rate, element retention probability, training epochs, batch size, and embedding size. Specifically, the following settings can be set: learning rate 0.001, element retention probability 0.8, training epochs 10, batch size 64, and embedding size 300;
[0046] Iteratively select a continuous time data sequence from [v1, v2, ..., vn] as the training sample sequence [v1, v2, ..., vn] and input it into the encoder of the seq2seq model, where n represents the batch size. The encoder uses the RNN network to encode the input sequence [v1, v2, ..., vn] into an implicit representation h = (h1, h2, ...hn). Based on the implicit representation h, the encoder calculates the semantic vector ci according to the set attention concentration mechanism, which serves as the input si of the decoder. Based on si, the decoder calculates the selection probability of the microservice resource configuration vector yi with the maximum selection probability at the decoding time through the output layer softmax function.
[0047] In each iteration, based on [y1,y2,...,yn] corresponding to [v1,v2,...,vn], the seq2seq model is optimized through the preset loss function, and the parameters of the seq2seq model are adjusted until the iteration termination condition is reached, and the trained seq2seq model is determined.
[0048] Optionally, the preset attention focusing mechanism includes:
[0049] Determine the attention() function used to calculate the non-standard alignment score between the encoder hidden layer representation state hi and the decoder hidden layer representation state si; where si is the decoder hidden layer representation of the i-th token and hj is the encoder hidden layer representation of the j-th token;
[0050] Calculate the similarity coefficient a corresponding to all encoding moments ij , where i corresponds to the i-th token in the encoder output layer, and j corresponds to the j-th token in the encoder hidden layer:
[0051]
[0052] According to a ij The context c that the computational model is currently focusing on i , the formula is:
[0053] c i =∑ j a ij ×h j .
[0054] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for optimizing microservice resource configuration parameters of the power trading platform as described in the first aspect is implemented.
[0055] Beneficial effects
[0056] The microservice resource configuration parameter optimization method of the present invention is based on the understanding of real-time microservice monitoring data, defines it as network configuration, system perception, and microservice observation feature vectors, constructs a microservice performance feature set, and uses a recurrent neural network Seq2Seq architecture to learn microservice performance and its corresponding microservice resource configuration based on historical microservice performance and resource configuration data, train and optimize Seq2Seq parameters, and then uses the trained Seq2Seq model to configure the microservice resources of the actual power trading platform. It can adaptively adjust the microservice resource configuration parameters according to the microservice operation monitoring data, improve the rationality and adaptability of the microservice parameter configuration, and can effectively improve the serious shortage or surplus of system microservice resources caused by the rapid changes in the number of visits. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 Schematic diagram of the implementation architecture of the microservice resource configuration parameter optimization method of the power trading platform of the present invention;
[0058] Figure 2 The figure shows the vector conversion diagram of real-time monitoring data of microservice resources in the power trading platform;
[0059] Figure 3 The figure shows a schematic diagram of the computational inference process of the seq2seq model. DETAILED DESCRIPTION
[0060] The following is a further description with reference to the accompanying drawings and specific embodiments.
[0061] The technical concept of the present invention is as follows: the power trading platform architecture is based on the cloud platform microservice architecture. Through observation of the power trading platform, it is found that the network parameters, server physical performance, microservice execution efficiency and other parameters of the power trading platform are directly or indirectly closely related to the effective use of system resources. Therefore, in order to better play the characteristics of elastic changes in cloud resources, the present invention proposes a power trading platform microservice parameter optimization method, which integrates these three types of parameters, namely network parameters, server physical performance and microservice execution efficiency, as feature vectors or feature sets, and establishes a Seq2Seq system framework based on a recurrent neural network to understand the relationship between these parameters. By understanding the historical data containing the above feature vectors, the current microservice parameters to be optimized are obtained, and the microservice parameters are scientifically set according to the specific application scenario to solve the problem of serious shortage or surplus of system microservice resources due to the rapid change of access volume, so as to achieve the goal of optimizing the configuration of system resources according to user access volume.
[0062] Example 1
[0063] This embodiment introduces a method for optimizing microservice resource configuration parameters of an electric power trading platform. Figure 1 As shown, the method includes:
[0064] Obtain real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data;
[0065] constructing a network configuration vector based on the network operation parameter data, constructing a system perception vector based on the platform system operation parameter data, and constructing a microservice performance observation vector based on the microservice performance parameter data;
[0066] Input the network configuration vector, system perception vector, and microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for computational reasoning;
[0067] Determine the optimized microservice resource configuration parameters based on the output of the seq2seq model;
[0068] Performing microservice resource parameter configuration on the power trading platform according to the optimized microservice resource configuration parameters;
[0069] Among them, the training samples of the seq2seq model are continuous time series data of the platform processing performance vector of the known microservice resource configuration vector, and the platform processing performance vector is obtained by merging the network configuration vector, the system perception vector and the microservice performance observation vector; the microservice resource configuration vector is constructed based on the set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances.
[0070] The method of this embodiment specifically involves the following contents.
[0071] 1. Acquisition of Platform Processing Performance Data
[0072] When applied, the present invention needs to obtain real-time network operation parameter data, platform system operation parameter data and microservice performance parameter data, and convert them into network configuration vectors, system perception vectors and microservice performance observation vectors as platform processing performance vectors for input into the seq2seq model.
[0073] When training a seq2seq model, we need to obtain historical network operating parameter data, platform system operating parameter data, and microservice performance parameter data. These data are converted into corresponding historical platform processing performance vectors, which serve as training samples. We also obtain the microservice resource configuration vectors corresponding to each sample. These microservice resource configuration vectors are derived from the microservice resource configuration parameters: number of CPU cores, memory size, bandwidth, and number of instances. The specific parameters and indicators involved in the network operating parameter data, platform system operating parameter data, and microservice performance parameter data are shown in Table 1.
[0074] Table 1 Explanation of microservice resource-related terms
[0075]
[0076] By observing the operation data of the power trading platform for nearly 60 days, we obtained data once every minute, and obtained 86,400 data points. Each data point contains the indicator data shown in Table 1, including time delay, error rate, current bandwidth, throughput, TPS, QPS, CPU utilization, number of CPU cores, memory capacity, and expected bandwidth.
[0077] Specifically, the network operation parameter data includes the current bandwidth and the average time delay of microservice processing. The word vector is converted into: first, the current bandwidth and the average time delay of microservice processing data are taken as text, and the nltk toolkit is used to perform word segmentation processing respectively. Then, the word2vec model is used to convert each word segment into a word vector. Finally, multiple word vectors are spliced to obtain the two-dimensional vector network configuration vector V1.
[0078] The platform system operation parameter data includes throughput, TPS, QPS, memory utilization, and CPU utilization. Similar to the network operation parameter data, the platform system operation parameters are segmented and vectorized using word segmentation technology and word2vec to obtain multiple one-dimensional vectors. All the one-dimensional vectors are then concatenated into a two-dimensional vector to obtain the system perception vector V2.
[0079] Microservice performance parameters include the current number of threads and the average failure rate. Similarly, word segmentation and word2vec are used to segment and transform these two factors into vectors. The resulting word vectors are then used as column vectors to construct the microservice performance observation vector V3. Here, the number of threads and failure rate are integer and floating-point data, respectively. Word vector encoding can convert these into column vectors, where the word vector representations are "3:int" and "0.29:float."
[0080] The network configuration vector V1, the system perception vector V2, and the microservice performance observation vector V3 are linearly arranged and merged to obtain the platform processing performance vector V, which is expressed as: V = {V1|V2|V3};
[0081] In the training samples of the seq2seq model, the method for obtaining the microservice resource configuration vector Y is as follows: use word segmentation technology and word2vec to process the known number of CPU cores, memory size, bandwidth, and number of instances respectively to obtain word segmentation vectors, and then splice the word segmentation vectors to obtain the microservice resource configuration vector Y.
[0082] 2. Training of seq2seq Model
[0083] Based on the historical platform processing performance vector V and its corresponding microservice resource configuration vector Y obtained above, the system observation data model R can be constructed, which is expressed as:
[0084] R={(V,Y)}={r1,r2,...,rm}={(v1,y1),(v2,y2),...,(vm,ym)}
[0085] Where r1, r2, ..., rm represent m performance and resource configuration pairs, vm and ym represent the platform processing performance vector V and microservice resource configuration vector Y in the mth performance and resource configuration pair, respectively.
[0086] The encoder and decoder of the seq2seq model are both RNN networks. After initializing the training parameters, the seq2seq model training begins. The training process is referenced Figure 3 As shown in Figure 2, the encoder converts the collected vector information into an intermediate state of text. The decoder implements machine understanding based on this intermediate state and outputs a vector corresponding to the data to be predicted. The goal of the model is to capture the characteristics and properties of the data model R and then perform comprehension analysis to predict the vector Y when the actual vector V is known.
[0087] In this embodiment, the initial training parameters are: learning rate of 0.001, element retention probability of 0.8, training epochs of 10, batch size of 64, and embedding size of 300. The learning rate is the rate at which the seq2seq model learns data. A too small learning rate can easily lead to underfitting of the model, while a too large learning rate can easily lead to overfitting. Both situations will reduce the model's ability to predict new data. Experimental training analysis shows that a learning rate of 0.001 has stronger model generalization ability. The element retention probability means that the model will randomly discard some data during training. A retention rate of 0.8 prevents overfitting of the model training while ensuring generalization ability. A training epoch of 10 ensures model training results and saves training time. Batch size is set to the default value of 64 for batch training. Embedding_size is the dimension used to vectorize each word in the data. A higher dimension improves prediction results but also increases training time. It is empirically set to 300.
[0088] During training, a continuous time data sequence [v1, v2, ..., vn] is iteratively selected from [v1, v2, ..., vm] as the training sample sequence input to the seq2seq model's encoder, where n represents the batch size. The encoder uses an RNN network to encode the input sequence [v1, v2, ..., vn] into an implicit representation h = (h1, h2, ..., hn), where h represents the context state, equivalent to the model's understanding of the input dataset. Based on the implicit representation h, the encoder calculates a semantic vector ci using a predefined attention mechanism, which serves as the decoder input si. Based on si, the decoder calculates the probability of selecting the microservice resource configuration vector yi with the highest probability of selection at decoding time i using a softmax function in the output layer. In each iteration, the seq2seq model is optimized based on the corresponding values [y1, y2, ..., yn] of [v1, v2, ..., vn] using a preset loss function, adjusting the seq2seq model parameters until the iteration termination condition is met, confirming the trained seq2seq model.
[0089] The attention concentration mechanism set above includes:
[0090] Determine the attention() function used to calculate the non-standard alignment score between the encoder hidden layer representation state hi and the decoder hidden layer representation state si; where si is the decoder hidden layer representation of the i-th token and hj is the encoder hidden layer representation of the j-th token;
[0091] Calculate the similarity coefficient a corresponding to all encoding moments ij, where i corresponds to the i-th token in the encoder output layer and j corresponds to the j-th token in the encoder hidden layer:
[0092]
[0093] According to a ij Calculate the current most concerned context c of the model i , that is, accumulate all encoding states in the form of weighted summation to obtain the current most concerned context of the model. The formula is:
[0094] c i = ∑ j a ij × h j .
[0095] In the inference process of the above seq2seq model, the decoder is responsible for predicting probabilities. At the decoding time i, the probability calculation formula for each word in the word vector to be selected is:
[0096] P(yi|y<i,x) = softmax(W[si;ci] + b) <00002, construct the network configuration vector V1 based on the network operation parameter data, construct the system perception vector V2 based on the platform system operation parameter data, and construct the microservice performance observation vector V3 based on the microservice performance parameter data. Splice them into the platform processing performance vector V, input the trained seq2seq model, and obtain the prediction result vector of the microservice resource configuration vector Y. By decoding the vector Y, the corresponding microservice resource parameters that need to be configured can be obtained, namely the number of CPU cores, memory size, bandwidth and number of instances.
[0100] Table 2 below shows the microservice resource configurations inferred by the seq2seq model based on different combinations of platform processing performance parameters in some application examples.
[0101] Table 2
[0102]
[0103] 3. Effect Verification
[0104] Two microservices with the same number of instances were deployed in the same hardware environment. Solution A used a 15-minute interval to dynamically adjust microservice resource configuration parameters, including CPU core count, memory, and bandwidth, using the microservice resource configuration parameter optimization method of this embodiment. Solution B did not take any action. Results showed that within the same operating timeframe, Solution B experienced access delays during peak access times, with microservice response times reaching up to 5 seconds and system CPU utilization fluctuating by over 60%. Solution A, on the other hand, experienced no access delays during peak access times (page response times were consistently under 3 seconds). During periods of low system access, Solution A's system CPU utilization fluctuated by less than 30%.
[0105] It can be seen that compared with the existing technology, the microservice resource configuration parameter optimization method of this embodiment can adaptively adjust the microservice resource configuration parameters according to the microservice operation monitoring data, and effectively improve the serious shortage or surplus of system microservice resources caused by the rapid change of access volume.
[0106] Example 2
[0107] Based on the same inventive concept as Example 1, this embodiment introduces a device for optimizing microservice resource configuration parameters of an electric power trading platform, including:
[0108] A data acquisition module is configured to acquire real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data;
[0109] a vector conversion module configured to construct a network configuration vector based on the network operation parameter data, construct a system perception vector based on the platform system operation parameter data, and construct a microservice performance observation vector based on the microservice performance parameter data;
[0110] A computational reasoning module is configured to input the network configuration vector, the system perception vector, and the microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for computational reasoning;
[0111] A microservice resource configuration parameter determination module is configured to determine optimized microservice resource configuration parameters based on the output of the seq2seq model;
[0112] and, a parameter configuration module configured to configure microservice resource parameters of the power trading platform according to the optimized microservice resource configuration parameters;
[0113] Among them, the training samples of the seq2seq model are continuous time series data of the platform processing performance vector of the known microservice resource configuration vector, and the platform processing performance vector is obtained by merging the network configuration vector, the system perception vector and the microservice performance observation vector; the microservice resource configuration vector is constructed based on the set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances.
[0114] The specific functional implementation of each of the above functional modules refers to the corresponding content in the method of Example 1, and the following is particularly pointed out.
[0115] The training of the seq2seq model involves:
[0116] Based on the historical platform processing performance vector V and microservice resource configuration vector Y, a system observation data model R is constructed, which can be expressed as: R = {(V,Y)} = {r1,r2,...,rm} = {(v1,y1),(v2,y2),...,(vm,ym)}, where r1,r2,...,rm represent m performance and resource configuration pairs, and vm and ym represent the platform processing performance vector V and microservice resource configuration vector Y in the mth performance and resource configuration pair respectively;
[0117] Initialize the training parameters, including learning rate, element retention probability, training epochs, batch size, and embedding size. Specifically, the following settings can be set: learning rate 0.001, element retention probability 0.8, training epochs 10, batch size 64, and embedding size 300;
[0118] Iteratively select a continuous time data sequence from [v1, v2, ..., vn] as the training sample sequence [v1, v2, ..., vn] and input it into the encoder of the seq2seq model, where n represents the batch size. The encoder uses the RNN network to encode the input sequence [v1, v2, ..., vn] into an implicit representation h = (h1, h2, ...hn). Based on the implicit representation h, the encoder calculates the semantic vector ci according to the set attention concentration mechanism, which serves as the input si of the decoder. Based on si, the decoder calculates the selection probability of the microservice resource configuration vector yi with the maximum selection probability at the decoding time through the output layer softmax function.
[0119] In each iteration, based on [y1,y2,...,yn] corresponding to [v1,v2,...,vn], the seq2seq model is optimized through the preset loss function, and the parameters of the seq2seq model are adjusted until the iteration termination condition is reached, and the trained seq2seq model is determined.
[0120] The default attention-focusing mechanisms include:
[0121] Determine the attention() function used to calculate the non-standard alignment score between the encoder hidden layer representation state hi and the decoder hidden layer representation state si; where si is the decoder hidden layer representation of the i-th token and hj is the encoder hidden layer representation of the j-th token;
[0122] Calculate the similarity coefficient a corresponding to all encoding moments ij , where i corresponds to the i-th token in the encoder output layer, and j corresponds to the j-th token in the encoder hidden layer:
[0123]
[0124] According to a ij The context c that the computational model is currently focusing on i , the formula is:
[0125] c i =∑ j a ij ×h j .
[0126] Example 3
[0127] Based on the same inventive concept as Example 1 and Example 2, this embodiment introduces a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the microservice resource configuration parameter optimization method of the power trading platform as introduced in Example 1.
[0128] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0132] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which are all protected by the present invention.
Claims
1. A method for optimizing microservice resource configuration parameters of an electric power trading platform, characterized in that: include: Obtain real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data; constructing a network configuration vector based on the network operation parameter data, constructing a system perception vector based on the platform system operation parameter data, and constructing a microservice performance observation vector based on the microservice performance parameter data; Input the network configuration vector, system perception vector and microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for computational reasoning; Determine the optimized microservice resource configuration parameters based on the output of the seq2seq model; Performing microservice resource parameter configuration on the power trading platform according to the optimized microservice resource configuration parameters; The training samples of the seq2seq model are continuous time series data of the platform processing performance vector of the known microservice resource configuration vector, and the platform processing performance vector is obtained by merging the network configuration vector, the system perception vector and the microservice performance observation vector; the microservice resource configuration vector is constructed based on the set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances; in: The network operation parameter data includes current bandwidth and average time delay of microservice processing; Constructing a network configuration vector based on network operation parameter data includes: taking the current bandwidth and average microservice processing delay data as text, using the nltk toolkit to perform word segmentation processing, using the word2vec model to convert each word segmentation into a word vector, and concatenating multiple word vectors to obtain a two-dimensional network configuration vector V1; The platform system operation parameter data includes throughput, TPS, QPS, memory utilization and CPU utilization; Constructing a system perception vector based on the platform system operation parameter data includes: using word segmentation technology and word2vec to perform word segmentation and vector conversion processing on throughput, TPS, QPS, memory utilization, and CPU utilization to obtain multiple one-dimensional vectors, and splicing all one-dimensional vectors into a two-dimensional vector to obtain the system perception vector V2; The microservice performance parameters include the current number of threads and the average failure rate; Constructing a microservice performance observation vector based on microservice performance parameters includes: using word segmentation technology and word2vec to perform word segmentation and vector conversion on the current number of threads and the average failure rate, and using the obtained word segmentation vectors as different column vectors to splice and obtain the microservice performance observation vector V3.
2. The method according to claim 1, characterized in that: The network configuration vector V1, the system perception vector V2 and the microservice performance observation vector V3 are combined into the platform processing performance vector V through linear arrangement, which is expressed as: ; In the training sample of the seq2seq model, the method for obtaining the microservice resource configuration vector Y is as follows: the known number of CPU cores, memory size, bandwidth, and number of instances are processed using word segmentation technology and word2vec to obtain word segmentation vectors, and the word segmentation vectors are concatenated to obtain the microservice resource configuration vector Y; The output of the seq2seq model is a microservice resource configuration vector Y corresponding to the input platform processing performance vector V; Determining the optimized microservice resource configuration parameters according to the output of the seq2seq model includes: parsing the output microservice resource configuration vector Y to obtain the corresponding number of CPU cores, memory size, bandwidth, and number of instances.
3. The method according to claim 1, characterized in that: The training of the seq2seq model includes: Based on the historical platform processing performance vector V and the microservice resource configuration vector Y, the system observation data model R is constructed, which is expressed as: ,in represents m performance and resource configuration pairs, and They represent the platform processing performance vector V and the microservice resource configuration vector Y in the mth performance and resource configuration pair respectively; Initialize training parameters, including learning rate, element retention probability, training rounds epochs, batch size and embedding size; Iteratively from Select the continuous time data sequence as the training sample sequence Input the encoder of the seq2seq model, where Indicates Batch size; the encoder uses the RNN network to convert the input sequence Encoded as an implicit representation Based on the implicit representation , the encoder calculates the semantic vector according to the set attention concentration mechanism , as the input of the decoder ; The decoder is based on , the decoding time is calculated through the output layer softmax function Microservice resource configuration vector with the highest probability of being selected The probability of being selected; In each iteration, based on Corresponding , optimize the seq2seq model through the preset loss function, adjust the parameters of the seq2seq model until the iteration termination condition is reached, and determine the trained seq2seq model.
4. The method according to claim 3, characterized in that: At the decoding moment , the probability calculation formula for each word in the word vector is: , In the formula, Indicates that the matrix is composed of si and ci, and b represents the offset of the matrix value. Represents: x is the context word vector library at the decoding time The decoding time obtained by using the previous word vector as a condition The probability of each word being selected in the word vector.
5. A device for optimizing microservice resource configuration parameters of a power trading platform using the method according to any one of claims 1 to 4, characterized in that: include: A data acquisition module is configured to acquire real-time network operation parameter data, platform system operation parameter data, and microservice performance parameter data; a vector conversion module configured to construct a network configuration vector based on the network operation parameter data, to construct a system perception vector based on the platform system operation parameter data, and to construct a microservice performance observation vector based on the microservice performance parameter data; A computational reasoning module is configured to input the network configuration vector, the system perception vector, and the microservice performance observation vector into a pre-trained sequence-to-sequence model seq2seq for computational reasoning; A microservice resource configuration parameter determination module is configured to determine optimized microservice resource configuration parameters according to the output of the seq2seq model; and, a parameter configuration module configured to configure microservice resource parameters of the power trading platform according to the optimized microservice resource configuration parameters; Among them, the training samples of the seq2seq model are continuous time series data of the platform processing performance vector of the known microservice resource configuration vector, and the platform processing performance vector is obtained by merging the network configuration vector, the system perception vector and the microservice performance observation vector; the microservice resource configuration vector is constructed based on the set microservice resource configuration parameters, and the set microservice resource configuration parameters include the number of CPU cores, memory size, bandwidth and number of instances.
6. The device for optimizing microservice resource configuration parameters of an electric power trading platform according to claim 5 is characterized in that: The training of the seq2seq model includes: Based on the historical platform processing performance vector V and the microservice resource configuration vector Y, the system observation data model R is constructed, which is expressed as: ,in represents m performance and resource configuration pairs, and They represent the platform processing performance vector V and the microservice resource configuration vector Y in the mth performance and resource configuration pair respectively; Initialize the training parameters, including learning rate, element retention probability, training epochs, Batchsize and embedding size. Specifically, the following parameters can be set: learning rate is 0.001, element retention probability is 0.8, training epochs is 10, Batch size is 64, and embedding size is 300. Iteratively from Select the continuous time data sequence as the training sample sequence Input the encoder of the seq2seq model, where Indicates Batch size; the encoder uses the RNN network to convert the input sequence Encoded as an implicit representation ; Based on the implicit representation h, the encoder calculates the semantic vector ci according to the set attention concentration mechanism as the input si of the decoder; the decoder calculates the selection probability of the microservice resource configuration vector yi with the maximum selection probability at the decoding time according to si through the output layer softmax function; In each iteration, based on Corresponding , optimize the seq2seq model through the preset loss function, adjust the parameters of the seq2seq model until the iteration termination condition is reached, and determine the trained seq2seq model.
7. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for optimizing microservice resource configuration parameters of an electric power trading platform as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Anomaly detection method and device for micro-service system and electronic device
CN110825589A
Method and system for improving cancer detection using deep learning
US20210225511A1