A method and system for implementing VPC multicast master / standby switching in a multi-instance mode

By analyzing the status of the VPC multicast relay gateway through timed monitoring and service locking mechanisms, master-slave switching in multi-instance mode was realized, solving the high availability and self-healing issues of the VPC multicast relay gateway and ensuring the stability and continuity of multicast services.

CN118945039BActive Publication Date: 2026-01-13SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410969973.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2026-01-13
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

How to ensure high availability and self-healing in VPC multicast relay gateways, especially in multi-instance mode to implement VPC multicast master-slave switching and ensure uninterrupted multicast service traffic.

Method used

By periodically triggering VPC multicast relay gateway status monitoring, a service locking mechanism is adopted to ensure that only one instance of each instance is locked. The gateway status is analyzed and primary/backup switching is performed, including handling one primary and one backup, dual primary or dual backup, primary/backup failure, and primary/backup single point of failure modes.

Benefits of technology

It enables real-time monitoring of the health status of VPC multicast relay gateways, quickly detects and handles faults, ensures uninterrupted multicast service traffic, and improves the high availability and self-healing capability of the gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945039B_ABST
    Figure CN118945039B_ABST
Patent Text Reader

Abstract

The application discloses a kind of methods and systems for realizing VPC multicast master standby switching under multiple instance mode, belong to computer network communication technical field, including: the state monitoring of VPC multicast transit gateway is triggered regularly;By the mode of business lock, it is guaranteed that only one instance can be locked simultaneously in each VPC multicast under multiple instance mode, and the instance that obtains the lock will start sub-thread to execute analysis VPC multicast transit gateway state and VPC multicast transit gateway executes master standby switching;Analysis VPC multicast transit gateway state: query VPC multicast transit gateway state, analysis statistics each state type, VPC multicast transit gateway executes master standby switching: the processing of master standby scene is carried out, including one master one backup mode, double master or double backup mode, master standby failure mode, master standby single point failure mode.The application guarantees the high availability and self-healing of VPC multicast transit gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network communication technology, specifically to a method and system for implementing VPC multicast master-slave switching in a multi-instance mode. Background Technology

[0002] With the rapid development of the internet and the widespread adoption of multimedia applications, multicast communication, compared to unicast and broadcast communication modes, can help reduce server load and improve bandwidth utilization in one-to-many network communication scenarios. The Internet Group Management Protocol (IGMP), as a key component of multicast in IPv4 networks, plays an indispensable role. IGMP is a protocol in the TCP / IP protocol suite responsible for managing IP multicast membership, used to establish and maintain multicast group membership relationships between IP hosts and their directly adjacent multicast routers.

[0003] Multicast technology is one of the three methods of data transmission in IP networks. Multicast solves the problems of duplicate message copying and bandwidth duplication in unicast, and also addresses the bandwidth waste problem in broadcast. It is commonly used in one-to-many network communication scenarios such as online live streaming, video conferencing, financial transaction data synchronization, distance education, and IPTV.

[0004] To connect multicast sources and receiver networks within and outside the cloud, VPC multicast was developed. As a bridge between cloud and external networks, the VPC multicast relay gateway needs to ensure high availability and self-healing capabilities. How to guarantee the high availability and self-healing capabilities of VPC multicast is a problem currently being addressed and researched within the industry. Summary of the Invention

[0005] The technical objective of this invention is to address the above-mentioned shortcomings by providing a method and system for implementing VPC multicast master-slave switching in a multi-instance mode. This method can monitor the health status of the VPC multicast relay gateway in a multi-instance mode, analyze the status of the VPC multicast relay gateway, and select an appropriate master-slave switching mode, thereby ensuring the high availability and self-healing capability of the VPC multicast relay gateway.

[0006] The technical solution adopted by this invention to solve its technical problem is:

[0007] A method for implementing VPC multicast master / slave failover in a multi-instance mode includes:

[0008] Scheduled VPC multicast relay gateway status monitoring: Triggered by a scheduled task, in multi-instance mode, a business lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switchover of the VPC multicast relay gateway.

[0009] Analyze VPC multicast relay gateway status: Query the VPC multicast relay gateway status and analyze and statistically analyze each status type. This is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to execute the primary / backup switchover module.

