Method and system for realizing VPC multicast active-standby switching in multi-instance mode

Through the VPC multicast host-backup switching method in multi-instance mode, the timing triggering and service lock mechanisms are used to monitor and analyze the status of the VPC multicast transit gateway in real time, solving the problems of high availability and self-healing of the VPC multicast transit gateway, and realizing the realization of the VPC multicast transit gateway. Fast failover and service stability guarantee.

CN118945039AActive Publication Date: 2024-11-12SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

In VPC multicast, how to ensure high availability and self-healing to ensure the stability and efficiency of network communication is a challenge facing an industry.

Method used

Using the VPC multicast master-backup switching method in multi-instance mode, the health status of the VPC multicast transit gateway is analyzed in real time through the time-triggered status monitoring and service lock mechanism, and the master-backup switching is performed according to different states, including one master and one backup. , dual master or dual backup, master and standby failure and master and standby single point of failure mode.

Benefits of technology

Real-time monitoring and intelligent analysis of VPC multicast transit gateways is realized, faults are detected quickly and switched, ensuring uninterrupted service traffic, improving the high availability and self-healing of the gateway, and reducing operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945039A_ABST
    Figure CN118945039A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for realizing VPC multicast master-slave switching in a multi-instance mode, which belong to the technical field of computer network communication, and comprise the following steps: triggering VPC multicast transfer gateway state monitoring at regular time: triggering by a timed task, ensuring that each VPC multicast can only be locked by one instance at the same time through a service lock mode in the multi-instance mode, and ensuring that each VPC multicast is locked by one instance in the multi-instance mode; the instance obtaining the lock starts a sub-thread to analyze the state of the VPC multicast transfer gateway and the VPC multicast transfer gateway executes main-standby switching; the method comprises the steps of analyzing the state of a VPC multicast transfer gateway, inquiring the state of the VPC multicast transfer gateway, analyzing and counting each state type, executing main-standby switching by the VPC multicast transfer gateway, and processing main-standby scenes which comprise a one-main-one-standby mode, a double-main or double-standby mode, a main-standby fault mode and a main-standby single-point fault mode. According to the invention, high availability and self-healing performance of the multicast transit gateway of the VPC are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer network communications, and in particular to a method and system for implementing VPC multicast master-slave switching in a multi-instance mode. Background Art

[0002] With the increasing development of the Internet and the popularization of multimedia applications, in one-to-many network communication scenarios, multicast communication mode can help reduce server load and improve bandwidth utilization compared to unicast and broadcast communication modes. As a key component of multicast in IPv4 networks, Internet Group Management Protocol (IGMP) plays an indispensable role. IGMP (Internet Group Management Protocol) is a protocol in the TCP / IP protocol family responsible for IP multicast member management. It is used to establish and maintain multicast group membership between IP hosts and multicast routers directly adjacent to them.

[0003] Multicast technology is one of the three modes of IP network data transmission. Multicast solves the problem of duplicate message copying and bandwidth duplication in unicast mode, and also solves the problem of bandwidth resource waste in broadcast mode. It is often used in one-to-many network communication scenarios such as online live broadcast, video conferencing, financial transaction market data synchronization, distance education and network TV.

[0004] VPC multicast was born to connect the multicast sources inside and outside the cloud with the multicast receiver network. As a bridge connecting the networks inside and outside the cloud, the VPC multicast transit gateway needs to ensure high availability and self-healing. How to ensure the high availability and self-healing of VPC multicast is a problem currently faced and studied in the industry. Summary of the invention

[0005] The technical task of the present invention is to address the above shortcomings and provide a method and system for realizing VPC multicast active-standby switching in multi-instance mode, which can monitor the health status of VPC multicast transit gateway in multi-instance mode, analyze the status of VPC multicast transit gateway and select the appropriate active-standby switching mode, thereby ensuring the high availability and self-healing of VPC multicast transit gateway.

[0006] The technical solution adopted by the present invention to solve the technical problem is:

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

[0008] Scheduled triggering of VPC multicast transit gateway status monitoring: triggered by a scheduled task, in multi-instance mode, business locks are used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform master-slave switching of the VPC multicast transit gateway;

