Server switching method and system

The monitoring application module obtains and sets the monitoring card status and notifies the identity switching module to switch server status, which solves the problem of data loss during server switching, and realizes fast switching and uninterrupted data service.

CN119892609AActive Publication Date: 2025-04-25BEIJING HELISHI CONTROL TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510386489.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

In DCS systems, when server switching is switched by network data transmission, the time is usually around 3 seconds, which causes the real-time server to be unable to receive data sent by the IO server, resulting in data loss and unable to meet the requirements of uninterrupted data service.

Method used

The monitoring application module periodically obtains the status of the local and peer monitoring cards, and sets the master and slave status of the local monitoring card according to these statuses, notifies the identity switching module to switch server status, realizes quick switching and ensures uninterrupted data services.

Benefits of technology

By placing status negotiation on the local monitoring card and the peer monitoring card, the server's status switching only needs to follow the status of the monitoring card to complete the switching, realizing rapid switching of the server, avoiding data loss and meeting the requirements of uninterrupted data service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892609A_ABST
    Figure CN119892609A_ABST
Patent Text Reader

Abstract

The invention discloses a server switching method and system, the server switching method is applied to the server switching system, the server switching system comprises a plurality of servers which are arranged in a redundant mode, each server is provided with a monitoring card, a monitoring card driving module, a monitoring application module and an identity switching module, the monitoring cards on all the servers are connected, and the identity switching module is connected with the monitoring card driving module. The method comprises the following steps: a monitoring application module periodically obtains the states of a home terminal monitoring card and an opposite terminal monitoring card from a home terminal monitoring card through a home terminal monitoring card driving module; after each acquisition operation is completed, the monitoring application module sets the master-slave state of the home terminal monitoring card according to the acquired states of the home terminal monitoring card and the opposite terminal monitoring card, and informs the identity switching module of the master-slave state set this time when the master-slave state set this time changes compared with the last time; and the identity switching module performs switching operation of corresponding states of the server according to the obtained master-slave states. Rapid switching of the server is realized, and uninterrupted data service is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to server control technology, and more particularly to a server switching method and system. Background Art

[0002] With the development of DCS system, DCS has become the main means of operation and management of nuclear power plant units. The DCS system of nuclear power plant requires real-time servers to provide uninterrupted data services. Therefore, in order to ensure the stability and reliability of system operation, the servers in the DCS system are configured in dual-machine redundancy.

[0003] In the related art, after the configuration is completed in a dual-machine redundant manner, server switching is often performed by transmitting data over the network.

[0004] However, the time for server switching using network data transmission is generally around 3 seconds. During this 3 seconds, the real-time server cannot receive the data sent by the IO server, resulting in the loss of data collected in this process, which cannot meet the requirements of uninterrupted data service. Summary of the invention

[0005] The embodiment of the present application provides a server switching method and system, which can perform switching operations of the corresponding server states according to the master-slave states of the local monitoring card, thereby achieving rapid switching and ensuring uninterrupted data services.

[0006] The embodiment of the present application provides a server switching method, which is applied to a server switching system, wherein the server switching system includes: a plurality of servers arranged in a redundant manner, each server is provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring cards on all the servers are connected, and the method includes: The monitoring application module periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time; After each acquisition operation is completed, the monitoring application module sets the master-slave status of the local monitoring card according to the status of the local monitoring card and the status of the opposite monitoring card, and notifies the identity switching module of the master-slave status of the local monitoring card set this time when the master-slave status set this time changes compared with the master-slave status set last time; The identity switching module performs a switching operation of the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

[0007] The embodiment of the present application also provides a server switching system, comprising: a plurality of servers arranged in a redundant manner, each server being provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring cards on all the servers being connected; The monitoring application module is used to periodically obtain the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time; The monitoring application module is also used to set the master-slave status of the monitoring card at the local end according to the status of the monitoring card at the local end and the status of the monitoring card at the opposite end after each acquisition operation is completed, and when the master-slave status set this time changes from the master-slave status set last time, notify the identity switching module of the master-slave status of the monitoring card at the local end set this time; The identity switching module is used to perform a switching operation of the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

[0008] The embodiment of the present application includes a monitoring application module that periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, and after each acquisition operation is completed, sets the master-slave status of the local monitoring card according to the obtained status of the local monitoring card and the status of the opposite monitoring card, and when the master-slave status of the local monitoring card set this time changes compared with the master-slave status of the local monitoring card set last time, notifies the identity switching module of the master-slave status of the local monitoring card set this time; the identity switching module performs a switching operation of the corresponding server status according to the obtained master-slave status of the local monitoring card, so that the negotiation of the status is completed by the local monitoring card and the opposite monitoring card, and the status switching of the server only needs to follow the status of the monitoring card to complete the switching, thereby realizing fast switching of the server and ensuring uninterrupted data service.

[0009] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0011] Figure 1 A schematic diagram of a server switching method according to an embodiment of the present application; Figure 2This is a schematic diagram of the state reading and writing process of a dual-machine monitoring card according to an embodiment of the present application; Figure 3 This is a schematic diagram of a process of initializing and setting the monitoring card status according to an embodiment of the present application; Figure 4 A schematic diagram of a process of non-initialization setting of monitoring card status according to an embodiment of the present application; Figure 5 A schematic diagram of the structure of a server switching system according to an embodiment of the present application. DETAILED DESCRIPTION

