Server group active-standby switching method, device and equipment and storage medium

By integrating process control and group management components in the server group and using heartbeat messages to monitor process status, efficient master-slave switching of server groups in the aviation ground service system is achieved, solving the problem of high switching complexity in the existing technology and ensuring the efficient operation and standby status of the system.

CN120704852APending Publication Date: 2025-09-26CHINA ELECTRONICS TECHNOLOGY AVIONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410350136.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-26
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the existing aviation ground service system, the active-standby switching solution of the server group cannot achieve the decoupling of components and processes, resulting in high switching complexity and inability to ensure that only one server group is running.

Method used

By integrating process control components and group management components in the server group and using heartbeat messages to monitor process status, automatic management and switching of processes can be achieved, ensuring that only one server group is running and the other is in standby status.

Benefits of technology

It reduces the complexity of active/standby switching, improves switching efficiency, and ensures that only one server group is running while the other is in standby mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704852A_ABST
    Figure CN120704852A_ABST
Patent Text Reader

Abstract

The invention discloses a server group main-standby switching method, device and equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: monitoring and receiving a process heartbeat message sent by a process control component in each server in a first server group through a first group management component integrated in any server in the first server group; detecting whether all controlled processes in the first server group are started or not according to process state information in the process heartbeat message; if not, sending a control message for closing the process to a process control component in each server so as to close all the controlled processes in the first server group; and sending the heartbeat information of the first group of management components to the second group of management components so as to switch the second server group into the main server group through the second group of management components, and starting all controlled processes in the second server group. According to the method and the device, decoupling of the component and the controlled process can be realized, the complexity of active-standby switching is reduced, and the efficiency of active-standby switching is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for switching between a primary and a secondary server group. Background Art

[0002] Currently, aviation ground service systems typically receive downlink data from aircraft through various data link methods, such as ADS-B (Automatic Dependent Surveillance-Broadcast), Beidou short messages, and KA-band satellite communications, and implement functions such as reorganization, packaging, parsing, processing, user interaction, and storage of downlink data. Users can use a browser (such as a web browser) to access the downlink data stored or processed by the aviation ground service system.

[0003] However, in many application scenarios, such as the scenario where dual Beidou command aircraft receive airborne original messages, the aviation ground service system adopts a master-slave redundant design and needs to meet the requirements of master-slave switching, such as Figure 1 As shown, it includes a primary server group and a backup server group, and each server group can contain several servers, and each server can run several application software processes. The two server groups can serve as the primary and backup for each other. Figure 1 Mainstream approaches for master-slave switching between two server groups in a cluster include: a switchover solution based on microservice clusters (such as Spring Cloud) and a master-slave switching solution based on Zookeeper (an open source distributed coordination framework). The microservice cluster-based switchover solution develops a single process as a small service and deploys multiple identical processes in a distributed manner using cluster technology. Each process runs independently and uses lightweight mechanisms, such as communicating through an API (Application Programming Interface) of an HTTP (Hypertext Transfer Protocol) resource, so that the corresponding process can be called through the API for data processing. However, this approach requires strict adherence to the microservice framework and the use of the technical support provided by the microservice framework when developing each application software (program), and cannot achieve complete decoupling from the microservice framework. Furthermore, this approach cannot meet the requirement of the master-slave switching solution that only one server group can run simultaneously in the master and standby server groups, and requires the addition of additional logical functions. The Zookeeper-based master-slave switching solution also requires the use of the API and technical support provided by Zookeeper when developing the process. The master-slave switching logic must be implemented within the process, and the process cannot be fully decoupled from the Zookeeper framework.

[0004] In summary, how to implement active / standby switching of a server group is a problem that still needs to be further solved in this field. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a method, apparatus, device, and storage medium for active / standby switching of a server group, which can decouple components from controlled processes, reduce the complexity of active / standby switching, improve the efficiency of active / standby switching, and ensure that only one server group is running while the other is in standby mode. The specific solution is as follows:

[0006] In a first aspect, the present application discloses a method for active / standby switching of a server group, which is applied to an active / standby switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, including:

[0007] monitoring and receiving, by a first group management component integrated in any server of the first server group, heartbeat messages sent by process control components in each server in the first server group, to obtain process heartbeat messages; wherein the process heartbeat messages include identifiers corresponding to each process control component in the first server group and process status information of all controlled processes;