[0010] VPC multicast relay gateway performs master / standby switchover: Based on the statistics provided by the VPC multicast relay gateway status module, it handles master / standby scenarios, including one master and one standby mode, dual master or dual backup mode, master / standby failure mode, and master / standby single point of failure mode.

[0011] This method monitors the health status of VPC multicast relay gateways in real time, reducing operational costs. It provides an intelligent analysis method for the VPC multicast relay gateway's status and mode, enabling real-time detection of faulty gateways and perform primary / backup switching to ensure uninterrupted multicast traffic forwarding. This method comprehensively covers real-world scenarios and solutions for VPC multicast relay gateways, quickly locating faulty gateways, intelligently analyzing gateway modes, and ensuring high availability and self-healing capabilities. Furthermore, this method employs service locking to ensure the accuracy of VPC multicast gateway data in multi-instance mode.

[0012] Furthermore, the timed triggering of VPC multicast relay gateway status monitoring includes timed task triggering for status monitoring and VPC multicast locking, enabling only one instance in multi-instance mode to perform status monitoring of a specific VPC multicast relay gateway. A more detailed explanation follows:

[0013] The status monitoring scheduled task is triggered as follows:

[0014] Each instance is scheduled by a timed task that controls the status monitoring function.

[0015] The status monitoring function will retrieve all VPC multicast sets;

[0016] Circulate the VPC multicast collection and feed each VPC multicast into the thread pool;

[0017] The VPC multicast locking:

[0018] In the thread pool, a child thread performs a VPC multicast lock check. The check method is to query the business lock table based on the multicast ID to see if the data exists.

[0019] If the VPC multicast is locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast relay gateway cannot be monitored and processed in this instance.

[0020] If the VPC multicast is not locked, a service lock record is added, and the instance locks the VPC multicast.

[0021] Once you have acquired an instance of the VPC multicast lock, you can proceed to execute the following two functional modules.

[0022] Furthermore, each instance is scheduled by a timed task control status monitoring function once per minute.

[0023] Furthermore, the specific steps for analyzing the VPC multicast relay gateway status are as follows:

[0024] 1) Obtain the set of records from the VPC multicast relay gateway database and loop through it:

[0025] Call the relay gateway status interface to obtain the underlying status of the relay gateway and perform analysis:

[0026] If the status is MAIN, then the number of primary gateways, the number of surviving gateways, and the total number of gateways are incremented by one.

[0027] If the status is BACKUP, the number of backup gateways, the number of live gateways, and the total number of gateways are incremented by one.

[0028] If the status is empty, the number of faulty gateways is incremented by one, and the total number of gateways is incremented by one.

[0029] 2) Analyze the status type of the VPC multicast relay gateway, and determine the following criteria:

[0030] One-primary-one-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways is greater than 0, and the number of backup gateways is greater than 0;

[0031] Dual-master or dual-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways or backup gateways equals the total number of gateways;

[0032] Primary / standby failure mode: The number of failed gateways equals the total number of gateways;

[0033] Primary / backup single point of failure mode: The number of faulty gateways is greater than 0 and the number of faulty gateways is less than the total number of gateways.

[0034] Furthermore, the VPC multicast relay gateway performs primary / standby failover, and handles the corresponding primary / standby failover mode according to the gateway's status type, specifically as follows:

[0035] Primary and backup mode:

[0036] If the current gateway type is the same as the database gateway type, and the database status is available, no action is taken;

[0037] If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the underlying database.

[0038] Dual-master or dual-backup mode:

[0039] Reselect primary and standby, issue primary and standby assignments, and update the database gateway type and status.

[0040] Primary / standby failure modes:

[0041] The database gateway status has been updated to "faulty".

[0042] Primary / standby single point of failure mode:

[0043] If the current gateway fails, update the database gateway status to "failed".

[0044] If the current gateway is not faulty and is a backup gateway, then issue the primary gateway configuration to the gateway and update the database.

[0045] If the current gateway is not faulty and is the primary gateway, no action is taken;

[0046] Regardless of which mode is executed, the VPC multicast service lock is released in the end so that the next scheduled task can continue to monitor the VPC multicast relay gateway status.

[0047] Furthermore, the specific implementation steps of this method are as follows:

[0048] Step 1: Start the VPC multicast monitoring scheduled task;

[0049] Step 2: Obtain all VPC multicasts and put each VPC multicast into a thread pool. The master / slave switching function for each VPC multicast is executed by an independent sub-thread.

[0050] Step 3: Verify whether the VPC multicast in the child thread can be locked. If locking fails, exit the current scheduled task.

[0051] Step 4: If VPC multicast locking is successful, analyze the status of the VPC multicast relay gateway and count the number of gateways.

[0052] Step 5: Based on the VPC multicast relay gateway status statistics, execute the corresponding primary / backup switchover logic according to the appropriate mode;

[0053] Step Six: Release the VPC multicast service lock;

[0054] Step 7: Wait for the next scheduled task to start, and repeat steps 1 to 6.

[0055] This invention also claims a system for implementing VPC multicast master-slave failover in a multi-instance mode, comprising:

[0056] The VPC multicast relay gateway status monitoring module is triggered periodically. This module is triggered by a scheduled task. In multi-instance mode, it uses a business lock to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switchover of the VPC multicast relay gateway.

[0057] The VPC multicast relay gateway status module analyzes and queries the VPC multicast relay gateway status, analyzes and statistically analyzes each status type, and is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to perform primary / backup switchover.

[0058] The VPC multicast relay gateway executes the primary / backup switching module, and processes the primary / backup scenarios based on the statistics provided by the VPC multicast relay gateway status module, including one primary and one backup mode, dual primary or dual backup mode, primary / backup failure mode, and primary / backup single point of failure mode.

[0059] The system implements VPC multicast master-slave switching through the method described above in the multi-instance mode.

[0060] Furthermore, the scheduled task is performed once every minute.

[0061] The present invention also claims a device for implementing VPC multicast master-slave switching in a multi-instance mode, comprising: at least one memory and at least one processor;

[0062] The at least one memory is used to store a machine-readable program;

[0063] The at least one processor is used to call the machine-readable program to implement the above method.

[0064] The present invention also claims protection for a computer-readable medium storing computer instructions that, when executed by a processor, cause the processor to perform the method described above.

[0065] Compared with the prior art, the method and system for implementing VPC multicast master-slave switching in a multi-instance mode according to the present invention have the following advantages:

[0066] 1. Monitor the health status of all VPC multicast relay gateways in real time.

[0067] 2. Intelligent analysis of the VPC multicast relay gateway status and its mode.

[0068] 3. Quickly perform primary / backup switching on abnormal gateways to ensure uninterrupted service in multicast scenarios.

[0069] 4. Improved the high availability and self-healing capabilities of the VPC multicast relay gateway.

[0070] 5. Comprehensive coverage of real-world scenarios and solutions for VPC multicast relay gateways. Attached Figure Description

[0071] Figure 1 This is a flowchart illustrating the method for implementing VPC multicast master / slave switching in a multi-instance mode provided by an embodiment of the present invention. Detailed Implementation

[0072] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0073] This invention provides a method for implementing VPC multicast master-slave failover in a multi-instance mode, comprising three functional modules: periodically triggering VPC multicast relay gateway status monitoring, analyzing the VPC multicast relay gateway status, and executing master-slave failover for the VPC multicast relay gateway. These three modules enable real-time monitoring of the health status of all VPC multicast relay gateways and rapid master-slave failover for abnormal gateways. The main functions of each module are as follows:

[0074] Scheduled VPC multicast relay gateway status monitoring: Triggered by a scheduled task, in multi-instance mode, a business lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switchover of the VPC multicast relay gateway.

[0075] Analyze VPC multicast relay gateway status: Query the VPC multicast relay gateway status and analyze and statistically analyze each status type. This is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to execute the primary / backup switchover module.

[0076] VPC multicast relay gateway performs master / standby switchover: Based on the statistics provided by the VPC multicast relay gateway status module, it handles master / standby scenarios, including one master and one standby mode, dual master or dual backup mode, master / standby failure mode, and master / standby single point of failure mode.

[0077] This method can monitor the health status of all VPC multicast relay gateways in real time, ensuring the uniqueness of gateway data in multi-instance mode, and performs corresponding master / slave switching for four master / slave scenarios, ensuring that VPC multicast relay gateways can quickly switch between master and slave and restore VPC multicast relay gateway functions in an instant.