[0012] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0013] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0014] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.

[0015] The technical solution of the embodiment of the present application is applicable to the scenario where the server needs to be switched to avoid data loss caused by discontinuous switching process, thereby meeting the requirement of uninterrupted data service. The following are common scenarios for server switching: 1. Website hosting and cloud services: To ensure the continuous availability of online services, especially in the face of traffic peaks or hardware failures, server switching can automatically redirect user requests to backup servers to avoid service interruptions.

[0016] 2. Database management system: In database operation, the master-slave server architecture is a common configuration method. When the master database fails, the server can be quickly switched to the slave database to ensure that data processing and services are not interrupted.

[0017] 3. Financial trading system: For financial trading systems that require high reliability and real-time performance, server switching can complete failover within seconds, thereby minimizing the risk of transaction interruption.

[0018] 4. Telecommunications and Communications: In telecommunications networks, server switching is used to ensure the continuity of communication services. For example, in a mobile communication network, if a base station controller has a problem, the system will quickly switch to a backup controller to maintain the continuity of calls and data transmission.

[0019] 5. Healthcare: Hospitals and other healthcare providers rely on high-availability information systems to manage medical records, schedule resources, etc. Server switching technology ensures that the system can maintain stable operation even in the event of hardware failure.

[0020] 6. Media and Entertainment: Streaming service providers use server switching to cope with sudden increases in the number of viewers or hardware failures to ensure that the quality and stability of video streaming are not affected.

[0021] In the above scenarios, in order to ensure service continuity, related technologies often use network data transmission to switch servers after they are configured in a redundant manner.

[0022] In addition, with the development of DCS system, DCS has become the main means of operation and management of nuclear power plant units to ensure the safe and reliable operation of the units. The field instrument collects the field signal to the input and output module (IO module), and all the signals are aggregated and processed by the controller and forwarded to the IO server; the real-time server obtains data from the IO server for processing functions such as alarm, log, trend, etc., and provides various information to the operator station for online display.

[0023] The DCS system of a nuclear power plant requires that the real-time server can provide uninterrupted data services, and the collection and display of on-site data will not be affected during the switching process when a server fails. Therefore, in order to ensure the stability and reliability of the system operation, the servers in the DCS system are configured in a dual-machine redundant manner. For the real-time server, all data collection and processing and the functions of providing services to the operator station are completed by the main server. When the main server fails, the real-time server fault diagnosis is carried out by transmitting data over the network and the slave server is automatically switched to the main server.

[0024] However, the time for server switching using network data transmission is generally around 3 seconds. During this 3 seconds, the real-time server cannot receive the data sent by the IO server, resulting in the loss of data collected in this process, which cannot meet the requirements of uninterrupted data service.

[0025] In view of this, the embodiments of the present application are dedicated to providing a server switching method and system, which can place the state negotiation between the local monitoring card and the peer monitoring card, and the state switching of the server only needs to follow the state of the monitoring card to complete the switching, thereby achieving rapid switching of the server and ensuring uninterrupted data service. The following embodiments are described in detail one by one.

[0026] The embodiment of the present disclosure provides a server switching method, wherein the server switching system comprises: a plurality of servers arranged in a redundant manner, each server being provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring cards on all the servers are connected, such as Figure 1 As shown, the method includes: Step 100: The monitoring application module periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time.

[0027] The monitoring application module used to execute step 100 refers to the monitoring application module in each server in the server switching system. This end refers to the same end as the end where the monitoring application module is located, and the opposite end refers to the end that is different from the end where the monitoring application module is located. Assume that the server switching system is two servers set up in a redundant manner, namely server A and server B, and servers A and B are both provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring card in server A is connected to the monitoring card in server B. For the monitoring card driver module on server A, the monitoring card driver module on this end refers to the monitoring card driver module in server A, the monitoring card on this end refers to the monitoring card in server A, and the monitoring card on the opposite end refers to the monitoring card in server B; and for the monitoring card driver module on server B, the monitoring card driver module on this end refers to the monitoring card driver module in server B, the monitoring card on this end refers to the monitoring card in server B, and the monitoring card on the opposite end refers to the monitoring card in server A.

[0028] The monitoring cards on all servers can be connected using a DB15 signal transmission cable to transmit status signals between all devices. Taking the two servers set up in the above redundant manner, server A and server B as an example, the monitoring card on server A and the monitoring card on server B are connected using a DB15 signal transmission cable, and the status of the monitoring card on server A is transmitted to the monitoring card in server B in real time, and the status of the monitoring card on server B is transmitted to the monitoring card in server A in real time. Therefore, for the monitoring card driver module on server A, the monitoring application module in server A obtains the status of the monitoring card of server A and the status of the monitoring card in server B from the monitoring card of server A through the monitoring card driver module of server A, and for the monitoring card driver module on server B, the monitoring application module in server B obtains the status of the monitoring card of server B and the status of the monitoring card in server A from the monitoring card of server B through the monitoring card driver module of server B.