[0008] detecting whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message;

[0009] If all controlled processes in the servers of the first server group are not started, sending a control message for shutting down the process to the process control component in each server of the first server group, so as to shut down all controlled processes in each server of the first server group;

[0010] Send the heartbeat information of the current first group management component to the second group management component to switch the second server group to the main server group through the second group management component, and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

[0011] Optionally, the monitoring and receiving, by a first group management component integrated in any server of the first server group, a heartbeat message sent by a process control component in each server in the first server group, to obtain the process heartbeat message includes:

[0012] The process heartbeat message is obtained by monitoring and receiving the heartbeat message sent by the process control component in each server in the current first server group through UDP multicast and according to a preset sending period through the first group management component integrated in any server located in the first server group.

[0013] Optionally, before obtaining the process heartbeat message, the step of monitoring and receiving the heartbeat message sent by the process control component in each server in the first server group through the first group management component integrated in any server in the first server group further includes:

[0014] monitoring and receiving, by the first group management component, a heartbeat message sent by a second group management component integrated in any server of the second server group, to obtain a group management heartbeat message; the group management heartbeat message includes operating status information of the second group management component and a corresponding primary / standby priority;

[0015] If the running status information in the group management heartbeat message is in a closed state and the primary / secondary priority is a backup server group, the first server group is determined as the primary server group.

[0016] Optionally, the sending of the heartbeat information of the current first group of management components to the second group of management components, so as to switch the second server group to the primary server group through the second group of management components and start all controlled processes in each server in the second server group, includes:

[0017] Obtaining the current heartbeat information of the first group of management components, obtaining the current heartbeat information, and sending the current heartbeat information to the second group of management components; the current heartbeat information includes the operating status information of the first group of management components and the corresponding active / standby priority;

[0018] When the second group management component receives the current heartbeat information, it switches the second server group to the main server group, and sends a control instruction for starting the process to the process control component in each server located in the second server group, so as to start all controlled processes in each server in the second server group.

[0019] Optionally, the server group master / slave switching method further includes:

[0020] Determine all controlled processes of each server in the first server group, obtain first controlled processes, obtain process information of each first controlled process to obtain first process information, and then save all the first process information to a first configuration file; the first configuration file is located in the server where the first group management component is located;

[0021] Determine all controlled processes of each server in the second server group respectively to obtain the second controlled process, obtain the process information of each second controlled process to obtain the second process information, and then save all the second process information to the second configuration file; the second configuration file is located in the server where the second group management component is located.

[0022] Optionally, the first process information and the second process information both include a process name, a process start instruction, a process stop instruction, a process stop instruction, and a process monitoring instruction; the process start instruction is located in a .sh file, the process stop instruction uses a killall instruction or a kill instruction, and the process monitoring instruction uses a ps instruction;

[0023] Accordingly, starting all controlled processes in each server in the second server group includes:

[0024] All controlled processes in each server in the second server group are started using the process start instruction in the second configuration file.

[0025] Optionally, the server group master / slave switching method further includes:

[0026] The heartbeat information of the first group of management components is monitored respectively through the process control components in each server in the first server group. If the heartbeat information sent by the first group of management components is not received within a preset time period, all controlled processes in the corresponding servers are closed; the controlled processes are processes in the aviation ground service station software.

[0027] In a second aspect, the present application discloses a server group active / standby switching device, which is applied to an active / standby switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, including:

[0028] a monitoring and receiving module, configured to monitor and receive heartbeat messages sent by process control components in each server in the first server group through a first group management component integrated in any server in the first server group, thereby obtaining process heartbeat messages; wherein the process heartbeat messages include identifiers corresponding to each process control component in the first server group and process status information of all controlled processes;

[0029] A detection module, configured to detect whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message;

[0030] a control message sending module, configured to send a control message for shutting down a process to a process control component in each server in the first server group if all controlled processes in each server in the first server group have not been started, so as to shut down all controlled processes in each server in the first server group;

[0031] A heartbeat information sending module is used to send the heartbeat information of the current first group management component to the second group management component, so as to switch the second server group to the main server group through the second group management component and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

[0032] In a third aspect, the present application discloses an electronic device comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the aforementioned server group active-standby switching method is implemented.

[0033] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned method for switching between active and standby servers is implemented.

