A microservice scheduling method and system based on edge computing

Through the timing analysis model, predicting the future service indicators of microservices and broadcasting resource collaborative notifications in edge networks, the problem that traditional microservice scheduling algorithms are difficult to adjust in real time in high concurrency scenarios is solved, and the optimization of resource utilization and the stability of microservices are achieved.

CN119201407BActive Publication Date: 2025-02-28HUNAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411678166.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-28
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

Traditional microservice scheduling algorithms are difficult to adjust in real time in high concurrency scenarios, resulting in unbalanced resource utilization and fluctuations in service performance.

Method used

By collecting the time series data of the microservices' historical service indicators and service requirements description information, input them into the timing analysis model, predicting future service indicators, and when the risk of service performance decline is detected, resource collaborative notifications are generated to broadcast on the edge network to realize the dynamic migration of microservices and requests.

Benefits of technology

It realizes the real-time adjustment of dynamic and real-time response delay of user requests, optimizes resource utilization of edge networks, and enhances the fault tolerance and continuity of microservices in high concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses a microservice scheduling method and system based on edge computing, which relates to the field of distributed edge computing technology. The method includes: collecting historical service indicator time series data and service demand description information of microservices; inputting the historical service indicator time series data and corresponding service demand description information of each microservice into a time series analysis model to determine the predicted service indicators of each microservice in the future time step; generating resource coordination notifications according to the intermediate state data of the risk microservice and the corresponding service demand description information of the first queue request, and broadcasting the resource coordination notifications in the edge network; when a response reply message is detected, migrating the risk microservice and the queue request to the second target edge node. Thus, a decision-making mechanism based on data-driven is realized, and the service allocation and resource scheduling strategies in the edge network are dynamically adjusted. Through the service migration between edge nodes, the fault tolerance of microservices is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed edge computing technology, and in particular to a microservice scheduling method and system based on edge computing. Background Art

[0002] Edge computing is an emerging computing architecture that migrates computing, storage, and network resources from the cloud to the edge of the network, closer to data sources and users, thereby reducing data transmission latency. Microservices make application development, deployment, and expansion more flexible by splitting applications into multiple small, independent services. However, the dynamic and uncertain nature of edge computing makes it difficult for traditional microservice scheduling methods to effectively cope with it.

[0003] Traditional microservice scheduling algorithms rely on preset rules and strategies, which results in dramatic changes in the load of edge devices when microservices face high concurrency scenarios. It is difficult to adjust the deployment and resource allocation of microservices in real time, resulting in fluctuations in microservice quality and reduced user experience. In addition, there are significant differences in the amount of resource surplus of edge devices at different times, resulting in some edge devices failing to fully realize their potential due to scheduling policy limitations, while other devices are unable to provide effective services due to overload, resulting in uneven resource utilization in edge networks.

[0004] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention

[0005] The present application provides a microservice scheduling method, system, storage medium, computer program product and electronic device based on edge computing, which are used to at least solve the problem that traditional microservice scheduling algorithms in current related technologies are difficult to adjust in real time in high-concurrency scenarios, resulting in uneven resource utilization and fluctuating service performance.

[0006] In a first aspect, an embodiment of the present application provides a microservice scheduling method based on edge computing, which is applied to a first edge node, and the method includes: for each microservice, collecting the historical service indicator time series data of the microservice, and parsing the service demand description information corresponding to the microservice in the request queue; the service demand description information includes the number of requests, request priority and maximum response delay; the historical service indicator time series data includes multiple historical time steps of the microservice and corresponding historical service indicator data, and the indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization rate; the historical service indicator time series data of each of the microservices and the corresponding service demand description information are respectively input into the time series analysis model, to determine the predicted service indicators of each of the microservices in the future time step; when it is detected that the predicted service indicators of the risk microservice have the risk of service performance degradation, a resource collaboration notification is generated according to the intermediate state data of the risk microservice and the service requirement description information of the corresponding first queue request, and the resource collaboration notification is broadcast in the edge network, so that each second edge node determines whether to respond to the resource collaboration notification through resource evaluation; the intermediate state data includes the container resource surplus, the request queue length and the container failure rate; when a response reply message of the second target edge node to the resource collaboration notification is detected, the risk microservice and the queue request are migrated to the second target edge node.

[0007] In a second aspect, an embodiment of the present application provides a microservice scheduling system based on edge computing, which is deployed on a first edge node, and the system includes: a data collection unit, which is used to collect historical service indicator time series data of each microservice, and parse the service demand description information corresponding to the microservice in the request queue; the service demand description information includes the number of requests, request priority and maximum response delay; the historical service indicator time series data includes multiple historical time steps of the microservice and corresponding historical service indicator data, and the indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization rate; a service indicator prediction unit, which is used to input the historical service indicator time series data and the corresponding service demand description information of each microservice into a time series analysis model respectively, to determine the predicted service indicators of each of the microservices in the future time step; a resource collaborative broadcast unit is used to generate a resource collaborative notification based on the intermediate state data of the risk microservice and the corresponding service requirement description information of the first queue request when it is detected that there is a risk of service performance decline in the predicted service indicators of the risk microservice, and broadcast the resource collaborative notification in the edge network, so that each second edge node determines whether to respond to the resource collaborative notification through resource evaluation; the intermediate state data includes the container resource surplus, the request queue length and the container failure rate; a service scheduling unit is used to migrate the risk microservice and the queue request to the second target edge node when a response reply message of the second target edge node to the resource collaborative notification is detected.

[0008] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the edge computing-based microservice scheduling method of any embodiment of the present application.

[0009] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the microservice scheduling method based on edge computing of any embodiment of the present application are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the edge computing-based microservice scheduling method of any embodiment of the present application.

[0011] The microservice scheduling method and system based on edge computing provided by this application can produce at least the following technical effects:

[0012] (1) By collecting the historical service indicator time series data and service demand description information of microservices in real time and inputting them into the time series analysis model, the potential risk of service performance degradation of microservices can be accurately predicted, so that corresponding measures can be taken to dynamically migrate microservices and requests between edge nodes. This helps to reduce the response delay to user requests in high-concurrency scenarios by making dynamic real-time adjustments in the edge network.

[0013] (2) When the first edge node senses a potential risk of service performance degradation, it generates a resource coordination notification and broadcasts it in the edge network. The other second edge nodes can evaluate the current resource status and decide whether to accept migration requests for potentially congested microservices, thereby achieving dynamic scheduling of service resources in the edge network. This ensures that each edge node can fully utilize its computing power under high load and low load conditions, thereby optimizing the overall resource utilization of the edge network.

[0014] (3) The resource coordination mechanism enables the edge computing environment to flexibly respond to dynamically changing load demands. By real-time detection of the intermediate status data of microservices (such as container resource surplus, request queue length, and container failure rate), load balancing can be effectively achieved to prevent some edge devices from being unable to provide services due to overload, while preventing other devices from being idle and wasting resources, thereby improving the overall reliability and stability of the system.