[0029] The monitoring application module can use the built-in monitoring application program to perform the operations that need to be performed, and the monitoring card driver module can use the built-in monitoring card driver to perform the operations that need to be performed.

[0030] Step 110. After each acquisition operation is completed, the monitoring application module sets the master-slave status of the local monitoring card according to the status of the local monitoring card and the status of the opposite monitoring card, and when the master-slave status set this time changes compared with the master-slave status set last time, the master-slave status of the local monitoring card set this time is notified to the identity switching module.

[0031] The local monitoring card driver module is used to control the normal operation of the local monitoring card and provide an interface for the local monitoring application module, and the provided interface includes: a status read interface and a status write interface. When the local monitoring card driver module includes a status read interface and a status write interface, the monitoring application module periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, which means: the monitoring application module periodically reads the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the status read interface provided by the local monitoring card driver module; the monitoring application module sets the master-slave status of the local monitoring card according to the status of the local monitoring card and the status of the opposite monitoring card obtained, which means: the monitoring application module writes the master-slave status determined this time to the local monitoring card through the status write interface provided by the local monitoring card driver module.

[0032] The status of the local monitoring card and the status of the peer monitoring card include: master status, slave status, and idle status. The master-slave status refers to the master status or slave status. The monitoring card is a PCI interface hardware device. When used on site, the monitoring card is inserted into the PCI slot of the server. In order to maintain the master-slave status of the monitoring card, the monitoring application module needs to periodically call the card write status interface of the monitoring card driver module to set the master-slave status of the monitoring card, otherwise the monitoring card will enter the idle state.

[0033] The DB15 signal transmission cable transmits 6 signals in parallel, of which 3 are used to receive the status of the peer monitoring card, and the other 3 are used to send the status of the local monitoring card to the peer monitoring card. Among the 3 signals used to receive the status of the peer monitoring card, 1 is used to identify whether the peer monitoring card exists, and the other 2 are used to identify the status of the peer monitoring card (e.g., master status, slave status, or idle status). Among the 3 signals used to send the status of the local monitoring card to the peer monitoring card, 1 is used to identify whether the local monitoring card exists, and the other 2 are used to identify the status of the local monitoring card (e.g., master status, slave status, or idle status).

[0034] Through the status reading interface provided by the local monitoring card driver module, the status of the local monitoring card and the status of the opposite monitoring card can be read from the local monitoring card by calling the status reading interface. Each time the status reading interface is called, both the status of the local monitoring card and the status of the opposite monitoring card can be read.

[0035] The read status can be represented by four-bit binary data, and the four-bit binary data can be represented by D3D2D1D0.

[0036] Among them, D1D0 is the read local monitoring card status, which is defined as follows: D1D0= 00 means the local monitoring card is in idle state; D1D0= 01 means the local monitoring card is in slave state; D1D0= 10 means the local monitoring card read is in the host state; D3D2 is the read peer monitoring card status, which is defined as follows: D3D2= 00 means the peer monitoring card is in idle state; D3D2= 01 means that the peer monitoring card is in slave state. D3D2= 10 means that the peer monitoring card is in the host state; D3D2= 11 means the peer monitoring card read does not exist and is running in stand-alone mode.

[0037] The set state (also called the written state) can be represented by two-bit binary data, and the two-bit binary data can be represented by D1D0. Among them, the state of the local monitoring card set is defined as follows: D1D0= 00 means setting the state of the local monitoring card to idle state; D1D0= 01 means setting the state of the local monitoring card to slave state; D1D0= 10 means setting the status of the local monitoring card to the host status.

[0038] The master-slave state set this time may be consistent with the master-slave state set last time, for example, the master-slave state set last time was the master state, and the master-slave state set this time is also the master state, and for another example, the master-slave state set last time was the slave state, and the master-slave state set this time is also the slave state. When the master-slave state set this time is inconsistent with the master-slave state set last time, for example, the master-slave state set last time was the master state, and the master-slave state set this time is the slave state, and for another example, the master-slave state set this time is the slave state, and the master-slave state set this time is the master state, it means that the master-slave state set this time has changed compared with the master-slave state set last time, so the master-slave state of the local monitoring card set this time is notified to the identity switching module.

[0039] Step 120: The identity switching module performs a switching operation of the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

[0040] The identity switching module may perform switching operations of the corresponding server status including: data synchronization and consistency check, configuration update, service switching and load balancing, monitoring and alarm system update, log recording and auditing.

[0041] Data synchronization means that when switching from a master server to a slave server, the identity switching module needs to ensure that all data on the slave server is synchronized with the master server, especially database or key business data. This can be achieved through data synchronization mechanisms (such as master-slave synchronization of databases, file synchronization, etc.). Consistency check means that before switching, data consistency check needs to be performed on the slave server to ensure that the system will not have problems due to data inconsistency after switching. For example, check the log synchronization and transaction status in the database.

[0042] Configuration update means that the identity switching module needs to update the role configuration of the master server or slave server. Network configuration update means that the identity switching module needs to adjust the network configuration, for example, modify routing, DNS, load balancing, etc., to ensure that the client or other components can access the new master server.

