Application interaction exception processing method and device and electronic equipment
By receiving interactive requests and determining the status of the backend server, sending a fault signal to the load balancer to determine the allocation strategy of the interactive request, the problem of unsatisfactory interaction stability caused by abnormal functions of the backend server is solved, and the effect of improving processing efficiency and ensuring interaction continuity is achieved.
Patent Information
- Application Number
- CN202411863524.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-15
AI Technical Summary
The interaction stability caused by abnormal back-end server functions in the prior art is not ideal and there is a lack of effective solutions.
By receiving the interactive request, the status query result of the backend server is determined, and when there is an abnormal node that cannot perform the target processing, a fault signal is sent to the load balancer, and the allocation policy of the interaction request is determined based on the signal, and the request is sent to the normal node indicated by the allocation policy.
It improves the processing efficiency and processing capability of the back-end server when the connection is normal but the function is abnormal, ensures interaction continuity, and solves the problem of unsatisfactory interaction stability.
Smart Images

Figure CN119829318A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and more specifically, to a method, device and electronic device for handling application interaction exceptions. Background Art
[0002] With the rapid development of technologies such as big data, cloud computing, the Internet of Things, and AI (Artificial Intelligence), the processing of massive interactive requests has put forward higher requirements for the high availability and fault handling efficiency of the application interactive system. Due to the complexity of the application interactive system, the failure of the application interactive system may cause serious consequences such as system performance degradation, data loss, service interruption, system crash or data leakage. The stability and high availability of the back-end server play a vital role in the normal operation of the entire application interactive system. In the related technology, for the situation where the back-end server is connected normally but the function is abnormal, it mainly depends on the operation and maintenance personnel to find the fault in time and manually switch the business request to the backup server. Human errors or operation delays may occur, and there are problems such as the inability to respond to or delayed response to interactive requests, as well as data loss and damage. The processing process is inefficient, resulting in the inability of the application interactive system to provide services. There is a problem of unsatisfactory interaction continuity caused by the normal connection of the back-end server but abnormal function.
[0003] Currently, no effective solution has been proposed to address the problem of poor interaction stability caused by abnormal functions of backend servers in related technologies. Summary of the invention
[0004] The main purpose of the present application is to provide a method, device and electronic device for handling application interaction exceptions, so as to solve the problem of unsatisfactory business continuity caused by application server exceptions in related technologies.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for handling application interaction exceptions is provided. The method comprises: receiving an interaction request, wherein the interaction request is used to request interaction with a backend server; determining a status query result of the backend server according to the target processing required by the interaction request; sending a fault signal to a load balancer when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, wherein the load balancer is used to determine a distribution strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; and sending the interaction request to a normal node indicated by the distribution strategy.
[0006] Optionally, the target processing is data reading and writing processing, and the back-end server is a database server. According to the target processing required by the interaction request, the status query result of the back-end server is determined, including: querying the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the back-end server; when there is a status abnormality record in the alarm linkage information indicating that the data file status is abnormal, it is determined that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0007] Optionally, the target processing is identity authentication processing, and the back-end server is an identity authentication server. According to the target processing required by the interaction request, the status query result of the back-end server is determined, including: determining the first authentication protocol version based on the interaction request; obtaining the second authentication protocol version used by all nodes in the back-end server respectively; when the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the back-end server, determining that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0008] Optionally, there is a backup server in the back-end server, and the method also includes: determining the total number of abnormal nodes in the back-end server that cannot execute target processing; when the total number of abnormal nodes is greater than or equal to a predetermined threshold, sending a master-slave switching instruction as a fault signal to the load balancer, wherein the normal node indicated by the allocation strategy belongs to the backup server.
[0009] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for handling application interaction exceptions is provided. The method comprises: obtaining a fault signal, wherein the fault signal is an interaction request received by an application container for requesting interaction with a backend server; determining a status query result of the backend server according to the target processing required by the interaction request; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, the application container sends; when it is detected that the connection with the backend server is normal, determining an allocation strategy for the interaction request based on the fault signal; and sending the interaction request to a normal node indicated by the allocation strategy.
[0010] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for handling application interaction exceptions is provided. The method comprises: an application container receives an interaction request, wherein the interaction request is used to request interaction with a backend server; according to the target processing required by the interaction request, a status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to a load balancer; when the load balancer detects that the connection with the backend server is normal, the load balancer determines a distribution strategy for the interaction request based on the fault signal; and the interaction request is sent to a normal node indicated by the distribution strategy.
[0011] Optionally, the method also includes: the back-end server sets access rights to the status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used by the application container to process the target required by the interaction request and determine the status query result of the back-end server.
[0012] Optionally, the method further includes: the back-end server determines an update time interval based on the service type; and the back-end server determines status information according to the update time interval.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an application interaction exception processing device is provided. The device includes: an interaction request receiving module, which is used to receive an interaction request, wherein the interaction request is used to request interaction with a backend server; a first query result determination module, which is used to determine the status query result of the backend server according to the target processing required by the interaction request; an allocation strategy determination module, which is used to send a fault signal to a load balancer when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the backend server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
[0014] Optionally, the query result determination module includes: a query module for querying and processing the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the back-end server; a first abnormal node determination module for determining that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing when there is a status abnormality record indicating that the data file status is abnormal in the alarm linkage information.
[0015] Optionally, the query result determination module includes: a first authentication protocol determination module, used to determine the first authentication protocol version based on the interaction request; a second authentication protocol determination module, used to obtain the second authentication protocol version used by all nodes in the back-end server; and a second abnormal node determination module, used to determine that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing when the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the back-end server.
[0016] Optionally, the device also includes: an abnormal node total amount determination module, used to determine the total number of abnormal nodes in the back-end server that cannot execute target processing; a first fault signal sending module, used to send a master-slave switching instruction as a fault signal to the load balancer when the total number of abnormal nodes is greater than or equal to a predetermined threshold, wherein the normal node indicated by the allocation strategy belongs to the backup server.
[0017] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an application interaction exception processing device is provided. The device includes: a fault signal acquisition module, used to acquire a fault signal, wherein the fault signal is an interaction request received by the application container for requesting interaction with a backend server; determining the status query result of the backend server according to the target processing required by the interaction request; sent by the application container when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing; a first allocation strategy determination module, used to determine the allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the backend server is normal; and a sending module, used to send the interaction request to the normal node indicated by the allocation strategy.
[0018] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an application interaction exception processing device is provided. The device includes: a second fault signal sending module, which is used for the application container to receive an interaction request, wherein the interaction request is used to request interaction with a backend server; according to the target processing required by the interaction request, the status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to the load balancer; a second allocation strategy determination module is used for the load balancer to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; and the interaction request is sent to the normal node indicated by the allocation strategy.
[0019] Optionally, the device also includes: a second query result determination module, which is used for the back-end server to set access rights to status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used for the application container to process the target required by the interaction request and determine the status query result of the back-end server.
[0020] Optionally, the device further includes: a time interval determination module, which is used by the backend server to determine the update time interval based on the service type; and a status information determination module, which is used by the backend server to determine the status information according to the update time interval.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes any one of the application interaction exception handling methods when running.
[0022] In the embodiment of the present application, the state information of the backend server is updated in real time, by receiving an interaction request, wherein the interaction request is used to request interaction with the backend server; determining the state query result of the backend server according to the target processing required by the interaction request; sending a fault signal to the load balancer when the state query result is that there is an abnormal node in the backend server that cannot perform the target processing, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; and sending the interaction request to the normal node indicated by the allocation strategy. The purpose of improving the processing efficiency and processing capacity when the backend server is connected normally but the function is abnormal is achieved, thereby achieving the technical effect of ensuring the continuity of interaction, and then solving the technical problem of unsatisfactory interaction stability caused by the abnormal function of the backend server. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] Figure 1 A hardware structure block diagram of a computer terminal for implementing an application interaction exception handling method is shown;
[0025] Figure 2 is a first flow chart of the application interaction exception handling method provided according to an embodiment of the present application;
[0026] Figure 3 is a second flow chart of the application interaction exception handling method provided in an embodiment of the present application;
[0027] Figure 4 is a third flow chart of the application interaction exception handling method provided according to an embodiment of the present application;
[0028] Figure 5 is a structural diagram of an application interaction exception handling method provided in an embodiment of the present application;
[0029] Figure 6 is a first schematic diagram of an application interaction exception handling device provided according to an embodiment of the present application;
[0030] Figure 7 is a second schematic diagram of the application interaction exception handling device provided according to an embodiment of the present application;
[0031] Figure 8 is a third schematic diagram of the application interaction exception handling device provided according to an embodiment of the present application;
[0032] Fig. 9 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0036] SLB (Server Load Balancer) is used to distribute a large number of concurrent network requests or workloads to multiple backend servers to optimize resource usage, improve system availability and response speed, and enhance the system's fault tolerance.
[0037] OFFLINE (offline state) refers to the state in which a data file, table space, or database instance in the database is temporarily unavailable or is actively removed from the service.
[0038] A PAAS (Platform as a Service) group is a collection of multiple Platform as a Service instances that together provide the environment and services required for application operations. The PAAS group supports the operation and management of application containers and is also a key component in business processes and data processing chains.
[0039] Application container is a lightweight virtualization technology used to encapsulate applications and their runtime environment, so that applications can run on any host that supports containers without having to worry about the underlying hardware or operating system details.
[0040] A database group refers to a collection of multiple independently running database instances. They may each store different data sets or share the same data through replication technology. However, each database instance is independent and has its own storage and computing resources.
[0041] DML (Data Manipulation Language) is used to manipulate data in a database. DML can perform INSERT (insert new rows into a database table), UPDATE (modify existing rows in a database table), DELETE (delete rows from a database table), and MERGE (insert data into a table or update existing records) operations on data.
[0042] The downtime mechanism refers to the automatic or manual intervention measures taken to deal with abnormal situations such as server failures, performance bottlenecks or security threats, in order to temporarily stop or isolate the service of a server node, thereby protecting the stability and security of the entire system.
[0043] It should be noted that the collected information (including but not limited to user device information, user personal information, database status information, data file information and identity authentication system status information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0044] Example 1
[0045] According to an embodiment of the present application, a method embodiment of an application interactive exception handling method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0046] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing the application interaction exception handling method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0047] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0048] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the application interaction exception handling method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned application interaction exception handling method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0049] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0050] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0051] Under the above operating environment, this application provides Figure 2 The application interaction exception handling method shown. Figure 2 This is a first flow chart of the application interaction exception handling method provided according to an embodiment of the present application, and the execution subject may be an application container.
[0052] Step S201, receiving an interaction request, wherein the interaction request is used to request interaction with a backend server;
[0053] It can be understood that the application container, as a network entrance, receives interaction requests from the load balancer. The above interaction request sends the interaction request of the application container to the backend server through the communication between the application container and the backend server. By receiving interaction requests, the system can provide users with fast and stable services, and ensure business continuity and user experience even in a high-concurrency environment.
[0054] Optionally, the backend server may be a database server or an identity authentication system server.
[0055] Step S202, determining the status query result of the backend server according to the target processing required by the interactive request;
[0056] It can be understood that after receiving the request, the application container parses the content of the request to determine the target processing that the backend server needs to execute. According to the target processing, the status of the backend server is queried to obtain the status query result of the backend server. By checking the status of the backend server, the execution strategy of the target processing request can be determined to avoid business interruption caused by abnormalities of some sub-servers of the backend server, thereby ensuring the reliability and continuity of business execution.
[0057] Optionally, in the application interaction exception handling method provided in the embodiment of the present application, the target processing is data reading and writing processing, the back-end server is a database server, and the status query result of the back-end server is determined according to the target processing required by the interaction request, including: querying the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the back-end server; when there is a status exception record in the alarm linkage information indicating that the data file status is abnormal, determining that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0058] It can be understood that if the backend server is a database server, the target processing required for the interactive request can be the reading and writing processing of the data. After receiving the target processing of the interactive request, the application container will query the alarm linkage information of the database. The alarm linkage information stores the data file status corresponding to all nodes in the backend server, and the marking information related to the status, for example, if the status is normal, it can be marked as 0, and if the status is abnormal, it can be marked as 1. If there is a case where the data file status is marked as an abnormal state in the alarm linkage information, it means that the query result is that there is no abnormal node in the backend server that cannot perform the target processing (i.e., reading and writing of data). If there is a case where the data file status is marked as an abnormal state in the alarm linkage information, it means that the query result is that there is an abnormal node in the backend server that cannot perform the target processing (i.e., reading and writing of data). By querying the alarm linkage information in real time, the system can intelligently identify the abnormal nodes in the database server, so as to make decisions before the data read and write request is executed, avoid access to abnormal database nodes, and improve the security and success rate of interaction.
[0059] Optionally, in the application interaction exception handling method provided in the embodiment of the present application, the target processing is identity authentication processing, the back-end server is an identity authentication server, and the status query result of the back-end server is determined according to the target processing required by the interaction request, including: determining the first authentication protocol version based on the interaction request; obtaining the second authentication protocol version used by all nodes in the back-end server respectively; when the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the back-end server, determining that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0060] It can be understood that if the backend server is an identity authentication system server, the target processing required for the interactive request can be the user's identity authentication processing. After receiving the target processing of the interactive request, the application container determines the first authentication protocol version (i.e., the authentication protocol version supported by the application container) carried in the request through parsing. Query the authentication version information of the backend server to obtain the second authentication protocol version used by all nodes in the backend server. Compare the first authentication protocol version with the second authentication protocol version to check whether there is any incompatibility. If there is no incompatibility between the first authentication protocol version and the second authentication protocol version used by any node in the backend server, it means that the query result is that there is no abnormal node in the backend server that cannot perform the target processing (i.e., identity authentication processing). If there is an incompatibility between the first authentication protocol version and the second authentication protocol version used by any node in the backend server, it means that the query result is that there is an abnormal node in the backend server that cannot perform the target processing (i.e., identity authentication processing). By ensuring the compatibility of the authentication protocol between the application container and the backend server, security vulnerabilities caused by protocol mismatch, as well as authentication delays and authentication failures are reduced, the continuity and response speed of the service are ensured, and the stability and efficiency of the identity authentication processing are improved.
[0061] Step S203, when the status query result is that there is an abnormal node in the backend server that cannot execute the target processing, a fault signal is sent to the load balancer, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when it detects that the connection with the backend server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
[0062] It can be understood that if the status query result of the backend server is that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to the load balancer. The above fault signal may include identification information of the abnormal node and target processing information that needs to be executed. When the load balancer detects that the connection with the backend server is normal, the allocation strategy for the interactive request is determined according to the information of the fault signal, and the allocation strategy contains the normal node information of the target processing required to execute the interactive request. Based on the determined allocation strategy, the interactive request is sent to the normal node indicated by the allocation strategy to perform the target processing. If the status query result of the backend server is that there is no abnormal node in the backend server that cannot perform the target processing, the interactive request is sent to the node indicated by the pre-allocation strategy. By pre-detecting the status of the node that performs the target processing, it is avoided to send the business request to the abnormal node, which ensures the stability and response speed of the system and improves the continuity and reliability of business processing.
[0063] Optionally, in the application interaction exception handling method provided in an embodiment of the present application, there is a backup server in the back-end server, and the method also includes: determining the total number of abnormal nodes in the back-end server that cannot perform target processing; when the total number of abnormal nodes is greater than or equal to a predetermined threshold, sending a master-slave switching instruction as a fault signal to the load balancer, wherein the normal node indicated by the allocation strategy belongs to the backup server.
[0064] It can be understood that if the status query result of the backend server is that there are abnormal nodes in the backend server that cannot perform the target processing, the total number of abnormal nodes is determined. If the total number of abnormal nodes is less than the predetermined threshold, the main server of the current backend server continues to receive the interaction request of the application container and perform subsequent processing. If the total number of abnormal nodes is greater than or equal to the predetermined threshold, the system will generate a master-slave switching instruction and send this instruction as a fault signal to the load balancer. After receiving the master-slave switching instruction, the load balancer will immediately adjust its allocation strategy and switch the identifier of the normal node from the current main server to the backup server, and subsequent interaction requests will be directed to the backup server. By triggering the master-slave switching when the number of abnormal nodes reaches the preset threshold, the system can effectively avoid business interruptions caused by single-point abnormalities, improve the stability and high availability of the entire system, and at the same time, the master-slave switching mechanism can quickly direct business requests to healthy backup servers, reducing the impact time on business and services due to the abnormality of the main server.
[0065] Optionally, when the total number of abnormal nodes in the back-end server is greater than or equal to a predetermined threshold, it indicates that the stability of the current main server is affected, and the system may not be able to perform subsequent work normally, so it is necessary to start the master-slave switching mechanism. After determining to start the master-slave switching mechanism, the system will generate a master-slave switching instruction and send this instruction as a fault signal to the load balancer. The fault signal not only contains the master-slave switching instruction, but also may include detailed information of the abnormal node, so that the load balancer can accurately understand the current fault condition. After receiving the master-slave switching instruction, the load balancer will immediately adjust its allocation strategy, switch the identifier of the normal node from the current main server to the backup server, and subsequent interaction requests will be sent to the backup server. The above operation realizes the automatic isolation of the abnormal main server, and after the abnormality of the main server is isolated, the operation and maintenance team can focus on repairing the problem of the main server. Once the main server returns to normal, it can be reconfigured as a backup server or main server.
[0066] Through the above step S201, an interaction request is received, wherein the interaction request is used to request interaction with the backend server; step S202, according to the target processing required by the interaction request, the status query result of the backend server is determined; step S203, when the status query result is that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to the load balancer, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when it detects that the connection with the backend server is normal; the interaction request is sent to the normal node indicated by the allocation strategy. The purpose of improving the processing efficiency and processing capacity when the backend server is connected normally but the function is abnormal can be achieved, and the technical effect of ensuring the continuity of interaction is achieved, thereby solving the technical problem of unsatisfactory interaction continuity caused by the backend server being connected normally but the function is abnormal.
[0067] This application provides Figure 3 The application interaction exception handling method shown. Figure 3 This is a second flow chart of the application interaction exception handling method provided according to an embodiment of the present application, and the execution entity may be a load balancer.
[0068] Step S301, obtaining a fault signal, wherein the fault signal is an application container receiving an interaction request for requesting interaction with a backend server; determining a status query result of the backend server according to the target processing required by the interaction request; and sent by the application container when the status query result indicates that there is an abnormal node in the backend server that cannot execute the target processing;
[0069] It can be understood that based on the target processing that the back-end server needs to perform as determined by the interactive request, the status of the back-end server is queried to obtain the status query result of the back-end server. If the status query result of the back-end server is that there is an abnormal node in the back-end server that cannot perform the target processing, a fault signal is sent to the load balancer. After receiving the fault signal, the load balancer performs corresponding processing, such as failover or isolation mechanism, to avoid affecting the normal operation of the business. The load balancer responds to the fault signal from the application container in real time, quickly identifies and processes the abnormal node, and avoids long-term impact on business continuity. At the same time, the automated anomaly detection and response mechanism reduces the dependence on operation and maintenance personnel. When the system detects an anomaly, it can automatically trigger the emergency processing process, reduce the frequency of manual intervention, and improve operation and maintenance efficiency.
[0070] Step S302, when it is detected that the connection with the backend server is normal, determining a distribution strategy for the interactive request based on the fault signal;
[0071] It can be understood that when the load balancer detects that the connection with the backend server is normal, it determines the allocation strategy for the interactive request based on the information of the fault signal, and the allocation strategy contains the normal node information of the target processing required to execute the interactive request. By redetermining the allocation strategy when it is detected that the connection is normal but the application server status is abnormal, the system can ensure business continuity, prevent a large number of interactive request processing or data operations from failing due to application server abnormalities, and improve business stability and user experience.
[0072] Step S303: Send the interaction request to the normal node indicated by the allocation strategy.
[0073] It can be understood that based on the determined allocation strategy, the interaction request is sent to the normal node indicated by the allocation strategy to perform the target processing, ensuring that the request can be processed without interrupting the business. Through anomaly detection, even if there are abnormal nodes in the application server, the system can still forward the request to the normal node to ensure that the business is not affected and improve the reliability of the system. At the same time, the normal node is intelligently scheduled to process subsequent interaction requests, so that the system can dynamically adjust the allocation of interaction requests according to the health status and load of the node, ensuring that resources are used more reasonably and avoiding resource waste and node overload.
[0074] Through the above step S301, a fault signal is obtained, wherein the fault signal is an interaction request received by the application server for requesting interaction with the backend server; according to the target processing required by the interaction request, the status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, it is sent by the application server; step S302, when it is detected that the connection with the backend server is normal, the allocation strategy for the interaction request is determined based on the fault signal; step S303, the interaction request is sent to the normal node indicated by the allocation strategy. The purpose of improving the processing efficiency and processing capacity when the backend server is connected normally but the function is abnormal can be achieved, and the technical effect of ensuring the continuity of interaction is achieved, thereby solving the technical problem of unsatisfactory interaction continuity caused by the backend server being connected normally but the function is abnormal.
[0075] This application provides Figure 4 The application interaction exception handling method shown. Figure 4 This is the third flow chart of the application interaction exception handling method provided according to the embodiment of the present application. The execution subject can be an application container, a load balancer and a backend server.
[0076] Step S401, the application container receives an interaction request, wherein the interaction request is used to request interaction with a backend server; determines a status query result of the backend server according to target processing required by the interaction request; and sends a fault signal to a load balancer when the status query result indicates that there is an abnormal node in the backend server that cannot execute the target processing;
[0077] It can be understood that the application container receives the user's interaction request. The above interaction request sends the interaction request of the application container to the back-end server through the communication between the application container and the back-end server. The interaction request is parsed to determine the target processing that the back-end server needs to perform. According to the target processing, the status of the back-end server is queried to obtain the status query result of the back-end server. If the status query result of the back-end server is that there is an abnormal node in the back-end server that cannot perform the target processing, a fault signal is sent to the load balancer. The above fault signal may include identification information of the abnormal node and target processing information that needs to be executed. By checking the status of the back-end server in advance, it is possible to avoid sending requests to abnormal nodes, prevent business operation failures or reduce user experience, and ensure business continuity and system stability.
[0078] Optionally, in the application interaction exception handling method provided in the embodiment of the present application, the method also includes: the back-end server sets the access rights of the status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used for the application container to process the target required by the interaction request and determine the status query result of the back-end server.
[0079] It can be understood that the back-end server determines the permission level of the application container and sets corresponding access rights for the status information according to the permission level, ensuring that only application containers with corresponding permission levels can perform subsequent query processing. The status information includes at least one of the alarm linkage information and the authentication version information. The status information is used by the application container to determine the status query result of the back-end server according to the target processing required by the interaction request, that is, according to the status query result corresponding to the status information, determine whether there is an abnormal node in the back-end server that cannot perform the target processing. Through permission classification and access control of status information, unauthorized application containers can be effectively prevented from accessing sensitive information, reducing the risk of malicious attacks on the system and improving the overall security. At the same time, the permission control strategy provides the system with more refined access management capabilities, and can flexibly adjust its access rights to status information according to the responsibilities and needs of the application container, ensuring the reasonable use and protection of information.
[0080] Optionally, the permission level of the application container can be determined based on factors such as the type, importance, and security requirements of the application container, ensuring that each container can only access status information that matches its permissions. The backend server determines the permission level of the application container. When the application container needs to query status information, the backend server first verifies the permission level of the application container to ensure that it has the right to access the requested status information. Only after the permission verification is passed, the backend server returns the status query result.
[0081] Optionally, in the application interaction exception handling method provided in the embodiment of the present application, the method also includes: the back-end server determines an update time interval based on the business type; and the back-end server determines status information according to the update time interval.
[0082] It can be understood that the system first analyzes the target processing types required for different business (i.e., interaction requests) types to understand the characteristics of each target processing and the requirements for data reading and writing or identity authentication. Based on the analysis results of the target processing types corresponding to the business types, the back-end server sets a suitable status information update time interval for each business type. The back-end server regularly checks and updates its status information according to the set update time interval. By regularly updating the status information, the system can timely reflect the latest status of the back-end server, improve the real-time and accuracy of status detection, and promptly discover and isolate abnormal nodes. Different business types correspond to different update time intervals, which avoids unnecessary frequent monitoring, reduces the consumption of system resources, and improves resource utilization efficiency.
[0083] Optionally, the update time interval can be a fixed time, such as 1 minute, or a dynamically adjusted parameter, which is optimized according to the real-time requirements of the target processing type corresponding to the business type and the resource status of the system. The update time interval can be dynamically adjusted according to different business type processing scenarios and requirements. For example, during the peak period of business processing or important business processing period, the update time interval can be shortened to ensure real-time status update management; and during the low peak or non-critical period of business processing, the update interval can be appropriately extended to save resources. The update time interval can also be dynamically adjusted according to the current network bandwidth, memory usage and other resource usage conditions to ensure the rational allocation of system resources and avoid performance degradation caused by excessive resource consumption.
[0084] Step S402: When the load balancer detects that the connection with the backend server is normal, it determines a distribution strategy for the interaction request based on the fault signal; and sends the interaction request to a normal node indicated by the distribution strategy.
[0085] It can be understood that when the load balancer detects that the connection with the backend server is normal, the allocation strategy for the interactive request is determined according to the information of the fault signal, and the allocation strategy contains the normal node information for the target processing required to execute the interactive request. Based on the determined allocation strategy, the interactive request is sent to the normal node indicated by the allocation strategy to execute the target processing. By dynamically adjusting the allocation strategy, resources are avoided from being wasted on abnormal nodes, ensuring the efficient use of system resources, improving resource utilization efficiency, as well as the response speed and processing capacity of the system, and enhancing the security and reliability of the system.
[0086] Through the above step S401, the application container receives an interaction request, wherein the interaction request is used to request interaction with the backend server; according to the target processing required by the interaction request, the status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to the load balancer; in step S402, when the load balancer detects that the connection with the backend server is normal, based on the fault signal, it determines the allocation strategy for the interaction request; and sends the interaction request to the normal node indicated by the allocation strategy. The purpose of improving the processing efficiency and processing capacity when the backend server is connected normally but the function is abnormal can be achieved, and the technical effect of ensuring the continuity of interaction is achieved, thereby solving the technical problem of unsatisfactory interaction continuity caused by the normal connection of the backend server but the function is abnormal.
[0087] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation method for processing application services with abnormal interactions. In the implementation method of the present application, the application server is a database server, and a method for processing database interaction anomalies is proposed.
[0088] To prevent the situation where the database has normal external connections but is not readable or writable, the application container (client) that initiates the business (i.e. interaction request) connection will not be able to obtain the data in the database, resulting in the current interaction failing to complete smoothly. The application side will not be able to isolate the abnormal database server in the first time, resulting in a large number of interaction request errors and business impact.
[0089] In common application architectures, the flow of processing an interactive request is as follows: after the application container initiates a request, it connects to the database through an interface, such as JDBC (Java Database Connectivity, which provides a set of common interfaces) and ODBC (Open Database Connectivity, an application programming interface), or directly calls the database to send a DML request (an interactive request) to the database; after receiving the request, the database performs identity authentication based on the credentials of the interactive request and establishes a database connection with the application container; the database server reads, writes, modifies and performs other operations on the data in the database according to the execution plan (and performs the target processing required to execute the interactive request); the database server returns the result to the application container.
[0090] For application scenarios under high-availability architecture, in order to meet high-availability requirements, multiple application containers can be used to carry business. The application containers are load-balanced and distributed to multiple database nodes according to the business volume, and can access the database through the database nodes to perform DML operations. Figure 5 is a structural diagram of an application interaction exception handling method provided in an embodiment of the present application, such as Figure 5 As shown in the figure, under the high-availability architecture, the flow process of the main data flow is: terminal->Internet->F5 (an application delivery controller responsible for receiving requests from the Internet)->SLB (load balancer)->PAAS group (used to support the operation and management of application containers)->SLB->database group.
[0091] In the case of database downtime and inaccessibility, SLB will automatically perform redundancy and failover, and can automatically redirect traffic to other normally running servers when a database server fails, thereby ensuring high availability of the system. However, for scenarios where database connectivity is normal and database read and write are abnormal, SLB cannot achieve failover. For example, if some data files are OFFLINE, DML operations involving related data files will report errors. In order to solve the above problems, automatically isolate faulty nodes, achieve failover, and ensure business continuity to the greatest extent, taking the data file OFFLINE scenario as an example, the database interaction exception handling method of the embodiment of the present application is introduced, and the specific steps are as follows.
[0092] First, the database node creates an alarm linkage table A, which is created in the system tablespace. This is because the data file in the system tablespace is OFFLINE, and the database will automatically go down.
[0093] As a network portal, the application container receives interaction requests from the load balancer. The interaction request is sent to the database server through the communication between the application container and the database server. After receiving the request, the application container parses the content of the request to determine the target processing that the database server needs to perform, such as data read and write processing. According to the target processing, the status of the database server is queried to obtain the status query result of the database server. By checking the status of the database server, the execution strategy of the target processing request can be determined to avoid business interruption caused by abnormalities of some sub-servers of the database server, thereby ensuring the reliability and continuity of business execution.
[0094] The database node creates an alarm linkage table A. After receiving the target processing of the interaction request, the application container will query the alarm linkage information of the database through the alarm linkage table A. The alarm linkage information stores the data file status corresponding to all nodes in the database server, as well as the mark information related to the status. For example, if the status is normal, it can be marked as 0, and if the status is abnormal, it can be marked as 1. If the data file status is marked as an abnormal state in the alarm linkage information, it means that the query result is that there is no abnormal node in the database server that cannot execute the target processing (i.e., reading and writing data). If the data file status is marked as an abnormal state in the alarm linkage information, it means that the query result is that there is an abnormal node in the database server that cannot execute the target processing (i.e., reading and writing data). By querying the alarm linkage information in real time, the system can intelligently identify the abnormal nodes in the database server, so as to make decisions before the data read and write request is executed, avoid access to abnormal database nodes, and improve the security and success rate of interaction.
[0095] Secondly, the alarm linkage table A grants query permissions to the user corresponding to the application container.
[0096] The alarm linkage table A of the database server determines the permission level of the application container, and sets corresponding access rights for the status information according to the permission level, ensuring that only application containers with corresponding permission levels can perform subsequent query processing. The status information of the database server is alarm linkage information. The status information is used by the application container to determine the status query result of the database server according to the target processing required by the interaction request, that is, according to the status query result corresponding to the status information, determine whether there are abnormal nodes in the database server that cannot perform the target processing. Through permission classification and access control of status information, unauthorized application containers can be effectively prevented from accessing sensitive information, reducing the risk of malicious attacks on the system and improving overall security. At the same time, the permission control strategy provides the system with more refined access management capabilities, and can flexibly adjust its access rights to status information according to the responsibilities and needs of the application container, ensuring the reasonable use and protection of information.
[0097] The permission level of the application container can be determined based on factors such as the type, importance, and security requirements of the application container, ensuring that each container can only access status information that matches its permissions. The database server determines the permission level of the application container. When the application container needs to query status information, the database server first verifies the permission level of the application container to ensure that it has the right to access the requested status information. Only after the permission verification is passed, the database server returns the status query result.
[0098] Then, create a scheduled job to query the status of data files in each table space of the database, which is executed once every minute. The data file status is updated to Table A, with a normal status recorded as 0 and an abnormal status recorded as 1.
[0099] After receiving the target processing of the interaction request, the application container will query the alarm linkage information of the database through the alarm linkage table A. The alarm linkage information stores the data file status corresponding to all nodes in the database server and the marking information related to the status. For example, if the status is normal, it can be marked as 0, and if the status is abnormal, it can be marked as 1.
[0100] In order to implement the update of the alarm linkage information in the alarm linkage table A, the system will create a scheduled job to query the status of all data files in each table space of the database according to the update time interval. First, analyze the target processing types required by different business (i.e., interactive requests) types to understand the characteristics of each target processing and the requirements for data reading and writing or identity authentication. Based on the analysis results of the target processing types corresponding to the business types, the database server sets a suitable status information update time interval for each business type. The database server regularly checks and updates its status information according to the set update time interval. By regularly updating the status information, the system can timely reflect the latest status of the database server, improve the real-time and accuracy of status detection, and timely discover and isolate abnormal nodes. Different business types correspond to different update time intervals, which avoids unnecessary frequent monitoring, reduces the consumption of system resources, and improves resource utilization efficiency.
[0101] The above update time interval can be a fixed time, such as 1 minute, or a dynamically adjusted parameter, which is optimized according to the real-time requirements of the target processing type corresponding to the business type and the resource status of the system. The update time interval can be dynamically adjusted according to different business type processing scenarios and requirements. For example, during the peak period of business processing or important business processing period, the update time interval can be shortened to ensure real-time status update management; and during the low peak or non-critical period of business processing, the update interval can be appropriately extended to save resources. The update time interval can also be dynamically adjusted according to the current network bandwidth, memory usage and other resource usage conditions to ensure the reasonable allocation of system resources and avoid performance degradation caused by excessive resource consumption.
[0102] Next, the application container deploys query strategy S. Before connecting to the database to issue DML requirements, strategy S is triggered to query whether the database status is normal. If the return result is 0, the DML request is executed. If the return result is 1, a fault signal is sent to the SLB, triggering the SLB failover mechanism to transfer the current business request to other database nodes in normal status.
[0103] The application container receives the DML interaction request. The interaction request is parsed to determine the target processing that the database server needs to perform. The application container deploys the query strategy S. According to the target processing, before sending the DML request to the database server, the strategy S will be triggered to query the status of the database server and obtain the status query result of the database server. If the return result is 0, it means that the status query result of the database server is that there is no abnormal node in the database server that cannot perform the target processing, and the DML request will continue to be executed. If the return result is 1, it means that the status query result of the database server is that there is an abnormal node in the database server that cannot perform the target processing, and a fault signal is sent to the load balancer. After receiving the fault signal, the load balancer executes the failover mechanism, which is specifically manifested as follows: when the load balancer detects that the connection with the database server is normal, according to the information of the fault signal, the allocation strategy for the interaction request is determined, and the allocation strategy contains the normal node information of the target processing required to perform the interaction request. Based on the determined allocation strategy, the interaction request is sent to the normal node indicated by the allocation strategy to perform the target processing to avoid affecting the normal operation of the business. The load balancer responds to fault signals from the application container in real time, quickly identifies and handles abnormal nodes, and avoids long-term impact on business continuity. At the same time, the automated anomaly detection and response mechanism reduces dependence on operation and maintenance personnel. When the system detects an anomaly, it can automatically trigger the emergency handling process, reducing the frequency of manual intervention and improving operation and maintenance efficiency.
[0104] The above fault signal may contain the identification information of the abnormal node and the target processing information that needs to be executed. By checking the status of the database server in advance, it is possible to avoid sending requests to abnormal nodes, prevent business operation failures or user experience degradation, and ensure business continuity and system stability.
[0105] If the status query result of the database server is that there are abnormal nodes in the database server that cannot perform the target processing, the total number of abnormal nodes is determined. If the total number of abnormal nodes is less than the predetermined threshold, the main server of the current database server continues to receive the interaction request of the application container and perform subsequent processing. If the total number of abnormal nodes is greater than or equal to the predetermined threshold, the system will generate a master-slave switching instruction and send this instruction as a fault signal to the load balancer. After receiving the master-slave switching instruction, the load balancer will immediately adjust its allocation strategy and switch the identifier of the normal node from the current main server to the backup server, and subsequent interaction requests will be directed to the backup server. By triggering the master-slave switching when the number of abnormal nodes reaches the preset threshold, the system can effectively avoid business interruptions caused by single-point abnormalities, improve the stability and high availability of the entire system, and at the same time, the master-slave switching mechanism can quickly direct business requests to healthy backup servers, reducing the impact time on business and services due to the abnormality of the main server.
[0106] When the total number of abnormal nodes in the database server is greater than or equal to the predetermined threshold, it means that the stability of the current master server is affected and the system may not be able to perform subsequent work normally, so it is necessary to start the master-slave switching mechanism. After determining to start the master-slave switching mechanism, the system will generate a master-slave switching instruction and send this instruction as a fault signal to the load balancer. The fault signal not only contains the master-slave switching instruction, but also may include detailed information about the abnormal node, so that the load balancer can accurately understand the current fault condition. After receiving the master-slave switching instruction, the load balancer will immediately adjust its allocation strategy and switch the normal node identifier from the current master server to the backup server, and subsequent interaction requests will be sent to the backup server. The above operation realizes the automatic isolation of the abnormal master server, and after the abnormality of the master server is isolated, the operation and maintenance team can focus on fixing the problem of the master server. Once the master server returns to normal, it can be reconfigured as a backup server or master server.
[0107] Finally, after the failover is triggered, a monitoring alarm is sent to the corresponding database operation and maintenance personnel to repair the faulty database node. The repaired database node will automatically join the database group for use after the query status is normal.
[0108] The database interaction exception handling method proposed in the embodiment of the present application can ensure business continuity to the greatest extent without users noticing, and solves the failure scenario caused by the database being unable to go down while the application is still connected.
[0109] The above-mentioned application interaction anomaly handling method achieves the following effects: by constructing an alarm linkage table to record and update the alarm linkage information of the database in real time, abnormal database nodes can be discovered and isolated in time, thereby improving the real-time and accuracy of database status detection; through the failover mechanism of the load balancer, automatic transfer and isolation of abnormal database interaction nodes are achieved, thus avoiding the waste of resources on abnormal nodes, ensuring the efficient use of system resources, improving resource utilization efficiency, as well as the system's response speed and processing capabilities, and enhancing the system's security and reliability.
[0110] The application interaction exception handling method provided by the embodiment of the present application receives an interaction request, wherein the interaction request is used to request interaction with a backend server; determines the status query result of the backend server according to the target processing required by the interaction request; sends a fault signal to the load balancer when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; and sends the interaction request to the normal node indicated by the allocation strategy. The problem of unsatisfactory interaction stability caused by abnormal function of the backend server is solved. The purpose of improving the processing efficiency and processing capacity when the backend server is connected normally but the function is abnormal is achieved, thereby realizing the technical effect of ensuring the continuity of interaction.
[0111] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0112] Example 2
[0113] The embodiment of the present application also provides an application interaction exception processing device. It should be noted that the application interaction exception processing device of the embodiment of the present application can be used to execute the application interaction exception processing method provided by the embodiment of the present application. The application interaction exception processing device provided by the embodiment of the present application is introduced below.
[0114] According to an embodiment of the present application, a device for implementing the above-mentioned application interaction exception handling method is also provided. Figure 6 is a first schematic diagram of an application interaction exception handling device provided according to an embodiment of the present application, such as Figure 6As shown, the device includes: an interaction request receiving module 601, used to receive an interaction request, wherein the interaction request is used to request interaction with a back-end server; a first query result determination module 602, connected to the interaction request receiving module 601, used to determine a status query result of the back-end server according to the target processing required by the interaction request; an allocation strategy determination module 603, connected to the first query result determination module 602, used to send a fault signal to a load balancer when the status query result indicates that there is an abnormal node in the back-end server that cannot execute the target processing, wherein the load balancer is used to determine an allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the back-end server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
[0115] The application interaction exception processing device provided in the embodiment of the present application is used to receive the interaction request through the interaction request receiving module 601, wherein the interaction request is used to request interaction with the back-end server; the first query result determination module 602 is connected to the interaction request receiving module 601, and is used to determine the status query result of the back-end server according to the target processing required by the interaction request; the allocation strategy determination module 603 is connected to the first query result determination module 602, and is used to send a fault signal to the load balancer when the status query result is that there is an abnormal node in the back-end server that cannot perform the target processing, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the back-end server is normal; and send the interaction request to the normal node indicated by the allocation strategy. The problem of unsatisfactory interaction continuity caused by the normal connection of the back-end server but abnormal function in the related art is solved. Then, the effect of ensuring the interaction continuity is achieved by improving the processing efficiency and processing capacity of the interaction request when the back-end server is connected normally but the function is abnormal.
[0116] Optionally, in the application interaction exception handling device provided in the embodiment of the present application, optionally, the query result determination module includes: a query module, used to query and process the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the back-end server respectively; a first abnormal node determination module, used to determine that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing when there is a status abnormality record in the alarm linkage information that the data file status is abnormal.
[0117] Optionally, in the application interaction exception handling device provided in the embodiment of the present application, the query result determination module includes: a first authentication protocol determination module, used to determine the first authentication protocol version based on the interaction request; a second authentication protocol determination module, used to obtain the second authentication protocol version used by all nodes in the back-end server respectively; a second abnormal node determination module, used to determine that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing when the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the back-end server.
[0118] Optionally, in the application interaction exception handling device provided in the embodiment of the present application, the device also includes: an abnormal node total amount determination module, used to determine the total number of abnormal nodes in the back-end server that cannot perform target processing; a first fault signal sending module, used to send a master-slave switching instruction as a fault signal to the load balancer when the total number of abnormal nodes is greater than or equal to a predetermined threshold, wherein the normal node indicated by the allocation strategy belongs to the backup server.
[0119] It should be noted that the above-mentioned interaction request receiving module 601, the first query result determination module 602, and the allocation strategy determination module 603 correspond to steps S201 to S203 in Example 1, and the two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0120] According to an embodiment of the present application, a device for implementing the above-mentioned application interaction exception handling method is also provided. Figure 7 is a second schematic diagram of the application interaction exception handling device provided according to an embodiment of the present application, such as Figure 7 As shown, the device includes: a fault signal acquisition module 701, used to acquire a fault signal, wherein the fault signal is an interaction request received by an application container for requesting interaction with a backend server; determining a status query result of the backend server according to target processing required by the interaction request; sent by the application container when the status query result indicates that there is an abnormal node in the backend server that cannot execute the target processing; a first allocation strategy determination module 702, connected to the fault signal acquisition module 701, used to determine an allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the backend server is normal; a sending module 703, connected to the first allocation strategy determination module 702, used to send the interaction request to a normal node indicated by the allocation strategy.
[0121] The application interaction exception processing device provided by the embodiment of the present application is used to obtain a fault signal through a fault signal acquisition module 701, wherein the fault signal is an interaction request received by the application container for requesting interaction with the backend server; according to the target processing required by the interaction request, the status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, it is sent by the application container; the first allocation strategy determination module 702 is connected to the fault signal acquisition module 701, and is used to determine the allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the backend server is normal; the sending module 703 is connected to the first allocation strategy determination module 702, and is used to send the interaction request to the normal node indicated by the allocation strategy. The problem of unsatisfactory interaction continuity caused by the normal connection of the backend server but abnormal function in the related art is solved. Then, the effect of ensuring the interaction continuity is achieved by improving the processing efficiency and processing capacity of the interaction request when the backend server is connected normally but the function is abnormal.
[0122] It should be noted that the above-mentioned fault signal acquisition module 701, the first allocation strategy determination module 702, and the sending module 703 correspond to steps S301 to S303 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (for example, the memory 104) and processed by one or more processors (for example, processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0123] According to an embodiment of the present application, a device for implementing the above-mentioned application interaction exception handling method is also provided. Figure 8 is a third schematic diagram of the application interaction exception handling device provided according to an embodiment of the present application, such as Figure 8 As shown, the device includes: a second fault signal sending module 801, which is used for the application container to receive an interaction request, wherein the interaction request is used to request interaction with a back-end server; determining a status query result of the back-end server according to the target processing required by the interaction request; sending a fault signal to the load balancer when the status query result indicates that there is an abnormal node in the back-end server that cannot execute the target processing; a second allocation strategy determination module 802, which is connected to the second fault signal sending module 801, and is used for the load balancer to determine an allocation strategy for the interaction request based on the fault signal when it is detected that the connection with the back-end server is normal; and sending the interaction request to the normal node indicated by the allocation strategy.
[0124] The application interaction exception processing device provided in the embodiment of the present application is used for the application container to receive the interaction request through the second fault signal sending module 801, wherein the interaction request is used to request interaction with the backend server; according to the target processing required by the interaction request, the status query result of the backend server is determined; when the status query result indicates that there is an abnormal node in the backend server that cannot perform the target processing, a fault signal is sent to the load balancer; the second allocation strategy determination module 802 is connected to the second fault signal sending module 801, and is used for the load balancer to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; the interaction request is sent to the normal node indicated by the allocation strategy. The problem of unsatisfactory interaction continuity caused by the normal connection of the backend server but abnormal function in the related art is solved. Then, the effect of ensuring the interaction continuity is achieved by improving the processing efficiency and processing capacity of the interaction request when the backend server is connected normally but the function is abnormal.
[0125] Optionally, in the application interaction exception handling device provided in the embodiment of the present application, the device also includes: a second query result determination module, which is used for the back-end server to set the access rights of the status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used for the application container to process the target required by the interaction request and determine the status query result of the back-end server.
[0126] Optionally, in the application interaction exception handling device provided in the embodiment of the present application, the device also includes: a time interval determination module, which is used for the back-end server to determine the update time interval based on the business type; and a status information determination module, which is used for the back-end server to determine the status information according to the update time interval.
[0127] It should be noted that the second fault signal sending module 801 and the second allocation strategy determination module 802 correspond to steps S401 to S402 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0128] Example 3
[0129] An embodiment of the present application may provide an electronic device, Fig. 9is a structural block diagram of an electronic device according to an embodiment of the present application. Fig. 9 As shown, the electronic device may include: one or more ( Fig. 9 (only one is shown) processor 902, memory 904, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0130] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receive an interaction request, wherein the interaction request is used to request interaction with the back-end server; determine the status query result of the back-end server according to the target processing required by the interaction request; when the status query result is that there is an abnormal node in the back-end server that cannot perform the target processing, send a fault signal to the load balancer, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when it detects that the connection with the back-end server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
[0132] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: query and process the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the back-end server; when there is a status abnormality record indicating that the data file status is abnormal in the alarm linkage information, it is determined that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0133] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: determine the first authentication protocol version based on the interaction request; obtain the second authentication protocol version used by all nodes in the back-end server respectively; when the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the back-end server, determine that the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing.
[0134] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: determine the total number of abnormal nodes in the back-end server that cannot perform target processing; when the total number of abnormal nodes is greater than or equal to a predetermined threshold, send the master-slave switching instruction as a fault signal to the load balancer, wherein the normal node indicated by the allocation strategy belongs to the backup server.
[0135] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: obtain a fault signal, wherein the fault signal is an interaction request received by the application container for requesting interaction with the back-end server; determine the status query result of the back-end server according to the target processing required by the interaction request; when the status query result indicates that there is an abnormal node in the back-end server that cannot perform the target processing, it is sent by the application container; when it is detected that the connection with the back-end server is normal, determine the allocation strategy for the interaction request based on the fault signal; and send the interaction request to the normal node indicated by the allocation strategy.
[0136] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: the application container receives an interaction request, wherein the interaction request is used to request interaction with the back-end server; determines the status query result of the back-end server according to the target processing required by the interaction request; when the status query result indicates that there is an abnormal node in the back-end server that cannot perform the target processing, sends a fault signal to the load balancer; when the load balancer detects that the connection with the back-end server is normal, based on the fault signal, determines the allocation strategy for the interaction request; and sends the interaction request to the normal node indicated by the allocation strategy.
[0137] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: the back-end server sets the access rights of the status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used by the application container to process the target required by the interaction request and determine the status query result of the back-end server.
[0138] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: the back-end server determines the update time interval based on the business type; the back-end server determines the status information according to the update time interval.
[0139] By adopting the embodiment of the present application, a scheme for an application interaction exception processing method is provided. By receiving an interaction request, wherein the interaction request is used to request interaction with a back-end server; determining the status query result of the back-end server according to the target processing required by the interaction request; when the status query result is that there is an abnormal node in the back-end server that cannot perform the target processing, sending a fault signal to the load balancer, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the back-end server is normal; and sending the interaction request to the normal node indicated by the allocation strategy. Thereby achieving the purpose of improving the processing efficiency and processing capacity when the back-end server is connected normally but the function is abnormal, thereby solving the technical problem of unsatisfactory interaction stability caused by the abnormal function of the back-end server.
[0140] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations are shown.
[0141] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0142] Example 4
[0143] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the application interaction exception handling method provided in the first embodiment.
[0144] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0145] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the application interaction exception handling method.
[0146] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0147] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0148] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above-mentioned units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0149] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0151] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0152] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for handling application interaction exceptions, characterized in that: include: receiving an interaction request, wherein the interaction request is used to request interaction with a backend server; Determine the status query result of the backend server according to the target processing required by the interactive request; When the status query result is that there is an abnormal node in the backend server that cannot execute the target processing, a fault signal is sent to the load balancer, wherein the load balancer is used to determine an allocation strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
2. The method according to claim 1, characterized in that: The target processing is data reading and writing processing, the back-end server is a database server, and the state query result of the back-end server is determined according to the target processing required by the interactive request, including: Perform query processing on the alarm linkage information indicating the target processing, wherein the alarm linkage information includes the data file status corresponding to all nodes in the backend server respectively; When there is a status abnormality record indicating that the data file status is abnormal in the alarm linkage information, it is determined that the status query result is that there is an abnormal node in the backend server that cannot execute the target processing.
3. The method according to claim 1, characterized in that The target processing is identity authentication processing, the backend server is an identity authentication server, and the determining of the status query result of the backend server according to the target processing required by the interaction request includes: Based on the interaction request, determining a first authentication protocol version; Obtaining a second authentication protocol version used by all nodes in the backend server respectively; In the case where the first authentication protocol version is incompatible with the second authentication protocol version used by any node in the backend server, it is determined that the status query result is that there is an abnormal node in the backend server that cannot execute the target processing.
4. The method according to claim 1, characterized in that: The back-end server has a backup server, and the method further includes: Determine the total number of abnormal nodes in the backend server that cannot execute the target processing; When the total number of abnormal nodes is greater than or equal to a predetermined threshold, a primary-backup switching instruction is sent to the load balancer as the fault signal, wherein the normal node indicated by the allocation strategy belongs to the backup server.
5. A method for handling application interaction exceptions, characterized in that: include: Acquire a fault signal, wherein the fault signal is received by the application container for requesting interaction with the backend server; determine the status query result of the backend server according to the target processing required by the interaction request; and is sent by the application container when the status query result indicates that there is an abnormal node in the backend server that cannot execute the target processing; In the case where it is detected that the connection with the backend server is normal, determining a distribution strategy for the interaction request based on the fault signal; The interaction request is sent to a normal node indicated by the allocation strategy.
6. A method for handling application interaction exceptions, characterized in that: include: The application container receives an interaction request, wherein the interaction request is used to request interaction with a backend server; determines a status query result of the backend server according to a target processing required by the interaction request; and sends a fault signal to a load balancer when the status query result indicates that there is an abnormal node in the backend server that cannot execute the target processing; The load balancer determines a distribution strategy for the interaction request based on the fault signal when detecting that the connection with the backend server is normal; The interaction request is sent to a normal node indicated by the allocation strategy.
7. The method according to claim 6, characterized in that The method further comprises: The back-end server sets access rights for status information according to the permission level of the application container, wherein the status information includes at least one of the following: alarm linkage information, authentication version information, and the status information is used by the application container to process the target required by the interaction request and determine the status query result of the back-end server.
8. The method according to claim 7, characterized in that The method further comprises: The back-end server determines the update time interval based on the service type; The backend server determines the status information according to the update time interval.
9. An application interaction exception handling device, characterized in that: include: An interaction request receiving module, used for receiving an interaction request, wherein the interaction request is used for requesting interaction with a backend server; A first query result determination module, configured to determine a status query result of the backend server according to target processing required by the interaction request; An allocation strategy determination module is used to send a fault signal to the load balancer when the status query result is that there is an abnormal node in the back-end server that cannot execute the target processing, wherein the load balancer is used to determine the allocation strategy for the interaction request based on the fault signal when detecting that the connection with the back-end server is normal; and send the interaction request to the normal node indicated by the allocation strategy.
10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 8 when running.