[0034] It can be seen that the present application is applied to a master-slave switching system comprising a first server group and a second server group, wherein the first server group and the second server group each comprise a plurality of servers, and each of the servers is integrated with a process control component, and firstly, a first group of management components integrated in any server located in the first server group monitors and receives heartbeat messages sent by process control components in each server currently in the first server group, and obtains a process heartbeat message; wherein, the process heartbeat message includes an identifier corresponding to each process control component in the first server group and process status information of all controlled processes; then, the process status information in the process heartbeat message is used to detect the process control component located in the first server group. Whether all controlled processes in each server of the first server group have been started; if all controlled processes in each server of the first server group have not been started, a control message for shutting down the process is sent to the process control component in each server of the first server group to shut down all controlled processes in each server of the first server group, and then the heartbeat information of the current first group management component is sent to the second group management component to switch the second server group to the main server group through the second group management component, and start all controlled processes in each server of the second server group; the second group management component is a group management component integrated in any server of the second server group. This application integrates a process control component in each server in the two server groups, and integrates a group management component in any server in the two server groups. Through any group of management components, the process control components of each server in the server group can be monitored, and based on the monitored process status information, it can be detected whether there is an unstarted application software process in the current server group. If so, the other group of management components is notified to realize the master-slave switching of the server group. Since the controlled process does not depend on the component itself, that is, there is no need to redevelop the controlled process, the decoupling of the component and the controlled process is realized, thereby reducing the complexity of the master-slave switching and improving the efficiency of the master-slave switching. At the same time, it can also ensure that only one server group is running and the other is in a standby state. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0036] Figure 1 This is a schematic diagram of the distribution of a primary and backup server group disclosed in this application;

[0037] Figure 2 This is a flow chart of a method for switching between a primary and a secondary server group disclosed in this application;

[0038] Figure 3 This is a block diagram of a specific method for switching between active and standby servers disclosed in this application;

[0039] Figure 4 This is a flow chart of a specific method for switching between active and standby servers.

[0040] Figure 5 This is a structural diagram of a server group master-slave switching device disclosed in this application;

[0041] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0043] The present invention discloses a method for switching between a primary and a secondary server group, which is applied to a primary and a secondary server group switching system including a first server group and a second server group. The first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component. Figure 2 As shown, the method includes:

[0044] Step S11: Monitor and receive the heartbeat messages sent by the process control components in each server in the first server group through the first group of management components integrated in any server located in the first server group, and obtain a process heartbeat message; wherein, the process heartbeat message includes the identifier corresponding to each process control component in the first server group and the process status information of all controlled processes.

[0045] It should be pointed out that the active-standby switching solution for server groups proposed in this application is applied to an active-standby switching system comprising two server groups (respectively, a first server group and a second server group), wherein the first server group and the second server group each contain multiple servers, and each of the servers is pre-integrated with a process control (Process Control) component for controlling all processes in the current server. The processes in the server include but are not limited to office software, such as processes in Word, PPT and other software, as well as controlled processes in aviation ground service station software. It should be pointed out that the active-standby switching system can be implemented through different operating systems and programming languages, such as using the Linux operating system and C++ language for development and implementation, and can be further reconstructed into a Windows application.

[0046] Also, see Figure 3 As shown, a management (Group Manager) component is pre-integrated in any server of the first server group and the second server group, namely the first group management component and the second group management component. In the initial state, the first server group is used as the main server group and the second server group is used as the backup server group by default, and only one server group (i.e., the first server group) is working. It should be pointed out that there is one and only one group management component in each server group. Moreover, each component can communicate with each other through a pre-set communication method to realize the sharing of message information. The communication method includes but is not limited to UDP (User Datagram Protocol) multicast, UDP unicast, TCP (Transmission Control Protocol) protocol, HTTP protocol, RS485 (a serial communication standard) protocol, etc.

[0047] In this embodiment, the first group management component integrated in any server located in the first server group can monitor and receive the heartbeat messages sent by the process control components in each server in the current first server group in real time, and obtain corresponding process heartbeat messages; wherein, the process heartbeat message specifically includes the identifier corresponding to each process control component in the first server group (such as Process Control_1-1, Process Control_1-2, ProcessControl_1-3, etc., respectively indicating the process control component in the server in the first server group) and the process status information of all controlled processes (such as status0 indicates that all processes have not been started; status1 indicates that some processes have been started; status2 indicates that all processes have been started).