[0043] Service switching means that the identity switching module needs to ensure that the new primary server can smoothly take over all services of the primary server, which may involve starting some specific services, configurations or processes. Load balancing means that if there is a load balancer (such as a hardware load balancer or a software load balancer) in the system, the identity switching module needs to notify the load balancer to update and direct traffic to the new primary server to ensure that requests from the client to the primary server can be correctly routed to the new host.

[0044] Monitoring system update means that the identity switching module needs to guide the monitoring system to understand the new primary server role and start monitoring the operating status of the new host, including system resource monitoring, performance monitoring, logging, etc. Alarm system update means that the identity switching module needs to synchronously update the alarm system to ensure that the new primary server status is correctly monitored and promptly notify the administrator when a failure or abnormality occurs.

[0045] Logging means that the identity switching module should record detailed log information when performing any switching operation, including the time, reason, operation performed, affected services, etc. These logs will help with subsequent troubleshooting and auditing. Auditing means that if the system involves important business, the identity switching operation may need to comply with compliance requirements, and all switching operations should be recorded for later tracking and auditing.

[0046] The server switching method provided in the embodiment of the present application is that the monitoring application module periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, and after each acquisition operation is completed, the master-slave status of the local monitoring card is set according to the obtained status of the local monitoring card and the status of the opposite monitoring card, and when the master-slave status of the local monitoring card set this time changes compared with the master-slave status of the local monitoring card set last time, the master-slave status of the local monitoring card set this time is notified to the identity switching module; the identity switching module performs the switching operation of the corresponding server status according to the obtained master-slave status of the local monitoring card, so the status negotiation is completed by the local monitoring card and the opposite monitoring card, and the server status switching only needs to follow the status of the monitoring card to complete the switching, thereby realizing the rapid switching of the server and ensuring uninterrupted data service.

[0047] When the redundancy setting mode is a dual-machine redundancy setting mode (taking server A and server B as an example), the monitoring card can refer to a dual-machine monitoring card, the monitoring card driver module can refer to a dual-machine monitoring card driver module, and the monitoring card application module can refer to a dual-machine monitoring card application module. Therefore, server A and server B are respectively provided with a dual-machine monitoring card, a dual-machine monitoring card driver module, and a dual-machine monitoring card application module. The status reading and writing process of the dual-machine monitoring card is as follows: Figure 2 As shown, for server A, the dual-machine monitoring card in server A reads the status of the local monitoring card (i.e., the dual-machine monitoring card in server A) and the status of the opposite monitoring card (i.e., the dual-machine monitoring card in server B) from the dual-machine monitoring card in server A through the dual-machine monitoring card driver module in server A, and after determining the master-slave status of the local monitoring card, writes it to the dual-machine monitoring card in server A through the dual-machine monitoring card driver module in server A. For server B, the process is similar and will not be repeated.

[0048] In an exemplary embodiment, the method further includes: The monitoring application module opens the local monitoring card through the local monitoring card driver module; In response to the successful opening of the local monitoring card and the successful opening of the opposite monitoring card, and in the case where the local monitoring card and the opposite monitoring card are opened at the same time, the monitoring application module obtains the local master state setting right, and determines whether the local monitoring card has the master state priority setting right according to the obtained local master state setting right; In response to the judgment result that the local monitoring card enjoys the right to set the master state first, the monitoring application module obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, and sets the master-slave state of the local master state to the master state when the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a non-master state.

[0049] When multiple servers are set up in a redundant manner, one end is usually pre-designated to have the right to set the master state first. When both the local monitoring card and the peer monitoring card are successfully opened and opened at the same time, the need to obtain the right to set the local master state is because it is necessary to determine whether the local monitoring card has the right to set the master state, and then determine whether to "preemptively" set the master-slave state of the local monitoring card. Because after power-on, both the local monitoring card and the peer monitoring card are in idle state, whichever monitoring application module takes priority, the master-slave state of the local monitoring card of the corresponding monitoring application module will be set to the master state.

[0050] However, when the local monitoring card and the peer monitoring card are not opened at the same time, the monitoring application module does not need to obtain the local main state setting right, because the monitoring card that is successfully opened first will definitely "seize" the main state, regardless of whether it enjoys the main state priority setting right.

[0051] Taking the example of setting up two servers (i.e., server A and server B) in a redundant manner in the above embodiment, and turning on the monitoring cards in server A and server B at the same time, after the initial power-on, the monitoring application module in server A turns on the local monitoring card (i.e., the monitoring card in server A) through the local monitoring card driver module (i.e., the monitoring card driver module in server A), and the state of the local monitoring card is idle, and the monitoring application module in server A sets the state of the local monitoring card to a slave state; the monitoring application module in server B turns on the local monitoring card (i.e., the monitoring card in server B) through the local monitoring card driver module (i.e., the monitoring card driver module in server B), and the state of the local monitoring card is idle, and the monitoring application module in server B sets the state of the local monitoring card to a slave state. Subsequently, the monitoring application module in server A obtains the right to set the main state of the local end, and judges whether the local monitoring card enjoys the right to set the main state priority based on the obtained right to set the main state of the local end. When it is judged that the local monitoring card enjoys the right to set the main state priority, the monitoring application module in server A obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, and sets the master-slave status of the local master state to the master status when the status of the local monitoring card is a slave status and the status of the opposite monitoring card is a non-master status.

