Micro-service governance method and device and electronic equipment

By using prediction models and real-time monitoring mechanisms in the microservice architecture, we predict the future performance indicator values ​​of the service nodes and allocate resources. Combined with the circuit breaker current limiting and scaling mechanisms, the problem of abnormal operation of the service nodes is solved and the system is stable Sex and resource optimization.

CN119109749APending Publication Date: 2024-12-10BEIYIN FINANCIAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In modern microservice architecture, fluctuations in traffic and sudden growth of services may lead to service overload and system crashes, and the existing technology is difficult to effectively prevent abnormal operation of service nodes.

Method used

By obtaining the historical performance metric values ​​of the target service node from the database, predicting future performance metric values ​​using the prediction model, and allocating and configuration resources based on the prediction results, combining the circuit breaker current limiting and scaling mechanisms, monitoring and responding to the surge in traffic in real time.

Benefits of technology

Effectively prevent service nodes from operating abnormally, ensure system stability and resource optimization, respond to emergencies in a timely manner, and avoid insufficient resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109749A_ABST
    Figure CN119109749A_ABST
Patent Text Reader

Abstract

The invention is applied to the technical field of micro-services, and particularly relates to a micro-service governance method and device and electronic device.The method comprises the steps that for any kind of services, performance index values of historical periods of target service nodes executing the any kind of services are obtained from a database; inputting the performance index value of the historical time period into a prediction model to obtain a performance index value of the target service node in a future time period; and based on the performance index value of the future time period, determining configuration resources allocated to the target service node of the any type of service in the future time period. Through the method, the traffic trend can be predicted, emergency situations can be timely coped with, and stable operation of the service nodes is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of microservice technology, and specifically to a microservice governance method, device, and electronic device. Background Art

[0002] With the emergence of distributed and microservice architectures, there are more and more services and the service architecture is becoming more complex. Microservice governance has become an important topic, and one of the main purposes of microservice governance is to protect the stable operation of the system. In modern microservice architectures, service traffic fluctuations and sudden growth may occur. If not handled in time, it is easy to cause service overload and system crash. Summary of the invention

[0003] The embodiments of the present application provide a microservice governance method, device, and electronic device that can prevent abnormal operation of service nodes.

[0004] In a first aspect, an embodiment of the present application provides a microservice governance method, the method comprising:

[0005] For any type of service, obtain the performance indicator value of the target service node executing the any type of service in the historical period from the database;

[0006] Inputting the performance index value of the historical period into a prediction model to obtain the performance index value of the target service node in a future period, wherein the prediction model is trained based on the sample performance index value of the service node in a first period and the sample performance index value of a second period, wherein the second period is after the first period;

[0007] Based on the performance indicator value of the future time period, the configuration resources allocated to the target service node of the any one type of service in the future time period are determined.

[0008] In a possible implementation, the method further includes:

[0009] After the future time period arrives, collecting the actual performance indicator value of the target service node;

[0010] If the actual performance indicator value exceeds a preset threshold, a processing strategy for the target service node is executed to prevent abnormal operation of the target service node.

[0011] In a possible implementation manner, the actual performance indicator value is the actual number of queries per second;

[0012] If the actual performance indicator value exceeds a preset threshold, executing a processing strategy for the target service node includes:

[0013] If the actual number of queries per second exceeds the preset number, instructing the target service node to suspend providing any type of service;

[0014] After each preset period, the actual number of queries per second is detected, and if the number of queries per second does not exceed the preset number, the target service node is instructed to resume providing any one type of service.

[0015] In a possible implementation manner, the actual performance indicator value is the actual load;

[0016] If the actual performance indicator value exceeds a preset threshold, executing a processing strategy for the target service node includes:

[0017] If the actual load exceeds the preset load, determining the number of target service nodes that need to be expanded based on the difference between the actual load and the preset load;

[0018] According to the quantity, the quantity of target service nodes currently executing the any one type of service is expanded.

[0019] In a possible implementation manner, after collecting the actual performance indicator value of the target service node in the future period, the method further includes:

[0020] If the identity of the target service node is in the pre-built whitelist, verifying the actual performance indicator value;