[0009] Analyze the status of the VPC multicast transit gateway: query the status of the VPC multicast transit gateway, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary-backup switching module;

[0010] The VPC multicast transit gateway performs active / standby switching: Based on the statistics provided by the VPC multicast transit gateway status module, the active / standby scenarios are processed, including one active / one standby mode, dual active or dual standby mode, active / standby failure mode, and active / standby single point failure mode.

[0011] This method monitors the health status of the VPC multicast transit gateway in real time to reduce operation and maintenance costs; provides a method for intelligently analyzing the mode of the VPC multicast transit gateway status, discovers faulty gateways in real time and performs active / standby switching to ensure uninterrupted forwarding of multicast service traffic; this method can fully cover the actual scenarios and solutions of the VPC multicast transit gateway, quickly locate faulty gateways, intelligently analyze gateway modes, and ensure high availability and self-healing of the gateway. At the same time, this method uses a business lock to ensure the accuracy of VPC multicast gateway data in multi-instance mode.

[0012] Furthermore, the timed triggering of VPC multicast transit gateway status monitoring includes status monitoring timed task triggering and VPC multicast locking, so as to realize the function that only one instance in the multi-instance mode performs a certain VPC multicast transit gateway status monitoring, which is described in more detail below:

[0013] The status monitoring scheduled task is triggered:

[0014] Each instance is controlled by a scheduled task to monitor the status of the scheduling function;

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

[0016] Loop through the VPC multicast set and put each VPC multicast into the thread pool;

[0017] The VPC multicast lock:

[0018] A child thread in the thread pool performs a lock check on a VPC multicast. The check is performed by querying the service lock table for data based on the multicast ID.

[0019] If the VPC multicast has been locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast transit gateway cannot be monitored at this time;

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

[0021] The instance that obtains the VPC multicast lock can continue to execute the following two functional modules.

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

[0023] Furthermore, the VPC multicast transit gateway status is analyzed, and the specific implementation steps are as follows:

[0024] 1) Get the VPC multicast transit gateway database record set and loop:

[0025] Call the transit gateway status interface to obtain the underlying status of the transit gateway and analyze it:

[0026] If the status is MAIN, the number of main gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

[0027] If the status is BACKUP, the number of backup gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

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

[0029] 2) Analyze the type of the VPC multicast transit gateway status. The judgment conditions are as follows:

[0030] One master and one backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of master gateways is greater than 0, and the number of backup gateways is greater than 0;

[0031] Dual-active or dual-backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of active gateways or backup gateways is equal to the total number of gateways;

[0032] Active / standby failure mode: The number of failed gateways is equal to the total number of gateways;

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

[0034] Furthermore, the VPC multicast transit gateway performs active / standby switching, and performs corresponding active / standby switching mode processing according to the type of gateway status, which is specifically implemented as follows:

[0035] One master and one standby mode:

[0036] If the current gateway type is consistent with the database gateway type and the database status is available, no processing is performed;

[0037] If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the database according to the bottom layer;

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

[0039] Reselect the master and slave, issue the master and slave allocation, and update the database gateway type and status.

[0040] Active / standby failure mode:

[0041] Update the database gateway status to failure;

[0042] Active / standby single point failure mode:

[0043] If the current gateway fails, update the database gateway status to failure;

[0044] If the current gateway is not faulty and is a backup gateway, the primary gateway configuration is sent to the gateway and the database is updated;

[0045] If the current gateway is not faulty and is a primary gateway, no processing is performed;