[0052] In an exemplary embodiment, the method further includes: In response to the judgment result that the local monitoring card does not enjoy the right to prioritize the setting of the master state, the monitoring application module obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card through the local monitoring card driver module at a preset time, and sets the master-slave state of the local master state to the slave state when the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a master state.

[0053] Still taking the redundant setting of two servers in the above embodiment, server A and server B as an example, in the process of the monitoring application module in server A setting the master-slave status of the local monitoring card, the monitoring application module in server A obtains the local master status setting right, and judges whether the local monitoring card enjoys the master status priority setting right based on the obtained local master status setting right. When it is judged that the local monitoring card does not enjoy the master status priority setting right, the monitoring application module in server A waits for a preset time period (the preset time period is sufficient for the monitoring application module in server B to set the master-slave status of its monitoring card to the master status). After the preset time period, the local monitoring card driver module obtains the status of the local monitoring card and the status of the opposite monitoring card (i.e., the monitoring card in server B) from the local monitoring card, and when the status of the local monitoring card is the slave status and the status of the opposite monitoring card is the master status, the master-slave status of the local master status is set to the slave status.

[0054] The preset time can be set with reference to the total time required for a series of operations to set the main state in the initial state. When the preset time is set with reference to the total time required for the aforementioned series of operations, the preset time should not be less than the total time required for the aforementioned series of operations. The aforementioned series of operations include: the application module obtains the right to set the main state of the local end through the local monitoring card, and when judging whether the local monitoring card has the right to set the main state first according to the right to set the main state of the local end, the application module obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card, and sets the master-slave state of the local monitoring card to the master state.

[0055] In an exemplary embodiment, the monitoring application module sets the master-slave status of the local monitoring card according to the obtained status of the local monitoring card and the status of the opposite monitoring card, including: In response to the obtained state of the local monitoring card and the obtained state of the opposite monitoring card being in a reasonable state relationship, the monitoring application module sets the master-slave state of the local monitoring card according to the obtained state of the local monitoring card; wherein the reasonable state relationship is a state mapping to the respective servers so that the multiple servers are set in a redundant manner; In response to an unreasonable state relationship between the obtained state of the local monitoring card and the obtained state of the opposite monitoring card, the monitoring application module sets the master-slave state of the local monitoring card according to the local redundant state, the obtained state of the local monitoring card and the state of the opposite monitoring card; wherein, the unreasonable state relationship is a state mapping to the respective servers that cannot make it possible for multiple servers to be set up in a redundant manner; the local redundant state includes: the local master state setting right or the redundant state of the local monitoring card.

[0056] Still taking the redundant setting of two servers in the above embodiment, server A and server B as an example, the relationship between the state of the local monitoring card obtained and the state of the opposite monitoring card obtained is a reasonable state relationship, which means: the state of the local monitoring card obtained is mapped to the local server, the state of the opposite monitoring card obtained is mapped to the opposite server, and the local server and the opposite server are in a redundant setting relationship; and the relationship between the state of the local monitoring card obtained and the state of the opposite monitoring card obtained is an unreasonable state relationship, which means: the state of the local monitoring card obtained is mapped to the local server, the state of the opposite monitoring card obtained is mapped to the opposite server, and the local server and the opposite server cannot be in a redundant setting relationship; In an exemplary embodiment, the reasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a master state; Alternatively, the reasonable status relationship includes: the status of the monitoring card at the local end obtained is the master status and the status of the monitoring card at the opposite end obtained is the slave status.

[0057] When the status of the monitoring card at the local end and the status of the monitoring card at the opposite end are in a master-slave state, it means that a reasonable status relationship is maintained between the status of the monitoring card at the local end and the status of the monitoring card at the opposite end. Since the status of the server follows the status of the monitoring card and is consistent with the status of the monitoring card, the relationship between the servers can be maintained in a redundant manner.

[0058] In an exemplary embodiment, when the unreasonable state relationship is that the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a non-master state, and the local redundant state is a redundant state of the local monitoring card, the redundant state of the local monitoring card includes: a slave state count of the local monitoring card; The monitoring application module sets the master-slave status of the local monitoring card according to the local redundancy status, the status of the local monitoring card obtained, and the status of the opposite monitoring card, including: Obtaining the slave state count of the local monitoring card, and determining whether the obtained slave state count of the local monitoring card reaches a preset number; wherein the slave state count of the local monitoring card starts to accumulate from zero, accumulates when the master-slave state of the local monitoring card is a slave state, and returns to zero when the master-slave state of the local monitoring card is a non-slave state; In response to the obtained slave state count of the local monitoring card reaching a preset number, the monitoring application module sets the master-slave state of the local monitoring card to the master state.

[0059] When the status of the local monitoring card obtained is a slave status and the status of the opposite monitoring card obtained is a non-master status, that is, a slave status or an idle status, it means that there is no master status between the status of the local monitoring card obtained and the status of the opposite monitoring card, and it is an unreasonable status relationship. Then consider setting the master-slave status of the local monitoring card to the master status. Before setting the master-slave status of the local monitoring card to the master status, the redundant status of the local monitoring card in the recent period of time also needs to be considered. Therefore, the slave status count of the local monitoring card is obtained, and when the slave status count of the local monitoring card obtained reaches the preset number of times, it means that the local monitoring card is normal, and the status of the local monitoring card is set to the master status.