[0048] In a specific embodiment, the first group management component integrated in any server of the first server group monitors and receives the heartbeat message sent by the process control component in each server in the first server group to obtain the process heartbeat message, which may specifically include: monitoring and receiving the heartbeat message sent by the process control component in each server in the first server group through UDP multicast and according to a preset sending period by the first group management component integrated in any server of the first server group to obtain the process heartbeat message. For details, see Figure 3 As shown, the process control component in each server in the first server group sends heartbeat messages to the UDP multicast according to a preset sending period (such as every 2 seconds), and the first group management component integrated in any server of the first server group obtains the process heartbeat messages sent by each process control component in the group from the UDP multicast in each preset receiving period (such as every 2 seconds).

[0049] It should be pointed out that, before obtaining the process heartbeat message, the first group management component integrated in any server of the first server group monitors and receives the heartbeat message sent by the process control component in each server in the current first server group, specifically also includes: monitoring and receiving the heartbeat message sent by the second group management component integrated in any server of the second server group through the first group management component, to obtain the group management heartbeat message; the group management heartbeat message includes the running status information and the corresponding master-slave priority of the second group management component; if the running status information in the group management heartbeat message is in the closed state, and the master-slave priority is the backup server group, the first server group is determined to be the master server group. In this embodiment, when the first server group is the master server group in the default initial state, it is necessary to close all processes in the second server group through the first group management component in the first server group, so as to ensure that only one server group is running and the other is in use. Specifically, the heartbeat message sent by the second group management component integrated in any server located in the second server group is first monitored and received by the first group management component, and the group management heartbeat message corresponding to the second group management component containing the operating status information of the second group management component and the corresponding master-slave priority is obtained. If the operating status information in the above group management heartbeat message (such as status0 indicating that the component is being initialized; status1 indicating that the component is in the shutdown state; status2 indicating that the component is in the startup state; status3 indicating that the component is in an abnormal state) indicates that the operating status of the second group management component is the shutdown state (i.e., status1), and the corresponding master-slave priority is the backup server group, then the first server group can be determined as the master server group. It should be pointed out that the monitoring of the status information of other components by each component can be achieved through a state machine.

[0050] Step S12: detecting whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message.

[0051] In this embodiment, after monitoring and receiving the process heartbeat message sent by the process control component in each server in the current first server group, further, based on the process status information in the above process heartbeat message, it can be detected whether all controlled processes located in each server in the above first server group have been started.

[0052] Step S13: If all controlled processes in each server in the first server group are not started, a control message for shutting down the process is sent to the process control component in each server in the first server group to shut down all controlled processes in each server in the first server group.

[0053] In this embodiment, if all controlled processes in the servers located in the above-mentioned first server group are not started, that is, there are unstarted processes in the first server group, a control message for closing all processes in the current server is sent to the process control component in each server located in the above-mentioned first server group. After each server in the first server group receives the above-mentioned control message, it closes all processes controlled by itself.

[0054] Step S14: Send the heartbeat information of the current first group management component to the second group management component, so as to switch the second server group to the main server group through the second group management component, and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

[0055] In this embodiment, after closing all controlled processes in each server in the first server group through the first group management component, the first group management component can further send the heartbeat information of the current first group management component to the second group management component integrated in any server located in the above-mentioned second server group; when the second group management component receives the heartbeat information sent by the first group management component, it switches the current second server group to the main server group, and starts all controlled processes in each server in the current second server group, that is, converts the second server group from a backup server group to a main server group.

[0056] In this embodiment, the server group active / standby switching method may further include: determining all controlled processes of each server in the first server group to obtain a first controlled process, obtaining process information of each first controlled process to obtain first process information, and then saving all first process information to a first configuration file; the first configuration file is located on the server where the first group management component is located; determining all controlled processes of each server in the second server group to obtain a second controlled process, obtaining process information of each second controlled process to obtain second process information, and then saving all second process information to a second configuration file; the second configuration file is located on the server where the second group management component is located. All controlled processes of each server in the first server group may be determined in advance to obtain the corresponding first controlled process, then obtaining process information of each first controlled process to obtain first process information, and then saving all first process information to a first configuration file located on the server where the first group management component is located, so that the information in the configuration file is automatically loaded when the server is powered on, thereby starting each controlled process. Similarly, all controlled processes of each server in the second server group are determined respectively to obtain the corresponding second controlled processes, and then the process information of each second controlled process is obtained to obtain the second process information, and then all the first process information is saved to the second configuration file of the server where the second group management component is located, so that the information in the configuration file can be automatically loaded when the server is started, thereby starting each controlled process.