[0015] Through this technical solution, the predictive ability of the timing analysis model is utilized to implement a data-driven decision-making mechanism, which automatically adjusts service allocation and resource scheduling strategies in a dynamic environment. By migrating services to edge nodes with strong responsiveness, microservices can still maintain high availability in the face of burst traffic, thereby enhancing the fault tolerance of microservices and ensuring the continuity and stability of microservices. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 A flowchart of an example of a microservice scheduling method based on edge computing according to an embodiment of the present application is shown;

[0018] Figure 2 An operation flow chart of an example of resource collaborative networking notification implemented by an edge network broadcast component according to an embodiment of the present application is shown;

[0019] Figure 3An example operation flow chart for evaluating the priority of resource collaboration according to an embodiment of the present application is shown;

[0020] Figure 4 A schematic diagram of the structural connection of an example of an ARIMA-LSTM hybrid model according to an embodiment of the present application is shown;

[0021] Figure 5 A structural block diagram of an example of a microservice scheduling system based on edge computing according to an embodiment of the present application is shown;

[0022] Figure 6 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION

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

[0024] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0025] Figure 1 A flowchart of an example of a microservice scheduling method based on edge computing according to an embodiment of the present application is shown.

[0026] Regarding the execution subject of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. Specifically, it can be implemented by the first edge node in the edge network. The "first" in the first edge node is not specific, and in some cases, it can be any edge node in the edge network. By applying the timing analysis model, microservices can be adaptively adjusted under changing network environments and user needs. In addition, by introducing advanced prediction and dynamic scheduling mechanisms, service performance, resource utilization and overall system stability are significantly improved, thereby optimizing the microservice user experience based on edge network support.

[0027] In some examples, it may be integrated and configured in an electronic device or terminal by means of software, hardware, or a combination of software and hardware, and the type of the terminal or electronic device may be diverse, such as a mobile phone, a tablet computer, or a desktop computer, etc.

[0028] like Figure 1As shown, in step S110, for each microservice, the historical service indicator time series data of the microservice is collected, and the service requirement description information corresponding to the microservice in the request queue is parsed.

[0029] Here, the service demand description information includes the number of requests, request priority and maximum response delay. The historical service indicator time series data contains multiple historical time steps of microservices and corresponding historical service indicator data. The indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization.

[0030] In some embodiments, the operation data of each microservice is regularly collected by using a monitoring tool, including failed request rate, average response time, and container resource usage, etc. Such operation data can be sorted into time series according to timestamps and stored in a time series database to support fast retrieval and analysis.

[0031] It should be noted that each microservice is deployed in a corresponding container through containerization technology (such as Docker), so that the microservice can run independently. The resource usage of each container is collected in real time through monitoring tools (such as Prometheus). In the microservice architecture, each microservice can be composed of one or more containers. The resource utilization rate of the container directly affects the performance of the microservice. Excessive resource usage will lead to increased response delays or service crashes.

[0032] In addition, according to the characteristics of the edge network, the access request will give priority to the nearest edge node to fully utilize the low latency advantage of the edge network. In this way, when the request arrives at the first edge node, the first edge node uses the monitoring module in the message queue or task scheduling system to analyze the access request and extract the service demand description information, which specifically includes the number of requests (that is, the number of requests currently queued), the request priority (which can be set according to business needs, such as emergency, normal, and low priority) and the maximum response delay (the longest waiting time acceptable to users).

[0033] In step S120, the historical service indicator time series data of each microservice and the corresponding service requirement description information are respectively input into the time series analysis model to determine the predicted service indicator of each microservice in the future time step.

[0034] It should be noted that the types of time series analysis models can be diverse, such as ARIMA (Autoregressive Integrated Moving Average) model, LSTM (Long - Short Term Memory) network or other non-restrictive models. The time series analysis model can use the data sample set built based on historical data for model tuning. By analyzing historical data, the change pattern of container resource utilization and microservice response time under different service load requirements can be identified, so that the model can fully consider the dynamic changes of service indicator time series and service requirements when predicting microservice performance.

[0035] Furthermore, the historical service indicator time series data and service requirement description information of each microservice are standardized and input into the training convergence timing analysis model, so that the timing analysis model can predict the predicted service indicators in future time steps, such as the future failed request rate, the future average response time and the potential container resource utilization rate.

[0036] Therefore, by integrating the resource usage data of the container and the historical service indicators of the microservices, a comprehensive service performance view is formed and input into the timing analysis model, which can help the model more accurately predict future resource requirements and performance changes.

[0037] In step S130, when it is detected that the predicted service indicator of the risk microservice has a risk of service performance degradation, a resource collaboration notification is generated based on the intermediate state data of the risk microservice and the service requirement description information of the corresponding first queue request, and the resource collaboration notification is broadcast in the edge network, so that each second edge node determines whether to respond to the resource collaboration notification through resource evaluation.

[0038] In some implementations, by comparing the predicted service indicator with a set threshold, once a performance indicator of a microservice (for example, the predicted response time exceeds the maximum tolerance value) is found to be at risk of decline, the microservice is marked as a risky microservice and enters a risk response mechanism.

[0039] Furthermore, according to the intermediate state data of the risk microservice (such as the container resource surplus, request queue length and container failure rate) and the service requirement description information of the first queue request corresponding to the risk microservice, a detailed resource coordination notification is generated to describe the required resources and service requirements. Then, in the edge network, a broadcast protocol (such as Multicast) is used to send the resource coordination notification to all relevant second edge nodes.

[0040] After receiving the resource coordination notification, the resource management module of the second edge node will compare its own resource status with the resource requirements requested in the notification, and evaluate whether its own resource margin can meet the resource quantity or service requirement description specified in the broadcast resource coordination notification. Preferably, the second edge node can also evaluate the priority of the request currently being processed and compare it with the priority of the coordination request to ensure the operational stability of the original service system after the implementation of resource assistance. Furthermore, based on the results of the resource evaluation, the second edge node will decide whether to respond to the resource coordination notification, and will mark the second edge node determined to respond to the resource coordination notification as the second target edge node.

[0041] More specifically, by parsing resource collaboration notifications, the container resource surplus of the service that needs assistance is analyzed. If the container resource surplus is too low, it means that the demand for microservice scheduling is more urgent, and it can be given a higher assistance priority. By analyzing the request queue length, the longer the length, the higher the assistance priority, and combined with the queue length, the potential response delay can also be analyzed to determine whether to respond or only respond to some requests. Furthermore, the container failure rate can also be used to characterize the assistance priority. For example, the greater the container failure rate, the lower the assistance priority. Specifically, if the container corresponding to the service that needs assistance has a higher container failure rate, then even if other conditions are met, the second edge node can choose not to respond to ensure the stability of its own system.

[0042] Therefore, based on detailed resource evaluation, edge nodes can reasonably allocate and utilize resources while ensuring their own service quality, optimize overall resource utilization, and avoid the collapse of their own original services due to the implementation of resource collaboration, thereby improving the stability of system microservice operation.

[0043] It should be noted that, on the one hand, the second edge node can be any other edge node in the edge network except the first edge node. On the other hand, the second edge node can also be an edge node in the edge network with a specific function or mode (e.g., resource collaboration mode) enabled. For example, only when the resource load in the edge node is light or the resources are relatively abundant, that is, below a specific threshold, the second edge node can be enabled with the resource collaboration mode to provide resource assistance to other edge nodes. In addition, when the resource load of the second edge node is too large, for example, exceeding a preset threshold, the second edge node can exit the resource collaboration mode, no longer provide resource assistance, and reject the microservice migration of other edge nodes.