[0078] 1. The timed triggering of VPC multicast relay gateway status monitoring includes timed task triggering of status monitoring and VPC multicast locking, enabling only one instance in multi-instance mode to perform status monitoring of a specific VPC multicast relay gateway. A more detailed explanation follows:

[0079] 1.1 The status monitoring scheduled task is triggered:

[0080] Each instance is scheduled for status monitoring via a timed task, once per minute.

[0081] The status monitoring function will retrieve all VPC multicast sets;

[0082] Circulate the VPC multicast collection and feed each VPC multicast into the thread pool.

[0083] 1.2 VPC multicast locking:

[0084] In the thread pool, a child thread performs a VPC multicast lock check. The check method is to query the business lock table based on the multicast ID to see if the data exists.

[0085] If the VPC multicast is locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast relay gateway cannot be monitored and processed in this instance.

[0086] If the VPC multicast is not locked, a service lock record is added, and the instance locks the VPC multicast.

[0087] Once you have acquired an instance of the VPC multicast lock, you can proceed to execute the following two functional modules.

[0088] 2. Analyze and statistically analyze each status type: This is used to count the number of live gateways, the number of failed gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster. This provides data for the VPC multicast relay gateway to execute the primary / backup switchover module. The steps are as follows:

[0089] 2.1 Obtain the VPC multicast relay gateway database record set and loop through it:

[0090] Call the relay gateway status interface to obtain the underlying status of the relay gateway and perform analysis:

[0091] If the status is MAIN, then the number of primary gateways, the number of surviving gateways, and the total number of gateways are incremented by one.

[0092] If the status is BACKUP, the number of backup gateways, the number of live gateways, and the total number of gateways are incremented by one.

[0093] If the status is empty, the number of faulty gateways is incremented by one, and the total number of gateways is incremented by one.

[0094] 2.2 Analyze the status type of this VPC multicast relay gateway. The determination criteria are as follows:

[0095] One-primary-one-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways is greater than 0, and the number of backup gateways is greater than 0;

[0096] Dual-master or dual-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways or backup gateways equals the total number of gateways;

[0097] Primary / standby failure mode: The number of failed gateways equals the total number of gateways;

[0098] Primary / backup single point of failure mode: The number of faulty gateways is greater than 0 and the number of faulty gateways is less than the total number of gateways.

[0099] 3. The VPC multicast relay gateway performs primary / standby failover, and handles the corresponding primary / standby failover mode according to the gateway's status type. The specific implementation is as follows:

[0100] 3.1 One primary and one backup mode:

[0101] If the current gateway type is the same as the database gateway type, and the database status is available, no action is taken;

[0102] If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the database according to the underlying data.

[0103] 3.2 Dual-master or dual-backup mode:

[0104] Reselect primary and standby, issue primary and standby assignments, and update the database gateway type and status.

[0105] 3.3, Primary / Backup Failure Mode:

[0106] The database gateway status has been updated to "faulty".

[0107] 3.4 Single point of failure mode for primary and backup systems:

[0108] If the current gateway fails, update the database gateway status to "failed".

[0109] If the current gateway is not faulty and is a backup gateway, then issue the primary gateway configuration to the gateway and update the database.

[0110] If the current gateway is not faulty and is the primary gateway, no action is taken.

[0111] Regardless of which mode is executed, the VPC multicast service lock is released in the end so that the next scheduled task can continue to monitor the VPC multicast relay gateway status.

[0112] The specific implementation steps of this method are as follows:

[0113] Step 1: Start the VPC multicast monitoring scheduled task;

[0114] Step 2: Obtain all VPC multicasts and put each VPC multicast into a thread pool. The master / slave switching function for each VPC multicast is executed by an independent sub-thread.

[0115] Step 3: Verify whether the VPC multicast in the child thread can be locked. If locking fails, exit the current scheduled task.

[0116] Step 4: If VPC multicast locking is successful, analyze the status of the VPC multicast relay gateway and count the number of gateways.

[0117] Step 5: Based on the VPC multicast relay gateway status statistics, execute the corresponding primary / backup switchover logic according to the appropriate mode;