[0060] In an exemplary embodiment, when the unreasonable state relationship is that the state of the local monitoring card obtained is the master state and the state of the opposite monitoring card obtained is the master state, and the local redundant state is the local master state setting right, the monitoring application module sets the master-slave state of the local monitoring card according to the local redundant state, the state of the local monitoring card obtained, and the state of the opposite monitoring card, including: The monitoring application module determines whether the local monitoring card has the right to set the main state first according to the local main state setting right; In response to the judgment result that the local monitoring card does not have the right to set the master state first, the monitoring application module sets the master-slave state of the local monitoring card to the slave state.

[0061] When the status of the local monitoring card obtained is the master status and the status of the opposite monitoring card obtained is the master status, it means that the status of the local monitoring card and the status of the opposite monitoring card are both master status, which is an unreasonable status relationship. Consider setting the master status of one of the monitoring cards to the slave status. At this time, it is necessary to consider that the local monitoring card does not have the right to set the master status first. If the local server does not have the right to set the master status first, consider leaving the master status to the opposite monitoring card. The monitoring application module sets the master-slave status of the local monitoring card to the slave status, thereby ensuring that the master-slave status of the local monitoring card and the master-slave status of the opposite monitoring card do not conflict, which is a reasonable status relationship.

[0062] In an exemplary embodiment, the method further includes: In response to the judgment result that the local monitoring card has the right to set the master state first, the monitoring application module sets the master-slave state of the local monitoring card to the master state.

[0063] If the local server has the right to set the master state first, it will "occupy" the master state, and the monitoring application module will set the master-slave state of the local monitoring card as the master state, thereby ensuring that the master-slave state of the local monitoring card does not conflict with the master-slave state of the opposite monitoring card, which is a reasonable state relationship.

[0064] The server switching method provided in the embodiment of the present application can be divided into the following according to the timing of setting the monitoring card status: the process of setting the monitoring card status during initialization (initial power-on) and the process of setting the monitoring card status during non-initialization (normal use). Taking the dual-machine redundant setting method as an example, the process of setting the monitoring card status during initialization can be as follows: Figure 3 As shown, including: Step 300, open the dual-machine monitoring card device, and execute step 310 when it is successfully opened.

[0065] If the dual-machine monitoring card fails to be opened, it can be judged that the dual-machine monitoring card is abnormal, an error is prompted and the program exits.

[0066] Step 310, determine whether the setting times of the local monitoring card is greater than the maximum setting times. If not, when the local monitoring card and the opposite monitoring card are turned on at the same time, execute step 320. If greater than the maximum setting times, execute step 330.

[0067] Step 320, determine whether the local end is machine B, if it is machine B, execute step 340, if it is not machine B, execute step 350.

[0068] In this step, the server is divided into one end having the right to set the main status first and the other end not having the right to set the main status first according to the power supply source, which are respectively recorded as machine A and machine B. When machine A and machine B are started at the same time, machine A has the right to set the main status first.

[0069] Step 330, exit the setup process.

[0070] Step 340: Delay for a certain period of time, and after the delay, set the local monitoring card to a slave state according to the local monitoring card state and the opposite monitoring card state.

[0071] After step 340, step 360 is continued, and in this step, due to the delay, the opposite monitoring card "seizes" the master state, and the local monitoring card state is idle, so the local monitoring card is set to the slave state. The delay time can be 1S.

[0072] Step 350: Set the local monitoring card state as the main state according to the local monitoring card state and the peer monitoring card state.

[0073] After step 350, the process continues to execute step 360. In this step, since the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a non-master state, the local monitoring card is set to a master state.

[0074] Step 360: Determine whether the setting is successful. If successful, complete the setting. If unsuccessful, execute step 370. Step 370, set the number of times plus 1, and then return to execute step 310.

[0075] Still taking the dual-machine redundant setting as an example, the process of setting the monitoring card status without initialization can be as follows: Figure 4 As shown, including: Step 400: Obtain the status of the local monitoring card and the status of the peer monitoring card.

[0076] Step 410, determine whether the status of the local monitoring card and the status of the opposite monitoring card are a master-slave state. If so, execute step 420. If not, execute steps 430 and 450 simultaneously.

[0077] Step 420: Set the master-slave status of the local monitoring card according to the status of the local monitoring card.

[0078] Step 430, determine whether the local monitoring card is in the slave state for N consecutive cycles and the opposite monitoring card is in the non-master state. If the local monitoring card is in the slave state for N consecutive cycles and the opposite monitoring card is in the non-master state, execute step 440.

[0079] In this step, N can be 10.

[0080] Step 440: Set the local monitoring card to the master state.

[0081] Step 450: Determine whether the local monitoring card and the opposite monitoring card are both in the master state, and whether the local server is machine B. If the local monitoring card and the opposite monitoring card are both in the master state, and the local server is machine B, execute step 460; if the local monitoring card and the opposite monitoring card are both in the master state, and the local server is machine A, execute step 470.

[0082] Step 460, setting the local monitoring card to slave state; Step 470: Set the local monitoring card to the master state.