[0044] In step S140, when a response reply message of the second target edge node to the resource coordination notification is detected, the risk microservice and the queue request are migrated to the second target edge node.

[0045] In some embodiments, after receiving the response from the second target edge node, the first edge node implements the migration operation of the microservice, for example, container technology (such as Docker) can be used to achieve the migration of the microservice and its request. Exemplarily, by using a fast state transfer mechanism, the service interruption time is minimized. After the migration is completed, the state of the new node is ensured to be synchronized with the original node, and the service discovery mechanism is updated so that the access request can be accurately routed to the new node.

[0046] Through the embodiments of the present application, effective container migration and dynamic resource adjustment are used to ensure that microservices can run quickly and stably on new edge nodes, thereby achieving seamless migration of microservices and minimizing service interruption time, thereby improving the flexibility and reliability of the system.

[0047] Regarding the implementation details of broadcasting resource collaboration notifications in the edge network, in some examples of the embodiments of the present application, the resource collaboration notification is sent to an edge network broadcast component, and the edge network broadcast component is used to perform unified networking management on each edge node that has enabled the resource collaboration function.

[0048] In some implementations, an edge network broadcast component is constructed through a message queue system (such as Kafka or RabbitMQ) to receive and temporarily store resource coordination notifications issued by each edge node. In this way, each resource coordination notification is pushed to the message queue as a message, so that the resource coordination notification can be efficiently and prioritized in the edge network and sequentially delivered and responded.

[0049] Figure 2 An operational flow chart of an example of resource collaborative networking notification implemented by an edge network broadcast component according to an embodiment of the present application is shown.

[0050] like Figure 2 As shown, in step S210, it is detected whether there are multiple unresponded resource coordination notifications.

[0051] In some embodiments, the edge network broadcast component is provided with a status monitoring module, which periodically scans the list of resource collaboration notifications that have been sent to check whether there are any unresponded notifications. Specifically, a timeout mechanism is set for each resource collaboration notification, and a response time window is specified. If the resource collaboration notification is not responded to within the response time window, the notification will be marked as "unresponded". Furthermore, the unresponded notifications are recorded in a temporary list, and the broadcast component obtains the resource collaboration notifications that are currently unresponded by querying the temporary list.

[0052] In step S221, if there is only one unanswered resource coordination notification, the resource coordination notification is directly broadcast in the edge network.

[0053] Specifically, when only one unanswered resource coordination notification is detected, it can be implemented through a simple broadcast mechanism, such as using the UDP protocol for one-to-many message delivery, to send the notification to all nodes in the edge network.

[0054] In step S223, if there are multiple unresponded resource collaboration notifications, the priority of each corresponding risk microservice is evaluated according to each unresponded resource collaboration notification.

[0055] In some embodiments, based on the service demand description information in each unanswered resource collaboration notification, the corresponding priority is calculated according to the set priority evaluation criteria by comprehensively considering factors such as request urgency, historical service performance, current load conditions, and container failure rate. Exemplarily, by adopting a weighted scoring mechanism, each evaluation dimension involved in the notification is scored and summed, such as the container resource surplus, request queue length, and container failure rate. The higher the total score, the higher the priority. Regarding the positive or negative correlation between each evaluation dimension and the assistance priority, please refer to the description in combination with other examples above, which will not be repeated here.

[0056] In step S230, each unresponded resource coordination notification is broadcast in the edge network according to the corresponding priority order.

[0057] In some implementations, unanswered resource coordination notifications are sorted according to the priority evaluation results and broadcast one by one in order. During broadcasting, in order to ensure that all edge nodes can receive the notification, an efficient broadcast protocol (such as Multicast) can be used to ensure the rapid propagation of information. Thus, by broadcasting in priority order, the broadcast mechanism of resource coordination notifications is optimized, which can ensure that the most important resource requests are met first, so that when faced with complex high-concurrency scenarios, the edge network can efficiently and dynamically respond to resource scheduling needs.

[0058] Figure 3 An operational flowchart of an example for evaluating the priority of resource collaboration according to an embodiment of the present application is shown.

[0059] like Figure 3 As shown, in step S310, a collaborative microservice matrix is ​​constructed according to each unresponded resource collaborative notification.

[0060] Here, each row of the collaborative microservice matrix represents a different type of risk microservice, and each column represents the standardized value of the corresponding intermediate state data or service requirement description information of the risk microservice.

[0061] In some implementations, for all unanswered resource collaboration notifications, the risk microservices involved in each notification are extracted, and these microservices are arranged by type as rows of the collaboration microservice matrix. The intermediate state data (such as container resource surplus, request queue length, container failure rate) and service requirement description information (such as request priority, maximum response delay, etc.) of each microservice are standardized to ensure that data of different dimensions can be compared and clustered in the same matrix.

[0062] In the collaborative microservice matrix, the standardized intermediate state data and service requirement description information of each risk microservice are filled into the corresponding matrix cells, so that the matrix can fully represent the current service status and requirements of each microservice.

[0063] In step S320, the collaborative microservice matrix is ​​solved according to the spectral clustering algorithm to determine the priority of each corresponding risk microservice.

[0064] It should be noted that the spectral clustering algorithm is an algorithm based on graph theory. It represents data as a graph structure and calculates the Laplacian matrix of the graph to divide the data into different categories. It has good results when processing high-dimensional data, so it is suitable for risk microservice priority assessment containing multiple indicators. Here, the spectral clustering technology is used to transform the collaborative microservice matrix into a graph model, evaluate the similarity and resource sharing potential between microservices, and then perform priority allocation.

[0065] Through the embodiments of the present application, a collaborative microservice matrix is ​​constructed and the priority of risk microservices is sorted using a spectral clustering algorithm, which can automatically prioritize the risk microservices according to their status and needs, thereby realizing automated priority evaluation and ensuring that the processing of resource collaborative notifications can be reasonably arranged according to the actual needs and status of the risk microservices.

[0066] The spectral clustering algorithm uses multi-dimensional performance indicators in the collaborative microservice matrix (such as resource surplus, request queue length, container failure rate, etc.), based on similarity calculation and dimensionality reduction analysis of multiple performance data, to accurately identify microservices in a high-risk state, ensure risk assessment in multiple dimensions, and ensure the accuracy of identification. Compared with the traditional single-indicator risk assessment, the embodiment of the present application realizes the comprehensive analysis of multi-dimensional data, which can better locate high-risk microservices in the edge network.

[0067] As a preferred implementation of the embodiment of the present application, a spectral clustering algorithm based on dynamic update of cluster centers can be used. Based on the dynamic update mechanism of cluster centers, the system can adjust the clustering structure of microservices according to real-time monitoring data.

[0068] Specifically, the similarity matrix of the collaborative microservice matrix is ​​calculated:

[0069] , Formula (1)

[0070] , Formula (2)