[0057] Among them, the first process information and the second process information both include a process name (such as ID, PID, etc.), a process start instruction, a process close instruction, a process close instruction and a process monitoring instruction; the process start instruction can specifically be a Linux shell instruction and is located in a sh file, the process close instruction can use the killall instruction or the kill instruction, and the process monitoring instruction can use the ps instruction (a Linux system command).

[0058] Accordingly, starting all controlled processes in each server in the second server group may specifically include starting all controlled processes in each server in the second server group using the process start instruction in the second configuration file. That is, when starting all controlled processes in each server in the second server group, the process start instruction pre-stored in the second configuration file may be directly called to start the corresponding controlled processes.

[0059] In a specific embodiment, it may also include: monitoring the heartbeat information of the first group management component through the process control component in each server in the first server group respectively, and if the heartbeat information sent by the first group management component is not received within a preset time period, then shutting down all controlled processes in the corresponding server; the controlled process is a process in the aviation ground service station software. In this embodiment, the heartbeat information of the first group management component can be monitored by the process control component in each server in the first server group. If the heartbeat information sent by the first group management component is not received within a preset time period, it indicates that the current server group is a backup server group, and it is necessary to shut down all controlled processes in the corresponding server; wherein, the controlled process can specifically be a process in the aviation ground service station software, such as the reorganization, packaging, parsing, processing, user interaction, storage and other processes of downlink data.

[0060] It can be seen that the embodiment of the present application is applied to a master-slave switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, and firstly, a first group of management components integrated in any server located in the first server group monitors and receives heartbeat messages sent by process control components in each server currently in the first server group, and obtains a process heartbeat message; wherein, the process heartbeat message includes an identifier corresponding to each process control component in the first server group and process status information of all controlled processes; then, the process status information in the process heartbeat message is detected according to the process status information in the process heartbeat message. Whether all controlled processes in each server of the server group have been started. If all controlled processes in each server of the first server group have not been started, a control message for shutting down the process is sent to the process control component in each server of the first server group to shut down all controlled processes in each server of the first server group, and then the heartbeat information of the current first group management component is sent to the second group management component to switch the second server group to the main server group through the second group management component and start all controlled processes in each server of the second server group; the second group management component is a group management component integrated in any server of the second server group. The embodiment of the present application integrates a process control component in each server in the two server groups, and integrates a group management component in any server in the two server groups. Through any group of management components, the process control components of each server in the server group can be monitored, and based on the monitored process status information, it is detected whether there is an unstarted application software process in the current server group. If so, the other group of management components is notified to realize the master-slave switching of the server group. Since the controlled process does not depend on the component itself, that is, there is no need to redevelop the controlled process, the decoupling of the component and the controlled process is realized, thereby reducing the complexity of the master-slave switching and improving the efficiency of the master-slave switching. At the same time, it can also ensure that only one server group is running and the other is in a standby state.

[0061] The embodiment of the present application discloses a specific method for active / standby switching of a server group, which is applied to an active / standby switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, see Figure 4 As shown, the method includes:

[0062] Step S21: Monitor and receive heartbeat messages sent by process control components in each server in the first server group through the first group of management components integrated in any server located in the first server group, and obtain process heartbeat messages; wherein, the process heartbeat messages include identifiers corresponding to each process control component in the first server group and process status information of all controlled processes; the controlled processes are processes in the aviation ground service station software.

[0063] Step S22: detecting whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message.

[0064] Step S23: If all controlled processes in each server in the first server group are not started, a control message for shutting down the process is sent to the process control component in each server in the first server group to shut down all controlled processes in each server in the first server group.

[0065] Step S24: Obtain the heartbeat information of the first group of management components, obtain the current heartbeat information, and send the current heartbeat information to the second group of management components; the current heartbeat information includes the operating status information of the first group of management components and the corresponding master-slave priority; the second group of management components is a group management component integrated in any server located in the second server group.