[0021] If the verification of the actual performance indicator value passes, the actual performance indicator value is stored in the database.

[0022] In a possible implementation manner, the verifying the actual performance indicator value includes:

[0023] If it is determined that the actual performance indicator value is within the preset value range, determining whether the data format of the actual performance indicator value satisfies the preset data format;

[0024] If it is determined that the data format of the actual performance indicator value meets the preset data format, it is determined that the verification is passed.

[0025] In a second aspect, an embodiment of the present application provides a microservice governance device, the device comprising:

[0026] An acquisition module, used for acquiring, from a database, performance indicator values ​​of a target service node executing any one type of service in a historical period;

[0027] A prediction module, configured to input the performance index value of the historical period into a prediction model to obtain the performance index value of the target service node in a future period, wherein the prediction model is trained based on the sample performance index value of the service node in a first period and the sample performance index value of a second period, wherein the second period is after the first period;

[0028] The allocation module is used to determine the configuration resources of the target service node allocated to the any one type of service in the future period based on the performance indicator value of the future period.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:

[0030] 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 execute the method as described in the first aspect above.

[0031] In a fourth aspect, an embodiment of the present application provides a computer program product, which is used to enable a computer to execute the method in the first aspect.

[0032] In a fifth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to enable a computer to execute the method in the first aspect above.

[0033] A microservice governance method provided in an embodiment of the present application can predict the performance index values ​​of future time periods through the performance index values ​​of target service nodes in historical time periods, and allocate resources for future time periods based on the predicted performance index values, which can effectively respond to emergencies and ensure the stable operation of target service nodes. In order to prevent inaccurate predictions, a method for implementing monitoring and response measures are further provided, namely, a circuit breaker and current limiting mechanism and a capacity expansion and contraction mechanism. The circuit breaker and current limiting mechanism and the capacity expansion mechanism can respond to traffic surges in a timely manner, and the capacity reduction mechanism can optimize resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of an application scenario of a microservice governance method provided in an embodiment of the present application;

[0035] Figure 2 A schematic diagram of a process flow of a microservice governance method provided in an embodiment of the present application;

[0036] Figure 3 A flowchart of a real-time monitoring and response method provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of an application scenario of another microservice governance method provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a microservice management device provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0041] The acquisition, storage, use, and processing of data in the embodiments of this application comply with the relevant provisions of national laws and regulations.

[0042] First, some concepts involved in the embodiments of the present application are introduced.

[0043] Service governance: refers to the auxiliary monitoring means of microservices. Generally, complete service governance includes logs, alarms, call chains, service degradation and circuit breaking, permission control, communication protocols, serialization, exception handling, documents, configuration centers, service registration and discovery, load balancing, and service integration.

[0044] Microservices: Microservices are small services composed of a single application, with their own itinerary and lightweight processing. Services are designed according to business functions, deployed in a fully automatic manner, and communicate with other services using the application interface of the application layer protocol. At the same time, the service will use the smallest scale of centralized management (such as Docker) capabilities, and the service can be implemented with different programming languages ​​and database components.

[0045] Container Cluster Management System (Kubernetes, K8s): is an open source container orchestration engine that supports automated deployment, large-scale scalability, and application container management. When deploying an application in a production environment, you usually need to deploy multiple instances of the application to load balance application requests. In K8s, you can create multiple containers, each of which runs an application instance, and then use the built-in load balancing strategy to manage, discover, and access this group of application instances, and these details do not require the operation and maintenance personnel to perform complex manual configuration and processing.

[0046] Distributed system infrastructure (Hadoop): The core design of the Hadoop framework is the distributed file system (Hadoop Distributed File System, HDFS) and the parallel programming model (MapReduce). HDFS provides storage for massive data, and MapReduce provides computing for massive data. Hadoop is highly fault-tolerant and is often deployed on low-cost hardware. It has high throughput and can better access data in applications. It is suitable for applications with large data sets. It allows users to develop distributed programs without understanding the underlying details of the distributed system, and fully utilize the power of the cluster for high-speed computing and storage.

