Self-healing processing method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202211666178.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-12-23
AI Technical Summary
[0004]本申请提供一种应用自愈处理方法、装置、设备和存储介质,用以解决应用的稳定性较低的问题
[0034]The application self-healing processing method, apparatus, device, and storage medium provided in this application monitor whether a business anomaly occurs in the target application. The business anomaly is at least one of a fault, a sudden increase in business volume, and a sudden decrease in business processing efficiency. In response to detecting a business anomaly in the target application, a copy application corresponding to the target application is generated. If the business anomaly in the target application does not include a fault, it is determined whether there is a transaction relationship between the business processes to be processed by the target application. If there is no transaction relationship, the business scenario is determined to be a scheduling scenario, an election scenario, or a preemption scenario. The copy application is started using a setting algorithm suitable for the business scenario. The setting algorithm suitable for the scheduling scenario is to schedule the target application and the copy application in an orderly manner according to business data to process the business. The setting algorithm suitable for the preemption scenario is to allow the copy application to preemptively process the business. The setting algorithm suitable for the election scenario is to elect the target application and the copy application according to business data, and the selected application processes the business. By monitoring whether the target application is malfunctioning, experiencing a sudden surge in business volume, or a sudden drop in business processing efficiency, the system can automatically identify business anomalies in the target application. When a business anomaly occurs in the target application, a corresponding copy application is generated. Using preset business scenarios and appropriate algorithms, the system differentiates between different business scenarios and coordinates the scheduling of the target application and the copy application. The copy application handles business processing, or the target application and the copy application work together to process business. This enables the target application to self-heal in different business scenarios, avoiding time waste caused by business anomalies, improving business processing efficiency and capabilities, and ultimately enhancing application stability.
Smart Images