[0066] In this embodiment, after closing all controlled processes in each server in the first server group, the heartbeat information of the current first group management component is obtained, and the current heartbeat information including the operating status information of the first group management component and the corresponding master-slave priority (the priority is used to indicate that the first server group is currently a backup server group) is obtained, and then the above-mentioned current heartbeat information is sent to the second group management component integrated in any server located in the second server group.

[0067] Step S25: When the second group management component receives the current heartbeat information, it switches the second server group to the main server group, and sends a control instruction for starting the process to the process control component in each server located in the second server group, so as to start all controlled processes in each server in the second server group.

[0068] In this embodiment, when the second group of management components receives the current heartbeat information sent by the first group of management components, it first switches the second server group to the main server group, and then sends a control instruction for starting all controlled processes to the process control components in each server located in the above two server groups, thereby starting all controlled processes in each server in the above second server group, completing the entire master-slave switching process.

[0069] For more specific processing procedures of the above steps S21 to S23, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described again here.

[0070] It can be seen that the controlled process in the embodiment of the present application is a process in the aviation ground service station software. By integrating a process control component in each server in the two server groups and integrating a group management component in any server in the two server groups, any group of management components can not only monitor the process control components of each server in the server group, but also detect whether there is an unstarted application software process in the current server group based on the monitored process status information. If so, the other group of management components is notified to realize the master-slave switching of the server group. The present application realizes the complete decoupling of components and controlled processes, reduces the complexity of master-slave switching, improves the efficiency of master-slave switching, and can also ensure that only one server group is running and the other is in standby status, solving the problem that the current aviation ground service station master-slave switching system cannot ensure that only one server group is running.

[0071] Accordingly, the embodiment of the present application further discloses a server group active / standby switching device, which is applied to an active / standby switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, see Figure 5 As shown, the device includes:

[0072] A monitoring and receiving module 11 is configured to monitor and receive heartbeat messages sent by process control components in each server in the first server group through a first group management component integrated in any server in the first server group, thereby obtaining a process heartbeat message; wherein the process heartbeat message includes an identifier corresponding to each process control component in the first server group and process status information of all controlled processes;

[0073] A detection module 12 is configured to detect whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message;

[0074] a control message sending module 13 configured to send a control message for shutting down a process to a process control component in each server in the first server group if all controlled processes in each server in the first server group are not started, so as to shut down all controlled processes in each server in the first server group;

[0075] The heartbeat information sending module 14 is used to send the heartbeat information of the current first group management component to the second group management component, so as to switch the second server group to the main server group through the second group management component and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

[0076] Among them, the specific work processes of the above modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0077] It can be seen that the embodiment of the present application is applied to a master-slave switching system including a first server group and a second server group, wherein the first server group and the second server group each include multiple servers, and each of the servers is integrated with a process control component, and firstly, a first group of management components integrated in any server located in the first server group monitors and receives heartbeat messages sent by process control components in each server currently in the first server group, and obtains a process heartbeat message; wherein, the process heartbeat message includes an identifier corresponding to each process control component in the first server group and process status information of all controlled processes; then, the process status information in the process heartbeat message is detected according to the process status information in the process heartbeat message. Whether all controlled processes in each server of the server group have been started. If all controlled processes in each server of the first server group have not been started, a control message for shutting down the process is sent to the process control component in each server of the first server group to shut down all controlled processes in each server of the first server group, and then the heartbeat information of the current first group management component is sent to the second group management component to switch the second server group to the main server group through the second group management component and start all controlled processes in each server of the second server group; the second group management component is a group management component integrated in any server of the second server group. The embodiment of the present application integrates a process control component in each server in the two server groups, and integrates a group management component in any server in the two server groups. Through any group of management components, the process control components of each server in the server group can be monitored, and based on the monitored process status information, it is detected whether there is an unstarted application software process in the current server group. If so, the other group of management components is notified to realize the master-slave switching of the server group. Since the controlled process does not depend on the component itself, that is, there is no need to redevelop the controlled process, the decoupling of the component and the controlled process is realized, thereby reducing the complexity of the master-slave switching and improving the efficiency of the master-slave switching. At the same time, it can also ensure that only one server group is running and the other is in a standby state.

[0078] In some specific embodiments, the monitoring and receiving module 11 may specifically include:

[0079] The first monitoring and receiving unit is used to monitor and receive the heartbeat messages sent by the process control components in each server in the first server group through UDP multicast and according to a preset sending period through the first group management component integrated in any server located in the first server group, and obtain the process heartbeat message.

[0080] In some specific embodiments, the monitoring and receiving module 11 may further include:

[0081] A second monitoring and receiving unit is configured to monitor and receive, through the first group management component, a heartbeat message sent by a second group management component integrated in any server of the second server group, to obtain a group management heartbeat message; the group management heartbeat message includes the operating status information of the second group management component and the corresponding primary and backup priorities;

[0082] The primary server group determining unit is configured to determine the first server group as the primary server group if the running status information in the group management heartbeat message is in a closed state and the primary-backup priority is a backup server group.

[0083] In some specific embodiments, the heartbeat information sending module 14 may specifically include:

[0084] A heartbeat information acquisition unit, configured to acquire the current heartbeat information of the first group of management components to obtain current heartbeat information; the current heartbeat information includes the running status information of the first group of management components and the corresponding active / standby priority;

[0085] a heartbeat information sending unit, configured to send the current heartbeat information to the second group of management components;

[0086] The master-slave switching unit is used to switch the second server group to the master server group after the second group management component receives the current heartbeat information, and send a control instruction for starting the process to the process control component in each server located in the two server groups, so as to start all controlled processes in each server in the second server group.

[0087] In some specific embodiments, the server group active / standby switching device may further include:

[0088] a first process determining unit, configured to respectively determine all controlled processes of each server in the first server group to obtain a first controlled process;

[0089] a first process information acquiring unit, configured to acquire process information of each of the first controlled processes to obtain first process information;

[0090] A first information storage unit is configured to store all the first process information in a first configuration file; the first configuration file is located in a server where the first group of management components is located;

[0091] a second process determining unit, configured to respectively determine all controlled processes of each server in the second server group to obtain a second controlled process;

[0092] A second process information acquiring unit, configured to acquire process information of each of the second controlled processes to obtain second process information;

[0093] The second information storage unit is used to save all the second process information into a second configuration file; the second configuration file is located in the server where the second group of management components is located.

[0094] In some specific embodiments, the first process information and the second process information both include a process name, a process start instruction, a process stop instruction, a process stop instruction, and a process monitoring instruction; the process start instruction is located in a .sh file, the process stop instruction uses a killall instruction or a kill instruction, and the process monitoring instruction uses a ps instruction;

[0095] Accordingly, the heartbeat information sending module 14 may specifically include:

[0096] A process starting unit is configured to start all controlled processes in each server in the second server group using the process starting instruction in the second configuration file.

[0097] In some specific embodiments, the server group active / standby switching device may further include:

[0098] a heartbeat information monitoring unit, configured to monitor the heartbeat information of the first group of management components through the process control component in each server in the first server group;

[0099] The controlled process closing unit is used to close all controlled processes in the corresponding server if the heartbeat information sent by the first group of management components is not received within a preset time period; the controlled process is a process in the aviation ground service station software.

[0100] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.

[0101] Figure 6This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the server group active / standby switching method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0102] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0103] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0104] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, and can be Windows Server, NetWare, Unix, Linux, etc. In addition to including a computer program capable of implementing the server group active / standby switching method performed by the electronic device 20 as disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of implementing other specific tasks.

[0105] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned method for active / standby switching of a server group. The specific steps of this method can be found in the corresponding contents disclosed in the aforementioned embodiments and will not be further described here.

[0106] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0107] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0108] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0109] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0110] The above is a detailed introduction to the server group master-slave switching method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for switching between active and standby servers, characterized in that: Applicable to a master-slave switching system comprising a first server group and a second server group, wherein the first server group and the second server group each comprise multiple servers, and each of the servers is integrated with a process control component, including: monitoring and receiving, by a first group management component integrated in any server of the first server group, heartbeat messages sent by process control components in each server in the first server group, to obtain process heartbeat messages; wherein the process heartbeat messages include identifiers corresponding to each process control component in the first server group and process status information of all controlled processes; detecting whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message; If all controlled processes in the servers of the first server group are not started, sending a control message for shutting down the process to the process control component in each server of the first server group, so as to shut down all controlled processes in each server of the first server group; Send the heartbeat information of the current first group management component to the second group management component to switch the second server group to the main server group through the second group management component, and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