[0047] Distributed publish-subscribe messaging system (Kafka): It can handle all the action stream data of consumers on the website. This action (web browsing, search and other user actions) is a key factor in many social functions on the modern network. This data is usually solved by processing logs and log aggregation due to throughput requirements. For log data and offline analysis systems like Hadoop, but requiring real-time processing, this is a viable solution. The purpose of Kafka is to unify online and offline message processing through Hadoop's parallel loading mechanism, and to provide real-time messages through clusters. Kafka has high throughput, supports partitioning messages through kafka servers and consumer machine clusters, supports Hadoop parallel data loading, etc.

[0048] Service node: In the embodiment of the present application, the service node can be a Pod. Pod is the smallest resource management component in K8s. Pod is also the resource object that minimizes the running of containerized applications. A Pod represents a process running in the cluster. Most other components in K8s are centered around Pod to support and expand Pod functions.

[0049] Performance index value: represents the performance of the service node during operation. When the traffic accessing the service node changes, the performance index value will also change. For example, the performance index value is the number of queries per second. When the number of queries per second is too high, it indicates that the current traffic accessing the target node is large.

[0050] The microservice governance method in the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0051] like Figure 1 The application scenario of the microservice governance method is shown, and the application scenario includes a microservice system 101, at least one client (client 102_1, client 102_2, ..., client 102_N in the figure) and a gateway 103. The microservice system 101 includes a monitoring node, at least one service node (service node 1, service node 2, ..., service node 3 in the figure), a control node and a storage node.

[0052] The service node in the microservice system is used to provide various business services to at least one client outside the microservice system. The service node can be a Pod, which can be composed of one container or multiple containers; the monitoring node can monitor and collect the operation log of the service node; the storage node is used to store the data collected by the monitoring node; the control node is used to manage the service nodes, storage nodes and monitoring nodes in the microservice system, and to interact with the service nodes, storage nodes and monitoring nodes. When the client needs to access the microservice system, it can be accessed through the gateway 103. The storage node, control node and monitoring node can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0053] Based on the abnormal operation of service nodes caused by the current traffic surge phenomenon when the microservice system is working, the embodiment of the present application provides a microservice governance method, such as Figure 2 As shown, the method includes:

[0054] S201: For any type of service, obtain from a database a performance indicator value of a target service node executing the any type of service in a historical period.

[0055] In the embodiment of the present application, the target service node is used to provide any type of service. The target service node can be one or more. The embodiment of the present application does not limit the number of target service nodes providing any type of service.

[0056] The data obtained from the database can be obtained from the real-time search engine (Elasticsearch, ES), the distributed file system (Hadoop Distributed File System, HDFS), or the data warehouse (Hive). ES and HDFS store the original data files collected by the monitoring nodes, and Hive can store data after operations such as extraction and aggregation of the data in the original data files, or it can store the original data.

[0057] S202: Input the performance indicator value of the historical period into a prediction model to obtain the performance indicator value of the target service node in the future period.

[0058] In order to be able to respond in advance to abnormal traffic periods (such as traffic peaks) and seasonal changes, an embodiment of the present application provides a method for predicting performance index values ​​for future time periods based on the performance index values ​​of the target service nodes in historical time periods, specifically: the performance index values ​​of the target service nodes in historical time periods pre-collected by the monitoring nodes are input into the prediction model, and the performance index values ​​of the target service nodes in future time periods are output.

[0059] Among them, the above performance indicator values ​​may include part or all of the number of queries per second (Query PerSecond, QPS) of the target service node, the response time of the target service node in response to the access request sent by the client, and the probability of the target service node making an error in responding to the access request of the client, and may also be other types of performance indicators; the above prediction model is obtained by training based on the sample performance indicator value of the first time period of the service node and the sample performance indicator value of the second time period, and the second time period is after the first time period. The prediction model can be a deep learning model built based on a convolutional layer; the above historical time period and future time period are both preset time periods, for example, the data of the next month is predicted by the historical data of 1 year. The embodiment of the present application does not specifically limit the category of performance indicators, the category of prediction models, and the duration of historical time periods and future time periods.

[0060] S203: Determine, based on the performance indicator value of the future period, the configuration resources of the target service node allocated to the any one type of service in the future period.