[0071] In the formula, represents the collaborative microservice matrix, For the matrix Line The elements of the column represent risk microservices In the indicator Performance values ​​on Represents the total number of risky microservices, Indicates the total number of indicators; is the similarity matrix Elements in the risk microservice and risk microservices The similarity value between and Represents risk microservices and risk microservices The performance indicator vector, and Respectively and The norm of .

[0072] By adding various indicators such as request queue length to the similarity matrix, microservices with high potential risks can be identified. For these microservices, resource scheduling or migration will be prioritized, thereby reducing the risk of fault propagation and improving the system's fault tolerance.

[0073] Similarity Matrix Perform eigenvalue decomposition to obtain eigenvalues ​​and eigenvectors, and select the first Eigenvectors:

[0074] , Formula (3)

[0075] In the formula, is a diagonal matrix containing The eigenvalues ​​of ; is the eigenvector matrix, column vector is the corresponding eigenvector.

[0076] Select the one corresponding to the top ranked eigenvalue eigenvectors, forming a matrix :

[0077] , Formula (4)

[0078] Random Selection Cluster Centers , and assign each risk microservice to the nearest cluster center:

[0079] , Formula (5)

[0080] , Formula (6)

[0081] In the formula, Representing Risk Microservices Projection on The coordinates in the feature space of express The transposed matrix of Representing Risk Microservices The cluster to which it belongs, Representation clustering center.

[0082] Update cluster centers:

[0083] , Formula (7)

[0084] In the formula, Represents the updated clustering The center of Represents the clustering before updating The center of Represents clustering before update The number of microservices, Represents the clustering before updating The sum of the feature vectors of all microservices in .

[0085] By using the spectral clustering algorithm to group microservices in fine-grained manner, we can better identify the similarities and dependencies between microservices. Based on the clustering results based on similarity, we can formulate more targeted management strategies for each microservice group, such as load balancing, resource isolation, etc., so as to achieve refined service governance. As a result, we can flexibly respond to complex service environments, support the management needs of large-scale microservice systems, and achieve fine-grained management methods.

[0086] At each cluster update, the difference in cluster centers is monitored. If the difference exceeds the set threshold, the cluster centers are recalculated:

[0087] , Formula (8)

[0088] In the formula, Represents the cluster center The amount of change, Indicates setting a threshold.

[0089] In the embodiment of the present application, when the load fluctuates or the state changes greatly, the cluster center can be recalculated according to the set threshold to ensure the accuracy of the priority evaluation. As a result, in the case of high load or sudden requests, key risk microservices can be quickly identified and prioritized, which enhances the elasticity of the system, reduces the resource allocation lag caused by load changes, and improves the response speed to emergencies.

[0090] Calculate the priority coefficient of each risk microservice, and determine the priority of each corresponding risk microservice according to each priority coefficient:

[0091] , Formula (9)

[0092] In the formula, Representing Risk Microservices The priority coefficient of Representing Risk Microservices The number of requests, and Representing Risk Microservices And the final cluster center The distance between.

[0093] Here, the priority evaluation formula integrates the request volume and distance to ensure that resources are allocated first to microservices with high request volume and close to the cluster center. This allows limited resources to be concentrated on the services that need them most, and allows efficient operation to be maintained in high-concurrency scenarios, extending the effective utilization cycle of resources, thereby reducing the overall system overhead and improving resource utilization.

[0094] As a result, not only the accuracy of microservice priority assessment is improved, but also the system's elasticity and resource utilization are enhanced, enabling it to operate efficiently and stably in complex environments, meeting the high demands of modern microservice architecture for intelligence, real-time and stability.

[0095] In some examples of the embodiments of the present application, the time series analysis model adopts an ARIMA-LSTM hybrid model.

[0096] Figure 4 A schematic diagram of the structural connection of an example of an ARIMA-LSTM hybrid model according to an embodiment of the present application is shown.

[0097] like Figure 4 As shown, the ARIMA-LSTM hybrid model 400 includes an ARIMA module 410 , an LSTM module 420 and a fusion output module 430 .

[0098] The ARIMA module 410 is used to perform linear autoregression and moving average analysis on the inputted historical service indicator time series data of the microservice and the corresponding service demand description information to generate ARIMA linear prediction values ​​and ARIMA prediction residuals.

[0099] ARIMA is a statistical model for time series analysis, which consists of three parts: autoregression (AR), difference (I) and moving average (MA). Specifically, first, the input microservice historical service indicator time series data and service demand description information are preprocessed, including removing outliers, filling missing values ​​and standardizing. Considering that the service demand description information is a single value, the time step of the historical service indicator time series data can also be used to expand the service demand description information into time series data. Then, according to the input time series data, the autocorrelation function (ACF) and partial autocorrelation function (PACF) are used to determine the parameters of ARIMA, such as the number of autoregression terms and the number of moving average terms. Then, using the selected ARIMA, a linear autoregression analysis is performed on the input historical service indicators to generate the ARIMA linear prediction value corresponding to the future time step. Finally, the difference between the actual value of the current time step (i.e., the latest time step indicated by the historical service indicator time series data) and the corresponding predicted value is obtained to obtain the ARIMA prediction residual.

[0100] The LSTM module 420 is used to process the ARIMA forecast residuals and the service demand description information, and capture the complex nonlinear characteristics in the time series to generate nonlinear forecast values.

[0101] In some embodiments, the ARIMA forecast residuals and related service demand description information are used as inputs to the LSTM module. The LSTM can be combined in a stacked manner using an appropriate number of LSTM units and layers to capture complex nonlinear features in the time series. Here, the LSTM can be trained using historical data, and the weights can be adjusted based on the back propagation algorithm so that it can generate nonlinear prediction values ​​corresponding to future time steps after training.

[0102] The fusion output module 430 is used to perform weighted fusion on the ARIMA linear prediction value and the nonlinear prediction value, and determine the prediction service index of the microservice in the future time step according to the result of the weighted fusion.

[0103] In some embodiments, the fusion output module can weight the ARIMA linear prediction value and the LSTM nonlinear prediction value according to a specific weighting strategy. For example, the weights for the ARIMA linear prediction value and the LSTM nonlinear prediction value can be preset. Finally, the final predicted service indicators of the microservice at the future time step are generated by combining the results of the weighted fusion, such as the potential failed request rate, the average response time and other key performance indicators.

[0104] As a preferred implementation of the embodiment of the present application, the LSTM model can also be enhanced to further improve its performance in microservice indicator prediction tasks.

[0105] In some examples of the embodiments of the present application, the ARIMA module 410 adopts an adaptive feature weighting mechanism and is used to perform the following operations:

[0106] The service demand description information is time-series expanded so that the expanded service demand sequence and the service indicator time series data maintain the same time step.

[0107] Calculate the adaptive weights and perform weighted fusion of the historical service indicator time series data and the service demand description information according to the adaptive weights to generate weighted input time series data:

[0108] , Formula (10)

[0109] , Formula (11)

[0110] , Formula (12)