2. The method for switching between active and standby servers according to claim 1, wherein: The step of monitoring and receiving, by means of a first group management component integrated in any server of the first server group, a heartbeat message sent by a process control component in each server in the first server group, to obtain a process heartbeat message includes: The process heartbeat message is obtained by monitoring and receiving the heartbeat message sent by the process control component in each server in the current first server group through UDP multicast and according to a preset sending period through the first group management component integrated in any server located in the first server group.

3. The method for switching between active and standby servers according to claim 1, wherein: Before obtaining the process heartbeat message, the method further includes: monitoring and receiving the heartbeat message sent by the process control component in each server in the first server group through the first group management component integrated in any server in the first server group; monitoring and receiving, by the first group management component, a heartbeat message sent by a second group management component integrated in any server of the second server group, to obtain a group management heartbeat message; the group management heartbeat message includes operating status information of the second group management component and a corresponding primary / standby priority; If the running status information in the group management heartbeat message is in a closed state and the primary / secondary priority is a backup server group, the first server group is determined as a primary server group.

4. The method for switching between active and standby servers according to claim 1, wherein: The sending the heartbeat information of the current first group management component to the second group management component, so as to switch the second server group to the primary server group through the second group management component and start all controlled processes in each server in the second server group, includes: Obtaining the current heartbeat information of the first group of management components, obtaining the current heartbeat information, and sending the current heartbeat information to the second group of management components; the current heartbeat information includes the operating status information of the first group of management components and the corresponding active / standby priority; When the second group management component receives the current heartbeat information, it switches the second server group to the main server group, and sends a control instruction for starting the process to the process control component in each server located in the second server group, so as to start all controlled processes in each server in the second server group.

5. The method for switching between active and standby servers according to claim 1, wherein: Also includes: Determine all controlled processes of each server in the first server group, obtain first controlled processes, obtain process information of each first controlled process to obtain first process information, and then save all the first process information to a first configuration file; the first configuration file is located in the server where the first group management component is located; Determine all controlled processes of each server in the second server group respectively to obtain the second controlled process, obtain the process information of each second controlled process to obtain the second process information, and then save all the second process information to the second configuration file; the second configuration file is located in the server where the second group management component is located.

6. The method for switching between active and standby servers according to claim 5, wherein: The first process information and the second process information both include a process name, a process start instruction, a process stop instruction, a process stop instruction, and a process monitoring instruction; the process start instruction is located in a .sh file, the process stop instruction uses a killall instruction or a kill instruction, and the process monitoring instruction uses a ps instruction; Accordingly, starting all controlled processes in each server in the second server group includes: All controlled processes in each server in the second server group are started using the process start instruction in the second configuration file.

7. The method for switching between active and standby servers according to any one of claims 1 to 6, wherein: Also includes: monitoring the heartbeat information of the first group of management components through the process control component in each server in the first server group, and if no heartbeat information sent by the first group of management components is received within a preset time, shutting down all controlled processes in the corresponding server; The controlled process is a process in the aviation ground service station software.

8. A server group master-slave switching device, characterized in that: Applicable to a master-slave switching system comprising a first server group and a second server group, wherein the first server group and the second server group each comprise multiple servers, and each of the servers is integrated with a process control component, including: a monitoring and receiving module, configured to monitor and receive heartbeat messages sent by process control components in each server in the first server group through a first group management component integrated in any server in the first server group, thereby obtaining process heartbeat messages; wherein the process heartbeat messages include identifiers corresponding to each process control component in the first server group and process status information of all controlled processes; A detection module, configured to detect whether all controlled processes in the servers of the first server group have been started according to the process status information in the process heartbeat message; a control message sending module, configured to send a control message for shutting down a process to a process control component in each server in the first server group if all controlled processes in each server in the first server group have not been started, so as to shut down all controlled processes in each server in the first server group; A heartbeat information sending module is used to send the heartbeat information of the current first group management component to the second group management component, so as to switch the second server group to the main server group through the second group management component and start all controlled processes in each server in the second server group; the second group management component is a group management component integrated in any server located in the second server group.

9. An electronic device, characterized in that: The method comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the method for switching the active / standby server group according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, the server group active-standby switching method according to any one of claims 1 to 7 is implemented.