[0061] Since the performance index value can indicate the access traffic situation, after determining the performance index value of the target service node in the future period, the configuration resources such as processor resources, memory resources, and disk resources allocated to the target service node for any type of service in the future period can be determined. Specifically, a mapping relationship between the performance index value and the configuration resources can be pre-built, and after determining the performance index value of the future period, the corresponding configuration resources can be queried from the mapping relationship, and then the resource configuration of the target service node in the future period can be performed according to the queried configuration resources. The mapping relationship can be shown in Table 1 below.

[0062] Table 1

[0063] Performance index value Configuring Resources a1 Resource 1 a2 Resource 2 a3 Resource 3 ... ... an Resource 4

[0064] The prediction model is used to deeply analyze the collected historical data to obtain traffic peaks and seasonal changes. Based on these analysis results, the resource allocation of service nodes can be optimized in advance, emergencies can be effectively responded to, and the stability and reliability of system operation can be ensured.

[0065] Since resource configuration for service nodes requires reserving resources in advance, this process may require the system administrator to coordinate the resources of the entire microservice system, such as expanding the memory stick. If the resource configuration of the service node is performed every day, a lot of manpower is required and the time may not be sufficient. Therefore, the above-mentioned embodiments of S201 to S203 are periodic (such as once a week, or once a month), not real-time, that is, only when the preset period is reached, the performance indicator value of the future time period will be predicted, and the service node resources of the future time period will be pre-configured. It should be noted that for different types of services, the prediction period can be set to the same or different. For example, for commonly used services, the prediction period can be set to one week, and for uncommon services, the prediction period can be set to one month. This embodiment of the present application does not specifically limit this.

[0066] However, the prediction results of the prediction model may be biased. For example, there will be no traffic peak in the future period, but in fact there is a traffic peak, and then the pre-configured resources may be insufficient to cope with the current emergency. In view of this situation, the embodiment of the present application further provides a method for real-time monitoring of service nodes, such as Figure 3 As shown, the method includes:

[0067] S301: After the future time period arrives, collect the actual performance indicator value of the target service node.

[0068] In an embodiment of the present application, the actual performance index value of the target service node can be collected in real time through the monitoring node, wherein a log collection system (Apache Flume) with an integrated sentinel component (Sentinel) is deployed on the monitoring node to collect data, and the type of monitoring node is not specifically limited in the embodiment of the present application. After the actual performance index value is collected in real time by ApacheFlume, the stable output of the data is ensured and transmitted to the Kafka cluster, which is responsible for high-throughput messaging and persistent storage. Subsequently, the data collection engine (Logstash) consumes data from Kafka, parses and processes it, and converts the raw data into a structured format, such as JSON, to facilitate subsequent analysis and storage.

[0069] When collecting data, you can further use authentication and authorization mechanisms to verify the identity and authority of the data source to ensure that the data comes from the expected source or system. Specifically, you can implement it as follows: Get the identity of the target service node, and determine whether the identity of the target service node is in a pre-built whitelist. If it is, it means that the identity of the target service node meets expectations, and further verify the collected performance indicator value. If it is not, it is determined not to store the data obtained from the target service node. If the verification of the actual performance indicator value is passed, the actual performance indicator value is stored in the database, otherwise it is not stored.

[0070] In a possible implementation, the actual performance indicator value is verified in the following manner:

[0071] If it is determined that the actual performance indicator value is within the preset value range, determining whether the data format of the actual performance indicator value satisfies the preset data format;

[0072] If it is determined that the data format of the actual performance indicator value meets the preset data format, it is determined that the verification is passed.

[0073] In addition to the above verification standards, the number of collected performance indicator values ​​can be further verified to ensure the integrity of the data. If the preset number is reached, the verification is determined to be passed, otherwise the verification fails. The verified data is stored in ES according to the time period according to the categories of "hot data", "warm data" and "cold data". Hot data is data that has been frequently accessed in the recent period and is stored in ES to ensure efficient query. Warm data is older data with reduced access frequency, and cold data is historical data that is rarely accessed but needs to be stored for a long time. Through this strategy of classified storage by time period, the query performance and storage resource utilization of ES can be optimized, and the system's response speed and data management efficiency can be improved. This method realizes efficient and reliable data collection and processing, providing a solid foundation for real-time monitoring and intelligent analysis.