[0111] In the formula, and denote the first adaptive weight and the second adaptive weight respectively, and represent the corresponding first sensitive adjustment parameter and second sensitive adjustment parameter respectively; represents the exponential function, Indicates the current The fluctuation of service index in time steps, Indicates the request priority. Indicates the number of requests. Indicates the maximum response delay, Represents the current historical service indicator time series data. Represents the current service demand sequence, Represents the current weighted input time series data.

[0112] In edge computing environments, the demand information of different microservices, such as the request volume, priority, and maximum response delay, often changes in real time. The adaptive feature weighting mechanism dynamically calculates the weights. and , so that the model can adaptively adjust the impact of each feature on the prediction result according to the current service demand (such as request volume and priority). Higher or requested quantity When it increases, the model will automatically increase the corresponding weight , so that these factors receive more attention in the forecast to accurately reflect the resource requirements in high-priority and high-traffic situations. will be increased so that the ARIMA module can respond more quickly to performance fluctuations.

[0113] The adaptive feature weighting mechanism realizes the integration of multiple factors, unifying service indicator data (such as failed request rate, average response time, etc.) and service demand description (such as number of requests, priority, maximum response delay) into weighted input data. By integrating this information, a more comprehensive judgment can be made on service performance changes, ensuring that the resource scheduling strategy can fully utilize the computing resources of the current node and make dynamic response adjustments to improve prediction accuracy.

[0114] Perform linear autoregression and differencing on the weighted input time series data to capture the linear trend in the time series data:

[0115] , Formula (13)

[0116] , Formula (14)

[0117] In the formula, Indicates the future The AR linear prediction results of time steps are: represents the number of autoregressive terms; Indicates that in history The weighted input data for time steps, Indicates that in the current The autoregressive difference results of time steps; Represents the autoregressive coefficient, reflecting the lag of The influence weight of each time step.

[0118] Perform moving average calculation on the autoregressive difference results to smooth the error of the autoregressive forecast:

[0119] , Formula (15)

[0120] In the formula, is the result of moving average analysis, indicating the corresponding future Smoothed forecast value for time steps; represents the number of moving average items, represents the moving average coefficient, Indicates that in history The autoregressive difference results for time steps.

[0121] According to the results of linear autoregression analysis and moving average analysis, the ARIMA linear prediction value and ARIMA prediction residual are calculated:

[0122] , Formula (16)

[0123] , Formula (17)

[0124] In the formula, Indicates the future ARIMA linear forecast value for time steps, Represents the actual service indicator value of the current time step obtained from the historical service indicator time series data. Represents the ARIMA forecast residuals at the current time step.

[0125] On the one hand, in microservice scheduling, high-priority tasks usually need to ensure lower response delays, while low-priority tasks can tolerate larger delays. When high-priority tasks arrive, the corresponding weights will be increased to ensure that the ARIMA module pays more attention to these request requirements. When edge node resources are tight, the system will prioritize the service quality of high-priority tasks to avoid low-priority tasks interfering with the service performance of high-priority tasks.

[0126] On the other hand, in edge computing scenarios, service performance is easily affected by external factors (such as network fluctuations and sudden requests). The adaptive feature weighting mechanism can adjust the weight of each feature in the model under different loads and service requests, which helps to improve the robustness and stability of the system. When service indicators fluctuate abnormally (such as a surge in failed request rate or a sharp increase in response time), the ARIMA module can The value can quickly respond to abnormal situations to adjust the prediction strategy to prevent the system from crashing due to inability to cope with sudden loads. In this way, in high-load scenarios, by adjusting the weight distribution, it can operate stably in an environment where service demand is constantly changing, thereby reducing the risk of performance degradation or resource exhaustion in the edge computing system.

[0127] In some examples of the embodiments of the present application, the LSTM module 420 adopts a multi-scale residual analysis mechanism and includes a multi-scale residual decomposition layer, an LSTM layer, a multi-scale residual modeling layer, an adaptive fusion layer and a fully connected layer.

[0128] The multi-scale residual decomposition layer is used to perform wavelet decomposition on the ARIMA prediction residuals to obtain short-term fluctuation residuals and long-term trend residuals, and to concatenate short-term fluctuation residuals, long-term trend residuals, ARIMA linear prediction values ​​and service demand description information to generate a multi-scale input feature vector.

[0129] By performing wavelet decomposition on the ARIMA forecast residuals and decomposing them into short-term fluctuation residuals and long-term trend residuals, we can effectively separate signals of different frequencies, thereby capturing the short-term and long-term variation characteristics in microservice performance indicators. Specifically, wavelet decomposition decomposes the signal into high-frequency and low-frequency components in different frequency bands through a series of scaling transformations and wavelet basis functions, and then extracts short-term and long-term residual components.

[0130] , Formula (18)

[0131] , Formula (19)

[0132] , formula (20)

[0133] , Formula (21)

[0134] In the formula, for No. The high-frequency component represents the short-term fluctuation residual; for No. The first-order low-frequency component represents the long-term trend residual; is the total number of decomposition levels, is the short-term volatility residual; is the hierarchical threshold used to separate the short-term component and the long-term component, where The high-frequency components of are combined into short-term residuals; is the long-term trend residual, where is the decomposition level used to capture low-frequency trends; Represents the multi-scale input feature vector at the current time step.

[0135] Here, by combining multi-scale residual decomposition and LSTM module to process short-term fluctuations and long-term trends, the complex variation characteristics of service performance can be accurately captured. Capturing sudden changes in instantaneous requests helps to respond quickly to high-frequency fluctuations. It provides a low-frequency, slowly changing trend, allowing the model to identify the gradual increase or decrease in service load. Therefore, through the precise modeling of multi-scale features, the LSTM layer can more accurately predict future service demand and performance changes, avoiding ignoring a certain type of change feature due to the limitation of a single scale.

[0136] The LSTM layer is used to nonlinearly process multi-scale input feature vectors to capture the complex variation patterns of service performance:

[0137] , Formula (22)

[0138] In the formula, is the hidden state output by the LSTM layer, indicating the memory state of the LSTM at the current time step; It is the LSTM module for the history The hidden state output at each time step; Represents the nonlinear processing function of the LSTM module, including the comprehensive calculation of the input gate, forget gate, memory gate, and output gate.

[0139] The multi-scale residual modeling layer is used to calculate the short-term volatility residual change and the long-term trend residual change:

[0140] , Formula (23)

[0141] , Formula (24)

[0142] In the formula, is the change in the short-term fluctuation residual at the current time step, indicating the rate of change of high-frequency features; is the change in the long-term trend residual at the current time step, indicating the smooth change rate of the low-frequency feature; is the time window size, which is used to smooth the long-term residuals to reduce the interference of short-term fluctuations on long-term trends.

[0143] The adaptive fusion layer is used to calculate the short-term residual weight coefficient and the long-term residual weight coefficient, and perform multi-scale residual weighted fusion on the hidden state output by the LSTM layer to obtain the corresponding weighted fusion hidden state:

[0144] , Formula (25)

[0145] , Formula (26)

[0146] , Formula (27)

[0147] In the formula, and They represent the short-term residual weighting coefficient and the long-term residual weighting coefficient respectively; and represents the adjustment coefficient, which is used to control the sensitivity of the corresponding weighting coefficient to the change of residual; represents the weighted fusion hidden state.