[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 transit 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: Get all VPC multicasts and add each VPC multicast to the thread pool. Each VPC multicast active / standby switching function is executed by an independent sub-thread.

[0050] Step 3: Check whether the VPC multicast in the child thread can be locked. If the lock fails, exit this scheduled task.

[0051] Step 4: If the VPC multicast is locked successfully, analyze the VPC multicast transit gateway status and count the number;

[0052] Step 5: According to the VPC multicast transit gateway status statistics, execute the corresponding active / standby switching logic in the corresponding mode;

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

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

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

[0056] The VPC multicast transit gateway status monitoring module is triggered by a scheduled task. In multi-instance mode, the service lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform active / standby switching of the VPC multicast transit gateway.

[0057] Analyze the VPC multicast transit gateway status module, query the VPC multicast transit gateway status, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary and backup switching module;

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

[0059] The system implements VPC multicast active / standby switching through the above-mentioned method for implementing VPC multicast active / standby switching in multi-instance mode.

[0060] Furthermore, the scheduled task is performed once a 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 having computer instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-mentioned method.

[0065] Compared with the prior art, the method and system for implementing VPC multicast master-slave switching in a multi-instance mode of the present invention has the following beneficial effects:

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

[0067] 2. Intelligently analyze the status mode of the VPC multicast transit gateway.

[0068] 3. Rapidly perform active / standby switching of abnormal gateways to ensure uninterrupted services in multicast scenarios.

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

[0070] 5. Comprehensive coverage of actual scenarios and solutions for VPC multicast transit gateways. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 It is a flowchart of a method for implementing VPC multicast master-slave switching in a multi-instance mode provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0073] The embodiment of the present invention provides a method for implementing VPC multicast active / standby switching in a multi-instance mode, including three functional modules: timing triggering VPC multicast transit gateway status monitoring, analyzing VPC multicast transit gateway status, and VPC multicast transit gateway executing active / standby switching. These three modules can monitor the health status of all VPC multicast transit gateways in real time and quickly perform active / standby switching on abnormal gateways. The main functions of each module are as follows:

[0074] Scheduled triggering of VPC multicast transit gateway status monitoring: triggered by a scheduled task, in multi-instance mode, business locks are used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform master-slave switching of the VPC multicast transit gateway;

[0075] Analyze the status of the VPC multicast transit gateway: query the status of the VPC multicast transit gateway, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary-backup switching module;

[0076] The VPC multicast transit gateway performs active / standby switching: Based on the statistics provided by the VPC multicast transit gateway status module, the active / standby scenarios are processed, including one active / one standby mode, dual active or dual standby mode, active / standby failure mode, and active / standby single point failure mode.

[0077] This method can monitor the health status of all VPC multicast transit gateways in real time, ensure the uniqueness of gateway data in multi-instance mode, and perform corresponding master-slave switching processing for four master-slave scenarios respectively, ensuring that the VPC multicast transit gateway can quickly perform master-slave switching and instantly restore the VPC multicast transit gateway function.

[0078] 1. The timed triggering of VPC multicast transit gateway status monitoring includes status monitoring timed task triggering and VPC multicast locking, so as to realize the function that only one instance in multi-instance mode performs a certain VPC multicast transit gateway status monitoring. The following is a more detailed description:

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

[0080] Each instance is scheduled by a scheduled task to control the status monitoring function once a minute;

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

[0082] Loop through the VPC multicast set and add each VPC multicast to the thread pool.

[0083] 1.2 VPC multicast lock:

[0084] A child thread in the thread pool performs a lock check on a VPC multicast. The check is performed by querying the service lock table for data based on the multicast ID.

[0085] If the VPC multicast has been locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast transit gateway cannot be monitored at this time;

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

[0087] The instance that obtains the VPC multicast lock can continue to execute the following two functional modules.

[0088] 2. Analyze and count each status type: used to count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, and provide data basis for the VPC multicast transit gateway to execute the primary and backup switching module. The steps are as follows:

[0089] 2.1. Get the VPC multicast transit gateway database record set and loop:

[0090] Call the transit gateway status interface to obtain the underlying status of the transit gateway and analyze it:

[0091] If the status is MAIN, the number of main gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

[0092] If the status is BACKUP, the number of backup gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

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

[0094] 2.2. Analyze the type of the VPC multicast transit gateway status. The judgment conditions are as follows:

[0095] One master and one backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of master gateways is greater than 0, and the number of backup gateways is greater than 0;

[0096] Dual-active or dual-backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of active gateways or backup gateways is equal to the total number of gateways;

[0097] Active / standby failure mode: The number of failed gateways is equal to the total number of gateways;

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

[0099] 3. The VPC multicast transit gateway performs active / standby switching and performs corresponding active / standby switching mode processing according to the type of gateway status. The specific implementation is as follows:

[0100] 3.1、One master and one standby mode:

[0101] If the current gateway type is consistent with the database gateway type and the database status is available, no processing is performed;

[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 bottom layer.

[0103] 3.2. Dual-primary or dual-backup mode:

[0104] Reselect the master and slave, issue the master and slave allocation, and update the database gateway type and status.

[0105] 3.3. Active / standby failure mode:

[0106] Update the database gateway status to Failed.

[0107] 3.4. Primary and standby single point failure mode:

[0108] If the current gateway fails, update the database gateway status to failure;

[0109] If the current gateway is not faulty and is a backup gateway, the primary gateway configuration is sent to the gateway and the database is updated;

[0110] If the current gateway is not faulty and is a primary gateway, no processing is performed.

[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 transit 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: Get all VPC multicasts and add each VPC multicast to the thread pool. Each VPC multicast active / standby switching function is executed by an independent sub-thread.

[0115] Step 3: Check whether the VPC multicast in the child thread can be locked. If the lock fails, exit this scheduled task.

[0116] Step 4: If the VPC multicast is locked successfully, analyze the VPC multicast transit gateway status and count the number;

[0117] Step 5: According to the VPC multicast transit gateway status statistics, execute the corresponding active / standby switching logic in the corresponding mode;

[0118] Step 6: 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 the VPC multicast transit gateway in real time to reduce operation and maintenance costs; provides a method for intelligently analyzing the mode of the VPC multicast transit gateway status, discovers faulty gateways in real time and performs active / standby switching to ensure uninterrupted forwarding of multicast service traffic; this method can fully cover the actual scenarios and solutions of the VPC multicast transit gateway, quickly locate faulty gateways, intelligently analyze gateway modes, and ensure high availability and self-healing of the gateway. At the same time, this method uses a business lock to ensure the accuracy of VPC multicast gateway data in multi-instance mode.

[0121] An embodiment of the present invention further provides a system for implementing VPC multicast active / standby switching in a multi-instance mode, including:

[0122] The VPC multicast transit gateway status monitoring module is triggered periodically. This module is triggered by a scheduled task once a minute. In multi-instance mode, the service lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform active / standby switching of the VPC multicast transit gateway.

[0123] Analyze the VPC multicast transit gateway status module, query the VPC multicast transit gateway status, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary and backup switching module;

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

[0125] The system implements VPC multicast active / standby switching through the method for implementing VPC multicast active / standby switching in the multi-instance mode described in the above embodiment.

[0126] 1. Scheduled triggering of the VPC multicast transit gateway status monitoring module, including status monitoring scheduled task triggering and VPC multicast locking, to achieve the function of only one instance in the multi-instance mode to perform a VPC multicast transit gateway status monitoring. The following is a more detailed description:

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

[0128] Each instance is scheduled by a scheduled task to control the status monitoring function once a minute;

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

[0130] Loop through the VPC multicast set and add each VPC multicast to the thread pool.

[0131] 1.2 VPC multicast lock:

[0132] A child thread in the thread pool performs a lock check on a VPC multicast. The check is performed by querying the service lock table for data based on the multicast ID.

[0133] If the VPC multicast has been locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast transit gateway cannot be monitored at this time;

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

[0135] The instance that obtains the VPC multicast lock can continue to execute the following two functional modules.

[0136] 2. Analyze and count each status type module to count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, and provide data basis for the VPC multicast transit gateway to execute the primary and backup switching module. The steps are as follows:

[0137] 2.1. Get the VPC multicast transit gateway database record set and loop:

[0138] Call the transit gateway status interface to obtain the underlying status of the transit gateway and analyze it:

[0139] If the status is MAIN, the number of main gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

[0140] If the status is BACKUP, the number of backup gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one;

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

[0142] 2.2. Analyze the type of the VPC multicast transit gateway status. The judgment conditions are as follows:

[0143] One master and one backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of master gateways is greater than 0, and the number of backup gateways is greater than 0;

[0144] Dual-active or dual-backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of active gateways or backup gateways is equal to the total number of gateways;

[0145] Active / standby failure mode: The number of failed gateways is equal to the total number of gateways;

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

[0147] 3. The VPC multicast transit gateway executes the active / standby switching module and performs corresponding active / standby switching mode processing according to the type of gateway status. The specific implementation is as follows:

[0148] 3.1、One master and one standby mode:

[0149] If the current gateway type is consistent with the database gateway type and the database status is available, no processing is performed;

[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 bottom layer.

[0151] 3.2. Dual-primary or dual-backup mode:

[0152] Reselect the master and slave, issue the master and slave allocation, and update the database gateway type and status.

[0153] 3.3. Active / standby failure mode:

[0154] Update the database gateway status to Failed.

[0155] 3.4. Primary and standby single point failure mode:

[0156] If the current gateway fails, update the database gateway status to failure;

[0157] If the current gateway is not faulty and is a backup gateway, the primary gateway configuration is sent to the gateway and the database is updated;

[0158] If the current gateway is not faulty and is a primary gateway, no processing is performed.

[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 transit gateway status.

[0160] The specific steps for implementing VPC multicast active / standby switching implemented by this system are as follows:

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

[0162] Step 2: Get all VPC multicasts and add each VPC multicast to the thread pool. Each VPC multicast active / standby switching function is executed by an independent sub-thread.

[0163] Step 3: Check whether the VPC multicast in the child thread can be locked. If the lock fails, exit this scheduled task.

[0164] Step 4: If the VPC multicast is locked successfully, analyze the VPC multicast transit gateway status and count the number;

[0165] Step 5: According to the VPC multicast transit gateway status statistics, execute the corresponding active / standby switching logic in the corresponding mode;

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

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

[0168] An embodiment of the present invention also provides a device for implementing VPC multicast active / standby 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 implementing VPC multicast active-standby switching in the multi-instance mode described in the above embodiment.

[0171] The embodiment of the present invention also provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the method for implementing VPC multicast master-slave switching in the multi-instance mode described in the above embodiment. Specifically, a system or device equipped with a storage medium can be provided, on which software program codes implementing the functions of any of the above embodiments are stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0172] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0173] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0174] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0175] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0176] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A method for implementing VPC multicast master-slave switching in multi-instance mode, characterized in that: include: Scheduled triggering of VPC multicast transit gateway status monitoring: triggered by a scheduled task, in multi-instance mode, business locks are used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform master-slave switching of the VPC multicast transit gateway; Analyze the status of the VPC multicast transit gateway: query the status of the VPC multicast transit gateway, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary-backup switching module; The VPC multicast transit gateway performs active / standby switching: Based on the statistics provided by the VPC multicast transit gateway status module, the active / standby scenarios are processed, including one active / one standby mode, dual active or dual standby mode, active / standby failure mode, and active / standby single point failure mode.

