An automatic recovery method for microservice system
By generating the first correlation map from the initial map, determining the target parameter value and optimal recovery method of the abnormal microservice component, the automatic recovery problem of the microservice system when the abnormal microservice component occurs is solved, and efficient automatic recovery of the system is achieved.
Patent Information
- Application Number
- CN202111616843.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-27
AI Technical Summary
It is difficult for existing microservice systems to automatically recover when abnormal microservice components appear, especially when the causes of the newly emerging abnormal microservice components are different from the recovered abnormal microservice components. The preset rules cannot match the corresponding recovery method, resulting in the system being unable to complete automatic recovery.
By obtaining the first correlation map from the initial map, the association relationship between the abnormal microservice components is obtained, and the target parameter value of each abnormal microservice component is determined based on the parameter values of the abnormal microservice component and each preset recovery method in the first correlation map, thereby determining its optimal preset recovery method.
It ensures that abnormal microservice components in the microservice system can be automatically restored, avoids the problem of failure in matching preset recovery methods, and improves the system's automatic recovery efficiency.
Smart Images

Figure CN114371954B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of emerging information technology, and in particular to an automatic recovery method, device and electronic device for a microservice system. Background Art
[0002] Microservice system is an emerging software service architecture that has become increasingly popular in recent years. Microservice system refers to an architecture used to develop applications. Through the microservice system, large applications can be decomposed into multiple independent microservice components. Each microservice component has its own responsibility area. When processing a request message sent by a user, an application based on the microservice system may call multiple microservice components to generate response information corresponding to the request message sent by the user.
[0003] It should be further explained that there are multiple microservice components in the microservice system. The microservice system consists of multiple hosts and microservice components corresponding to each host, such as Figure 1 The figure shows the relationship between the host and the microservice components. The solid arrows represent the call relationship, and the dotted lines represent the deployment relationship. The host can deploy microservice components. Figure 1 In the example, host 1 deploys microservice components 1 and 3, and host 2 deploys microservice components 2 and 4. Microservice components can communicate with other microservice components that are called, such as Figure 1 In the microservice component 1, microservice component 2 is called to realize the communication between microservice component 1 and microservice component 2. When multiple microservice components process the request information sent by the above-mentioned user end, if a microservice component fails, the process of the microservice system generating response information according to the request information sent by the user end will be terminated. Before the abnormal microservice component is repaired, the user end cannot normally receive the response information of the microservice system.
[0004] In order to achieve automatic recovery of the microservice system, it is necessary to locate the abnormal microservice components in the microservice system. The method adopted is to detect the abnormal microservice components in the microservice system and the association relationship between the abnormal microservice components, and match the abnormal microservice components and the association relationship between the abnormal microservice components with the preset rules to determine the recovery method of the microservice system. However, the preset rules record the recovery method corresponding to the abnormal microservice components that have been successfully recovered. The preset rules need to be updated as the microservice system is updated, and the update of the preset rules is determined by the network status and the recovery method in the preset rules updated by the detection personnel. When the abnormal cause of the newly appeared abnormal microservice component is different from that of the restored abnormal microservice component, the abnormal microservice component will not match the corresponding recovery method in the preset rules, resulting in the microservice system being unable to complete the automatic recovery operation. Summary of the invention
[0005] The present application provides an automatic recovery method, device and electronic device for a microservice system, which obtains the association relationship between abnormal microservice components by obtaining a first association map from an initial map, obtains the target parameter value of each abnormal microservice component based on the abnormal microservice components in the first association map and the parameter values of each preset recovery method, thereby determining the optimal preset recovery method corresponding to each abnormal microservice component, further ensuring that the automatic recovery of abnormal microservice components in the microservice system can be achieved.
[0006] In a first aspect, the present application provides an automatic recovery method for a microservice system, the method comprising:
[0007] Obtaining an initial association map corresponding to a microservice component in a network application, inputting the initial association map into a preset model, and obtaining a first association map generated based on the initial association map, wherein the microservice component in the first association map is an abnormal microservice component;
[0008] Calculate the parameter values corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set to obtain multiple parameter values corresponding to the abnormal microservice component;
[0009] A target parameter value is screened out from the multiple parameter values according to a preset arrangement, and a target recovery method corresponding to the target parameter value of the abnormal microservice component is determined.
[0010] Through the method described above, by calculating the parameter values of the abnormal microservice components and each preset recovery method in the first association graph, the optimal preset recovery method of each abnormal microservice component is determined, avoiding the situation where the preset recovery method cannot be screened out from the preset recovery method set, thereby ensuring the automatic recovery of the abnormal microservice components in the microservice system.
[0011] In a possible design, the initial association map is input into a preset model to obtain a first association map generated based on the initial association map, including:
[0012] Obtaining the response time corresponding to each microservice component in the initial association graph;
[0013] When it is determined that there is a microservice component whose response time exceeds the preset time, inputting the initial association graph into a preset model;
[0014] A first association graph is generated based on the association relationship between each microservice component in the initial association graph.
[0015] In a possible design, calculating the parameter value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set includes:
[0016] Calculate a first risk assessment value and a first benefit assessment value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set, wherein the first risk assessment value represents the degree of influence of the change in resource utilization of the host, and the first benefit assessment value represents the resource utilization rate of the abnormal microservice component in the recovery state;
[0017] The first risk assessment value and the first benefit assessment value are read, and a parameter value corresponding to each preset recovery method is calculated according to a preset algorithm.
[0018] In a possible design, a parameter value corresponding to each preset recovery mode is calculated according to a preset algorithm, including:
[0019] Obtaining the recovery time for each preset recovery method to recover the abnormal microservice component;
[0020] A parameter value corresponding to the preset recovery method is calculated based on the first risk assessment value, the first benefit assessment value and the recovery time.
[0021] In a possible design, a target parameter value is screened out from the multiple parameter values according to a preset arrangement, and a target recovery method corresponding to the target parameter value of the abnormal microservice component is determined, including:
[0022] Associating the parameter value of the abnormal microservice component with the preset recovery method corresponding to the parameter value to obtain a first association relationship;
[0023] Arrange the parameter values of the abnormal microservice components according to a preset arrangement method, filter out the maximum parameter value, and use the maximum parameter value as the target parameter value;
[0024] A first association relationship corresponding to the target parameter value is obtained, and a target recovery mode corresponding to the target parameter value of the abnormal microservice component is determined.
[0025] In a second aspect, the present application provides an automatic recovery device for a microservice system, the device comprising:
[0026] An acquisition module, used to obtain an initial association map corresponding to a microservice component in a network application, input the initial association map into a preset model, and obtain a first association map generated based on the initial association map;
[0027] A calculation module, used to calculate the parameter values corresponding to the abnormal microservice component and each preset recovery mode in the preset recovery mode set, and obtain multiple parameter values corresponding to the abnormal microservice component;
[0028] The determination module is used to filter out a target parameter value from the multiple parameter values according to a preset arrangement, and determine a target recovery method corresponding to the target parameter value of the abnormal microservice component.
[0029] In one possible design, the acquisition module is specifically used to obtain the response time corresponding to each microservice component in the initial association map, and when it is determined that there is a microservice component whose response time exceeds a preset time, the initial association map is input into a preset model, and a first association map is generated based on the association relationship between each microservice component in the initial association map.
[0030] In one possible design, the calculation module is specifically used to calculate the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set, read the first risk assessment value and the first benefit assessment value, and calculate the parameter value corresponding to each preset recovery method according to a preset algorithm.
[0031] In one possible design, the calculation module is also used to obtain the recovery time for each preset recovery method to recover the abnormal microservice component, and calculate the parameter value corresponding to the preset recovery method based on the first risk assessment value, the first benefit assessment value and the recovery time.
[0032] In one possible design, the determination module is specifically used to associate the parameter value of the abnormal microservice component with a preset recovery method corresponding to the parameter value, obtain a first association relationship, arrange the parameter value of the abnormal microservice component according to a preset arrangement method, filter out the maximum parameter value, use the maximum parameter value as the target parameter value, obtain the first association relationship corresponding to the target parameter value, and determine the target recovery method corresponding to the target parameter value of the abnormal microservice component.
[0033] In a third aspect, the present application provides an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] The processor is used to implement the above-mentioned steps of the automatic recovery method of a microservice system when executing the computer program stored in the memory.
[0036] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for automatic recovery of a microservice system are implemented.
[0037] For each aspect from the first to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of the association between the host and microservice components provided for this application;
[0039] Figure 2 A flowchart of the steps of a thread binding method provided by this application;
[0040] Figure 3 A structural schematic diagram of a thread binding device provided in this application;
[0041] Figure 4 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0043] In the previous technology, the automatic recovery of the microservice system is to detect the abnormal microservice components in the microservice system and the association relationship between the abnormal microservice components, match the abnormal microservice components and the association relationship between the abnormal microservice components with the preset rules, and then determine the recovery method of the microservice system. However, the preset rules record the recovery method corresponding to the abnormal microservice components that have been automatically recovered. In order to ensure that the automatic recovery of the abnormal microservice components can be achieved, it is necessary to update them as the microservice system is updated. In addition, the update of the preset rules is determined by the network status and the recovery method in the preset rules updated by the detection personnel. When the abnormal cause of the newly appeared abnormal microservice component is different from that of the restored abnormal microservice component, the abnormal microservice component will not match the corresponding recovery method in the preset rules, resulting in the microservice system being unable to complete the automatic recovery operation.
[0044] In order to solve the above-described problems, the embodiments of the present application provide an automatic recovery method for a microservice system, which is used to ensure that the abnormal microservice components screened out can match the preset recovery method, thereby realizing the automatic recovery of the microservice system. Among them, the method and device described in the embodiments of the present application are based on the same technical concept. Since the principles of the problems solved by the method and the device are similar, the embodiments of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0045] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0046] Reference Figure 2 The present application provides an automatic recovery method for a microservice system, which can ensure that the screened abnormal microservice components can match the preset recovery method, thereby realizing automatic recovery of the microservice system. The implementation process of the method is as follows:
[0047] Step S21: obtaining an initial association graph corresponding to a microservice component in a network application, inputting the initial association graph into a preset model, and obtaining a first association graph generated based on the initial association graph.
[0048] The purpose of the embodiment of the present application is to achieve automatic recovery of a microservice system. Since the microservice components in the microservice system are associated with each other, when there are abnormal microservice components in the microservice system, in order to retain the association relationship between the abnormal microservice components and to be able to know the source of the microservice component abnormality, the abnormal microservice components still need to be presented in the form of an association map. In order to obtain the association map of the abnormal microservice components, first, it is necessary to determine whether there are abnormal microservice components in the initial association map. The way to determine the existence of abnormal microservice components is to detect whether the response time corresponding to each microservice component in the initial association map exceeds the preset time. When there is a microservice component whose response time exceeds the preset time, it is determined that there are abnormal microservice components in the initial association map.
[0049] In order to accurately locate the abnormal microservice component from the initial association map, it is necessary to obtain the initial association map corresponding to the microservice component from the network application. In order to screen out the abnormal microservice components and the association relationships between the abnormal microservice components from the initial association map, it is necessary to input the initial association map into the preset model to obtain the abnormal microservice components and the association relationships between the abnormal microservice components corresponding to the initial association map. A first association map is generated based on the obtained abnormal microservice components and the association relationships between the abnormal microservice components. In the embodiment of the present application, the preset model can be a pagerank algorithm model. Since the pagerank algorithm model is a technology well known to those skilled in the art, it will not be elaborated here.
[0050] Through the method described above, after determining that there are microservice components in the initial association map whose response time exceeds the preset time, the microservice components with abnormalities are screened out from the initial association map through the preset model, and a first association map containing all abnormal microservice components is generated, ensuring that the abnormal microservice components in the initial association map can be accurately located.
[0051] Step S22: Calculate the parameter values corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set to obtain multiple parameter values corresponding to the abnormal microservice component.
[0052] In the above description, the abnormal microservice components and the first association map generated based on the abnormal microservice components are screened out from the initial association map. In order to determine the parameter value of each abnormal microservice component in the first association map, it is necessary to calculate the parameter value of the abnormal microservice component and each preset recovery method. The specific process of calculating the parameter value of the abnormal microservice component and each preset recovery method is as follows:
[0053] The automatic recovery of abnormal microservice components requires the consumption of computer resources. Resource utilization is the ratio of resource utilization to resource allocation rate. In order to ensure that the abnormal microservice components can determine the optimal preset recovery method, it is necessary to consider the first benefit assessment value and the first risk assessment value corresponding to the microservice component when the preset recovery method is adopted. The first risk assessment value represents the degree of influence of the host's resource utilization change, and the first benefit assessment value represents the resource utilization rate of the abnormal microservice component in the recovery state.
[0054] It should be further explained that the preset recovery method will affect the deployment of the microservice system in the following three ways. The impact of the preset recovery method on the microservice system is shown in Table 1:
[0055]
[0056]
[0057] Table 1
[0058] In Table 1, the impacts of three preset recovery methods on the microservice system are listed. For other recovery methods and their impacts on the microservice system, refer to the impact of any preset recovery method on the microservice system in Table 1. Since the host in the microservice system can deploy microservice components, when the resource allocation rate of the host changes, the resource usage rate corresponding to the microservice components deployed on the host will also change accordingly. The ratio of the resources consumed by all microservice components deployed by the host to the resources allocated to the host is the resource utilization rate of the host, and the ratio of the resources consumed by each microservice component to the resources allocated by the host is the resource utilization rate corresponding to the microservice component.
[0059] After the above description of the resource utilization rate and resource allocation rate corresponding to the host and microservice components, in order to predict the parameter value corresponding to the abnormal microservice component after the abnormal microservice component adopts the preset recovery method, it is necessary to calculate the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component. Since the resource allocation rate of the host is likely to change after the abnormal microservice component adopts the preset recovery method, it is necessary to first record the resource allocation rate of the current host.
[0060] After recording the resource allocation rate of the host, record the resources consumed by all microservice components deployed on the host to obtain the resource utilization rate of the host. Since there are multiple preset recovery methods in the preset recovery method set, it is necessary to calculate the resource utilization rate of the abnormal microservice component after each preset recovery method is adopted. In order to more clearly illustrate the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component, an example will be used to illustrate. The specific process of obtaining the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component is as follows:
[0061] When there is an abnormal microservice component among the microservice components deployed on the host, and the abnormal microservice component has not been automatically restored, the resource allocation rate and resource usage rate corresponding to the host and the abnormal microservice component are shown in Table 1:
[0062] Resource Allocation Rate Resource Utilization Host 40% 85% Abnormal microservice components 40% 75%
[0063] Table 2
[0064] In Table 2, the resource allocation rate of the host is the percentage between the resources occupied by the host and the total resources of the microservice system, the resource utilization rate of the host is the percentage between the resources used by all microservice components deployed on the host and the resources occupied by the host, the abnormal microservice components in Table 2 are deployed by the host in Table 2, the resource allocation rate of the abnormal microservice component is the percentage between the resources allocated to the abnormal microservice component by the host and the resources occupied by the host, and the resource utilization rate of the abnormal microservice component is the percentage between the resources used by the abnormal microservice component and the resources allocated to the abnormal microservice component by the host. Table 2 records the resource allocation rate and resource utilization rate of a microservice component in the host. The resource allocation rate and resource utilization rate of other abnormal microservice components refer to the abnormal microservice components in Table 2, and will not be elaborated here.
[0065] After explaining Table 2, when the abnormal microservice component in the host uses the preset recovery method a to achieve automatic recovery, the resource allocation rate and resource utilization rate corresponding to the host and the abnormal microservice component are shown in Table 3:
[0066] Resource Allocation Rate Resource Utilization Host 50% 77% Abnormal microservice components 32% 50%
[0067] Table 3
[0068] The meanings of the resource allocation rate and resource utilization rate of the host in Table 3 and the resource allocation rate and resource utilization rate of the abnormal microservice component refer to the description in Table 2. In order to avoid repetition, no further explanation is given here.
[0069] Combining Table 2 and Table 3, it can be seen that the resource utilization rate of the host is 77%, and the resource utilization rate of the abnormal microservice component is reduced by 50%. 77% and 50% are respectively input as dependent variables into the membership function. The membership function is used to predict the impact of the abnormal microservice component on the microservice system after the preset recovery method is adopted when it is uncertain that the abnormal microservice component adopts the preset recovery method to affect the microservice system. The value determined by the membership function is used as the risk assessment value, and 50% is input into the value determined by the membership function as the benefit assessment value, and 77% is input into the value determined by the membership function as the risk assessment value. After obtaining the risk assessment value and the benefit assessment value, the risk assessment value and the benefit assessment value are defuzzified to obtain a first risk assessment value corresponding to the risk assessment value and a first benefit assessment value corresponding to the benefit assessment value. Since the membership function and defuzzification are well known to those skilled in the art, they are not elaborated here.
[0070] It should be further explained that the values in Table 2 and Table 3 describe the situation where an abnormal microservice component under the host adopts a preset recovery method. The number of abnormal microservice components in the microservice components deployed by the host can be other numbers. Since the process of automatic recovery of each abnormal microservice component using the preset recovery method is consistent, the automatic recovery of other abnormal microservice components can refer to the examples in Table 2 and Table 3 above. Therefore, no further elaboration will be given here.
[0071] If there are three recovery methods a, b, and c in the preset recovery method set, the above describes the first evaluation value and the first benefit value corresponding to the abnormal microservice component using the preset recovery method a, the first evaluation value and the first benefit value corresponding to the abnormal microservice component using the preset recovery method b, and the first evaluation value and the first benefit value corresponding to the abnormal microservice component using the preset recovery method c. The acquisition process refers to the first evaluation value and the first benefit value corresponding to the abnormal microservice component using the preset recovery method a. Since the acquisition process is the same, no further description is given here.
[0072] After obtaining the first evaluation value and the first benefit value corresponding to the abnormal microservice component using the preset recovery method a, the recovery time 3s corresponding to the abnormal microservice component using the preset recovery method a is obtained, and the parameter value corresponding to the abnormal microservice component using the preset recovery method a is determined based on Formula 1:
[0073] u(a i )=0.6B(ai )-0.2R(a i )-0.01T(a i )
[0074] In the above formula, u(a i ) indicates the parameter value corresponding to the preset recovery method a adopted by the abnormal microservice component, B(a i ) represents the first risk assessment value corresponding to the abnormal microservice component using the preset recovery method a, R(a i ) represents the first benefit evaluation value corresponding to the abnormal microservice component using the preset recovery method a, T(a i ) represents the recovery time corresponding to the preset recovery method a of the abnormal microservice component, where 0.6, 0.2, and 0.01 can be adjusted according to actual conditions and will not be elaborated here.
[0075] If the abnormal microservice component adopts the preset recovery method a, the first risk assessment value corresponding to the abnormal microservice component adopts the preset recovery method a is 0.78, the first benefit assessment value corresponding to the abnormal microservice component adopts the preset recovery method a is 0.43, and the parameter value corresponding to the abnormal microservice component adopting the preset recovery method a is: 0.6*0.78-0.2*0.43-0.1*3=0.352, if the abnormal microservice component adopts the preset recovery method b, the parameter value corresponding to the abnormal microservice component adopts the preset recovery method c is 0.293.
[0076] The above description is that an abnormal microservice component adopts the parameter value corresponding to each preset recovery method in the preset recovery set. The process for other abnormal microservice components to obtain the parameter value corresponding to each preset recovery method in the preset recovery set is consistent with the process described above. Therefore, no further elaboration is given here.
[0077] Through the method described above, the parameter values of the abnormal microservice component and each preset recovery method in the preset recovery method set are determined, and multiple parameter values are obtained. The parameter values are used to predict the impact of the abnormal microservice component on the microservice system after automatic recovery using the preset recovery method. This ensures that the abnormal microservice component can determine the preset recovery method with the least impact on the microservice system from the preset recovery method set, thereby improving the efficiency of the microservice system.
[0078] Step S23: Filter out a target parameter value from the multiple parameter values according to a preset arrangement, and determine a target recovery method corresponding to the target parameter value of the abnormal microservice component.
[0079] In the above description, the parameter values corresponding to each abnormal microservice component and each preset recovery method are obtained, and all parameter values corresponding to each abnormal microservice component are arranged from large to small. The maximum parameter value is screened out from all parameter values corresponding to each abnormal microservice component. The maximum parameter value represents the parameter value with the least impact on the microservice system. The maximum parameter value is used as the target parameter value, and the recovery method corresponding to the target parameter value is used as the target recovery method.
[0080] In the embodiment of the present application, the screened minimum parameter value can also be used as the target parameter value, or the parameter value within the preset range can be screened. Since there are too many specific situations, they will not be elaborated here.
[0081] Through the method described above, the first association map containing abnormal microservice components is screened out from the initial association map to ensure that the association relationship corresponding to the abnormal microservice components can be obtained, so that the abnormal source of the abnormal microservice components can be accurately located, which is conducive to improving the efficiency of automatic recovery of microservice components. Through the parameter values corresponding to the abnormal microservice components and each preset recovery method, the impact of each preset recovery method on the microservice system is predicted, thereby screening out the predicted recovery method with the least impact on the microservice system, and using the predicted recovery method as the target recovery method to achieve automatic recovery of abnormal microservice components in the microservice system.
[0082] Based on the same inventive concept, an automatic recovery device for a microservice system is also provided in an embodiment of the present application. The automatic recovery device for a microservice system is used to implement the function of an automatic recovery method for a microservice system. Figure 3 , the device comprises:
[0083] An acquisition module 301 is used to obtain an initial association graph corresponding to a microservice component in a network application, input the initial association graph into a preset model, and obtain a first association graph generated based on the initial association graph;
[0084] A calculation module 302 is used to calculate the parameter value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set, and obtain multiple parameter values corresponding to the abnormal microservice component;
[0085] The determination module 303 is used to filter out a target parameter value from the multiple parameter values according to a preset arrangement, and determine a target recovery method corresponding to the target parameter value of the abnormal microservice component.
[0086] In one possible design, the acquisition module 301 is specifically used to obtain the response time corresponding to each microservice component in the initial association map, and when it is determined that there is a microservice component whose response time exceeds a preset time, the initial association map is input into a preset model, and a first association map is generated based on the association relationship between each microservice component in the initial association map.
[0087] In one possible design, the calculation module 302 is specifically used to calculate the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set, read the first risk assessment value and the first benefit assessment value, and calculate the parameter value corresponding to each preset recovery method according to a preset algorithm.
[0088] In one possible design, the calculation module 302 is also used to obtain the recovery time for each preset recovery method to recover the abnormal microservice component, and calculate the parameter value corresponding to the preset recovery method based on the first risk assessment value, the first benefit assessment value and the recovery time.
[0089] In one possible design, the determination module 302 is specifically used to associate the parameter value of the abnormal microservice component with the preset recovery method corresponding to the parameter value, obtain a first association relationship, arrange the parameter value of the abnormal microservice component according to a preset arrangement method, filter out the maximum parameter value, use the maximum parameter value as the target parameter value, obtain the first association relationship corresponding to the target parameter value, and determine the target recovery method corresponding to the target parameter value of the abnormal microservice component.
[0090] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the function of the automatic recovery device of the aforementioned microservice system, referring to Figure 4 , the electronic device comprises:
[0091] At least one processor 401, and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 401 and the memory 402 are connected via the bus 400. The bus 400 is Figure 4 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 can also be called a controller, and there is no limitation on the name.
[0092] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute the method of the automatic recovery method of the microservice system discussed above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 3 The functions of each module in the device shown.
[0093] Among them, the processor 401 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 402 and calling data stored in the memory 402, the various functions of the device and process data, the device can be monitored as a whole.
[0094] In one possible design, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0095] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the automatic recovery method of a microservice system disclosed in the embodiments of the present application can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor.
[0096] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0097] By designing and programming the processor 401, the code corresponding to the automatic recovery method of a microservice system introduced in the above embodiment can be fixed into the chip, so that the chip can execute the automatic recovery method when running. Figure 1 The steps of an automatic recovery method for a microservice system in the embodiment shown are as follows: How to design and program the processor 401 is a technique known to those skilled in the art and will not be described in detail here.
[0098] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes an automatic recovery method for a microservice system discussed above.
[0099] In some possible implementations, various aspects of the automatic recovery method for a microservice system 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 an apparatus, the program code is used to enable the control device to execute the steps of the automatic recovery method for a microservice system according to various exemplary implementations of the present application described above in this specification.
[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] These computer program instructions may also 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.
[0103] 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.
[0104] 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. An automatic recovery method for a microservice system, characterized in that: include: Obtaining an initial association map corresponding to a microservice component in a network application, inputting the initial association map into a preset model, and obtaining a first association map generated based on the initial association map, wherein the microservice component in the first association map is an abnormal microservice component; Calculate the parameter values corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set to obtain multiple parameter values corresponding to the abnormal microservice component; Filtering a target parameter value from the multiple parameter values according to a preset arrangement, and determining a target recovery method corresponding to the target parameter value of the abnormal microservice component; The step of inputting the initial association map into a preset model to obtain a first association map generated based on the initial association map includes: Obtaining the response time corresponding to each microservice component in the initial association graph; When it is determined that there is a microservice component whose response time exceeds the preset time, the initial association graph is input into the pagerank algorithm model; Generate a first association graph based on the association relationship between each microservice component in the initial association graph; The step of calculating the parameter value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set includes: Calculate a first risk assessment value and a first benefit assessment value corresponding to the abnormal microservice component and each preset recovery mode in the preset recovery mode set, wherein the first risk assessment value represents the degree of influence of the change in resource utilization of the host, and the first benefit assessment value represents the resource utilization rate of the abnormal microservice component in the recovery state; Reading the first risk assessment value and the first benefit assessment value, and obtaining a recovery time for each preset recovery method to recover the abnormal microservice component; A parameter value corresponding to the preset recovery method is calculated based on the first risk assessment value, the first benefit assessment value and the recovery time.
2. The method according to claim 1, characterized in that Filtering a target parameter value from the multiple parameter values according to a preset arrangement, and determining a target recovery method corresponding to the target parameter value of the abnormal microservice component, including: Associating the parameter value of the abnormal microservice component with the preset recovery method corresponding to the parameter value to obtain a first association relationship; Arrange the parameter values of the abnormal microservice components according to a preset arrangement method, filter out the maximum parameter value, and use the maximum parameter value as the target parameter value; A first association relationship corresponding to the target parameter value is obtained, and a target recovery mode corresponding to the target parameter value of the abnormal microservice component is determined.
3. An automatic recovery device for a microservice system, characterized in that: The device comprises: An acquisition module is used to obtain an initial association map corresponding to a microservice component in a network application, input the initial association map into a preset model, and obtain a first association map generated based on the initial association map; wherein the microservice component in the first association map is an abnormal microservice component; A calculation module, used to calculate the parameter values corresponding to the abnormal microservice component and each preset recovery mode in the preset recovery mode set, and obtain multiple parameter values corresponding to the abnormal microservice component; A determination module, configured to filter out a target parameter value from the plurality of parameter values in a preset arrangement, and determine a target recovery mode corresponding to the target parameter value of the abnormal microservice component; The obtaining module is specifically used to obtain the response time corresponding to each microservice component in the initial association graph, and when it is determined that there is a microservice component whose response time exceeds the preset time, the initial association graph is input into the pagerank algorithm model, and a first association graph is generated based on the association relationship between each microservice component in the initial association graph; Among them, the calculation module is specifically used to calculate the first risk assessment value and the first benefit assessment value corresponding to the abnormal microservice component and each preset recovery method in the preset recovery method set, wherein the first risk assessment value represents the degree of influence of the change in resource utilization of the host, and the first benefit assessment value represents the resource utilization rate of the abnormal microservice component in the recovery state; read the first risk assessment value and the first benefit assessment value to obtain the recovery time for each preset recovery method to restore the abnormal microservice component; calculate the parameter value corresponding to the preset recovery method based on the first risk assessment value, the first benefit assessment value and the recovery time.
4. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 2 when executing the computer program stored in the memory.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-2 are implemented.
Citation Information
Patent Citations
Identified association graph self-optimization mechanism
CN110704630A
Rail transit emergency method and device based on knowledge graph
CN112612904A