[0148] Here, by adaptively weighting the fusion of short-term and long-term features, the degree of attention paid to short-term and long-term features can be automatically adjusted according to different load conditions. For example, when the system detects a sudden increase in load (such as a sudden increase in the number of requests or priority), the adaptive weight of the short-term residual The model will automatically increase the weight of the long-term trend residual under stable load. The increase enables the system to schedule resources more smoothly and reduce the overhead caused by frequent adjustments. As a result, the flexibility of resource scheduling is greatly improved through the adaptive adjustment mechanism, and computing resources can be reasonably allocated according to real-time load changes, which improves the response speed to sudden requests.

[0149] Fully connected layers are used to process the weighted fused hidden states to generate nonlinear predictions:

[0150] , formula (28)

[0151] In the formula, The final output of the LSTM module corresponds to the future The nonlinear prediction value of time steps, and They represent the weight matrix and bias term of the fully connected layer respectively.

[0152] In the embodiment of the present application, the LSTM based on multi-scale residual analysis can quickly identify abnormal request peaks by capturing short-term fluctuation residuals, avoiding system crashes caused by short-term excessive loads. By smoothing the long-term trend residuals, the interference of short-term fluctuations on long-term predictions can be effectively reduced, and more robust resource scheduling can be achieved. Therefore, on the one hand, it is possible to quickly respond to higher priority task requirements and reduce response delays for high-priority tasks; on the other hand, when the request load tends to stabilize, paying attention to long-term trends helps maintain system stability.

[0153] In some examples of the embodiments of the present application, the fusion output module 430 is used to perform the following operations:

[0154] Based on the dynamic weight mechanism, the ARIMA linear prediction value and the nonlinear prediction value are weighted and fused to obtain the weighted fusion prediction value.

[0155] , formula (29)

[0156] , formula (30)

[0157] , formula (31)

[0158] , Formula (32)

[0159] In the formula, Indicates the future The weighted fusion prediction value of time steps, represents the LSTM prediction residual at the current time step, and Respectively represent the ARIMA dynamic weight and LSTM dynamic weight at the current time step; and is the sensitivity coefficient, which is used to control the sensitivity of the corresponding weight item to the residual.

[0160] Here, by introducing a dynamic weighting mechanism in the fusion output module, the weights of the ARIMA module and the LSTM module can be adjusted in real time according to the historical prediction residuals, and the prediction accuracy can be automatically optimized under different load conditions. Specifically, during the low-load stable period, the stability of historical data is more suitable for linear models, and the system may rely more on the linear prediction results of ARIMA; during the high-load fluctuation period, the system may rely more on the nonlinear prediction results of LSTM to capture sudden nonlinear changes. In this way, the prediction deviation caused by the limitation of a single model is avoided, and the accuracy of future service demand prediction is improved.

[0161] Analyze the fluctuations of the historical forecast residuals of ARIMA and LSTM to calculate the uncertainty amount.

[0162] Specifically, by introducing an uncertainty assessment mechanism, the credibility of the current forecast is judged based on the fluctuation of the forecast residual. If the forecast fluctuation is large, the system tends to make conservative adjustments to the forecast results to reduce the error accumulation caused by uncertainty.

[0163] , formula (33)

[0164] In the formula, Indicates the future The uncertainty of the prediction results at each time step is used to evaluate the credibility of the prediction; is the standard deviation of the prediction residuals, is the size of the sliding window of historical fluctuations used to compute the residual.

[0165] According to the uncertainty, the weighted fusion prediction value is superimposed with the historical average of the service index to obtain the final predicted service index.

[0166] By introducing the uncertainty assessment mechanism, the confidence of the current prediction can be dynamically evaluated based on the historical residual fluctuations. Under the guidance of the system, when the system detects that the residual fluctuation of the current prediction is large, it will automatically increase the weight of the historical mean to make the prediction result more conservative. Specifically, under high uncertainty conditions, it is more inclined to use the historical mean, thereby reducing the extreme prediction value caused by sudden load fluctuations. In this way, the volatility of the prediction results can be alleviated, making the system more stable during resource scheduling and load balancing, and reducing frequent adjustments.

[0167] , formula (34)

[0168] , formula (35)

[0169] In the formula, represents the final output after uncertainty adjustment corresponding to the future The forecast service index of time steps, where the uncertainty When the uncertainty is large (i.e., exceeds the preset uncertainty threshold), the reliance on the current forecast results is reduced and the weight of the historical mean is increased, thereby reducing the error caused by forecast fluctuations: represents the uncertainty adjustment coefficient; Represents the historical average value of the service indicator corresponding to the current time step; represents the adjustment factor used to control the increase in the impact of uncertainty, represents the uncertainty reference value, Upper limit value adjusted for uncertainty.

[0170] In formula (35), the uncertainty adjustment coefficient Defined as a value controlled by a logic function, whose range is . It is an S-shaped function that can be used to calculate the uncertainty The size of the In addition, when the uncertainty Above the baseline hour, As the value increases, formula (34) becomes more dependent on the historical mean; Close to or below hour, As the value decreases, the system relies more on the predicted value. Here, Indicates the maximum value of the adjustment coefficient, ensuring It will not be too large, thereby limiting the weight of the historical mean and preventing over-reliance on historical data and loss of responsiveness to current forecasts.

[0171] In edge computing environments, the load and demand changes of microservices are uncertain. The prediction results of the ARIMA-LSTM hybrid model may be biased in some cases, and corrections based on historical means can enhance the stability of the prediction. , the degree of dependence on the predicted value and the historical mean can be dynamically adjusted to balance the prediction accuracy and stability, ensuring that the system's prediction output is more robust under high uncertainty.

[0172] In the embodiment of the present application, by adopting the uncertainty adjustment mechanism, when the load changes drastically, the reliance on the current prediction can be automatically reduced, the weight of the historical average can be increased, and the reliance on aggressive prediction can be reduced, thereby avoiding the risk of resource overload caused by overreaction. On the other hand, when the system load is high and the prediction is stable, the current prediction result can be more trusted to reduce redundant resource configuration.

[0173] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of actions combined, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0174] Figure 5 A structural block diagram of an example of a microservice scheduling system based on edge computing according to an embodiment of the present application is shown.

[0175] like Figure 5 As shown, the microservice scheduling system 500 based on edge computing includes a data collection unit 510, a service indicator prediction unit 520, a resource collaborative broadcast unit 530 and a service scheduling unit 540.

[0176] The data collection unit 510 is used to collect the historical service indicator time series data of each microservice, and parse the service requirement description information corresponding to the microservice in the request queue; the service requirement description information includes the number of requests, request priority and maximum response delay; the historical service indicator time series data includes multiple historical time steps of the microservice and corresponding historical service indicator data, and the indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization rate.

[0177] The service indicator prediction unit 520 is used to input the historical service indicator time series data of each microservice and the corresponding service requirement description information into the time series analysis model respectively, so as to determine the predicted service indicator of each microservice in the future time step.