2. According to a method for implementing VPC multicast active / standby switching in a multi-instance mode in claim 1, it is characterized in that: The timed triggering of VPC multicast transit gateway status monitoring includes status monitoring timed task triggering and VPC multicast locking; The status monitoring scheduled task is triggered: Each instance is controlled by a scheduled task to monitor the status of the scheduling function; The status monitoring function will obtain all VPC multicast sets; Loop through the VPC multicast set and put each VPC multicast into the thread pool; The VPC multicast lock: A child thread in the thread pool performs a lock check on a VPC multicast. The check is performed by querying the service lock table for data based on the multicast ID. If the VPC multicast has been locked, it means that the VPC multicast has been locked by other instances, and the VPC multicast transit gateway cannot be monitored at this time; If the VPC multicast is not locked, a service lock record is added and the instance locks the VPC multicast.

3. According to a method for implementing VPC multicast active / standby switching in a multi-instance mode in claim 1, it is characterized in that: Each instance is controlled by a scheduled task status monitoring function, once a minute.

4. According to a method for implementing VPC multicast active / standby switching in a multi-instance mode in claim 1, it is characterized in that: The specific steps for analyzing the VPC multicast transit gateway status are as follows: 1) Get the VPC multicast transit gateway database record set and loop: Call the transit gateway status interface to obtain the underlying status of the transit gateway and analyze it: If the status is MAIN, the number of main gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one; If the status is BACKUP, the number of backup gateways increases by one, the number of surviving gateways increases by one, and the total number of gateways increases by one; If the status is empty, the number of faulty gateways increases by one and the total number of gateways increases by one; 2) Analyze the type of the VPC multicast transit gateway status. The judgment conditions are as follows: One master and one backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of master gateways is greater than 0, and the number of backup gateways is greater than 0; Dual-active or dual-backup mode: The number of surviving gateways is equal to the total number of gateways, and the number of active gateways or backup gateways is equal to the total number of gateways; Active / standby failure mode: The number of failed gateways is equal to the total number of gateways; Active / standby single point failure mode: The number of faulty gateways is greater than 0 and is less than the total number of gateways.