[0074] In addition to storing data in ES, you can also upload verified data to HDFS. Since the data collected by the monitoring node may not only contain the performance indicator values ​​of the service node, but also some log data, such as the collection time and the data format of the collected data, the verified data needs to be further processed. Specifically, you can use MapReduce to extract the data in HDFS according to the preset rules, and insert the extracted data into the table created in Hive to obtain data aggregated by date and hour. In addition, Hive can also store raw data, which can be stored according to business needs. Hive provides SQL-like query capabilities to facilitate complex queries and analysis of processed data. These data provide a solid foundation for the visualization of service governance monitoring, enabling operation and maintenance personnel to intuitively view system performance and health status, and quickly identify and solve potential problems.

[0075] S302: If the actual performance indicator value exceeds a preset threshold, a processing strategy for the target service node is executed to prevent abnormal operation of the target service node.

[0076] In order to prevent the target service node from running abnormally, it is necessary to judge in real time whether the performance indicator value is normal and take corresponding processing measures. For different types of performance indicators, the judgment method and measures are different, including the following real-time methods.

[0077] (1) The performance indicator value is the number of responses per second or the response time.

[0078] If the actual number of queries per second exceeds the preset number, or the actual response time exceeds the preset time, instructing the target service node to suspend providing any type of service;

[0079] After each preset period, the actual number of queries per second is detected, and if the number of queries per second does not exceed the preset number, the target service node is instructed to resume providing any one type of service.

[0080] When the number of queries per second is too high or the response time is too long, it indicates that the current access traffic is abnormal (such as excessive traffic). At this time, a traffic fusing and limiting strategy can be adopted, such as a fixed window, a sliding window, and other strategies to achieve fusing. The fusing strategy can be automatically triggered according to the health status of the service node to prevent the propagation of faults and ensure that the system can still run stably under high traffic and abnormal conditions. When it is detected that the traffic has returned to normal, any type of service can be restored.

[0081] (2) The performance indicator value is load.

[0082] If the actual load exceeds the preset load, determining the number of target service nodes that need to be expanded based on the difference between the actual load and the preset load;

[0083] According to the quantity, the quantity of target service nodes currently executing the any one type of service is expanded.

[0084] In the embodiment of the present application, the microservice system can be deployed based on the K8s system, and the service node can be a Pod. When the actual load is monitored to exceed the preset load, it indicates that the current access traffic is too high. At this time, a capacity expansion strategy can be adopted, that is, the number of Pods can be expanded. For example, the current number of Pods providing any type of service is 2, and the preset number is 1. The number of Pods is expanded to 3. If the load is still too high, the number of Pods is expanded to 4 until the actual load is monitored to not exceed the preset load.

[0085] In addition, when the actual load is too small, it indicates that the current access traffic is small. In order to save resources, the capacity can be reduced, that is, the number of Pods can be reduced. The number of reductions each time can be 1, which is not specifically limited in the embodiments of the present application.

[0086] In a possible implementation, when it is determined that the performance indicator value exceeds a preset threshold, an alarm message can be generated and sent to the operation and maintenance personnel by email, SMS, instant message, or phone call to remind the operation and maintenance personnel to check the cause of the abnormal traffic (for example, to check whether there is a malicious attack). Furthermore, the results obtained by the prediction model analysis and the results of real-time monitoring can be visualized, that is, converted into intuitive charts and dashboards. The visualization includes real-time traffic graphs, response time trend graphs, error rate analysis graphs, etc., to help operation and maintenance personnel quickly understand the system status and performance bottlenecks.

[0087] The following is based on Figure 4 The microservice governance method provided in the embodiment of the present application is introduced in detail.