[0178] The resource collaboration broadcast unit 530 is used to generate a resource collaboration notification based on the intermediate state data of the risk microservice and the service requirement description information of the corresponding first queue request when it is detected that the predicted service indicator of the risk microservice has a risk of service performance degradation, and broadcast the resource collaboration notification in the edge network, so that each second edge node determines whether to respond to the resource collaboration notification through resource evaluation; the intermediate state data includes container resource surplus, request queue length and container failure rate.

[0179] The service scheduling unit 540 is configured to migrate the risk microservice and the queue request to the second target edge node when detecting a response reply message from the second target edge node to the resource coordination notification.

[0180] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of any of the above-mentioned edge computing-based microservice scheduling methods of the present application.

[0181] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer performs any step of the above-mentioned microservice scheduling method based on edge computing.

[0182] In some embodiments, an embodiment of the present application also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the microservice scheduling method based on edge computing.

[0183] Figure 6 is a schematic diagram of the hardware structure of an electronic device for executing a microservice scheduling method based on edge computing provided by another embodiment of the present application, such as Figure 6 As shown, the device includes:

[0184] One or more processors 610 and memory 620, Figure 6 A processor 610 is taken as an example.

[0185] The device for executing the microservice scheduling method based on edge computing may further include: an input device 630 and an output device 640 .

[0186] The processor 610, the memory 620, the input device 630 and the output device 640 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0187] The memory 620, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the microservice scheduling method based on edge computing in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, realizing the microservice scheduling method based on edge computing in the above method embodiment.

[0188] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0189] The input device 630 can receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 640 can include a display device such as a display screen.

[0190] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, the edge computing-based microservice scheduling method in any of the above method embodiments is executed.

[0191] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0192] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:

[0193] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.

[0194] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.

[0195] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0196] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.

[0197] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

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

Claims

1. A microservice scheduling method based on edge computing, applied to a first edge node, the method comprising: For each microservice, collect the historical service indicator time series data of the microservice, and parse the service requirement description information corresponding to the microservice in the request queue; The service demand description information includes the number of requests, request priority and maximum response delay; the historical service indicator time series data includes multiple historical time steps of microservices and corresponding historical service indicator data, and the indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization rate; Inputting the historical service indicator time series data of each microservice and the corresponding service requirement description information into the time series analysis model respectively to determine the predicted service indicator of each microservice in the future time step; When it is detected that the predicted service indicator of the risk microservice has a risk of service performance degradation, a resource coordination notification is generated according to the intermediate state data of the risk microservice and the service demand description information of the corresponding first queue request, and the resource coordination notification is broadcast in the edge network, so that each second edge node determines whether to respond to the resource coordination notification through resource evaluation; the intermediate state data includes the container resource surplus, the request queue length and the container failure rate; When a response reply message of the second target edge node to the resource collaboration notification is detected, migrating the risk microservice and the queue request to the second target edge node; The time series analysis model adopts an ARIMA-LSTM hybrid model, which includes an ARIMA module, an LSTM module and a fusion output module; The ARIMA module is used to perform linear autoregression and moving average analysis on the input historical service indicator time series data of the microservice and the corresponding service demand description information to generate ARIMA linear prediction values ​​and ARIMA prediction residuals; The LSTM module is used to process the ARIMA prediction residual and the service demand description information, capture the complex nonlinear characteristics in the time series, and generate a nonlinear prediction value; The fusion output module is used to perform weighted fusion on the ARIMA linear prediction value and the nonlinear prediction value, and determine the prediction service index of the microservice in the future time step according to the result of the weighted fusion.

2. The method according to claim 1, wherein: The broadcasting of the resource coordination notification in the edge network includes: Sending the resource collaboration notification to an edge network broadcast component, where the edge network broadcast component is used to perform unified networking management on each edge node that has the resource collaboration function enabled; The edge network broadcast component is used to perform the following operations: Detect whether there are multiple unanswered resource collaboration notifications; When there are multiple unanswered resource collaboration notifications, the priority of each corresponding risk microservice is evaluated according to each of the unanswered resource collaboration notifications; The unresponded resource collaborative notifications are broadcasted in the edge network in the corresponding priority order.

3. According to the method of claim 2, the step of evaluating the priority of each corresponding risk microservice according to each of the unresponded resource collaborative notifications comprises: According to each of the unresponded resource collaboration notifications, a collaborative microservice matrix is ​​constructed; Each row of the collaborative microservice matrix represents a different type of risk microservice, and each column represents a standardized value of corresponding intermediate state data or service requirement description information of the risk microservice; The collaborative microservice matrix is ​​solved according to a spectral clustering algorithm to determine the priority of each corresponding risk microservice.

4. The method according to claim 3, wherein: Solving the collaborative microservice matrix according to the spectral clustering algorithm to determine the priority of each corresponding risk microservice includes: Calculate the similarity matrix of the collaborative microservice matrix: , , In the formula, represents the collaborative microservice matrix, For the matrix Line The elements of the column represent risk microservices In the indicator Performance values ​​on Represents the total number of risky microservices, Indicates the total number of indicators; is the similarity matrix Elements in the risk microservice and risk microservices The similarity value between and Represents risk microservices and risk microservices The performance indicator vector, and Respectively and The norm of ; Similarity Matrix Perform eigenvalue decomposition to obtain eigenvalues ​​and eigenvectors, and select the first Eigenvectors: , In the formula, is a diagonal matrix containing The eigenvalues ​​of ; is the eigenvector matrix, column vector is the corresponding eigenvector; Select the one corresponding to the top ranked eigenvalue feature vectors, forming a matrix : ; Random Selection Cluster Centers , and assign each risk microservice to the nearest cluster center: , , In the formula, Representing Risk Microservices Projection on The coordinates in the feature space of express The transposed matrix of Representing Risk Microservices The cluster to which it belongs, Representation clustering the center of; Update cluster centers: , In the formula, Represents the updated clustering The center of Represents the clustering before updating The center of Represents clustering before update The number of microservices, Represents the clustering before updating The sum of the feature vectors of all microservices in; At each cluster update, the difference in cluster centers is monitored. If the difference exceeds the set threshold, the cluster centers are recalculated: , In the formula, Represents the cluster center The amount of change, Indicates setting threshold; Calculate the priority coefficient of each risk microservice, and determine the priority of each corresponding risk microservice according to each priority coefficient: , In the formula, Representing Risk Microservices The priority coefficient of Representing Risk Microservices The number of requests, and Representing Risk Microservices And the final cluster center The distance between.