[0118] Step Six: Release the VPC multicast service lock;

[0119] Step 7: Wait for the next scheduled task to start, and repeat steps 1 to 6.

[0120] This method monitors the health status of VPC multicast relay gateways in real time, reducing operational costs. It provides an intelligent analysis method for the VPC multicast relay gateway's status and mode, enabling real-time detection of faulty gateways and perform primary / backup switching to ensure uninterrupted multicast traffic forwarding. This method comprehensively covers real-world scenarios and solutions for VPC multicast relay gateways, quickly locating faulty gateways, intelligently analyzing gateway modes, and ensuring high availability and self-healing capabilities. Furthermore, this method employs service locking to ensure the accuracy of VPC multicast gateway data in multi-instance mode.

[0121] This invention also provides a system for implementing VPC multicast master-slave failover in a multi-instance mode, comprising:

[0122] The VPC multicast relay gateway status monitoring module is triggered periodically. This module is triggered by a scheduled task once every minute. In multi-instance mode, a business lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switch of the VPC multicast relay gateway.

[0123] The VPC multicast relay gateway status module analyzes and queries the VPC multicast relay gateway status, analyzes and statistically analyzes each status type, and is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to perform primary / backup switchover.

[0124] The VPC multicast relay gateway executes the primary / backup switching module, and processes the primary / backup scenarios based on the statistics provided by the VPC multicast relay gateway status module, including one primary and one backup mode, dual primary or dual backup mode, primary / backup failure mode, and primary / backup single point of failure mode.

[0125] The system implements VPC multicast master-slave switching through the method of multi-instance mode described in the above embodiments.

[0126] 1. The VPC multicast relay gateway status monitoring module is triggered periodically, including timed task triggering for status monitoring and VPC multicast locking. This enables only one instance in a multi-instance mode to perform status monitoring for a specific VPC multicast relay gateway. More detailed explanation follows:

[0127] 1.1 The status monitoring scheduled task is triggered:

[0128] Each instance is scheduled for status monitoring via a timed task, once per minute.

[0129] The status monitoring function will retrieve all VPC multicast sets;

[0130] Circulate the VPC multicast collection and feed each VPC multicast into the thread pool.

[0131] 1.2 VPC multicast locking:

[0132] In the thread pool, a child thread performs a VPC multicast lock check. The check method is to query the business lock table based on the multicast ID to see if the data exists.

[0133] If the VPC multicast is locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast relay gateway cannot be monitored and processed in this instance.

[0134] If the VPC multicast is not locked, a service lock record is added, and the instance locks the VPC multicast.

[0135] Once you have acquired an instance of the VPC multicast lock, you can proceed to execute the following two functional modules.

[0136] 2. Analyze and statistically analyze each status type module to count the number of live gateways, the number of failed gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster. This provides data for the VPC multicast relay gateway to execute the primary / backup failover module. The steps are as follows:

[0137] 2.1 Obtain the VPC multicast relay gateway database record set and loop through it:

[0138] Call the relay gateway status interface to obtain the underlying status of the relay gateway and perform analysis:

[0139] If the status is MAIN, then the number of primary gateways, the number of surviving gateways, and the total number of gateways are incremented by one.

[0140] If the status is BACKUP, the number of backup gateways, the number of live gateways, and the total number of gateways are incremented by one.

[0141] If the status is empty, the number of faulty gateways is incremented by one, and the total number of gateways is incremented by one.

[0142] 2.2 Analyze the status type of this VPC multicast relay gateway. The determination criteria are as follows:

[0143] One-primary-one-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways is greater than 0, and the number of backup gateways is greater than 0;

[0144] Dual-master or dual-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways or backup gateways equals the total number of gateways;

[0145] Primary / standby failure mode: The number of failed gateways equals the total number of gateways;

[0146] Primary / backup single point of failure mode: The number of faulty gateways is greater than 0 and the number of faulty gateways is less than the total number of gateways.

[0147] 3. The VPC multicast relay gateway executes the primary / standby switchover module, which performs the corresponding primary / standby switchover mode processing according to the gateway's status type. The specific implementation is as follows:

[0148] 3.1 One primary and one backup mode:

[0149] If the current gateway type is the same as the database gateway type, and the database status is available, no action is taken;