5. The method for implementing VPC multicast active / standby switching in a multi-instance mode according to claim 1 or 4, characterized in that: The VPC multicast transit gateway performs active / standby switching and performs corresponding active / standby switching mode processing according to the type of gateway status. The specific implementation is as follows: One master and one standby mode: If the current gateway type is consistent with the database gateway type and the database status is available, no processing is performed; If the current gateway type is inconsistent with the database gateway type, refresh the gateway type and status in the database according to the bottom layer; Dual-active or dual-backup mode: Reselect the master and slave, issue the master and slave allocation, and update the database gateway type and status. Active / standby failure mode: Update the database gateway status to failure; Active / standby single point failure mode: If the current gateway fails, update the database gateway status to failure; If the current gateway is not faulty and is a backup gateway, the primary gateway configuration is sent to the gateway and the database is updated; If the current gateway is not faulty and is a primary gateway, no processing is performed; 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 transit gateway status.

6. The method for implementing VPC multicast active / standby 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: Get all VPC multicasts and add each VPC multicast to the thread pool. Each VPC multicast active / standby switching function is executed by an independent sub-thread. Step 3: Check whether the VPC multicast in the child thread can be locked. If the lock fails, exit this scheduled task. Step 4: If the VPC multicast is locked successfully, analyze the VPC multicast transit gateway status and count the number; Step 5: According to the VPC multicast transit gateway status statistics, execute the corresponding active / standby switching logic in the corresponding mode; Step 6: Release the VPC multicast service lock; Step 7: Wait for the next scheduled task to start and repeat steps 1 to 6.

7. A system for implementing VPC multicast master-slave switching in multi-instance mode, characterized in that: include: The VPC multicast transit gateway status monitoring module is triggered by a scheduled task. In multi-instance mode, the service lock is used to ensure that each VPC multicast can only be locked by one instance at a time. The instance that obtains the lock will start a sub-thread to analyze the VPC multicast transit gateway status and perform active / standby switching of the VPC multicast transit gateway. Analyze the VPC multicast transit gateway status module, query the VPC multicast transit gateway status, analyze and count each status type, and count the number of surviving gateways, faulty gateways, primary gateways, backup gateways, and total gateways in the current VPC multicast transit gateway cluster, providing data basis for the VPC multicast transit gateway to execute the primary and backup switching module; The VPC multicast transit gateway executes the active / standby switching module, and processes the active / standby scenarios based on the statistics provided by the VPC multicast transit gateway status module, including one active / one standby mode, dual active or dual standby mode, active / standby failure mode, and active / standby single point failure mode. The system implements VPC multicast active / standby switching through the method for implementing VPC multicast active / standby switching in a multi-instance mode as described in any one of claims 1 to 6.

8. The system for implementing VPC multicast active / standby switching in multi-instance mode according to claim 7, characterized in that: The scheduled task is performed once a minute.

9. A device for implementing VPC multicast master-slave switching in 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 used to call the machine-readable program to implement the method described in any one of claims 1 to 6.

10. A computer readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Ethernet virtual network gateway switching method and service provider edge node equipment

    CN105490937A

  • Multi-activity distribution method and device of cloud scene NAT gateway cluster based on multicast

    CN115941493A

  • 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

  • Distributed virtual gateway appliance

    US20170126436A1

Cited By

  • Load sharing method and device for multicast service data processing

    CN120567809A