[0088] In the embodiment of the present application, the monitoring node may be a log collection system (Apache Flume) cloud platform, the data collected by the monitoring node can include the performance indicator values ​​of multiple service nodes, as well as other log data (such as collection time, data format type); the data collected by the monitoring node is transmitted to the distributed publishing and subscription system (Kafka cluster); the data is then consumed from Kafka through the collection engine (Logstash), parsed and processed, and the original data is converted into a structured format, such as JSON, for subsequent analysis and storage; the parsed data is then authenticated and verified, and after the identity authentication and data verification are confirmed to have passed, it is stored in the storage node; the storage node may include ES, HDFS, Hive, etc., and the storage process includes: storing the verified data in ES according to the time period according to the categories of "hot data", "warm data" and "cold data" to improve the system's response speed and data management efficiency, or uploading the verified data to HDFS, and then extracting the data in HDFS according to the preset rules through MapReduce, inserting the extracted data into the table created in Hive to obtain data aggregated by date and hour; the data stored in the storage node can be used for service governance projects such as predicting traffic trends. The above-mentioned Kafka cluster and Logstash can be deployed on the control node of the microservice system 101.

[0089] The microservice governance method provided in the embodiment of the present application can predict the traffic trend of future time periods through the performance indicator values ​​of the target service nodes in historical time periods, and allocate resources for future time periods according to the traffic trend, so as to effectively respond to emergencies. In order to prevent inaccurate predictions, a method for implementing monitoring and response measures are further provided, namely, a circuit breaker and flow limiting mechanism and a capacity expansion and contraction mechanism. The circuit breaker and flow limiting mechanism and the capacity expansion mechanism can respond to traffic surges in a timely manner, and the capacity reduction mechanism can optimize resource utilization. Moreover, the embodiment of the present application also provides an alarm and visualization method, so that operation and maintenance personnel can obtain the operation status of the service nodes in a timely and intuitive manner.

[0090] Based on the same inventive concept, the present application embodiment also provides a microservice management device, such as Figure 5 As shown, the device comprises:

[0091] An acquisition module 501 is used to acquire, from a database, a performance indicator value of a target service node executing any one type of service in a historical period;

[0092] A prediction module 502, configured to input the performance index value of the historical period into a prediction model to obtain a performance index value of the target service node in a future period, wherein the prediction model is trained based on a sample performance index value of the service node in a first period and a sample performance index value in a second period, wherein the second period is after the first period;

[0093] The allocation module 503 is used to determine the configuration resources of the target service node allocated to the any type of service in the future period based on the performance indicator value of the future period.

[0094] In a possible implementation, the device further includes a governance module, which is used to:

[0095] After the future time period arrives, collecting the actual performance indicator value of the target service node;

[0096] When it is determined that the actual performance indicator value exceeds a preset threshold, a processing strategy for the target service node is executed to prevent abnormal operation of the target service node.

[0097] In a possible implementation manner, the actual performance indicator value is the actual number of queries per second;

[0098] The governance module is used to: when it is determined that the actual number of queries per second exceeds the preset number, instruct the target service node to suspend providing any one type of service; after every preset time period, detect the actual number of queries per second, and when it is determined that the number of queries per second does not exceed the preset number, instruct the target service node to resume providing any one type of service.

[0099] In a possible implementation manner, the actual performance indicator value is the actual load;

[0100] The governance module is used to: when it is determined that the actual load exceeds the preset load, determine the number of target service nodes that need to be expanded based on the difference between the actual load and the preset load; and expand the number of target service nodes currently executing any type of service according to the number.

[0101] In a possible implementation manner, after collecting the actual performance indicator value of the target service node in the future period, the governance module is further configured to:

[0102] When it is determined that the identity of the target service node is in the pre-built whitelist, the actual performance indicator value is verified; when it is determined that the verification of the actual performance indicator value passes, the actual performance indicator value is stored in the database.

[0103] In one possible implementation, the governance module is used to:

[0104] When it is determined that the actual performance indicator value is within the preset value range, it is determined whether the data format of the actual performance indicator value meets the preset data format; when it is determined that the data format of the actual performance indicator value meets the preset data format, it is determined that the verification is passed.

[0105] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, the device comprising:

[0106] 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 execute the microservice governance method as described above.

[0107] Refer to the following Figure 6 The electronic device 60 according to this embodiment of the present application will be described. Figure 6 The electronic device 60 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 6 As shown, the electronic device 60 is in the form of a general electronic device. The components of the electronic device 60 may include but are not limited to: at least one processor 61, at least one memory 62, and a bus 63 connecting different system components (including the memory 62 and the processor 61).