[0150] If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the database according to the underlying data.

[0151] 3.2 Dual-master or dual-backup mode:

[0152] Reselect primary and standby, issue primary and standby assignments, and update the database gateway type and status.

[0153] 3.3, Primary / Backup Failure Mode:

[0154] The database gateway status has been updated to "faulty".

[0155] 3.4 Single point of failure mode for primary and backup systems:

[0156] If the current gateway fails, update the database gateway status to "failed".

[0157] If the current gateway is not faulty and is a backup gateway, then issue the primary gateway configuration to the gateway and update the database.

[0158] If the current gateway is not faulty and is the primary gateway, no action is taken.

[0159] Regardless of which mode is executed, the VPC multicast service lock is released in the end so that the next scheduled task can continue to monitor the VPC multicast relay gateway status.

[0160] The specific implementation steps of VPC multicast master / slave failover implemented by this system are as follows:

[0161] Step 1: Start the VPC multicast monitoring scheduled task;

[0162] Step 2: Obtain all VPC multicasts and put each VPC multicast into a thread pool. The master / slave switching function for each VPC multicast is executed by an independent sub-thread.

[0163] Step 3: Verify whether the VPC multicast in the child thread can be locked. If locking fails, exit the current scheduled task.

[0164] Step 4: If VPC multicast locking is successful, analyze the status of the VPC multicast relay gateway and count the number of gateways.

[0165] Step 5: Based on the VPC multicast relay gateway status statistics, execute the corresponding primary / backup switchover logic according to the appropriate mode;

[0166] Step Six: Release the VPC multicast service lock;

[0167] Step 7: Wait for the next scheduled task to start, and repeat steps 1 to 6.

[0168] This invention also provides an apparatus for implementing VPC multicast master-slave switching in a multi-instance mode, comprising: at least one memory and at least one processor;

[0169] The at least one memory is used to store a machine-readable program;

[0170] The at least one processor is used to call the machine-readable program to implement the method for VPC multicast master-slave switching in the multi-instance mode described in the above embodiments.

[0171] This invention also provides a computer-readable medium storing computer instructions. When executed by a processor, the computer instructions cause the processor to perform the method for implementing VPC multicast master-slave switching in the multi-instance mode described in the above embodiments. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the above embodiments can be provided, and the computer (or CPU or MPU) of the system or apparatus can read and execute the program code stored in the storage medium.

[0172] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0173] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0174] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0175] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0176] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.

Claims

1. A method for implementing VPC multicast master-slave failover in a multi-instance mode, characterized in that, include: Scheduled VPC multicast relay gateway status monitoring: Triggered by a scheduled task, in multi-instance mode, a business lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switchover of the VPC multicast relay gateway. Analyze VPC multicast relay gateway status: Query the VPC multicast relay gateway status and analyze and statistically analyze each status type. This is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to execute the primary / backup switchover module. VPC multicast relay gateway performs master / standby switchover: Based on the statistics provided by the VPC multicast relay gateway status module, the master / standby scenario is processed. The VPC multicast relay gateway performs primary / standby failover, and handles the corresponding primary / standby failover mode according to the gateway's status type, as specifically implemented as follows: Primary and backup mode: If the current gateway type is the same as the database gateway type, and the database status is available, no action is taken; If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the underlying database. Dual-master or dual-backup mode: Reselect primary and standby, issue primary and standby allocation, and update database gateway type and status; Primary / standby failure modes: The database gateway status has been updated to "faulty". Primary / standby single point of failure mode: If the current gateway fails, update the database gateway status to "failed". If the current gateway is not faulty and is a backup gateway, then issue the primary gateway configuration to the gateway and update the database. If the current gateway is not faulty and is the primary gateway, no action is taken; Regardless of which mode is executed, the VPC multicast service lock is released in the end so that the next scheduled task can continue to monitor the VPC multicast relay gateway status.

