Master-slave hot standby scheduling method, system and storage medium for universal management gateway
By adopting the master-slave hot standby scheduling method in the UMG system, using initial heartbeat packet negotiation and data synchronization, the problem of single point failure of the main control board is solved, and the system is high availability and reliability is achieved, reducing business interruption time.
Patent Information
- Application Number
- CN202510163769.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-14
AI Technical Summary
A single point of failure of the main control board in the existing UMG system causes the VoIP call service to be interrupted, affecting the stability and reliability of the system.
The master-slave hot standby scheduling method of the general management gateway is adopted, and the master-slave hot standby configuration is carried out through at least two initial slaves, and the working master and working slave are negotiated to determine the working master and working slave, real-time data synchronization and failover are achieved.
It effectively avoids single point of failure, improves the reliability and stability of the system, reduces business interruption time, and enhances the system's fault tolerance and user experience.
Smart Images

Figure CN119652739B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer networks, and in particular to a master-slave hot standby scheduling method, system and storage medium for a universal management gateway. Background Art
[0002] In modern communication systems, especially IP-based voice communication systems, namely VoIP, high availability and reliability of the system have become crucial. UMG, also known as Unified-Media-Gateway or Universal Management Gateway, is a key component in the VoIP system and is responsible for the conversion and transmission of voice and data.
[0003] In the existing UMG system, if the main control board fails, the entire UMG will not work properly, resulting in interruption of VoIP call service. This single point of failure problem seriously affects the stability and reliability of the system. In order to solve the above problems, it is necessary to implement dual-master hot standby technology, that is, deploy two control boards in UMG, which can synchronize status information and data in real time. In this way, when one control board fails, the other control board can take over all work to ensure the continuous operation of UMG. Summary of the invention
[0004] In order to enable UMG to achieve dual-master hot standby, that is, when one control board fails, the other control board can take over all work, the present application provides a master-slave hot standby scheduling method, system and storage medium for a universal management gateway.
[0005] In a first aspect, the present application provides a master-slave hot standby scheduling method for a universal management gateway, which adopts the following technical solution:
[0006] A master-slave hot standby scheduling method for a universal management gateway comprises the following steps:
[0007] Based on at least two initial slaves both in slave state, at least one of the initial slaves is configured to negotiate with the other initial slaves through an initial heartbeat packet;
[0008] After negotiation, the initial slave configured as master priority is used as the working master, and the other initial slaves are used as working slaves;
[0009] If the working host and the working slave are connected, the working host executes the set business policy based on the set business address; the working host sends the first heartbeat packet to the working slave based on the first cycle, and the working host sends the synchronization data corresponding to the first heartbeat packet based on the second cycle; the working slave executes the set non-business policy based on the set non-business address, and sends the second heartbeat packet to the working host regularly; the working host verifies the first heartbeat packet and the second heartbeat packet to generate a verification result, and sends the verification result to the working slave; the working slave receives the synchronization data according to the verification result of successful verification, and synchronizes the data with the working host;
[0010] If there is no connection between the working host and the working slave, the working host executes the set business policy based on the set business address; searches the working slave online based on the set search instruction; the working slave waits for the search instruction, and if the search instruction is obtained, establishes a connection with the working host according to the search instruction;
[0011] The working host is configured with a monitoring module with an independent computing core, and the monitoring module is controlled by the working host to send a temporary heartbeat packet to the working slave; the working host identifies the execution status of the business policy, and if the execution status is good, controls the monitoring module to suspend sending the temporary heartbeat packet to the working slave; if the execution status is a fault, the monitoring module sends the temporary heartbeat packet to the working slave;
[0012] After the working slave obtains the temporary heartbeat packet, it switches to the working master according to the latest synchronization data.
[0013] By adopting the above technical solution, firstly, at least two initial slaves are used in the universal management gateway to perform master-slave hot standby configuration, and the working host and the working slave are determined through the initial heartbeat packet negotiation, which effectively avoids single point failures, improves the reliability and stability of the system, and ensures the continuity of business. Secondly, in the connected state, the working host and the working slave periodically send and verify heartbeat packets and synchronize data to ensure the real-time consistency of the master-slave state information and data, so that the slave can quickly and seamlessly switch when the host fails, reducing the business interruption time. Furthermore, when there is no connection between the master and the slave, the search instructions of the working host and the waiting response mechanism of the working slave can quickly restore the connection, further enhancing the fault tolerance of the system. Finally, the monitoring module configured in the working host can flexibly control the sending of temporary heartbeat packets according to the execution status of the business policy, so that the working slave can detect the host failure in time and switch to the host according to the latest synchronization data, optimize the fault detection and switching mechanism, improve the availability of the entire system and the ability to respond to emergencies, and meet the strict requirements of modern communication systems for high availability and reliability, especially in key business scenarios such as VoIP, which can significantly improve user experience and stable operation of the business. By adopting the master-slave hot standby scheduling method of the above-mentioned general management gateway, the single point failure problem of the main control board can be effectively solved in the UMG system, ensuring that when the working host fails, the working slave can quickly switch to the host to continue working, realizing the dual master hot standby function, ensuring the stability and reliability of the system, and improving the high availability of the VoIP system. At the same time, through the heartbeat packet negotiation, data synchronization and the setting of the monitoring module, the status information and data between the master and slave can be synchronized and effectively monitored in real time, ensuring the continuous and stable operation of the business.
[0014] Optionally, the step of negotiating through the initial heartbeat packet further includes the following sub-steps:
[0015] One of the initial slaves periodically queries the other initial slave according to a set period;
[0016] Determine whether the query is successful in each cycle. If the query is unsuccessful, count once; otherwise, do not count;
[0017] If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to another initial slave, and then the state of the current initial slave is switched to an independent master state;
[0018] or,
[0019] One of the initial slave machines repeatedly queries another initial slave machine;
[0020] Determine whether each query is successful. If the query is unsuccessful, count once; otherwise, do not count.
[0021] If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to another initial slave, and then the state of the current initial slave is switched to an independent master state.
[0022] By adopting the above technical solution, during the initial heartbeat packet negotiation phase, one initial slave performs regular or cyclic queries on another, and counts based on the query results, the connection status between the two initial slaves can be accurately determined. This mechanism enables the system to have a keen sense of abnormal connections between hosts, promptly discover possible connection problems, and effectively avoid data transmission errors or business interruptions caused by unstable connections, thereby ensuring the stable operation of the entire system.
[0023] Optionally, the step of negotiating through the initial heartbeat packet further includes the following sub-steps:
[0024] One of the initial slaves periodically queries the other initial slaves one by one according to a set period;
[0025] According to the number of other initial slaves, the length of the set period is anti-correlatedly adjusted; the more the number of other initial slaves is, the shorter the set period is; the fewer the number of other initial slaves is, the longer the set period is.
[0026] By adopting the above technical solution, in an environment with multiple initial slaves, by querying other initial slaves one by one according to the set cycle, negotiation can be carried out in an orderly manner. And the length of the set cycle is adjusted inversely according to the number of other initial slaves. When the number of other initial slaves is large, the set cycle is shortened, so that the query of all initial slaves can be completed faster. This adjustment mechanism helps to reasonably allocate system resources. Longer cycles are used when the number of initial slaves is small, which can avoid waste of resources caused by frequent queries. Because when the number of hosts is small, there is no need to frequently check to determine the master-slave relationship.
[0027] Optionally, the step of negotiating through the initial heartbeat packet further includes the following sub-steps:
[0028] Randomly selecting one of the multiple initial slaves as a random master;
[0029] Numbering the other initial slaves;
[0030] The other initial slaves query the random master in turn according to the number;
[0031] Determine whether the query of the initial slave is successful each time, if the query is unsuccessful, count once; otherwise, do not count;
[0032] If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to the random master, and then the state of the other current initial slaves is switched to an independent master state;
[0033] According to the numbers of the other initial slaves, the set number of times that the other initial slaves query the random master is adjusted.
[0034] By adopting the above technical solution, one of the multiple initial slaves is randomly selected as a random host, and the other hosts are queried in sequence according to the number. This method is more systematic and regular than disordered queries. Through a specific query order, query conflicts and confusion can be reduced, making the entire negotiation process more orderly, and improving the efficiency and success rate of negotiation. Each query result is counted, and a continuous count threshold is set to determine the connection status. This quantitative method can accurately identify whether the connection between the initial slave and the random host is normal. When the continuous count exceeds the set number of times, it is determined that it is not connected and the host state is switched, which provides an effective means for the system to promptly discover and handle connection failures, and helps to ensure the stability and reliability of the system. According to the number size of other initial slaves, the set number of times corresponding to the query random host is adjusted to increase the flexibility and adaptability of the system.
[0035] Optionally, the step of negotiating through the initial heartbeat packet further includes the following sub-steps:
[0036] Based on the total number of the initial slave machines, the plurality of zones are divided according to a set number;
[0037] Determine the working host in each zone as the intermediate host;
[0038] From the determined multiple intermediate hosts, query and negotiate to determine a final working host;
[0039] When determining the final working host,
[0040] The intermediate host does not retain the state of the intermediate host, and switches to the working slave state;
[0041] Alternatively, the intermediate host retains the status of the intermediate host, being both the host of the working slave and the slave of the working host.
[0042] By adopting the above technical solution, the intermediate host is determined by sharding, the negotiation scope is narrowed, the negotiation complexity is reduced, and the process of determining the final working host is accelerated. The intermediate host can choose to switch between different states, flexibly allocate resources according to actual needs, and improve resource utilization. It can adapt to changes in the number of hosts, ensure stable operation of the system, and make adjustments conveniently when adding or reducing hosts, thereby improving the system's response capabilities.
[0043] Optionally, after the working slave obtains the temporary heartbeat packet, the method of switching to the working master according to the latest synchronization data further includes the following sub-steps:
[0044] Backing up the configuration of the working slave in the to-be-switched state;
[0045] Using the latest synchronization data, configuring the current working slave as the working master;
[0046] Loading call data into the configured working host.
[0047] By adopting the above technical solution, the working slave configuration is backed up to prevent configuration loss or confusion during switching, ensuring that the system runs stably according to the original rules. The new host is configured using the latest synchronization data to quickly take over the work of the original host and reduce business interruption time. Loading call data allows the new host to quickly enter the working state, ensuring continuous and stable communication services and improving reliability.
[0048] Optionally, the call data synchronization method further includes the following sub-steps:
[0049] The working host periodically stores the currently existing call data in a preset call data file; the call data includes all call information and RTP information of both parties of the call;
[0050] The working slave periodically synchronizes the call data file from the working host. When the working slave switches to the working host, it immediately applies the call data file and continues to take over the call status and RTP stream status indicated in the call data file until the call ends.
[0051] By adopting the above technical solutions, we can ensure that calls are not interrupted due to host switching, improve user experience and communication service quality. Synchronize in the form of files to simplify the process, reduce resource consumption, and improve system operation efficiency. The working slave machine grasps the latest call data, responds to host failures, and ensures stable system operation. It is convenient for managers to monitor and analyze call data and improve system maintainability.
[0052] Optionally, the step of importing the latest synchronization data and switching to the working host further includes the following sub-steps:
[0053] The synchronization data corresponds to call data; the working host sends the call data to a first memory in the working slave and a second memory outside the working slave;
[0054] The synchronization data includes data obtained by slicing and combining the call data according to a slicing algorithm;
[0055] The working slave obtains the call data according to the synchronization data, and verifies the consistency value between the call data and the synchronization data;
[0056] If the consistency degree value is greater than a preset consistency reference value, the working slave machine switches to the working master machine according to the call data in the first memory; otherwise, the working slave machine obtains the call data in the second memory and switches to the working master machine according to the obtained call data.
[0057] By adopting the above technical solution, the working host sends the call data to the internal and external storage of the working slave, which improves data reliability and reduces the risk of data loss. The synchronous data adopts a slicing algorithm combination to reduce the transmission volume, improve transmission efficiency, and reduce bandwidth occupancy. The working slave verifies the consistency of the call data and the synchronous data, and switches from different storages according to the results to ensure accurate and reliable switching.
[0058] In a second aspect, the present application provides a master-slave hot standby scheduling system for a universal management gateway, which adopts the following technical solution:
[0059] A master-slave hot standby scheduling system for a universal management gateway comprises a processor, wherein the processor executes the steps of the master-slave hot standby scheduling method for the universal management gateway as described in any one of the above items.
[0060] In a third aspect, the present application provides a storage medium, which adopts the following technical solution:
[0061] A storage medium stores a program, and when the program is executed by a processor, the steps of the master-slave hot standby scheduling method of a universal management gateway described in any one of the above are implemented.
[0062] In summary, the present application includes at least one of the following beneficial technical effects:
[0063] By deploying dual-master hot standby technology and using at least two initial slaves for master-slave hot standby configuration, the problem of VoIP call service interruption caused by single-point failure of the main control board in the UMG system is effectively avoided, ensuring the high availability and reliability of the system. When the working host fails, the working slave can quickly switch to the working host based on the temporary heartbeat packet and the latest synchronization data, which greatly reduces the service interruption time, ensures the continuity of the business, and improves the system's ability to respond to emergencies. Call data is stored in the first memory inside the working slave and the second memory outside the machine, and the working slave regularly synchronizes the call data file to achieve data redundancy backup. Even if there is a problem with a storage location, the integrity and accessibility of the data can be ensured, further enhancing the stability and reliability of the system.
[0064] In the initial heartbeat packet negotiation phase, a variety of reasonable query methods are used, such as periodic query, cyclic query, and shard query, etc., combined with period adjustment, number setting and other strategies, to make the negotiation process more orderly and efficient, reduce negotiation time and complexity, and improve the negotiation success rate. When the working slave switches to the working master, according to the consistency value of the synchronization data and the call data, it flexibly chooses to obtain data from different storage devices for switching, ensuring the accuracy and reliability of the switching process, and also improving the switching efficiency.
[0065] The working master and the working slave periodically send and verify heartbeat packets and synchronize data to ensure the real-time consistency of the master and slave status information and data, and ensure accurate data synchronization. The synchronized data is obtained by slicing and combining the call data using a slicing algorithm, which optimizes the data transmission process, reduces network bandwidth usage, and improves data transmission efficiency. Storing call data in preset files for synchronization makes it easier for system administrators to monitor, analyze, and manage call data, improving the maintainability and management efficiency of the system.
[0066] The query cycle is adjusted according to the initial number of slaves, and the intermediate host state switching selection is selected to achieve the reasonable allocation and load balancing of system resources in different host number scenarios, improving resource utilization efficiency. Multiple negotiation and switching mechanisms enable the system to adapt well to changes in the initial number of slaves. Whether the system is expanded or contracted, there is no need to make large-scale modifications to the mechanism, which reduces the cost of system maintenance and upgrades and enhances the scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a step diagram of the master-slave hot standby scheduling method of the universal management gateway.
[0068] Figure 2 This is a diagram of the steps for determining an intermediate host based on multiple divided zones.
[0069] Figure 3 It is a sub-step diagram for importing the latest synchronization data and switching to a working host. DETAILED DESCRIPTION
[0070] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings.
[0071] In the description of this specification, the description with reference to the terms "certain embodiments", "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0072] The present application embodiment discloses a master-slave hot standby scheduling method for a universal management gateway, referring to Figure 1 , including the following steps:
[0073] Based on at least two initial slaves both in slave state, at least one of the initial slaves is configured to negotiate with the other initial slaves through an initial heartbeat packet.
[0074] After negotiation, the initial slave configured as master priority will be used as the working master, and the other initial slaves will be used as working slaves.
[0075] Based on at least two initial slaves that are both in slave state, these initial slaves are in a relatively equal slave position in the initial state, waiting for further negotiation and configuration. At least one of the initial slaves is pre-configured to negotiate with other initial slaves through an initial heartbeat packet. The initial heartbeat packet is a periodically sent signal used to transmit its own status information and conduct preliminary communication between initial slaves. For example, in a system including three initial slaves A, B, and C, host A is configured to negotiate with host B and host C through an initial heartbeat packet. Host A will send initial heartbeat packets to host B and host C at a certain time interval to inform its current status and some basic configuration information, and also receive initial heartbeat packets from host B and host C to understand their situation. After negotiation, according to the preset master priority rule, the initial slave configured as master priority will be used as the working master, and the other initial slaves will be used as working slaves. In the above example, if host A is determined to be master priority in the negotiation, then host A will become the working master, and host B and host C will become working slaves.
[0076] If the working host and the working slave are connected, the working host executes the set business policy based on the set business address; the working host sends the first heartbeat packet to the working slave based on the first cycle, and the working host sends the synchronization data corresponding to the first heartbeat packet based on the second cycle; the working slave executes the set non-business policy based on the set non-business address, and sends the second heartbeat packet to the working host regularly; the working host verifies the first heartbeat packet and the second heartbeat packet to generate a verification result, and sends the verification result to the working slave; the working slave receives the synchronization data according to the successful verification result, and synchronizes the data with the working host.
[0077] If the working host and the working slave are connected, the whole system is in normal operation, and the working host and the working slave each undertake different tasks and cooperate with each other. The working host executes the set business policy based on the set business address. The business address is a specific network address or memory address set specifically for processing business data. The working host can accurately obtain and process business data through this address, and forward, filter, and process the business data according to the pre-set business policy. For example, in a network management system, the working host receives management requests from various network devices according to the set business address, and processes them according to the business policy, such as configuring the device and monitoring the device status. At the same time, the working host sends the first heartbeat packet to the working slave based on the first cycle. The first cycle is a time interval pre-set according to the performance and requirements of the system, such as sending it every 5 seconds. The working host informs the working slave of its survival status and working status by sending the first heartbeat packet. The working host also sends synchronization data corresponding to the first heartbeat packet based on the second cycle. The second cycle is different from the first cycle. For example, synchronization data is sent every 10 seconds. The synchronization data includes business data, configuration information, etc. on the working host, so that the working slave can be updated and synchronized in time. The working slave executes the set non-business policy based on the set non-business address. The non-business address is used to process some auxiliary tasks that are not related to the main business, such as system monitoring, log recording, etc. The working slave performs corresponding operations according to the set non-business policy. At the same time, the working slave sends the second heartbeat packet to the working host regularly to inform the working host of its own status and working status. After receiving the second heartbeat packet sent by the working slave, the working host will verify the first heartbeat packet and the second heartbeat packet, and generate a verification result by comparing the key information in the heartbeat packet, such as timestamp, sequence number, status identification, etc., and then send the verification result to the working slave. After receiving the verification result of successful verification, the working slave will receive the synchronization data and synchronize the data with the working host to ensure that the data of the working slave is consistent with that of the working host, so that it can quickly take over the work of the working host when switching is required.
[0078] If there is no connection between the working host and the working slave, the working host executes the set business policy based on the set business address; searches for the working slave online based on the set search instructions; the working slave waits for the search instruction, and if the search instruction is obtained, establishes a connection with the working host according to the search instruction.
[0079] If there is no connection between the working host and the working slave, it may be due to network failure, equipment failure and other reasons. At this time, the working host still executes the set business policy based on the set business address, maintains the normal operation of the business as much as possible, and avoids business interruption due to connection interruption. At the same time, the working host will search the working slave online based on the set search instruction. The search instruction contains parameters such as the identification information, search range, and search time of the working slave. The working host will search in the network according to these parameters, try to find the working slave and establish a connection. For example, in a distributed system, when the network connection between the working host and the working slave is disconnected, the working host will search for the IP address or device identification of the working slave in the entire distributed network according to the set search instruction, and try to re-establish the connection. The working slave is in a state of waiting for the search instruction, and will continuously monitor the network. If the search instruction is obtained, it will establish a connection with the working host according to the information in the search instruction to restore the communication and collaboration between the two.
[0080] The working host is configured with a monitoring module with an independent computing core. The monitoring module is controlled by the working host and is used to send temporary heartbeat packets to the working slave. The working host identifies the execution status of the business policy. If the execution status is good, the monitoring module is controlled to suspend sending temporary heartbeat packets to the working slave. If the execution status is faulty, the monitoring module sends temporary heartbeat packets to the working slave.
[0081] The working host is equipped with a monitoring module with an independent computing core. The monitoring module has independent computing power and processing power, and can monitor the operating status of the working host in real time. The monitoring module is controlled by the working host and is used to send temporary heartbeat packets to the working slave. During operation, the working host will continuously identify the execution status of the business strategy, and judge the execution status of the business strategy by monitoring and analyzing the processing results of business data, the usage of system resources, the execution progress of business processes, and other aspects. If the execution status is good, it means that the working host is working normally. At this time, the working host will control the monitoring module to suspend sending temporary heartbeat packets to the working slave to reduce unnecessary network communication and system resource consumption. If the execution status is a fault, such as a large number of errors in business data processing, excessive system resource usage, and long-term unresponsiveness of business processes, the monitoring module will send a temporary heartbeat packet to the working slave to notify the working slave that the working host may have a fault.
[0082] After the working slave obtains the temporary heartbeat packet, it switches to the working master according to the latest synchronization data, takes over the work of the working master, continues to execute the set business strategy, and ensures the normal operation of the system.
[0083] First, at least two initial slaves are used in the general management gateway for master-slave hot standby configuration, and the working master and working slave are determined through the initial heartbeat packet negotiation, which effectively avoids single point failure, improves the reliability and stability of the system, and ensures the continuity of business. Secondly, in the connected state, the working master and the working slave ensure the real-time consistency of the master-slave state information and data by regularly sending and verifying heartbeat packets and synchronizing data, so that the slave can quickly and seamlessly switch when the master fails, reducing the service interruption time. Furthermore, when there is no connection between the master and the slave, the search instructions of the working master and the waiting response mechanism of the working slave can quickly restore the connection, further enhancing the fault tolerance of the system. Finally, the monitoring module configured in the working host can flexibly control the sending of temporary heartbeat packets according to the business policy execution status, so that the working slave can detect the host failure in time and switch to the host according to the latest synchronization data, optimize the fault detection and switching mechanism, improve the availability of the entire system and the ability to cope with emergencies, meet the strict requirements of modern communication systems for high availability and reliability, especially in key business scenarios such as VoIP, can significantly improve user experience and stable operation of business. By adopting the master-slave hot standby scheduling method of the above-mentioned universal management gateway, the single point failure problem of the main control board can be effectively solved in the UMG system, ensuring that when the working host fails, the working slave can quickly switch to the host to continue working, realizing the dual master hot standby function, ensuring the stability and reliability of the system, and improving the high availability of the VoIP system. At the same time, through the setting of heartbeat packet negotiation, data synchronization and monitoring modules, the status information and data between the master and slave machines can be synchronized and effectively monitored in real time, ensuring the continuous and stable operation of the business.
[0084] State machine description:
[0085] By default, both machines are in slave state when they are started, that is, they are both initial slaves, and then through heartbeat packet negotiation, the one configured as the master is switched to the master first; when the working slave finds that it has lost connection with the working master, it will switch to an independent master; when the original working master is powered on, it is initially in slave state. When an independent master is found, the current machine remains as a working slave. When the independent master finds that the working slave is connected, the machine switches to the master.
[0086] Hot standby - master state: In this state, the business IP is used to take over all business functions, and heartbeat packets are sent to the working slaves regularly, and data is synchronized.
[0087] Dual-machine hot standby - slave state: In this state, it uses its own non-business IP and regularly sends heartbeat packets to the master and receives synchronization data, so as to be ready to switch to the master state at any time.
[0088] Hot standby - independent master state: In this state, use the business and take over all business functions. Try to establish a connection with the slave to see if it can successfully query the slave and be ready to switch to the master or slave state at any time.
[0089] The steps of negotiating through the initial heartbeat packet also include the following sub-steps:
[0090] One scenario is:
[0091] One of the initial slaves periodically queries the other initial slave according to a set cycle; for example, in a system consisting of initial slave A and initial slave B, initial slave A is set to query initial slave B every 5 seconds. In each such 5-second cycle, initial slave A will send a specific query command to initial slave B to try to obtain the response information of initial slave B, so as to determine the connection status between the two.
[0092] Determine whether the query is successful in each cycle. If the query is unsuccessful, count once; otherwise, do not count. The system will judge the query results in each cycle. If the initial slave A does not receive a response from the initial slave B within a 5-second cycle, that is, the query is unsuccessful (failed to connect), then a counting operation will be performed. If the initial slave B successfully receives a response within this cycle, that is, the query is successful, then no counting operation will be performed, and the number of unsuccessful connections remains unchanged.
[0093] If the number of consecutive counts exceeds the set value, it is determined that the initial slave is not connected to another initial slave, and then the current initial slave is switched to an independent host state. The system will continue to monitor this count. If the number of consecutive counts exceeds the preset value, for example, the initial slave B has not been successfully queried for three consecutive times, then the system will determine that the initial slave A is not connected to the initial slave B. Once such a judgment is made, the system will perform a switching operation to change the current initial slave A to an independent host state. This means that the initial slave A will no longer rely on the connection relationship with the initial slave B, but will independently undertake some tasks that may have required the collaboration of the two hosts to ensure that the entire system can still maintain a certain degree of functional operation under such abnormal connection conditions.
[0094] Another situation is:
[0095] One of the initial slaves repeatedly queries the other initial slave in a loop; taking initial slaves A and initial slaves B as an example, initial slave A will continuously and repeatedly execute the operation of querying initial slave B, and each query is performed in sequence according to the established query logic.
[0096] Determine whether each query is successful. If the query is unsuccessful, count once; otherwise, do not count. The system will also determine whether the query is successful. If the initial slave A does not receive feedback from the initial slave B, that is, the query is unsuccessful, just like the previous case, count once. On the contrary, if the query is successful, do not count.
[0097] If the number of consecutive counts exceeds the set number, it is determined that the initial slave is not connected to another initial slave, and then the current initial slave is switched to an independent master state. For example, if the query fails three times in a row, the system will determine that the initial slave A is not connected to the initial slave B, and then switch the initial slave A to an independent master state to ensure the stability of the system and the continuous operation of some functions, and avoid paralysis or abnormality of the entire system due to connection problems.
[0098] In the initial heartbeat packet negotiation phase, one initial slave performs regular or cyclic queries on another, and counts based on the query results, which can accurately determine the connection status between the two initial slaves. This mechanism enables the system to have a keen sense of abnormal connections between hosts, discover possible connection problems in a timely manner, and effectively avoid data transmission errors or business interruptions caused by unstable connections, thereby ensuring the stable operation of the entire system.
[0099] When the continuous count exceeds the set number of times and it is determined that another initial slave is not connected, the current initial slave is switched to an independent host state. This measure can optimize the allocation of system resources and prevent the host in an abnormal connection state from continuously consuming unnecessary resources waiting for the connection to be restored. At the same time, it gives it the ability to operate independently, so that it can perform some basic local business functions in the independent host state, improving the overall adaptability and flexibility of the system. When facing complex and changing network environments and hardware failure scenarios, it can more robustly maintain the operation of some businesses, reduce the scope and time of business stagnation caused by failures, and further enhance the reliability and practicality of the master-slave hot standby system of the universal management gateway.
[0100] The steps of negotiating through the initial heartbeat packet also include the following sub-steps:
[0101] One of the initial slaves periodically queries the other initial slaves one by one according to the set cycle; suppose there is a system environment containing multiple initial slaves, for example, there are five hosts in a distributed network system, namely initial slaves A, B, C, D, and E. One of the initial slaves, such as initial slave A, will periodically query the other initial slaves one by one according to the set cycle.
[0102] According to the number of other initial slaves, the period length of the set cycle is adjusted inversely; the more the number of other initial slaves is, the shorter the period length of the set cycle is; the fewer the number of other initial slaves is, the longer the period length of the set cycle is.
[0103] This set period is not fixed, but will be adjusted inversely according to the number of other initial slaves. When there are a large number of other initial slaves in the system, in order to be able to grasp the status of each host more timely and efficiently, the period of the set period will be shortened accordingly. Taking 5 hosts as an example, if there are 4 hosts in the system besides the initial slave A, namely, initial slaves B, C, D, and E, then the initial slave A will set the set period to query other hosts every 3 seconds. This is because there are a large number of hosts, and a shorter query period can complete a round of status queries for all other hosts more quickly, ensuring the timeliness and accuracy of the system status, so that it can respond and adjust quickly when problems arise.
[0104] On the contrary, when the number of other initial slaves is small, the number of objects to be monitored is reduced. In order to avoid unnecessary frequent queries and waste of system resources, the set period will be longer. For example, if there are only two hosts, initial slaves B and C, in the system in addition to initial slave A, then initial slave A will extend the set period to query other hosts once every 8 seconds. This can not only ensure effective monitoring of the status of other hosts, but also reasonably allocate system resources, so that the entire system can maintain a stable and efficient operating state under host configurations of different scales. Through this flexible set period adjustment mechanism, the adaptability and reliability of the system in the negotiation process are improved.
[0105] The steps of negotiating through the initial heartbeat packet also include the following sub-steps:
[0106] Among multiple initial slaves, one initial slave is randomly selected as the random master; suppose there is a system composed of several initial slaves, for example, in an enterprise-level distributed data storage system, there are five masters, namely, initial slave 1, initial slave 2, initial slave 3, initial slave 4 and initial slave 5. First, among these multiple initial slaves, one initial slave is randomly selected as the random master through a specific random algorithm. For example, a random number is generated in the range of 1 to 5 through the system's built-in random number generator. Assuming that the generated random number is 3, then initial slave 3 is selected as the random master.
[0107] Number the other initial slaves; then, number the other initial slaves except the random master, that is, initial slave 1, initial slave 2, initial slave 4 and initial slave 5. The numbering method can be to assign consecutive numbers in a certain order. For example, initial slave 1 is numbered 1, initial slave 2 is numbered 2, initial slave 4 is numbered 3, and initial slave 5 is numbered 4.
[0108] The other initial slaves query the random host in turn according to their numbers; after the numbering is completed, the other initial slaves query the random host in turn according to their numbers. First, the initial slave 1 with the number 1 queries the random host 3. It sends a specific query request packet to the random host 3. This packet contains its own identification information and query-related instructions to confirm the connection status with the random host 3 and obtain its related information. After the query is completed, the initial slave 2 with the number 2 performs the same query operation, and the cycle repeats.
[0109] Determine whether the initial slave has successfully queried each time. If the query is unsuccessful, count once; otherwise, do not count. After each query, the system will quickly determine whether the initial slave has successfully queried each time. The judgment is based on whether the confirmation response packet returned by the random host is received within the specified time. The response packet contains the current status information of the random host and the confirmation mark of the query request. If the initial slave does not receive such a response packet within the specified time, that is, the query is unsuccessful, then the system will perform a counting operation and add 1 to the number of unsuccessful queries of the initial slave. If the correct response packet is received, that is, the query is successful, then no counting operation is performed, and the number of unsuccessful connections remains unchanged.
[0110] If the number of consecutive counts exceeds the set value, it is determined that the initial slave is not connected to the random host, and then the status of other current initial slaves is switched to the independent host status. The system will continue to pay attention to this count. If the number of consecutive counts exceeds the set value, for example, if it is set to 5 consecutive unsuccessful queries, then the system will determine that the initial slave is not connected to the random host. Once such a judgment is made, the system will perform a switching operation and switch the status of other initial slaves that are currently not successfully connected to the independent host status. This means that the initial slave will no longer rely on the connection relationship with the random host, but will independently run some of its own functions to ensure that the entire system can still maintain a certain degree of stability and availability in this abnormal connection situation, and avoid paralysis or serious failure of the entire system due to problems with the connection of some hosts.
[0111] According to the numbers of the other initial slaves, the set number of times that the other initial slaves query the random master is adjusted.
[0112] In this process, the system will also skillfully adjust the set times corresponding to the query of the random host by other initial slaves according to the numbers of other initial slaves. Generally speaking, the set times corresponding to the initial slaves with larger numbers will be relatively small, while the set times corresponding to the initial slaves with smaller numbers will be relatively large. For example, the set times of the initial slave 1 numbered 1 is 6, the set times of the initial slave 2 numbered 2 is 5, the set times of the initial slave 4 numbered 3 is 4, and the set times of the initial slave 5 numbered 4 is 3. Such an adjustment mechanism is based on a reasonable assumption that the host with a larger number is relatively superior in terms of position or performance in the system, so when a connection problem occurs, it can make a decision to run independently relatively quickly, while the host with a smaller number is given relatively more attempts to maintain the integrity and coordination of the entire system as much as possible. Through this dynamic set times value adjustment strategy, the fault tolerance and adaptability of the system in a complex environment are further improved.
[0113] Randomly select one of the multiple initial slaves as a random host, and the other hosts are queried in turn according to the number. This method is more systematic and regular than disordered queries. Through a specific query order, query conflicts and confusion can be reduced, making the entire negotiation process more orderly, and improving the efficiency and success rate of negotiation. Count each query result and set a continuous count threshold to determine the connection status. This quantitative method can accurately identify whether the connection between the initial slave and the random host is normal. When the continuous count exceeds the set number, it is determined that it is not connected and the host state is switched, which provides an effective means for the system to promptly discover and handle connection failures, and helps to ensure the stability and reliability of the system. According to the number size of other initial slaves, the set number of queries corresponding to the random host is adjusted to increase the flexibility and adaptability of the system. Hosts with different numbers can set different judgment criteria according to their roles, performance or other requirements in the system. For example, for hosts with larger numbers and are relatively important in the system, a smaller set number value can be set so that they can detect connection anomalies faster and respond; for hosts with smaller numbers or less critical hosts, the set number value can be appropriately increased to avoid premature state switching due to occasional query failures, thereby meeting the differentiated needs of different hosts in the system. Switching other initial slaves that are not connected to the random host to independent host status allows these hosts to run independently and perform certain functions when they cannot establish a connection with the random host, avoiding the complete loss of the entire host function due to connection problems. This not only improves the fault tolerance of a single host, but also enhances the robustness of the entire system. Even if some connections fail, the system can still maintain a certain operating capacity and reduce the impact on the overall business.
[0114] Reference Figure 2 The step of negotiating through the initial heartbeat packet also includes the following sub-steps:
[0115] Based on the total number of initial slaves, multiple zones are divided according to the set number; suppose there is a large-scale distributed system, which contains 20 initial slaves, and these initial slaves are distributed in different physical locations or network areas. First, based on the total number of initial slaves, multiple zones are divided according to the set number. For example, if every 5 initial slaves are divided into one zone, then the 20 initial slaves can be divided into 4 zones. The number of slaves and hosts in the figure is not completely drawn, only for example of zone division.
[0116] Determine the working host of each zone as the intermediate host; in each zone, the working host of the zone will be determined according to certain rules, and the selected working host will be the intermediate host. For example, in the first zone, initial slaves 1, 2, 3, 4, and 5 exist. By comparing the order of their startup time, the earliest started initial slave 3 is determined as the intermediate host of the zone. In the same way, the intermediate hosts are also determined in other zones. It is assumed that the intermediate host of the second zone is the initial slave 8, the intermediate host of the third zone is the initial slave 13, and the intermediate host of the fourth zone is the initial slave 18.
[0117] From the determined multiple intermediate hosts, query and negotiate to determine the final working host; next, query and negotiate to determine the final working host from the determined multiple intermediate hosts. Each intermediate host will send its own performance parameters, load conditions, network connection stability and other information to other intermediate hosts, and this information will serve as the basis for negotiation to determine the final working host. For example, intermediate host 3 sends information to intermediate hosts 8, 13, and 18, informing them of the current CPU usage rate of 40%, memory usage rate of 30%, network connection delay of 10ms and other data, and other intermediate hosts also perform similar information exchange.
[0118] When determining the final working host,
[0119] The intermediate host does not retain the status of the intermediate host and switches to the working slave status;
[0120] Alternatively, the intermediate master retains the status of the intermediate master, being both the master of the working slave and the slave of the working master.
[0121] When the final working host is determined, there are two situations. The first situation is that the intermediate host does not retain the status of the intermediate host and directly switches to the working slave state. For example, if after comprehensive evaluation, the intermediate host 8 is determined to be the final working host, then the other intermediate hosts 3, 13, and 18 will give up the role of the intermediate host and switch their own status to the working slave state. They will stop some of the coordination work that was originally performed as the intermediate host in the area, and instead begin to accept the management and task allocation of the final working host 8, and perform tasks such as data backup and auxiliary business processing in accordance with the responsibilities of the working slave.
[0122] The second situation is that the intermediate host retains the status of the intermediate host, and is both the host of the working slave and the slave of the working host. For example, in certain specific business scenarios, in order to improve the fault tolerance of the system and the flexibility of data processing, even if the intermediate host 8 is determined to be the final working host, other intermediate hosts 3, 13, and 18 still retain some functions and states of the intermediate host. On the one hand, they will obey the main task scheduling and management of the final working host 8 like ordinary working slaves, and perform the routine tasks of the working slaves; on the other hand, they will continue to undertake certain coordination and data transfer work in their own areas, such as collecting status information of other initial slaves in the area and reporting it to the final working host 8 regularly. When the network connection between some initial slaves and the final working host 8 in the area fails temporarily, temporary data caching and forwarding are performed to ensure the business continuity and stability of the entire system. This complex role setting enables the system to respond to various situations more flexibly and efficiently under different operating conditions, improving overall performance and reliability.
[0123] Based on the total number of initial slaves, multiple zones are divided. Each zone determines the intermediate host, and then these intermediate hosts perform queries and negotiations to determine the final working host. This sharding method reduces the complexity and communication volume of direct negotiation between all initial slaves. For example, in the case of a large number of initial slaves, direct negotiation will lead to massive information interaction and complex coordination process. After sharding, each zone will first conduct preliminary coordination, which greatly reduces the scope and difficulty of negotiation, making the negotiation process more efficient and faster, and can determine the final working host more quickly, shortening the system initialization time. When determining the final working host, the intermediate host has different state switching options. When the intermediate host switches to the working slave state, all resources can be invested in assisting the working host to run, avoiding resource waste and ensuring that system resources are concentrated on key tasks; while the intermediate host retains the intermediate host state and has the roles of both working slave and working host slave. This mode increases the flexibility of the system, enabling it to flexibly adjust the resource allocation method according to different business needs and resource conditions, and improve resource utilization efficiency. The method of determining the intermediate host by sharding makes the system more adaptable when facing changes in the number of hosts. If the initial slave is added or reduced in the system, only the corresponding area needs to be adjusted without affecting the operation of the entire negotiation mechanism. At the same time, the switching mode of different states of the intermediate host also provides more possibilities for the expansion of the system. For example, when the system processing capacity needs to be enhanced, you can choose to retain the state of the intermediate host and use its dual role to share the work, improve the overall stability and scalability of the system, and better meet the needs of business development. The existence of multiple intermediate hosts is equivalent to increasing the redundancy and backup mechanism of the system. During the negotiation process, if an intermediate host fails, the intermediate hosts in other areas can still continue to negotiate, ensuring that the determination of the final working host is not greatly affected. Moreover, in subsequent operations, intermediate hosts in different states can cooperate with each other. When the working host fails, these intermediate hosts can work better together to achieve rapid switching and replacement, ensure the continuous and stable operation of the system, and improve the fault tolerance of the system.
[0124] After the working slave obtains the temporary heartbeat packet, the method for switching to the working master according to the latest synchronization data also includes the following sub-steps:
[0125] Back up the configuration of the working slave to be switched; use the latest synchronization data to configure the current working slave as the working master; load the call data into the configured working master.
[0126] Assume that there is a communication network system, which includes a working host and several working slaves, taking working slave A as an example. When working slave A obtains the temporary heartbeat packet, the first thing to do is to back up the configuration of the working slave to be switched. Working slave A will fully back up all its current configuration parameters, including but not limited to network connection settings, port configurations, data storage paths, security access rules, etc. For example, the current network connection of working slave A is set to connect to a specific switch port, and is configured with a static IP address of 192.168.1.10, a subnet mask of 255.255.255.0, and a gateway of 192.168.1.1. It will accurately record and save these network configuration information, and will also back up other configurations such as data storage partition settings and user authority management rules to ensure that if there is a problem during the switching process, it can be quickly restored to the original working slave state to ensure the stability of the system and the security of the data.
[0127] Next, the working slave A will use the latest synchronization data to configure itself as the working master. These latest synchronization data are key business data and system operation status information previously synchronized from the working master, including running business process information, user connection status, the latest version of business data, etc. For example, the synchronization data contains the communication connection information of the 50 users currently being processed, as well as the latest business data update log. Based on this data, the working slave A will adjust its own business process and data status to be consistent with the previous working master, so that it has the ability to take over the responsibilities of the working master, including starting the corresponding business processing program, loading business data into memory, and updating its own system status identification to the working master status, so that other devices and systems can correctly identify the change of their roles.
[0128] The last key sub-step is to load call data into the configured working host (i.e. the original working slave A). Call data is very important business data in this communication network system. For example, in a telephone communication network system, call data contains detailed information about the 10 calls currently in progress, including the numbers of both parties, call duration, call quality parameters, etc. After completing the previous configuration steps, the working slave A will obtain the latest call data from a dedicated call data storage device or server and load it into its own business processing module to ensure that after switching to the working host, it can seamlessly continue to process these ongoing call services without affecting the user's normal communication experience, maintaining the business continuity of the entire communication network system, and achieving a smooth transition from the working slave to the working host, ensuring the stable operation and efficient service capabilities of the system.
[0129] In addition, the hot standby switching process (including all types of switching) is as follows:
[0130] Hot standby defines three hot standby states: master state, slave state, and independent master state. When the state switches between these three states, corresponding actions need to be performed to complete the hot standby process.
[0131] Master->Slave Switching: Use the original machine configuration.
[0132] Switch from slave to master: back up the original machine configuration, use the synchronized master configuration, and load the call data.
[0133] Standalone host->Host switch: No action required.
[0134] Independent host->slave switch: use the original machine configuration.
[0135] Host->Independent host switch: No action required.
[0136] Switch from slave to independent master: back up the original machine configuration, use the synchronized master configuration, and load the call data.
[0137] To sum up, if you switch from slave state to master or independent master, you need to apply the master configuration and load the call data, because only the slave state will have call data and master configuration data.
[0138] Among them, the network port IP used as the heartbeat cannot be changed.
[0139] In order to quickly implement the switch, the configuration needs to be applied in time:
[0140] When the slave obtains the configuration of the host, it immediately applies the configuration, but all business network ports are disabled, and it continues to obtain the host configuration. When the host configuration changes, it immediately applies the new configuration, while keeping all business network ports disabled. Once the host loses connection, all business network ports are immediately activated, switched to standalone mode, and the business network ports are activated and calldata is effective.
[0141] Definition: Synchronous data refers to configuration data, call state machine data, sip protocol stack data, rtp data, etc.
[0142] Configuration data synchronization: The slave machine periodically synchronizes configuration data from the master machine. When there is a change between the configuration data and the local data, the synchronized data is immediately applied.
[0143] The method for synchronizing call data further includes the following sub-steps:
[0144] The working host periodically stores the current call data in the preset call data file; the call data includes the sip message source address of the calling party, the sip message destination address, the fom, to, contact, call-id, branch-id, from-tag, to-tag, and other call information as complete as possible. It also needs to include rtp related information, such as the source and destination addresses of the calling party, codec, packaging duration, and other information.
[0145] The working slave periodically synchronizes the call data file from the working master. When the working slave switches to the working master, it immediately applies the call data file and continues to take over the call state and RTP stream state indicated in the call data file until the call ends.
[0146] Take a network-based voice communication system as an example. In this system, there is a working host and several working slaves, which jointly undertake a large number of voice call services.
[0147] First, the work host stores the current call data in a preset call data file at a fixed time. The work host has powerful processing capabilities and a stable storage mechanism. It will organize and store the call data of all ongoing calls at a preset time interval, such as every 5 minutes. The call data includes all call information of both parties, such as the caller's phone number, the called party's phone number, the call start time, the call type (such as voice call, video call, etc.), and RTP (Real-time Transport Protocol) information. The RTP information contains the transmission parameters of voice or video data in the network, such as the sequence number, timestamp, and transmission port number of the data packet. This information is crucial to ensure the smoothness and quality of the call. Assuming that at a certain moment, there are 10 ongoing calls in the system, the work host will accurately integrate the relevant call data and RTP information of these 10 calls and store them in the preset call data file. This file is stored in a specific hard disk partition or a dedicated storage array of the work host to ensure data security and accessibility.
[0148] Next, the working slave periodically synchronizes the call data file from the working master. In order to ensure that it can take over the work of the working master at any time, the working slave will send a synchronization request to the working master at a certain period, such as every 10 minutes, to obtain the latest call data file. During the synchronization process, a secure and reliable transmission channel will be established between the working slave and the working master, and network transmission protocols such as encryption will be used to ensure that the call data file is not tampered with or lost during the transmission process. For example, the working slave connects to the working master through the secure SSH (SecureShell) protocol, downloads the latest call data file from the specified storage location, and stores it in the local cache area so that it can be quickly applied when switching is required.
[0149] When the working slave switches to the working master, the call data file is immediately applied, and the call state and RTP stream state indicated in the call data file are continued to be taken over until the call ends. For example, when the system detects that the working master fails or the network connection is abnormal, the switching mechanism of the working slave is triggered. At this time, the working slave that has just switched successfully (the original working slave) will quickly read the previously synchronized call data file, re-establish the connection with the two parties according to the information of the two callers, and accurately restore the transmission of voice or video data according to the RTP information to ensure that the call can continue seamlessly. Assuming that there is an ongoing video call at the time of switching, the original working master has transmitted 1000 RTP data packets. After the working slave switches, it will continue to receive and forward from the 1001th data packet to ensure the continuity of the video call picture and sound, and maintain the normal progress of the call until the two parties end the call normally, thereby ensuring the stability and reliability of the entire voice communication system, greatly improving the user's call experience, and avoiding problems such as call interruption or quality degradation due to host switching.
[0150] Reference Figure 3 , the step of importing the latest synchronization data and switching to the working host also includes the following sub-steps:
[0151] The synchronization data corresponds to the call data; the working host sends the call data to the first memory inside the working slave and the second memory outside the working slave; wherein the first memory is RAM; the second memory is ROM or solid state drive or mechanical hard disk.
[0152] The synchronization data includes data obtained by slicing and combining the call data according to the slicing algorithm.
[0153] The working slave obtains the call data according to the synchronization data, and verifies the consistency value between the call data and the synchronization data.
[0154] If the consistency degree value is greater than the preset consistency reference value, the working slave switches to the working master according to the call data in the first memory; otherwise, the working slave obtains the call data in the second memory and switches to the working master according to the obtained call data.
[0155] For example, a network communication platform that supports a large number of real-time voice calls and video conferences has a working host and multiple working slaves working together to ensure the stable operation of the entire system and the continuous development of business.
[0156] First, the synchronization data corresponds to the call data. As the core data processing and distribution node of the entire system, the working host will send the call data to the first memory in the working slave and the second memory outside the working slave. The first memory here is RAM (random access memory), which has the characteristics of fast reading and writing speed, enabling the working slave to quickly obtain call data for processing when needed, so as to quickly respond to various user operations and maintain the real-time nature of the call. For example, in a video conference, the real-time video stream data of the participants as part of the call data will be quickly temporarily stored in the RAM of the working slave so that timely encoding, transmission and other processing can be performed to ensure smooth video playback. The second memory is ROM (read-only memory) or solid-state hard disk or mechanical hard disk. These storage devices have the advantages of large storage capacity and high data storage stability, and are used to store call data for a long time to prevent data loss. For example, the historical record data of all video conferences in the past week will be stored in the solid-state hard disk for subsequent query and analysis.
[0157] The synchronization data includes data obtained by slicing and combining call data according to the slicing algorithm. The working host uses an advanced slicing algorithm to process call data. For example, for a voice call data lasting 1 hour, it is cut into slices every 10 minutes. Each slice contains key data such as the information of both parties in the call and the characteristics of the voice data packet within 10 minutes. Then these slices are combined in a specific order and rules to form the final synchronization data. This slicing combination method helps to improve the efficiency and accuracy of data transmission, and also facilitates rapid data verification and processing on the working slave end.
[0158] Next, the working slave obtains the call data based on the synchronization data and verifies the consistency value between the call data and the synchronization data. After receiving the synchronization data, the working slave verifies the integrity and accuracy of the call data through the built-in verification program. For example, by comparing the checksum of each slice in the synchronization data with the pre-set standard checksum, the consistency value between the two is calculated. If during a data synchronization process, the working slave finds that most of the slice checksums in the synchronization data match the standard value, and only a few deviate, then a higher consistency value will be obtained.
[0159] If the consistency degree value is greater than the preset consistency reference value, the working slave switches to the working master according to the call data in the first memory. This is because when the consistency degree is high, it means that the call data obtained by the working slave from the RAM is accurate and reliable, and can be directly used for fast switching and assume the responsibilities of the working master, and continue to efficiently handle various call services. For example, during an automatic system switching process, the working slave detects that the consistency degree value with the synchronization data reaches 95%, which is higher than the preset consistency reference value of 90%, so it immediately reads the call data from the RAM and quickly completes the switch, ensuring that multiple ongoing voice calls and video conferences are not affected, and the call quality and connection stability are maintained.
[0160] Otherwise, the working slave obtains the call data in the second memory and switches to the working master according to the obtained call data. When the consistency value does not meet the requirements, it means that the call data in the RAM may be partially erroneous or incomplete. At this time, the working slave will turn to the second memory to obtain a more reliable call data backup. For example, if in a switching attempt, the consistency value is only 80%, which is lower than the preset value, the working slave will read the previously stored complete copy of the call data from the solid-state drive, and then perform the switching operation based on this data. Although this process may be slightly slower than obtaining data from RAM, it can ensure that the working host after switching has complete and accurate call data, thereby ensuring the normal operation of the system and avoiding problems such as call interruptions or business failures due to data errors, providing a solid data guarantee and switching mechanism for the stable and reliable operation of the entire communication system.
[0161] An embodiment of the present application also discloses a master-slave hot standby scheduling system for a universal management gateway, including a processor, wherein the processor executes the steps of the master-slave hot standby scheduling method for the universal management gateway as described in any one of the above items.
[0162] An embodiment of the present application further discloses a storage medium, in which a program is stored. When the program is executed by a processor, the steps of the master-slave hot standby scheduling method of the universal management gateway described in any one of the above are implemented.
[0163] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A master-slave hot standby scheduling method for a universal management gateway, characterized in that: The steps include: Based on at least two initial slaves both in slave state, at least one of the initial slaves is configured to negotiate with the other initial slaves through an initial heartbeat packet; After negotiation, the initial slave configured as master priority is used as the working master, and the other initial slaves are used as working slaves; If the working host and the working slave are connected, the working host executes the set business policy based on the set business address; the working host sends a first heartbeat packet to the working slave based on a first cycle, and the working host sends synchronization data corresponding to the first heartbeat packet based on a second cycle; the working slave executes the set non-business policy based on the set non-business address, and sends a second heartbeat packet to the working host based on a set non-business address; The working host verifies the first heartbeat packet and the second heartbeat packet to generate a verification result, and sends the verification result to the working slave; The working slave receives the synchronization data according to the verification result of successful verification, and synchronizes the data with the working master; If there is no connection between the working host and the working slave, the working host executes the set service policy based on the set service address; Searching the working slave machine online based on a set search instruction; the working slave machine waits for the search instruction, and if the search instruction is obtained, establishes a connection with the working host machine according to the search instruction; The working host is configured with a monitoring module with an independent computing core, and the monitoring module is controlled by the working host to send a temporary heartbeat packet to the working slave; the working host identifies the execution status of the business policy, and if the execution status is good, controls the monitoring module to suspend sending the temporary heartbeat packet to the working slave; if the execution status is a fault, the monitoring module sends the temporary heartbeat packet to the working slave; After the working slave obtains the temporary heartbeat packet, it switches to the working master according to the latest synchronization data; The synchronization data corresponds to call data; the working host sends the call data to a first memory in the working slave and a second memory outside the working slave; The synchronization data includes data obtained by slicing and combining the call data according to a slicing algorithm; The working slave obtains the call data according to the synchronization data, and verifies the consistency value between the call data and the synchronization data; If the consistency degree value is greater than a preset consistency reference value, the working slave machine switches to the working master machine according to the call data in the first memory; otherwise, the working slave machine obtains the call data in the second memory and switches to the working master machine according to the obtained call data.
2. The master-slave hot standby scheduling method of the universal management gateway according to claim 1, characterized in that: The step of negotiating through the initial heartbeat packet also includes the following sub-steps: One of the initial slaves periodically queries the other initial slave according to a set period; Determine whether the query is successful in each cycle. If the query is unsuccessful, count once; otherwise, do not count; If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to another initial slave, and then the state of the current initial slave is switched to an independent master state; or, One of the initial slave machines repeatedly queries another initial slave machine; Determine whether each query is successful. If the query is unsuccessful, count once; otherwise, do not count. If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to another initial slave, and then the state of the current initial slave is switched to an independent master state.
3. The master-slave hot standby scheduling method of the universal management gateway according to claim 1, characterized in that: The step of negotiating through the initial heartbeat packet also includes the following sub-steps: One of the initial slaves periodically queries the other initial slaves one by one according to a set period; According to the number of the other initial slaves, the length of the set period is adjusted in an anti-correlation manner; the greater the number of the other initial slaves, the shorter the set period; The smaller the number of the other initial slaves is, the longer the set period is.
4. The master-slave hot standby scheduling method of the universal management gateway according to claim 1, characterized in that: The step of negotiating through the initial heartbeat packet also includes the following sub-steps: Randomly selecting one of the multiple initial slaves as a random master; Numbering the other initial slaves; The other initial slaves query the random master in turn according to the number; Determine whether the query of the initial slave is successful each time, if the query is unsuccessful, count once; otherwise, do not count; If the number of consecutive counts exceeds the set number of times, it is determined that the initial slave is not connected to the random master, and then the state of the other current initial slaves is switched to an independent master state; According to the numbers of the other initial slaves, the set number of times that the other initial slaves query the random master is adjusted.
5. The master-slave hot standby scheduling method of the universal management gateway according to claim 4, characterized in that: The step of negotiating through the initial heartbeat packet also includes the following sub-steps: Based on the total number of the initial slave machines, the plurality of zones are divided according to a set number; Determine the working host in each zone as the intermediate host; From the determined multiple intermediate hosts, query and negotiate to determine a final working host; When determining the final working host, The intermediate host does not retain the state of the intermediate host, and switches to the working slave state; Alternatively, the intermediate host retains the status of the intermediate host, being both the host of the working slave and the slave of the working host.
6. The master-slave hot standby scheduling method of the universal management gateway according to claim 5, characterized in that: After the working slave obtains the temporary heartbeat packet, the method for switching to the working master according to the latest synchronization data further includes the following sub-steps: Backing up the configuration of the working slave in the to-be-switched state; Using the latest synchronization data, configuring the current working slave as the working master; Loading call data into the configured working host.
7. The master-slave hot standby scheduling method of the universal management gateway according to claim 6, characterized in that: The method for synchronizing call data further comprises the following sub-steps: The working host periodically stores the currently existing call data in a preset call data file; the call data includes all call information and RTP information of both parties of the call; The working slave periodically synchronizes the call data file from the working host. When the working slave switches to the working host, it immediately applies the call data file and continues to take over the call status and RTP stream status indicated in the call data file until the call ends.
8. A master-slave hot standby scheduling system for a universal management gateway, characterized in that: It includes a processor, in which the steps of the master-slave hot standby scheduling method of the universal management gateway as described in any one of claims 1-7 are executed.
9. A storage medium, characterized in that: The medium stores a program, and when the program is executed by the processor, the steps of the master-slave hot standby scheduling method for the universal management gateway described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Dual-computer hot standby redundancy method and system of ultrahigh-speed maglev traffic central operation and control system
CN118270078A