Application process processing method and device, computer equipment, readable storage medium and program product
By obtaining server interface information and determining the status of the service copy, the master server and application process startup is achieved without intrusion, solving the problems of strong invasiveness and complex handover in the existing technology, and achieving an efficient and reliable master-support high-availability mode.
Patent Information
- Application Number
- CN202411779746.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-21
AI Technical Summary
When the existing technology realizes the high availability mode of primary and secondary, it requires intrusion into application code, which is costly to change, and it is difficult to seamlessly switch between primary and secondary servers.
The server's interface information is obtained through multiple master selection tools, and the business replica status of each server is determined, so as to determine the main server without intrusion, and the application process startup command is sent through the master selection tool of the master selection tool to achieve seamless application startup and master-slip switching.
It realizes a non-invasive master-slip high-availability mode, reduces implementation costs and complexity, ensures the security and reliability of the application, and is suitable for more application scenarios.
Smart Images

Figure CN119668948A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for processing an application process. Background Art
[0002] The system high availability (High Availability, HA) design mode is used to ensure that the system can still maintain availability when a failure occurs. Among them, the active-standby mode is a common high availability design mode. In this mode, the primary server (Active) handles all requests, while the backup server (Passive) is on standby to take over its work when the primary server fails.
[0003] In the related art, the master selection tool provided by the system is used to execute the master-standby mode, and the actual business processing function of the application is modified according to the master selection tool, so that when the actual business processing function is started, the master selection tool executes the master selection process. However, this method requires intrusion into the application code, and the modification cost is high. Summary of the invention
[0004] Based on this, it is necessary to provide a non-intrusive application process processing method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.
[0005] In a first aspect, the present application provides a method for processing an application process, comprising:
[0006] In response to receiving a startup instruction of an application program, interface information of multiple servers is acquired through multiple master selection tools, wherein the master selection tools correspond to the servers one by one;
[0007] Determine the business copy status of each of the servers according to the interface information, and determine the master server from the multiple servers according to the business copy status;
[0008] An application process start command is sent through a master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
[0009] In one embodiment, determining the service copy status of each server according to the interface information, and determining the master server from the multiple servers according to the service copy status, includes:
[0010] Determine the survival status and the ready status of the service copy corresponding to each of the servers according to the interface information;
[0011] According to the survival state and the ready state, it is determined that the server corresponding to the surviving and ready business copy is the primary server.
[0012] In one of the embodiments, after determining the survival state and the ready state of the service copy corresponding to each of the servers, the method further includes:
[0013] According to the survival state and the ready state, it is determined that the server corresponding to the surviving but not ready business copy is the secondary server.
[0014] In one embodiment, the method further comprises:
[0015] When the resource object created by the business copy of the primary server does not exist or has expired, using the primary selection tool of the secondary server to obtain the interface information of the secondary server;
[0016] A new primary server is determined from the secondary servers according to the interface information of the secondary servers.
[0017] In one embodiment, the method further comprises:
[0018] Obtaining information about the proxy node address of the master server through the master selection tool of the master server;
[0019] When the proxy node address does not exist, the application process of the main server is controlled to exit.
[0020] In one embodiment, the setting method of the master selection tool includes:
[0021] Obtaining a server corresponding to the master selection tool;
[0022] The application process start command corresponding to the server is used as a parameter of the master selection tool and is passed into the master selection tool, so that the master selection tool sends the application process start command when the business copy status of the server meets the conditions.
[0023] In a second aspect, the present application also provides a device for processing an application process, including:
[0024] an acquisition module, configured to, in response to receiving a startup instruction of an application program, acquire interface information of a plurality of servers through a plurality of master selection tools, wherein the master selection tools correspond to the servers one by one;
[0025] A determination module, configured to determine a business copy status of each of the servers according to the interface information, and determine a master server from the multiple servers according to the business copy status;
[0026] The sending module is used to send an application process start command through a master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
[0027] In one embodiment, the determining module is further configured to:
[0028] Determine the survival status and the ready status of the service copy corresponding to each of the servers according to the interface information;
[0029] According to the survival state and the ready state, it is determined that the server corresponding to the surviving and ready business copy is the primary server.
[0030] In one embodiment, the device is further used for:
[0031] According to the survival state and the ready state, it is determined that the server corresponding to the surviving but not ready business copy is the secondary server.
[0032] In one embodiment, the device is further used for:
[0033] When the resource object created by the business copy of the primary server does not exist or has expired, using the primary selection tool of the secondary server to obtain the interface information of the secondary server;
[0034] A new primary server is determined from the secondary servers according to the interface information of the secondary servers.
[0035] In one embodiment, the device is further used for:
[0036] Obtaining information about the proxy node address of the master server through the master selection tool of the master server;
[0037] When the proxy node address does not exist, the application process of the main server is controlled to exit.
[0038] In one embodiment, the device further comprises a setting module of the master selection tool, and the setting module of the master selection tool is further used for:
[0039] Obtaining a server corresponding to the master selection tool;
[0040] The application process start command corresponding to the server is used as a parameter of the master selection tool and is passed into the master selection tool, so that the master selection tool sends the application process start command when the business copy status of the server meets the conditions.
[0041] In a third aspect, an embodiment of the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0042] In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0043] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0044] The above-mentioned application process processing method, device, computer equipment, computer-readable storage medium and computer program product receive the startup instruction of the application program, obtain the interface information of the corresponding multiple servers through multiple master selection tools, determine the business copy status of the server according to the interface information, determine the main server from the multiple servers, and send the application process startup command through the master selection tool of the main server, so that the main server starts the application process of the application program. In the master selection process, the main server is determined by the interface information obtained by the master selection tool, without intruding the application code, and when starting the application, the application process startup command is sent through the master selection tool, and there is no need to change the application code. The original business process startup instruction is still used and triggered by the master selection tool. There is no need to introduce the system's master selection tool library to modify the application code to achieve the master-slave high availability mode, which is suitable for more application scenarios, reduces the cost and complexity of the master-slave mode implementation, and the application code and application process related information are not directly exposed, effectively ensuring the security and reliability of the application when it is running. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of a process flow of a method for processing an application in an embodiment;
[0047] Figure 2 is a flowchart of a method for processing an application in another embodiment;
[0048] Figure 3 is a flowchart of a method for processing an application in another embodiment;
[0049] Figure 4 is a flowchart of a method for processing an application in another embodiment;
[0050] Figure 5 is a flowchart of a method for processing an application in another embodiment;
[0051] Figure 6 is a structural block diagram of a processing device for an application in one embodiment;
[0052] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] In one embodiment, Figure 1 As shown, a method for processing an application process is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0055] Step S110, in response to receiving a startup instruction of an application, obtaining interface information of multiple servers through multiple master selection tools, wherein the master selection tools correspond to the servers one by one;
[0056] Exemplarily, the application may include an application designed, built and run in a cloud environment. When the application needs to be run, a startup instruction of the application is sent, wherein the startup instruction may be automatically triggered by the application or sent to a related account, which may be determined according to the actual application.
[0057] Optionally, the system includes multiple servers, each server corresponds to a leader election tool, and multiple servers correspond to multiple leader election tools. In one example, the leader election tool can be implemented by encapsulating a leader election mode (ie, Leader Election).
[0058] Exemplarily, the interface information of multiple servers is obtained through the master selection tool. In one example, the master selection tool instance preemptively creates resource objects according to the configured resource object information, and the server sends the business copy information of the created resource object to the master selection tool through a preset interface.
[0059] Step S120, determining the business copy status of each of the servers according to the interface information, and determining a master server from the multiple servers according to the business copy status;
[0060] Exemplarily, the business copy status of each server is determined according to the interface information. In one example, the business copy status of the server that successfully creates the resource object is different from the business copy status of the server that fails to successfully create the resource object.
[0061] Optionally, the server corresponding to the business copy of the resource object that is successfully created can be determined according to the business copy state, and the server is determined as the main server. In one example, after determining the main server, an expiration time is set for the resource object, and the expiration time of the resource object is refreshed within a preset interval period.
[0062] Step S130: sending an application process start command through a master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
[0063] Optionally, an application process start command is sent through a master selection tool corresponding to the master server, and the master server starts the application process of the application program, so that the application program can provide corresponding services through the master server.
[0064] In one example, the actual application process start command may be passed into the master selection tool as a parameter of the master selection tool, so as to trigger the application process start command after the master server is determined.
[0065] In the disclosed embodiment, upon receiving the application startup instruction, multiple master selection tools are used to obtain the interface information of multiple corresponding servers, and the business copy status of the server is determined based on the interface information, and the master server is determined from the multiple servers, and the application process startup command is sent through the master selection tool of the master server, so that the master server starts the application process of the application. In the master selection process, the master server is determined through the interface information obtained by the master selection tool, without intruding the application code, and when starting the application, the application process startup command is sent through the master selection tool, and there is no need to change the application code. The original business process startup instruction is still used and triggered by the master selection tool. There is no need to introduce the system's master selection tool library to modify the application code to achieve the master-standby high availability mode, which is suitable for more application scenarios, reduces the cost and complexity of the master-standby mode implementation, and the application code and application process related information are not directly exposed, effectively ensuring the security and reliability of the application when it is running.
[0066] In one embodiment, determining the service copy status of each server according to the interface information, and determining the master server from the multiple servers according to the service copy status, includes:
[0067] Determine the survival status and the ready status of the service copy corresponding to each of the servers according to the interface information;
[0068] According to the survival state and the ready state, it is determined that the server corresponding to the surviving and ready business copy is the primary server.
[0069] Exemplarily, the survival state and the ready state of the business copy corresponding to each server can be determined based on the interface information. In one example, the survival state of the business copy corresponds to whether the server is running an application process. If it is running, it means that the server can run the application; the ready state of the business copy corresponds to whether the server has preempted a resource object. If it is ready, it means that the server has successfully preempted and created a resource object.
[0070] Optionally, if the status of the business copy corresponds to survived and ready, it can be considered that the server corresponding to the business copy has successfully created the resource object, and the server is confirmed as the primary server, running the application to implement the corresponding business function.
[0071] The embodiment of the present disclosure determines the survival status and readiness status of the business copy corresponding to each server based on the interface information, so that the business copy of the resource object can be successfully created based on the survival status and readiness status, and the master server can be determined. The master selection process is implemented through the interface information, which is suitable for more application scenarios.
[0072] In one embodiment, after determining the survival state and the ready state of the service copy corresponding to each of the servers, the method further includes:
[0073] According to the survival state and the ready state, it is determined that the server corresponding to the surviving but not ready business copy is the secondary server.
[0074] Exemplarily, if the status corresponding to the business copy is alive but not ready, it can be considered that the business copy of the corresponding server can run successfully at this time, but no resource object is created, and it can be used as a secondary server, that is, a backup server.
[0075] In one example, the master election tool of the secondary server can monitor the status of the resource object in real time and perform corresponding actions according to the monitoring results.
[0076] In the disclosed embodiment, the server corresponding to the surviving but not ready business copy is determined as the secondary server, so that the server capable of running the application process can be determined as the backup server, i.e., the secondary server, realizing the active-standby mode of the system and ensuring the high availability of the system cluster resources.
[0077] In one embodiment, the method further comprises:
[0078] When the resource object created by the business copy of the primary server does not exist or has expired, using the primary selection tool of the secondary server to obtain the interface information of the secondary server;
[0079] A new primary server is determined from the secondary servers according to the interface information of the secondary servers.
[0080] For example, the secondary server can monitor the status of the resource object in real time. If the resource object exists and has not expired, it can be considered that the primary server is running normally and continue to monitor. If the resource object does not exist or has expired, it means that the resource object created by the business copy of the primary server is invalid, the primary server is down, and cannot continue to perform related functions, and a new primary server needs to be re-determined.
[0081] Optionally, the master selection tool of the secondary server executes the master selection process to preemptively create the resource object. The master selection tool of the secondary server obtains the interface information of the secondary server, determines the business copy status of the secondary server according to the interface information, thereby determining the secondary server corresponding to the business copy of the resource object that has been successfully created, and determines the secondary server as the new primary server.
[0082] In one example, after the new primary server is determined, the primary selection tool of the new primary server sends an application process start instruction so that the new primary server starts the application process of the application program.
[0083] In the embodiment of the present disclosure, when the resource object created by the business copy of the primary server does not exist or has expired, a new primary server is re-determined from the secondary server, and the status of the resource object created by the business copy of the primary server is monitored in real time, thereby achieving a master-slave high-availability mode in which the secondary server takes over all work when the primary server fails.
[0084] In one embodiment, the method further comprises:
[0085] Obtaining information about the proxy node address of the master server through the master selection tool of the master server;
[0086] When the proxy node address does not exist, the application process of the main server is controlled to exit.
[0087] Exemplarily, the master selection tool of the master server monitors the agent node address of the master server in real time. Since the master server is not exposed to the outside, it is necessary to detect the agent node address through the master selection tool to avoid failure to discover the abnormality of the master server in time.
[0088] In an example, if the Kubelet process of the primary server exits abnormally, the business replica example on the primary server is still running. At this time, it is necessary to judge based on the information of the proxy node address. That is, when the Kubelet process exits abnormally, there is no accessible address at the Kubelet level.
[0089] Optionally, if the proxy node address does not exist, it can be considered that an abnormality exists at this time, and the application process of the control main server exits.
[0090] The disclosed embodiment can also monitor the proxy node address of the main server in real time through the master selection tool. When the proxy node address does not exist, the main server application process is controlled to exit, thereby avoiding the problem that the main server node is unavailable but the business copy continues to run, resulting in other servers being unable to become new main servers. According to the proxy node address situation, abnormal problems of the proxy process of the main server are discovered in time and automatically exited, releasing the main server identity. Other servers can replace the server to provide services, ensuring the normal operation of the application, and being suitable for more application scenarios.
[0091] In one embodiment, the setting method of the master selection tool includes:
[0092] Obtaining a server corresponding to the master selection tool;
[0093] The application process start command corresponding to the server is used as a parameter of the master selection tool and is passed into the master selection tool, so that the master selection tool sends the application process start command when the business copy status of the server meets the conditions.
[0094] Exemplarily, when setting the master selection tool, the parameters of the master selection tool are adjusted according to the server corresponding to the master selection tool.
[0095] Optionally, the server corresponding to the master selection tool is determined, and the application process start command corresponding to the server is passed into the master selection tool as a parameter of the master selection tool. In one example, the master selection tool can be used as a pre-start command of the application program.
[0096] In one example, an application process start command is used as a parameter of a master selection tool. When the business copy status of the server meets the conditions, that is, when the server is determined to be the master server, the master selection tool sends an application process start command, thereby enabling the corresponding application process to be started through the actual application process start command without modifying the application code.
[0097] The disclosed embodiment sets the parameters of the master selection tool according to the application process startup command corresponding to the server, so that the business process can be started through the actual application process startup command without changing the code, thereby ensuring a non-intrusive master-slave high-availability mode suitable for more application scenarios.
[0098] Figure 2 FIG. 1 is a flow chart of a method for processing an application according to an exemplary embodiment. Figure 2 As shown, first set up the leader selection tool. In one example, the leader selection tool is encapsulated and implemented based on Leader Election. It needs to receive the startup command of the actual application. The leader selection tool selects the leader through the Leader Election mechanism. The leader selection tool instance that selects the leader will execute the startup command of the actual application and create the corresponding application process. The leader selection tool instance that does not select the leader will always monitor the resource objects. When the master instance is found to be down, a new application process is immediately started to achieve the effect of master-slave switching.
[0099] The master election process is as follows: When configuring the application startup command, use the master election tool as the pre-start command of the application, and then pass the actual application process startup command as the parameter of the master election tool. The master election tool instance uses the distributed lock mechanism of Kubernetes ETCD to preemptively create resource objects based on the configured resource object information. The master election tool that successfully creates the resource object, that is, the master election tool corresponding to the primary server, will execute the actual application startup command to start the application process, set an expiration time for the resource object, and then continuously refresh the expiration time of the resource object within the configured interval period. The master election tool that fails to create the resource object sets its own identity to "standby" (corresponding to the master election tool of the secondary server), and then continuously monitors whether the resource object exists and whether it has expired. When the "standby" master election tool finds that the resource object does not exist or has expired, it means that the replica instance corresponding to the "primary" master election tool has crashed. At this time, the standby master election tool tries to update the replica identifier to the resource object and sets an expiration time. If the update is successful, a new application process is started and then its own identity is set to "primary". After the "backup" master election tool successfully seizes the master, a master-backup high-availability mode is implemented in which when the master fails, the backup machine takes over all the work of the master.
[0100] In one example, if Figure 3 As shown in the figure, the master selection tool supports configuring the startup command of the actual application process. When configuring the business application, use the master selection tool as the startup command, and then pass the actual application process startup command into the master selection tool as a parameter of the master selection tool. When the master selection tool selects the master, that is, when the master selection tool corresponds to the primary server, it will execute the actual business application and create the application process.
[0101] In one example, if Figure 4As shown in the figure, when an application has multiple replicas and needs to provide interface services to the outside world, it is necessary to let external visitors know which replica instance is available. The readiness detection mechanism based on Kubernetes Pod enables Kubernetes Service to obtain available Endpoint addresses. Based on this, the master selection tool supports readiness detection, because no matter whether it is "master" or "slave", the actual Pod has been created, but only the "master" can provide services to the outside world. Specifically, detection is divided into survival detection and readiness detection. Survival detection is used to detect whether the replica instance is started normally, and readiness detection is used to detect whether the replica instance can provide services to the outside world. For the business replica of the primary server, the survival detection returns the result of survival (that is, the survival status is survived), because the replica instance is started normally; the readiness detection, by accessing the actual application process, returns the result of readiness (that is, the readiness status is ready), and can provide services to the outside world. For the business replica of the secondary server, the survival detection returns the result of survival (that is, the survival status is survived), because the replica instance is started normally; the readiness detection returns the result of not ready (that is, the readiness status is not ready), because the actual business process has not been started and cannot provide services to the outside world.
[0102] In one example, if Figure 5 As shown in the figure, in scenarios such as master server exceptions, the master selection tool supports an automatic exit mechanism. In some abnormal scenarios, for example, the Kubelet process of the host (i.e., the master server) exits abnormally. At this time, the Kubernetes cluster considers the host node to be unavailable. However, the abnormal exit of Kubelet will not shut down the container instance on the host. At this time, the replica instance selected as the master is actually still running. If this abnormal situation is not detected, it will continue to run and always have the "master" identity. At this time, the Kubernetes cluster considers the host node to be unavailable, and the Pod corresponding to this host node is in an unavailable state. The Kubernetes Service will remove the Endpoint corresponding to the Pod from the list of available instances. In this scenario, Kubernetes will create a new Pod to replace the old Pod, because the container instance on the down node is still running, and it will not release the "master" identity, resulting in the new Pod and the original "backup" identity Pod being unable to grab the "master" identity, and the entire application service is stuck in an unavailable state.
[0103] In this embodiment, in response to this abnormal situation, the master selection tool can detect that the corresponding Pod instance is already in an unavailable state in the Kubernetes cluster, for example, the corresponding proxy node address does not exist. Therefore, it is necessary to enable the master selection tool to have the ability to monitor the Kubernetes cluster. When an abnormality is detected in the Pod instance, it will automatically exit.
[0104] The disclosed embodiment proposes a non-intrusive implementation scheme of the active-standby high-availability mode. By setting up a primary selection tool, there is no need to modify the business code of the application program, and the scheme is applicable to more application scenarios. Based on the non-intrusive scheme, a startup command, a readiness detection, and an automatic exit mechanism are provided for passing in actual business applications, thereby ensuring the normal operation of the application program and the execution of the active-standby mode.
[0105] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0106] Based on the same inventive concept, the embodiment of the present application also provides an application process processing device for implementing the above-mentioned application process processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiment of the one or more application process processing devices provided below can refer to the limitations of the application process processing method above, and will not be repeated here.
[0107] In an exemplary embodiment, Figure 6 As shown, a processing device 600 for an application process is provided, comprising:
[0108] The acquisition module 610 is used to obtain the interface information of multiple servers through multiple master selection tools in response to receiving the startup instruction of the application program, wherein the master selection tools correspond to the servers one by one;
[0109] A determination module 620, configured to determine a business copy status of each of the servers according to the interface information, and determine a master server from the multiple servers according to the business copy status;
[0110] The sending module 630 is used to send an application process start command through the master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
[0111] In one embodiment, the determining module is further configured to:
[0112] Determine the survival status and the ready status of the service copy corresponding to each of the servers according to the interface information;
[0113] According to the survival state and the ready state, it is determined that the server corresponding to the surviving and ready business copy is the primary server.
[0114] In one embodiment, the device is further used for:
[0115] According to the survival state and the ready state, it is determined that the server corresponding to the surviving but not ready business copy is the secondary server.
[0116] In one embodiment, the device is further used for:
[0117] When the resource object created by the business copy of the primary server does not exist or has expired, using the primary selection tool of the secondary server to obtain the interface information of the secondary server;
[0118] A new primary server is determined from the secondary servers according to the interface information of the secondary servers.
[0119] In one embodiment, the device is further used for:
[0120] Obtaining information about the proxy node address of the master server through the master selection tool of the master server;
[0121] When the proxy node address does not exist, the application process of the main server is controlled to exit.
[0122] In one embodiment, the device further comprises a setting module of the master selection tool, and the setting module of the master selection tool is further used for:
[0123] Obtaining a server corresponding to the master selection tool;
[0124] The application process start command corresponding to the server is used as a parameter of the master selection tool and is passed into the master selection tool, so that the master selection tool sends the application process start command when the business copy status of the server meets the conditions.
[0125] Each module in the processing device of the above application process can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0126] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store interface information and other data involved in the method described in this embodiment. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing an application process is implemented.
[0127] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0130] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0132] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0134] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing an application process, characterized in that: The method comprises: In response to receiving a startup instruction of an application program, interface information of multiple servers is acquired through multiple master selection tools, wherein the master selection tools correspond to the servers one by one; Determine the business copy status of each of the servers according to the interface information, and determine the master server from the multiple servers according to the business copy status; An application process start command is sent through a master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
2. The method according to claim 1, characterized in that: Determining the business copy status of each of the servers according to the interface information, and determining the master server from the multiple servers according to the business copy status, includes: Determine the survival status and the ready status of the service copy corresponding to each of the servers according to the interface information; According to the survival state and the ready state, it is determined that the server corresponding to the surviving and ready business copy is the primary server.
3. The method according to claim 2, characterized in that After determining the survival state and the ready state of the service copy corresponding to each of the servers, the method further includes: According to the survival state and the ready state, it is determined that the server corresponding to the surviving but not ready business copy is the secondary server.
4. The method according to claim 3, characterized in that The method further comprises: When the resource object created by the business copy of the primary server does not exist or has expired, using the primary selection tool of the secondary server to obtain the interface information of the secondary server; A new primary server is determined from the secondary servers according to the interface information of the secondary servers.
5. The method according to claim 1, characterized in that: The method further comprises: Obtaining information about the proxy node address of the master server through the master selection tool of the master server; When the proxy node address does not exist, the application process of the main server is controlled to exit.
6. The method according to claim 1, characterized in that The setting method of the master selection tool includes: Obtaining a server corresponding to the master selection tool; The application process start command corresponding to the server is used as a parameter of the master selection tool and is passed into the master selection tool, so that the master selection tool sends the application process start command when the business copy status of the server meets the conditions.
7. A processing device for an application process, characterized in that: The device comprises: an acquisition module, configured to, in response to receiving a startup instruction of an application program, acquire interface information of a plurality of servers through a plurality of master selection tools, wherein the master selection tools correspond to the servers one by one; A determination module, configured to determine a business copy status of each of the servers according to the interface information, and determine a master server from the multiple servers according to the business copy status; The sending module is used to send an application process start command through a master selection tool corresponding to the master server, so that the master server starts the application process of the application program.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.