[0083] Corresponding to the above-mentioned server switching method, an embodiment of the present application also provides a server switching system. Figure 5Schematic diagram of a server switching system provided in an embodiment of the present application. Figure 5 As shown, the server switching system provided in the embodiment of the present application includes: a plurality of servers arranged in a redundant manner, each server is provided with a monitoring card 500, a monitoring card driver module 510, a monitoring application module 520 and an identity switching module 530, and the monitoring cards on all servers are connected; The monitoring application module 520 is used to periodically obtain the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card 500 through the local monitoring card driver module 510; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time; The monitoring application module 520 is also used to set the master-slave status of the monitoring card at the local end according to the status of the monitoring card at the local end and the status of the monitoring card at the opposite end after each acquisition operation is completed, and when the master-slave status set at the current time changes from the master-slave status set at the previous time, notify the master-slave status of the monitoring card at the local end set at the current time to the identity switching module 530; The identity switching module 530 is used to switch the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

[0084] In an exemplary embodiment, the monitoring application module 520 is further used to: Opening the local monitoring card 500 through the local monitoring card driver module 510; In response to the successful opening of the local monitoring card 500, the local main state setting right is obtained, and according to the obtained local main state setting right, it is determined whether the local monitoring card has the main state priority setting right; In response to the judgment result that the local monitoring card enjoys the right to set the master state first, the local monitoring card driver module 510 obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card, and when the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a non-master state, the master-slave state of the local master state is set to the master state.

[0085] In an exemplary instance, the monitoring application module 520 is also used to respond to the judgment result that the local monitoring card does not enjoy the right to prioritize the setting of the main state, and obtain the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card 500 through the local monitoring card driver module 510 after a preset time period, and set the master-slave state of the local master state to the slave state when the state of the local monitoring card is the master state and the state of the opposite monitoring card is the slave state.

[0086] In an exemplary embodiment, the monitoring application module 520 is further used to: In response to the state of the local monitoring card obtained and the state of the opposite monitoring card obtained belonging to a reasonable state relationship, the master-slave state of the local monitoring card is set according to the state of the local monitoring card obtained; wherein the reasonable state relationship is a state mapping to the respective servers so that multiple servers can be set in a redundant manner; In response to an unreasonable state relationship between the obtained state of the local monitoring card and the obtained state of the opposite monitoring card, the master-slave state of the local monitoring card is set according to the local redundant state, the obtained state of the local monitoring card and the state of the opposite monitoring card; wherein, the unreasonable state relationship is a state mapping to the respective servers that cannot make multiple servers set in a redundant manner; the local redundant state includes: the local master state setting right or the redundant state of the local monitoring card.

[0087] In an exemplary embodiment, the reasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a master state; Alternatively, the reasonable status relationship includes: the status of the monitoring card at the local end obtained is the master status and the status of the monitoring card at the opposite end obtained is the slave status.

[0088] In an exemplary embodiment, the unreasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a non-master state; Alternatively, the unreasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a slave state.

[0089] In an exemplary embodiment, when the unreasonable state relationship is that the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a non-master state, and the local redundant state is the redundant state of the local monitoring card, the redundant state of the local monitoring card includes: the slave state count of the local monitoring card; the monitoring application module 520 is also used for: Obtaining the slave state count of the local monitoring card, and determining whether the obtained slave state count of the local monitoring card reaches a preset number; wherein the slave state count of the local monitoring card starts to accumulate from zero, accumulates when the master-slave state of the local monitoring card is a slave state, and returns to zero when the master-slave state of the local monitoring card is a non-slave state; In response to the obtained slave state count of the local monitoring card reaching a preset number, the master-slave state of the local monitoring card is set to the master state.

[0090] In an exemplary embodiment, when the unreasonable state relationship is that the state of the local monitoring card obtained is the main state and the state of the opposite monitoring card obtained is the main state, and the local redundant state is the local main state setting right; the monitoring application module 520 is also used to: According to the master status setting right of the local end, judging whether the local monitoring card has the master status priority setting right; In response to the judgment result that the local monitoring card does not have the right to set the master state first, the master-slave state of the local monitoring card is set to the slave state.

[0091] In an exemplary embodiment, the monitoring application module 520 is further configured to set the master-slave state of the local monitoring card to the master state in response to a judgment result that the local monitoring card has the right to set the master state first.

[0092] The server switching system provided in this embodiment and the server switching method provided in the above embodiments of this application belong to the same application concept, and can execute the server switching method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the server switching method. For technical details not fully described in this embodiment, please refer to the specific processing content of the server switching method provided in the above embodiments of this application, and will not be repeated here.

[0093] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A server switching method, applied in a server switching system, characterized in that: The server switching system includes: a plurality of servers arranged in a redundant manner, each server is provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring cards on all the servers are connected, and the method includes: The monitoring application module periodically obtains the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time; After each acquisition operation is completed, the monitoring application module sets the master-slave status of the local monitoring card according to the status of the local monitoring card and the status of the opposite monitoring card, and notifies the identity switching module of the master-slave status of the local monitoring card set this time when the master-slave status set this time changes compared with the master-slave status set last time; The identity switching module performs a switching operation of the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