2. The method for implementing VPC multicast master-slave switching in a multi-instance mode according to claim 1, characterized in that, The timed triggering of VPC multicast relay gateway status monitoring includes timed status monitoring task triggering and VPC multicast locking; The status monitoring scheduled task is triggered as follows: Each instance is scheduled by a timed task that controls the status monitoring function. The status monitoring function will retrieve all VPC multicast sets; Circulate the VPC multicast collection and feed each VPC multicast into the thread pool; The VPC multicast locking mechanism: In the thread pool, a child thread performs a VPC multicast lock check. The check method is to query the business lock table based on the multicast ID to see if the data exists. If the VPC multicast is locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast relay gateway cannot be monitored and processed in this instance. If the VPC multicast is not locked, a service lock record is added, and the instance locks the VPC multicast.

3. The method for implementing VPC multicast master-slave switching in a multi-instance mode according to claim 1, characterized in that, Each instance is scheduled by a timed task to control the status monitoring function once per minute.

4. The method for implementing VPC multicast master-slave switching in a multi-instance mode according to claim 1, characterized in that, The specific steps for analyzing the VPC multicast relay gateway status are as follows: 1) Obtain the set of records from the VPC multicast relay gateway database and loop through it: Call the relay gateway status interface to obtain the underlying status of the relay gateway and perform analysis: If the status is MAIN, then the number of primary gateways, the number of surviving gateways, and the total number of gateways are incremented by one. If the status is BACKUP, the number of backup gateways, the number of live gateways, and the total number of gateways are incremented by one. If the status is empty, the number of faulty gateways is incremented by one, and the total number of gateways is incremented by one. 2) Analyze the status type of the VPC multicast relay gateway, and determine the following criteria: One-primary-one-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways is greater than 0, and the number of backup gateways is greater than 0; Dual-master or dual-backup mode: The number of surviving gateways equals the total number of gateways, and the number of primary gateways or backup gateways equals the total number of gateways; Primary / standby failure mode: The number of failed gateways equals the total number of gateways; Primary / backup single point of failure mode: The number of faulty gateways is greater than 0 and the number of faulty gateways is less than the total number of gateways.

5. The method for implementing VPC multicast master-slave switching in a multi-instance mode according to claim 1, characterized in that, The specific implementation steps of this method are as follows: Step 1: Start the VPC multicast monitoring scheduled task; Step 2: Obtain all VPC multicasts and put each VPC multicast into the thread pool. The master / slave switching function of each VPC multicast is executed by an independent sub-thread. Step 3: Verify whether the VPC multicast in the child thread can be locked. If locking fails, exit the current scheduled task. Step 4: If VPC multicast locking is successful, analyze the status of the VPC multicast relay gateway and count the number of gateways. Step 5: Based on the VPC multicast relay gateway status statistics, execute the corresponding primary / backup switchover logic according to the appropriate mode; Step Six: Release the VPC multicast service lock; Step 7: Wait for the next scheduled task to start, and repeat steps 1 to 6.

6. A system for implementing VPC multicast master-slave failover in a multi-instance mode, characterized in that, include: The VPC multicast relay gateway status monitoring module is triggered periodically. This module is triggered by a scheduled task. In multi-instance mode, it uses a business lock to ensure that each VPC multicast can only be locked by one instance at a time. The instance that acquires the lock will start a sub-thread to analyze the VPC multicast relay gateway status and perform master-slave switchover of the VPC multicast relay gateway. The VPC multicast relay gateway status module analyzes and queries the VPC multicast relay gateway status, analyzes and statistically analyzes each status type, and is used to count the number of live gateways, the number of faulty gateways, the number of primary gateways, the number of backup gateways, and the total number of gateways in the current VPC multicast relay gateway cluster, providing data basis for the VPC multicast relay gateway to perform primary / backup switchover. The VPC multicast relay gateway executes the primary / backup switching module, and processes the primary / backup scenarios based on the statistics provided by the VPC multicast relay gateway status module, including one primary and one backup mode, dual primary or dual backup mode, primary / backup failure mode, and primary / backup single point of failure mode. The system implements VPC multicast master-slave switching through the method of VPC multicast master-slave switching in the multi-instance mode as described in any one of claims 1 to 5.

7. A device for implementing VPC multicast master-slave switching in a multi-instance mode, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to implement the method of any one of claims 1 to 5.

8. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Main-standby switching method and device of equipment gateway and computer readable storage medium

    CN116743551A

  • Method for realizing intra-cloud and inter-cloud multicast function by virtual instance in public cloud

    CN118018341A