Figure CN115774613B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of application container technology, and in particular to an application self-healing method, apparatus, device and storage medium. Background Technology
[0002] Application container technology breaks down an application into multiple independent atomic applications (also known as atomic services) with business attributes. Each atomic application runs in an independent process and collaborates with each other through a lightweight communication mechanism, enabling the entire application to run and thus providing business value to end users.
[0003] In related technologies, in cloud-native microservices and original serial batch processing applications, when an atomic application encounters an anomaly, it can be scaled up by itself for emergency response. However, there are still some scenarios where there is no solution, resulting in low application stability. Summary of the Invention
[0004] This application provides an application self-healing processing method, apparatus, device, and storage medium to solve the problem of low application stability.
[0005] In a first aspect, this application provides a self-healing treatment method, comprising:
[0006] Monitor whether the target application is experiencing business anomalies. A business anomaly is at least one of the following: a failure, a sudden increase in business volume, or a sudden drop in business processing efficiency.
[0007] In response to detecting a business anomaly in the target application, a copy application corresponding to the target application is generated.
[0008] If the business anomaly occurring in the target application does not include a fault, then determine whether there is a transaction relationship between the business processes to be processed in the target application.
[0009] If no transaction relationship exists, the business scenario is determined to be a scheduling scenario, an election scenario, or a preemption scenario.
[0010] The algorithm for launching the replica application is based on the business scenario. Specifically, the algorithm for scheduling scenarios is to schedule the target application and replica application in an orderly manner to process the business based on the business data; the algorithm for preemption scenarios is to allow the replica application to preempt and process the business; and the algorithm for election scenarios is to elect the target application and replica application based on the business data, and the selected application processes the business.
[0011] In one possible implementation, if the business anomaly occurring in the target application includes a fault, the business scenario is determined to be a preemptive scenario; the replica application is controlled to process the business pending processing in the target application; if there are transactional relationships between the business pending processing in the target application, the business scenario is determined to be a special business scenario, and in combination with data sharding and / or business isolation, the target business with transactional relationships in the business is processed.
[0012] In one possible implementation, data sharding is combined to perform business processing on target businesses that have transactional relationships within the business, including: filtering and obtaining target data related to the target business; and performing business processing on the target business based on the target data.
[0013] In one possible implementation, business processing is performed on the target business based on the target data, including: determining whether there are multiple applications related to the target data; if so, a consumer group approach is adopted to control the multiple applications to consume the target data.
[0014] In one possible implementation, monitoring whether a target application experiences a business anomaly includes: obtaining heartbeat information from the target application, which includes a sudden increase in business volume and / or a sudden decrease in business processing efficiency; if the sudden increase in business volume is greater than or equal to a threshold for a sudden increase in business volume, then it is determined that the target application has experienced a sudden increase in business volume; if the sudden decrease in business processing efficiency is greater than or equal to a threshold for a sudden decrease in business processing efficiency, then it is determined that the target application has experienced a sudden decrease in business processing efficiency; if heartbeat information from the target application cannot be obtained, then it is determined that the target application has malfunctioned.
[0015] In one possible implementation, after starting the replica application using a setting algorithm suitable for the business scenario, the method further includes: verifying whether the replica application is correctly processing the business.
[0016] In one possible implementation, after starting the replica application using a setting algorithm suitable for the business scenario, the method further includes: in response to detecting self-healing of the target application, synchronizing the heartbeat information of the target application to the replica application, and synchronizing the heartbeat information of the replica application to the target application, so that the target application and the replica application can determine the application to be taken offline based on the heartbeat information of both parties.
[0017] In one possible implementation, the application to be taken offline undergoes a pre-offline process, including data auditing and critical abnormal data cleanup, before being taken offline. After the pre-offline process is successful, the main controller is notified to perform the offline process.
[0018] Secondly, this application provides an application of a self-healing device, comprising:
[0019] The monitoring module is used to monitor whether the target application experiences any business anomalies. A business anomaly is at least one of the following: a failure, a sudden increase in business volume, or a sudden drop in business processing efficiency.
[0020] The generation module is used to generate a copy of the target application in response to the detection of a business anomaly in the target application.
[0021] The first determining module is used to determine whether there is a transaction relationship between the business operations to be processed in the target application if the business exception that occurs in the target application does not include a fault.
[0022] The second determination module is used to determine whether the business scenario is a scheduling scenario, an election scenario, or a preemption scenario if no transaction relationship exists.
[0023] The processing module is used to launch the replica application using a set algorithm suitable for the business scenario. The set algorithm suitable for the scheduling scenario is to process the business by orderly scheduling the target application and the replica application according to the business data; the set algorithm suitable for the preemption scenario is to allow the replica application to preemptively process the business; and the set algorithm suitable for the election scenario is to elect the target application and the replica application according to the business data, and let the selected application process the business.
[0024] In one possible implementation, the first determining module may be specifically used to: determine the business scenario as a preemption scenario if the business anomaly occurring in the target application includes a fault; and control the replica application to process the business pending processing in the target application; the second determining module may be specifically used to: determine the business scenario as a special business scenario if there is a transaction relationship between the business pending processing in the target application, and, in conjunction with data sharding and / or business isolation, perform business processing on the target business with a transaction relationship in the business.
[0025] In one possible implementation, the second determining module can also be used to: filter and acquire target data related to the target business; and perform business processing on the target business based on the target data.
[0026] In one possible implementation, the second determining module can also be used to: determine whether there are multiple applications related to the target data; if so, control the multiple applications to consume the target data by adopting a consumer group approach.
[0027] In one possible implementation, the monitoring module can be specifically used to: acquire heartbeat information of the target application, including a sudden increase in traffic and / or a sudden decrease in business processing efficiency; if the sudden increase in traffic is greater than or equal to a traffic increase threshold, then it is determined that the target application has experienced a traffic increase; if the sudden decrease in business processing efficiency is greater than or equal to a business processing efficiency decrease threshold, then it is determined that the target application has experienced a business processing efficiency decrease; if the heartbeat information of the target application cannot be acquired, then it is determined that the target application has malfunctioned.
[0028] In one possible implementation, the processing module may be specifically used to: verify whether the replica application is correctly processing the business.
[0029] In one possible implementation, the processing module can also be used to: in response to detecting self-healing of the target application, synchronize the heartbeat information of the target application to the copy application, and synchronize the heartbeat information of the copy application to the target application, so that the target application and the copy application can determine the application to be taken offline based on the heartbeat information of both parties.
[0030] In one possible implementation, the application to be taken offline undergoes a pre-offline process, including data auditing and critical abnormal data cleanup, before being taken offline. After the pre-offline process is successful, the main controller is notified to perform the offline process.
[0031] Thirdly, this application provides an electronic device, including a memory and a processor. The memory is used to store program instructions; the processor is used to invoke the program instructions in the memory to execute the application self-healing processing method of the first aspect.
[0032] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, implement the application self-healing processing method of the first aspect.
[0033] Fifthly, this application provides a computer program product comprising a computer program, which, when executed by a processor, is used to implement the application self-healing processing method of the first aspect.
[0034] The application self-healing processing method, apparatus, device, and storage medium provided in this application monitor whether a business anomaly occurs in the target application. The business anomaly is at least one of a fault, a sudden increase in business volume, and a sudden decrease in business processing efficiency. In response to detecting a business anomaly in the target application, a copy application corresponding to the target application is generated. If the business anomaly in the target application does not include a fault, it is determined whether there is a transaction relationship between the business processes to be processed by the target application. If there is no transaction relationship, the business scenario is determined to be a scheduling scenario, an election scenario, or a preemption scenario. The copy application is started using a setting algorithm suitable for the business scenario. The setting algorithm suitable for the scheduling scenario is to schedule the target application and the copy application in an orderly manner according to business data to process the business. The setting algorithm suitable for the preemption scenario is to allow the copy application to preemptively process the business. The setting algorithm suitable for the election scenario is to elect the target application and the copy application according to business data, and the selected application processes the business. By monitoring whether the target application is malfunctioning, experiencing a sudden surge in business volume, or a sudden drop in business processing efficiency, the system can automatically identify business anomalies in the target application. When a business anomaly occurs in the target application, a corresponding copy application is generated. Using preset business scenarios and appropriate algorithms, the system differentiates between different business scenarios and coordinates the scheduling of the target application and the copy application. The copy application handles business processing, or the target application and the copy application work together to process business. This enables the target application to self-heal in different business scenarios, avoiding time waste caused by business anomalies, improving business processing efficiency and capabilities, and ultimately enhancing application stability. Attached Figure Description
[0035] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0036] Figure 1 This is a schematic diagram illustrating an application scenario of the self-healing processing method provided in an embodiment of this application;
[0037] Figure 2 This is a schematic flowchart of an embodiment of the self-healing processing method provided in this application;
[0038] Figure 3 This is a schematic diagram of the structure of an atomic application self-healing process provided in an embodiment of this application;
[0039] Figure 4 This is a schematic diagram of the self-healing process of a copy application provided in an embodiment of this application;
[0040] Figure 5 This is a schematic diagram of the structure of a multi-instance application scheduling process provided in an embodiment of this application;
[0041] Figure 6This is a schematic diagram of the single-instance application scheduling process provided in an embodiment of this application;
[0042] Figure 7 This is a schematic diagram of the structure of an application self-healing device provided in an embodiment of this application;
[0043] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0044] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0046] The terms “first,” “second,” etc., used in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, products, or apparatus.
[0047] In related technologies, with the development of cloud-native technologies, business support systems are gradually becoming more micro-functional. The emergence of microservice frameworks further guides business support systems towards this micro-functionality. In actual production and R&D, the system framework of a business support system contains a large number of atomic applications. These atomic applications collaborate with each other to enable the operation of the entire business support system. Although microservice frameworks can achieve scaling and circuit breaking for atomic applications, they only perform basic scaling on atomic applications, merely changing the quantity. Moreover, scaling consumes a large amount of physical resources, and in some extreme scenarios, scaling cannot solve the fundamental problem.
[0048] Furthermore, existing information technology (IT) frameworks generally follow the principle of application universality in processing business and data. Applications designed under this principle typically possess characteristics such as rapid processing, automatic scaling, and statelessness. However, in actual production applications, data processing, such as data logic processing, is often limited by the complexity of the business, thus restricting the application's processing efficiency and capabilities while still meeting the requirements of application universality.
[0049] To address the aforementioned issues, this application provides an application self-healing method. This method monitors the application's business status to automatically identify applications with abnormal business operations. When an application experiences a business anomaly, such as a sudden drop in processing efficiency, it self-replicates, generating a corresponding copy application. Using appropriate algorithms (such as scheduling, election, and preemption algorithms) and predefined business scenarios, it differentiates between different business scenarios and coordinates the scheduling of the abnormal application and its copy application when the abnormal application's health is insufficient. That is, when the abnormal application's processing capacity is insufficient, the copy application can handle the business, thus achieving self-healing for abnormal applications in different business scenarios. By automatically monitoring and self-healing applications, time wasted due to application business anomalies is avoided, improving application processing efficiency and capacity, and ultimately enhancing application stability.
[0050] Furthermore, the application's self-healing capability reduces the operational burden on relevant personnel, achieving a relatively satisfactory result.
[0051] Figure 1 This is a schematic diagram illustrating an application scenario of the self-healing processing method provided in an embodiment of this application. The application scenario may include scheduling scenarios, preemption scenarios, and election scenarios, etc. Figure 1As shown, in a specific application scenario, the main controller simultaneously controls atomic applications A, B, C, and D. When the main controller detects an anomaly in atomic application B via heartbeat information (which includes serialized business metrics, typically a sudden increase in workload or a sudden decrease in processing efficiency), it replicates atomic application B to generate a corresponding copy application b. Copy application b can have two forms (copy form and audit form), and the form can be designed by relevant personnel. Specifically, the main controller can synchronously send heartbeat information and the serialized business data contained within it to atomic application B and copy application b. Depending on the application scenario, the main controller can select the optimal application between atomic application B and copy application b for business processing based on the serialized business data, or the copy application can directly preemptively perform business processing. During the business processing of copy application b, the main controller can verify in real time whether the workload processed by copy application b reaches the workload threshold and whether the business processing flow of the copy application is correct. Once the workload or processing efficiency returns to normal levels, atomic application B can self-heal. After self-healing, atomic application B can proactively notify its copy application B to go offline and initiate business data auditing during the self-healing process.
[0052] The following is combined Figure 1 Application scenarios, refer to Figure 2 This application describes a self-healing processing method according to exemplary embodiments of the present application. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited to these scenarios. Figure 1 The limitations of the application scenarios shown.
[0053] Figure 2 This is a schematic flowchart illustrating an embodiment of the self-healing processing method provided in this application. Figure 2 As shown, the self-healing processing method in this embodiment includes the following steps:
[0054] S201: Monitor whether the target application is experiencing business anomalies. A business anomaly is at least one of the following: a failure, a sudden increase in business volume, or a sudden drop in business processing efficiency.
[0055] In this step, a failure refers to the target application being unable to process business, while a sudden increase in business volume and a sudden drop in business processing efficiency refer to the target application still being able to process business.
[0056] In some embodiments, monitoring whether a target application experiences business anomalies may further include: obtaining heartbeat information from the target application, including sudden increases in workload and / or sudden decreases in processing efficiency; if the sudden increase in workload is greater than or equal to a threshold for sudden increases in workload, then it is determined that the target application has experienced a sudden increase in workload; if the sudden decrease in processing efficiency is greater than or equal to a threshold for sudden decreases in processing efficiency, then it is determined that the target application has experienced a sudden decrease in processing efficiency; if heartbeat information from the target application cannot be obtained, then it is determined that the target application has malfunctioned. Here, heartbeat information refers to the real-time status of the target application, including serialized business metrics, typically indicators such as sudden increases in workload and sudden decreases in processing efficiency. For example, the thresholds for sudden increases in workload and sudden decreases in processing efficiency can be set by relevant personnel based on the business scenario and the actual processing situation of the target application (i.e., the "atomic application" mentioned above).
[0057] As mentioned earlier, the main controller can obtain the real-time status of the target application, i.e., heartbeat information. By monitoring the heartbeat information, it can determine whether the target application has experienced a business anomaly. For example, when the target application experiences a business anomaly, it could be that the main controller detects a sudden increase in the target application's workload, or it could detect a sudden decrease in the target application's business processing efficiency, and so on.
[0058] S202: In response to detecting a business anomaly in the target application, generate a copy application corresponding to the target application.
[0059] The specific implementation of generating the copy application in this step can be found in relevant technologies and will not be elaborated here. Those skilled in the art will understand that the target application can be either an atomic application or a copy application. Here, atomic application and copy application are relative concepts. If a copy application of an atomic application also experiences a business anomaly, then a copy application of that copy application is generated.
[0060] S203: If the business exception occurring in the target application does not include a fault, then determine whether there is a transaction relationship between the business processes to be processed in the target application.
[0061] In this step, the business anomalies that occur in the target application do not include failures. It can be understood that the target application can still process business. In this case, it is further determined whether there is a transaction relationship between the business processes to be processed by the target application.
[0062] In this context, a transaction relationship refers to a prescribed action, that is, a business process that can only be executed in a certain order. For example, if the target application is a printer, and the task is to print 10 copies of a document, then as much paper as possible needs to be taken to meet the printing requirements; then the paper is placed in the printer; finally, the print button is clicked to print the document, resulting in 10 copies. In this embodiment, the printer's printing mode can be set according to the document to be printed, such as single-sided printing of the cover and double-sided printing of the body. The printing mode can be set in advance or before clicking the print button, but the order of placing the paper, clicking the print button, and obtaining the printed document remains unchanged.
[0063] Based on the above example, it could be that one printer prints 10 copies of the document, or multiple printers can print 10 copies of the document simultaneously.
[0064] In some embodiments, the self-healing method may further include: if the business anomaly occurring in the target application includes a fault, the business scenario can be determined to be a preemption scenario; and the replica application is controlled to process the business pending processing in the target application. Wherein, when the target application fails and can no longer process business, the replica application performs the business processing. Optionally, the fault occurring in the target application in the preemption scenario may be a target application freeze or other anomaly. When the target application freezes, the replica application can directly preempt and process the business pending processing in the target application.
[0065] S204: If no transaction relationship exists, the business scenario is determined to be a scheduling scenario, an election scenario, or a preemption scenario.
[0066] It's understandable that there are no transactional relationships between business processes; that is, the application is stateless, and the business processes are independent of each other. They can be processed in parallel or sequentially, depending on the specific business requirements. In this case, the business scenario can be identified as a scheduling scenario, an election scenario, or a preemption scenario.
[0067] In some embodiments, if there are transactional relationships between the services to be processed in the target application, the service scenario can be determined as a special service scenario. Data sharding and / or service isolation can be combined to process the target services with transactional relationships.
[0068] Optionally, in special business scenarios, some target applications cannot achieve statelessness. In such cases, when the application is stateful, it is necessary to combine data sharding and / or business isolation (or business logic isolation) to perform business processing on the target business in order to meet the self-healing requirements of the application in the special business scenario.
[0069] S205: The algorithm for launching the replica application is based on the appropriate business scenario. The algorithm for scheduling scenarios is to schedule the target application and the replica application in an orderly manner to process the business based on the business data. The algorithm for preemption scenarios is to allow the replica application to preemptively process the business. The algorithm for election scenarios is to elect the target application and the replica application based on the business data, and the selected application processes the business.
[0070] In other words, when there is no transaction relationship between business processes, the target application and the replica application can be scheduled to process business processes in an orderly manner, or one of the target application and the replica application can be selected to process business processes, or the replica application can preemptively process business processes.
[0071] In some embodiments, the main controller can automatically replicate and self-heal the target application throughout its entire business process. For example, during the replication of the target application to generate a corresponding copy application, the main controller can use different algorithms to start or schedule the copy application based on different business scenarios. Specifically, in a scheduling scenario, a scheduling algorithm is used to start the copy application; in an election scenario, an election algorithm is used; and in a preemption scenario, a preemption algorithm is used. In the scheduling scenario, the target application and the copy application have the same business processing logic, and there is no transaction relationship between their services. The main controller can perform ordered scheduling based on business serialization data, and both the target application and the copy application can perform business processing. In the preemption scenario, the target application and the copy application have different business processing logics, and the target application may experience freezing or other abnormalities. The copy application can directly preempt and perform business processing. In the election scenario, both the target application and the copy application can handle the business when the target application experiences business abnormalities, and there is no transaction relationship between their services. The main controller can elect the optimal application based on business serialization data to perform business processing.
[0072] Optionally, the scheduling algorithm, election algorithm, and preemption algorithm can be pre-set according to the business scenario. For example, if the business scenario is that the printer needs to print 100 sheets of paper, and the fastest printing is required, a scheduling algorithm can be used to print simultaneously using two or more printers. If the requirement is to print 100 sheets of color paper, an election algorithm can be used to select a color printer for printing.
[0073] In addition, for specific business scenarios, it is recommended to formulate specific business processes in advance based on the business scenario, and formulate the most suitable business processing process on the business side.
[0074] Based on the above embodiments, Figure 3 This is a schematic diagram of the structure of an atomic self-healing process provided in an embodiment of this application. Figure 3As shown, when starting an atomic application (i.e., the "target application" mentioned above), if a business exception occurs during the atomic application's processing, a decision is made regarding whether to scale up the application, i.e., whether to replicate the atomic application to create a corresponding copy application. If not, the atomic application is restarted; if so, different scaling methods are used depending on the business scenario, i.e., the method of starting the copy application. Specifically, a scheduling algorithm is used to start the copy application in a scheduling scenario, an election algorithm is used in an election scenario, and a preemption algorithm is used in a preemption scenario. The interaction process with the main controller differs depending on the algorithm used to start the copy application in different business scenarios. In the scheduling scenario, the main controller controls the atomic application and the copy application to process the business; in the preemption scenario, the copy application processes the business first and then reports back to the main controller; in the election scenario, the atomic application and the copy application process a portion of the business first and report the results back to the main controller, which then selects the optimal application to process the remaining business based on the received results. For example, the processing results may include the business processing volume, the remaining business volume, and the business processing efficiency.
[0075] Corresponding to the above embodiments, Figure 4 A schematic diagram illustrating the structure of a copy application self-healing process provided in an embodiment of this application. For example... Figure 4 As shown, when the replica application also experiences a business anomaly, it can be replicated as a new atomic application. The specific implementation principle is the same as... Figure 3 The implementation examples are similar and will not be repeated here.
[0076] The application self-healing method provided in this application monitors whether the target application is malfunctioning, experiencing a sudden increase in business volume, or a sudden drop in business processing efficiency. This enables automatic identification of business anomalies in the target application. When a business anomaly occurs in the target application, a corresponding copy application is generated. By using preset business scenarios and appropriate setting algorithms, different business scenarios are distinguished to achieve coordinated scheduling between the target application and the copy application. The copy application handles business processing, or the target application and the copy application work together to handle business, thereby achieving self-healing of the target application. This avoids time waste caused by business anomalies, improves business processing efficiency and capabilities, and ultimately enhances application stability.
[0077] Furthermore, once the target application achieves self-healing, it can reduce the operational pressure and workload of relevant personnel, achieving a relatively satisfactory result.
[0078] In the specific business scenarios described above, data sharding and / or business isolation can be combined to perform business processing on target businesses with transactional relationships within the business to be processed. Specifically, performing business processing on target businesses with transactional relationships in conjunction with data sharding can include: filtering and obtaining target data related to the target business; and performing business processing on the target business based on the target data.
[0079] Furthermore, based on the target data, business processing of the target business can include: determining whether there are multiple applications related to the target data; if so, using a consumer group approach to control the consumption of target data by multiple applications. For example, when processing business data, applications can follow predetermined rules, where specific data can only be processed by a specific application, and applications and / or data outside their scope are filtered. When multiple applications consume the same set of data, a consumer group approach can be used to control the consumption of the same set of data by multiple applications.
[0080] Furthermore, by combining business isolation with atomic applications and / or replica applications, target business processes with transactional relationships can be processed. Business isolation enables replica applications to be more flexible. Each atomic application should possess the flexibility of a replica application, and each atomic application should have the ability to identify business scenarios. When processing business, multiple atomic applications can be chained together to form related applications. For example, business isolation can be performed based on business scenarios, allowing an application to handle only one type of business.
[0081] Based on the above embodiments, the application self-healing method provided in this application can cover atomic applications and batch processing applications (i.e., a collection of multiple atomic applications), realizing application self-healing processing in different business scenarios. For example... Figure 5 As shown, an embodiment is provided in which multiple atomic applications and multiple replica applications cooperate with each other to jointly process the business to be processed. Figure 5 This is a schematic diagram of the structure of a multi-instance application scheduling process provided in an embodiment of this application. Figure 5 The odd and even numbers in the atomic application can be considered as pending business transactions arranged in order [1, 2, 3, 4, 5, ...]. When an atomic application encounters a business exception, the atomic application is replicated to generate a corresponding copy application. Pending business transactions with odd numbers are processed by the atomic application, and pending business transactions with even numbers are processed by the copy application. Figure 5 It involves multiple atomic applications and multiple replica applications that collaborate with each other to process business logic.
[0082] Corresponding to the above embodiments, Figure 6 This is a schematic diagram illustrating the structure of a single-instance application scheduling process according to an embodiment of this application. Figure 5 similar, Figure 6 The odd and even numbers in the process can also be considered as pending business items arranged in order [1, 2, 3, 4, 5, ...]. When an atomic application experiences a business exception, the atomic application is replicated to generate a corresponding copy application. Ultimately, one atomic application handles the pending business items with odd numbers in the order, and one copy application handles the pending business items with even numbers in the order.
[0083] In some embodiments, after launching the replica application using a setting algorithm suitable for the business scenario, the process may further include: verifying whether the replica application is correctly processing the business. Optionally, verifying whether the replica application is correctly processing the business may include: verifying whether the business volume processed by the replica application reaches a business volume threshold, and whether the business processing flow of the replica application is correct, etc.; in response to the business volume processed by the replica application reaching the business volume threshold and the business processing flow of the replica application being correct, it is determined that the replica application is correctly processing the business, thereby ensuring the accuracy of business processing and / or data processing. For example, the business volume threshold can be set by relevant personnel according to actual conditions, or it can be directly set as the business volume of the business to be processed, etc.
[0084] Based on the above embodiments, after starting the replica application using a setting algorithm suitable for the business scenario, it may further include: in response to detecting self-healing of the target application, synchronizing the heartbeat information of the target application to the replica application, and synchronizing the heartbeat information of the replica application to the target application, so that the target application and the replica application determine the application to be taken offline based on the heartbeat information of both parties. Detecting self-healing of the target application may include: obtaining the heartbeat information of the target application; if the sudden increase in business volume is less than the sudden increase threshold of business volume, and the sudden decrease in business processing efficiency is less than the sudden decrease threshold of business processing efficiency, then it is determined that the target application has self-healed.
[0085] Optionally, before an application is taken offline, it can undergo pre-offline processing including data auditing and critical anomaly data cleanup. Upon successful pre-offline processing, the application can notify the main controller to proceed with the offline process. Data auditing refers to a complete data quality control chain that checks data integrity and consistency, including data collection, preprocessing, comparison, analysis, early warning, notification, and problem remediation, to improve data quality. Critical anomaly data cleanup (or garbage disposal) refers to abnormal data processing performed by the application before it is taken offline. For example, when a replica application receives a shutdown signal, it can perform data auditing and critical anomaly data cleanup during its self-healing process. If the data audit is successful and there is no abnormal data, the replica application can notify the main controller to proceed with the offline process.
[0086] For example, when the main controller determines that the application as a whole has recovered, the main controller will synchronize heartbeat information to the atomic application and the replica application. After receiving the heartbeat information, the two applications can actively conduct business interactions. Generally, the atomic application notifies the replica application to go offline and performs a data audit process; it is also possible that the replica application has high execution efficiency and strong processing capabilities, and can reversely request the atomic application to go offline and perform a data audit process.
[0087] It is understandable that the self-healing process of applications requires continuous optimization and iteration. After constructing some anticipated scenarios, the application self-healing method provided in this application can easily solve application business anomalies in most business scenarios. Application business anomalies in the remaining business scenarios can be continuously improved through continuous optimization, thereby continuously enhancing the self-healing capability of the application.
[0088] In summary, this application has at least the following advantages:
[0089] 1. Unlike simple application scaling, the application self-healing method provided in this application automatically identifies business anomalies in the target application by monitoring for failures, sudden increases in business volume, and sudden drops in business processing efficiency. When a business anomaly occurs, a corresponding copy application is generated. For different business scenarios, election algorithms, scheduling algorithms, and preemption algorithms are used to launch the copy application. The copy application compensates for or replaces the target application, thereby achieving self-healing. Furthermore, for special business scenarios, business isolation and data sharding can be used to achieve self-healing of the target application in specific business scenarios, thus enabling self-healing of the target application across multiple business scenarios.
[0090] 2. After the target application achieves self-healing, the stability and continuity of its business processing system can be improved, avoiding downtime and wasted time caused by business anomalies. This enhances the business processing efficiency and capabilities of the target application. Furthermore, self-healing reduces the operational burden on relevant personnel, decreases the complexity and workload of maintenance, achieving satisfactory results.
[0091] 3. After the target application achieves self-healing, the copy application exchanges heartbeat information with the target application. Based on the heartbeat information, applications with weak business processing capabilities can be taken offline to release temporarily occupied resources, and data auditing and critical abnormal data cleanup can be performed to ensure the accuracy of business processing and / or data processing.
[0092] 4. After the target application achieves self-healing, if an anomaly is detected in the target application's business, a copy application can be scheduled to start at any time. The copy application will take over and share the business processing to cope with situations such as a surge in business volume, thereby maximizing resource utilization.
[0093] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0094] Figure 7 This is a schematic diagram of the structure of a self-healing processing device provided in one embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. Figure 7 As shown, the self-healing device 70 includes: a monitoring module 71, a generation module 72, a first determination module 73, a second determination module 74, and a processing module 75. Among them,
[0095] Monitoring module 71 is used to monitor whether the target application has business anomalies. Business anomalies are at least one of the following: failure, sudden increase in business volume, and sudden drop in business processing efficiency.
[0096] Generation module 72 is used to generate a copy application corresponding to the target application in response to the detection of a business anomaly in the target application;
[0097] The first determining module 73 is used to determine whether there is a transaction relationship between the business operations to be processed in the target application if the business exception that occurred in the target application does not include a fault.
[0098] The second determining module 74 is used to determine whether the business scenario is a scheduling scenario, an election scenario, or a preemption scenario if no transaction relationship exists.
[0099] The processing module 75 is used to start the replica application using a set algorithm suitable for the business scenario. The set algorithm suitable for the scheduling scenario is to process the business by orderly scheduling the target application and the replica application according to the business data; the set algorithm suitable for the preemption scenario is to allow the replica application to preempt and process the business; and the set algorithm suitable for the election scenario is to elect the target application and the replica application according to the business data, and let the selected application process the business.
[0100] In one possible implementation, the first determining module 73 may be specifically used to: determine the business scenario as a preemption scenario if the business anomaly occurring in the target application includes a fault; control the replica application to process the business pending processing of the target application; the second determining module 74 may be specifically used to: determine the business scenario as a special business scenario if there is a transaction relationship between the business pending processing of the target application, and perform business processing on the target business with a transaction relationship in combination with data sharding and / or business isolation.
[0101] In one possible implementation, the second determining module 74 can also be used to: filter and obtain target data related to the target business; and perform business processing on the target business based on the target data.
[0102] In one possible implementation, the second determining module 74 can also be used to: determine whether there are multiple applications related to the target data; if so, control the multiple applications to consume the target data by adopting a consumer group approach.
[0103] In one possible implementation, the monitoring module 71 can be specifically used to: acquire heartbeat information of the target application, including a sudden increase in traffic and / or a sudden decrease in business processing efficiency; if the sudden increase in traffic is greater than or equal to a traffic increase threshold, then it is determined that the target application has experienced a traffic increase; if the sudden decrease in business processing efficiency is greater than or equal to a business processing efficiency decrease threshold, then it is determined that the target application has experienced a business processing efficiency decrease; if the heartbeat information of the target application cannot be acquired, then it is determined that the target application has malfunctioned.
[0104] In one possible implementation, the processing module 75 may be specifically used to: verify whether the copy application is processing the business correctly.
[0105] In one possible implementation, the processing module 75 can also be used to: in response to detecting self-healing of the target application, synchronize the heartbeat information of the target application to the copy application, and synchronize the heartbeat information of the copy application to the target application, so that the target application and the copy application can determine the application to be taken offline based on the heartbeat information of both parties.
[0106] In one possible implementation, the application to be taken offline undergoes a pre-offline process, including data auditing and critical abnormal data cleanup, before being taken offline. After the pre-offline process is successful, the main controller is notified to perform the offline process.
[0107] The self-healing device provided in this application embodiment has a similar implementation principle and technical effect to the above embodiments. For details, please refer to the above embodiments, which will not be repeated here.
[0108] Figure 8 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. For example, the electronic device may be provided as a server. Figure 8 As shown, the electronic device 80 includes:
[0109] Processor 810 further includes one or more processors and memory resources represented by memory 820 for storing instructions executable by processor 810, such as application programs. The application programs stored in memory 820 may include one or more modules, each corresponding to a set of processing instructions. Furthermore, processor 810 is configured to execute instructions to perform the aforementioned application self-healing processing method.
[0110] Electronic device 80 may also include a power supply component 830 configured to perform power management of electronic device 80, a wired or wireless network interface 840 configured to connect electronic device 80 to a network, and an input / output interface 850. Electronic device 80 may operate on an operating system stored in memory 820, such as x86, Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0111] Figure 8 The processor 810 mentioned can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0112] The memory 820 may include random access memory (RAM), and may also include static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk, such as at least one disk storage device.
[0113] Those skilled in the art will understand that Figure 8 The electronic devices shown do not constitute a limitation on electronic devices and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0114] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed, the above-mentioned self-healing processing method is implemented.
[0115] This application also provides a computer program product, including a computer program that, when executed, implements the above-described self-healing processing method.
[0116] This application also provides a chip for executing instructions, which is used to execute the application self-healing processing method as described in any of the above method embodiments.
[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0118] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0119] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A self-healing treatment method, characterized in that, include: Monitor whether the target application experiences any business anomalies, wherein the business anomalies are at least one of the following: failure, sudden increase in business volume, and sudden decrease in business processing efficiency; In response to detecting a business anomaly in the target application, a copy application corresponding to the target application is generated; If the business anomaly occurring in the target application does not include a fault, then determine whether there is a transaction relationship between the business processes to be processed in the target application; If no transaction relationship exists, the business scenario is determined to be a scheduling scenario, an election scenario, or a preemption scenario. The replica application is launched using a setting algorithm suitable for the business scenario. Specifically, the setting algorithm suitable for the scheduling scenario is to schedule the target application and the replica application in an orderly manner to process the business based on the business data; the setting algorithm suitable for the preemption scenario is to allow the replica application to preemptively process the business; and the setting algorithm suitable for the election scenario is to elect the target application and the replica application based on the business data, and allow the selected application to process the business. If the business anomaly occurring in the target application includes a fault, then the business scenario is determined to be a preemption scenario; the replica application is then controlled to process the business pending processing in the target application. If there are transactional relationships between the business processes to be processed in the target application, the business scenario is determined to be a special business scenario. In conjunction with data sharding and / or business isolation, the target business processes with transactional relationships are processed.
2. The self-healing treatment method according to claim 1, characterized in that, The process of combining data sharding to perform business processing on target businesses with transactional relationships in the business includes: Acquire and filter target data related to the target business; Based on the target data, business processing is performed on the target service.
3. The self-healing treatment method according to claim 2, characterized in that, The process of performing business processing on the target service based on the target data includes: Determine whether there are multiple applications related to the target data; If so, a consumer group approach is used to control the consumption of the target data by the multiple applications.
4. The self-healing treatment method according to any one of claims 1 to 3, characterized in that, Whether the target application being monitored experiences business anomalies includes: Obtain the heartbeat information of the target application, including a sudden increase in business volume and / or a sudden decrease in business processing efficiency; If the traffic volume suddenly increases to or exceeds the traffic volume surge threshold, then the target application is determined to have experienced a traffic surge. If the sudden drop in business processing efficiency is greater than or equal to the threshold for sudden drop in business processing efficiency, then it is determined that the target application has experienced a sudden drop in business processing efficiency. If the heartbeat information of the target application cannot be obtained, it is determined that the target application is malfunctioning.
5. The self-healing treatment method according to any one of claims 1 to 3, characterized in that, After starting the replica application using a setting algorithm suitable for the business scenario, the method further includes: Verify whether the replica application is processing business correctly.
6. The self-healing treatment method according to any one of claims 1 to 3, characterized in that, After starting the replica application using a setting algorithm suitable for the business scenario, the method further includes: In response to the detection of self-healing of the target application, the heartbeat information of the target application is synchronized to the copy application, and the heartbeat information of the copy application is synchronized to the target application, so that the target application and the copy application can determine the application to be taken offline based on the heartbeat information of both parties.
7. The self-healing treatment method according to claim 6, characterized in that, The application to be taken offline undergoes pre-offline processing, including data auditing and cleaning of critical abnormal data, and the main controller is notified to perform offline processing after the pre-offline processing is successful.
8. A self-healing device, characterized in that, include: The monitoring module is used to monitor whether the target application experiences any business anomalies, wherein the business anomalies are at least one of the following: failure, sudden increase in business volume, and sudden decrease in business processing efficiency. The generation module is used to generate a copy application corresponding to the target application in response to detecting a business anomaly in the target application. The first determining module is used to determine whether there is a transaction relationship between the services to be processed in the target application if the business anomaly occurring in the target application does not include a fault. The second determination module is used to determine whether the business scenario is a scheduling scenario, an election scenario, or a preemption scenario if no transaction relationship exists. The processing module is used to launch the replica application using a set algorithm suitable for the business scenario. The set algorithm suitable for the scheduling scenario is to process the business by orderly scheduling the target application and the replica application according to the business data; the set algorithm suitable for the preemption scenario is to allow the replica application to preemptively process the business; and the set algorithm suitable for the election scenario is to elect the target application and the replica application according to the business data, and allow the selected application to process the business. The first determining module is specifically used for: if the business anomaly occurring in the target application includes a fault, then determining the business scenario as a preemption scenario; and controlling the replica application to process the business pending processing of the target application. The second determining module is specifically used to: if there are transactional relationships between the business processes to be processed in the target application, determine the business scenario as a special business scenario, and, in conjunction with data sharding and / or business isolation, perform business processing on the target business processes that have transactional relationships in the business processes.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store program instructions; The processor is used to invoke program instructions in the memory to execute the application self-healing processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed, implement the application self-healing processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method, device, equipment and system based on artificial intelligence and medium
CN115454958A
Transaction commitment and replication in a storage system
US20130110774A1