[0109] The processor 61 is used to read and execute instructions in the memory 62, so that the at least one processor can execute a microservice governance method provided in the above embodiment.

[0110] Bus 63 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0111] The memory 62 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 621 and / or a cache memory 622 , and may further include a read-only memory (ROM) 623 .

[0112] The memory 62 may also include a program / utility 625 having a set (at least one) of program modules 624, such program modules 624 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0113] The electronic device 60 may also communicate with one or more external devices 64 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable an administrator to interact with the electronic device 60, and / or may communicate with any device that enables the electronic device 60 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 65. Furthermore, the electronic device 60 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 66. As shown, the network adapter 66 communicates with other modules for the electronic device 60 via a bus 63. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 60, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0114] In some possible implementations, various aspects of a microservice governance method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a microservice governance method according to various exemplary implementations of the present application described above in this specification.

[0115] In addition, the present application also provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program is used to enable a computer to execute any of the methods described in the above embodiments.

[0116] These computer program instructions may be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0117] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0118] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0119] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A microservice governance method, characterized in that: The method comprises: For any type of service, obtain the performance indicator value of the target service node executing the any type of service in the historical period from the database; Inputting the performance index value of the historical period into a prediction model to obtain the performance index value of the target service node in a future period, wherein the prediction model is trained based on the sample performance index value of the service node in a first period and the sample performance index value of a second period, wherein the second period is after the first period; Based on the performance indicator value of the future time period, the configuration resources of the target service node allocated to the any one type of service in the future time period are determined.

2. The method according to claim 1, characterized in that The method further comprises: After the future time period arrives, collecting the actual performance indicator value of the target service node; If the actual performance indicator value exceeds a preset threshold, a processing strategy for the target service node is executed to prevent abnormal operation of the target service node.

3. The method according to claim 2, characterized in that The actual performance indicator value is the actual number of queries per second; If the actual performance indicator value exceeds a preset threshold, executing a processing strategy for the target service node includes: If the actual number of queries per second exceeds the preset number, instructing the target service node to suspend providing any type of service; After each preset period, the actual number of queries per second is detected, and if the number of queries per second does not exceed the preset number, the target service node is instructed to resume providing any one type of service.

4. The method according to claim 2, characterized in that: The actual performance indicator value is the actual load; If the actual performance indicator value exceeds a preset threshold, executing a processing strategy for the target service node includes: If the actual load exceeds the preset load, determining the number of target service nodes that need to be expanded based on the difference between the actual load and the preset load; According to the quantity, the quantity of target service nodes currently executing any one type of service is expanded.

5. The method according to claim 2, characterized in that: After collecting the actual performance indicator value of the target service node in the future period, the method further includes: If the identity of the target service node is in the pre-built whitelist, verifying the actual performance indicator value; If the verification of the actual performance indicator value passes, the actual performance indicator value is stored in the database.

6. The method according to claim 5, characterized in that The verifying the actual performance indicator value includes: If it is determined that the actual performance indicator value is within the preset value range, determining whether the data format of the actual performance indicator value satisfies the preset data format; If it is determined that the data format of the actual performance indicator value meets the preset data format, it is determined that the verification is passed.

7. A microservice management device, characterized in that: The device comprises: An acquisition module, used for acquiring, from a database, performance indicator values ​​of a target service node executing any one type of service in a historical period; A prediction module, configured to input the performance index value of the historical period into a prediction model to obtain the performance index value of the target service node in a future period, wherein the prediction model is trained based on the sample performance index value of the service node in a first period and the sample performance index value of a second period, wherein the second period is after the first period; The allocation module is used to determine the configuration resources of the target service node allocated to the any one type of service in the future period based on the performance indicator value of the future period.

8. An electronic device, characterized in that: The device comprises: 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, the instructions being executed by the at least one processor so that the at least one processor can execute any one of the methods of claims 1-6.

9. A computer program product, characterized in that The computer program product is used to make a computer execute the method according to any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and the computer program is used to make a computer execute any one of the methods according to claims 1-6.

Citation Information

Cited By

  • Service fusing method, device and equipment of power distribution communication network and medium

    CN120499259A