2. The method according to claim 1, characterized in that The method further comprises: The monitoring application module opens the local monitoring card through the local monitoring card driver module; In response to the successful opening of the local monitoring card and the opposite monitoring card, and when the local monitoring card and the opposite monitoring card are opened at the same time, the monitoring application module obtains the local master state setting right, and determines whether the local monitoring card has the master state priority setting right according to the obtained local master state setting right; In response to the judgment result that the local monitoring card enjoys the right to set the master state first, the monitoring application module obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card through the local monitoring card driver module, and sets the master-slave state of the local master state to the master state when the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a non-master state.

3. The method according to claim 2, characterized in that The method further comprises: In response to the judgment result that the local monitoring card does not enjoy the right to prioritize the setting of the master state, the monitoring application module obtains the state of the local monitoring card and the state of the opposite monitoring card from the local monitoring card through the local monitoring card driver module after a preset time, and sets the master-slave state of the local master state to the slave state when the state of the local monitoring card is a slave state and the state of the opposite monitoring card is a master state.

4. The method according to any one of claims 1 to 3, characterized in that: The monitoring application module sets the master-slave status of the local monitoring card according to the obtained status of the local monitoring card and the status of the opposite monitoring card, including: In response to the obtained state of the local monitoring card and the obtained state of the opposite monitoring card being in a reasonable state relationship, the monitoring application module sets the master-slave state of the local monitoring card according to the obtained state of the local monitoring card; wherein the reasonable state relationship is a state mapping to the respective servers so that multiple servers can be set in a redundant manner; In response to an unreasonable state relationship between the obtained state of the local monitoring card and the obtained state of the opposite monitoring card, the monitoring application module sets the master-slave state of the local monitoring card according to the local redundant state, the obtained state of the local monitoring card and the state of the opposite monitoring card; wherein, the unreasonable state relationship is a state mapping to the respective servers that cannot make it possible for multiple servers to be set up in a redundant manner; the local redundant state includes: the local master state setting right or the redundant state of the local monitoring card.

5. The method according to claim 4, characterized in that The reasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a master state; Alternatively, the reasonable status relationship includes: the status of the monitoring card at the local end obtained is the master status and the status of the monitoring card at the opposite end obtained is the slave status.

6. The method according to claim 4, characterized in that The unreasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a non-master state; Alternatively, the unreasonable state relationship includes: the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a slave state.

7. The method according to claim 6, characterized in that When the unreasonable state relationship is that the state of the local monitoring card obtained is a slave state and the state of the opposite monitoring card obtained is a non-master state, and the local redundant state is a redundant state of the local monitoring card, the redundant state of the local monitoring card includes: a slave state count of the local monitoring card; The monitoring application module sets the master-slave status of the local monitoring card according to the local redundancy status, the status of the local monitoring card obtained, and the status of the opposite monitoring card, including: Obtaining the slave state count of the local monitoring card, and determining whether the obtained slave state count of the local monitoring card reaches a preset number; wherein the slave state count of the local monitoring card starts to accumulate from zero, accumulates when the master-slave state of the local monitoring card is a slave state, and returns to zero when the master-slave state of the local monitoring card is a non-slave state; In response to the obtained slave state count of the local monitoring card reaching a preset number, the monitoring application module sets the master-slave state of the local monitoring card to the master state.

8. The method according to claim 6, characterized in that When the unreasonable state relationship is that the state of the local monitoring card obtained is the main state and the state of the opposite monitoring card obtained is the main state, and the local redundant state is the local main state setting right; the monitoring application module sets the master-slave state of the local monitoring card according to the local redundant state, the obtained state of the local monitoring card and the state of the opposite monitoring card, including: The monitoring application module determines whether the local monitoring card has the right to set the main state first according to the local main state setting right; In response to the judgment result that the local monitoring card does not have the right to set the master state first, the monitoring application module sets the master-slave state of the local monitoring card to the slave state.

9. The method according to claim 8, characterized in that The method further comprises: In response to the judgment result that the local monitoring card has the right to set the master state first, the monitoring application module sets the master-slave state of the local monitoring card to the master state.

10. A server switching system, characterized in that: include: Multiple servers are set up in a redundant manner, each server is provided with a monitoring card, a monitoring card driver module, a monitoring application module and an identity switching module, and the monitoring cards on all servers are connected; The monitoring application module is used to periodically obtain the status of the local monitoring card and the status of the opposite monitoring card from the local monitoring card through the local monitoring card driver module; wherein the status of the opposite monitoring card is transmitted to the local monitoring card in real time; The monitoring application module is further used to set the master-slave status of the monitoring card at the local end according to the status of the monitoring card at the local end and the status of the monitoring card at the opposite end after each acquisition operation is completed, and when the master-slave status set this time changes from the master-slave status set last time, notify the identity switching module of the master-slave status of the monitoring card at the local end set this time; The identity switching module is used to switch the corresponding state of the server according to the master-slave state of the local monitoring card obtained.

Citation Information

Patent Citations

  • Two-computer switching device for redundant server switching

    CN101741532A

  • Module capable of achieving in-series server connection

    CN106919456A

  • Method and system for determining roles of servers of transformer substation monitoring system

    CN112394662A

  • Monitoring method and device of redundant system, equipment and storage medium

    CN116048911A

  • Redundancy monitoring system and method, electronic equipment and readable storage medium

    CN118354034A