5. The method according to claim 1, wherein: The ARIMA module uses an adaptive feature weighting mechanism and is used to perform the following operations: Perform time series expansion on the service demand description information so that the expanded service demand sequence and the service indicator time series data maintain the same time step; Calculate the adaptive weights and perform weighted fusion of the historical service indicator time series data and the service demand description information according to the adaptive weights to generate weighted input time series data: , , , In the formula, and denote the first adaptive weight and the second adaptive weight respectively, and represent the corresponding first sensitive adjustment parameter and second sensitive adjustment parameter respectively; represents the exponential function, Indicates the current The fluctuation of service index in time steps, Indicates the request priority. Indicates the number of requests. Indicates the maximum response delay, Represents the current historical service indicator time series data. Represents the current service demand sequence, Represents the current weighted input time series data; The weighted input time series data is subjected to linear autoregression processing and difference operation to capture the linear trend in the time series data: , , In the formula, Indicates the future The AR linear prediction results of time steps are: represents the number of autoregressive terms; Indicates that in history The weighted input data for time steps, Indicates that in the current The autoregressive difference results of time steps; Represents the autoregressive coefficient, reflecting the lag of The influence weight of each time step; A moving average calculation is performed on the autoregressive difference result to smooth the error of the autoregressive prediction: , In the formula, is the result of moving average analysis, indicating the corresponding future Smoothed forecast value for time steps; represents the number of moving average items, represents the moving average coefficient, Indicates that in history The autoregressive difference results of time steps; According to the results of linear autoregression analysis and moving average analysis, the ARIMA linear prediction value and ARIMA prediction residual are calculated: , , In the formula, Indicates the future ARIMA linear forecast value for time steps, Represents the actual service indicator value of the current time step obtained from the historical service indicator time series data. Represents the ARIMA forecast residual at the current time step.

6. The method according to claim 5, wherein: The LSTM module adopts a multi-scale residual analysis mechanism and includes a multi-scale residual decomposition layer, an LSTM layer, a multi-scale residual modeling layer, an adaptive fusion layer and a fully connected layer; The multi-scale residual decomposition layer is used to perform wavelet decomposition on the ARIMA prediction residuals to obtain short-term fluctuation residuals and long-term trend residuals, and concatenate the short-term fluctuation residuals, long-term trend residuals, ARIMA linear prediction values ​​and service demand description information to generate a multi-scale input feature vector: , , , , In the formula, for No. The high-frequency component represents the short-term fluctuation residual; for No. The first-order low-frequency component represents the long-term trend residual; is the total number of decomposition levels, is the short-term volatility residual; is the hierarchical threshold used to separate the short-term component and the long-term component, where The high-frequency components of are combined into short-term residuals; is the long-term trend residual, where is the decomposition level used to capture low-frequency trends; Represents the multi-scale input feature vector at the current time step; The LSTM layer is used to nonlinearly process the multi-scale input feature vector to capture the complex variation pattern of service performance: , In the formula, is the hidden state output by the LSTM layer, indicating the memory state of the LSTM at the current time step; It is the LSTM module for the history The hidden state output at each time step; Represents the nonlinear processing function of the LSTM module, including the comprehensive calculation of the input gate, forget gate, memory gate and output gate; The multi-scale residual modeling layer is used to calculate the short-term volatility residual change and the long-term trend residual change: , , In the formula, is the change in the short-term fluctuation residual at the current time step, indicating the rate of change of high-frequency features; is the change in the long-term trend residual at the current time step, indicating the smooth change rate of the low-frequency feature; is the time window size, which is used to smooth the long-term residuals to reduce the interference of short-term fluctuations on long-term trends; The adaptive fusion layer is used to calculate the short-term residual weighting coefficient and the long-term residual weighting coefficient, and perform multi-scale residual weighted fusion on the hidden state output by the LSTM layer to obtain the corresponding weighted fusion hidden state: , , , In the formula, and They represent the short-term residual weighting coefficient and the long-term residual weighting coefficient respectively; and represents the adjustment coefficient, which is used to control the sensitivity of the corresponding weighting coefficient to the change of residual; represents the weighted fusion hidden state; The fully connected layer is used to process the weighted fused hidden state to generate a nonlinear prediction value: , In the formula, The final output of the LSTM module corresponds to the future The nonlinear prediction value of time steps, and They represent the weight matrix and bias term of the fully connected layer respectively.

7. The method according to claim 6, wherein: The fusion output module is used to perform the following operations: The ARIMA linear prediction value and the nonlinear prediction value are weighted and fused based on a dynamic weight mechanism to obtain a weighted fusion prediction value: , , , , In the formula, Indicates the future The weighted fusion prediction value of time steps, represents the LSTM prediction residual at the current time step, and Respectively represent the ARIMA dynamic weight and LSTM dynamic weight at the current time step; and is the sensitivity coefficient, which is used to control the sensitivity of the corresponding weight item to the residual; Analyze the fluctuations of the historical forecast residuals of ARIMA and LSTM to calculate the uncertainty amount: , In the formula, Indicates the future The uncertainty of the prediction results at each time step is used to evaluate the credibility of the prediction; is the standard deviation of the prediction residuals, is the size of the sliding window used to calculate the historical fluctuations of the residual; The weighted fusion prediction value is superimposed with the historical average value of the service index according to the uncertainty amount to obtain the final predicted service index: , , In the formula, represents the final output after uncertainty adjustment corresponding to the future The forecast service index of time steps, where the uncertainty When the uncertainty threshold is exceeded, the reliance on the current forecast results is reduced and the weight of the historical mean is increased, thereby reducing the error caused by forecast fluctuations: represents the uncertainty adjustment coefficient; Represents the historical average value of the service indicator corresponding to the current time step; represents the adjustment factor used to control the increase in the impact of uncertainty, represents the uncertainty reference value, Upper limit adjusted for uncertainty.

8. A microservice scheduling system based on edge computing, deployed on a first edge node, the system comprising: The data collection unit is used to collect the historical service indicator time series data of each microservice and parse the service demand description information corresponding to the microservice in the request queue; The service demand description information includes the number of requests, request priority and maximum response delay; the historical service indicator time series data includes multiple historical time steps of microservices and corresponding historical service indicator data, and the indicator dimensions of the historical service indicator data include failed request rate, average response time and container resource utilization rate; A service indicator prediction unit, used to input the historical service indicator time series data of each microservice and the corresponding service demand description information into the time series analysis model to determine the predicted service indicator of each microservice in the future time step; A resource collaboration broadcast unit is used to generate a resource collaboration notification according to the intermediate state data of the risk microservice and the service demand description information of the corresponding first queue request when it is detected that the predicted service indicator of the risk microservice has a risk of service performance degradation, and broadcast the resource collaboration notification in the edge network so that each second edge node determines whether to respond to the resource collaboration notification through resource evaluation; the intermediate state data includes container resource surplus, request queue length and container failure rate; A service scheduling unit, configured to migrate the risk microservice and the queue request to the second target edge node when a response reply message of the second target edge node to the resource collaboration notification is detected; The time series analysis model adopts an ARIMA-LSTM hybrid model, which includes an ARIMA module, an LSTM module and a fusion output module; The ARIMA module is used to perform linear autoregression and moving average analysis on the input historical service indicator time series data of the microservice and the corresponding service demand description information to generate ARIMA linear prediction values ​​and ARIMA prediction residuals; The LSTM module is used to process the ARIMA prediction residual and the service demand description information, capture the complex nonlinear characteristics in the time series, and generate a nonlinear prediction value; The fusion output module is used to perform weighted fusion on the ARIMA linear prediction value and the nonlinear prediction value, and determine the prediction service index of the microservice in the future time step according to the result of the weighted fusion.

Citation Information

Patent Citations

  • Edge micro-service fine-grained deployment method and system based on reinforcement learning

    CN117041330A

  • Deep autoregressive recurrent neural network-based edge prediction method

    WO2024065904A1