CN111404730A - State synchronization method and device of virtual router, electronic equipment and storage medium - Google Patents

State synchronization method and device of virtual router, electronic equipment and storage medium Download PDF

Info

Publication number
CN111404730A
CN111404730A CN202010145722.1A CN202010145722A CN111404730A CN 111404730 A CN111404730 A CN 111404730A CN 202010145722 A CN202010145722 A CN 202010145722A CN 111404730 A CN111404730 A CN 111404730A
Authority
CN
China
Prior art keywords
virtual router
state
state information
virtual
routers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010145722.1A
Other languages
Chinese (zh)
Other versions
CN111404730B (en
Inventor
朱正东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Huayun Data Technology Service Co Ltd
Original Assignee
Wuxi Huayun Data Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Huayun Data Technology Service Co Ltd filed Critical Wuxi Huayun Data Technology Service Co Ltd
Priority to CN202010145722.1A priority Critical patent/CN111404730B/en
Publication of CN111404730A publication Critical patent/CN111404730A/en
Application granted granted Critical
Publication of CN111404730B publication Critical patent/CN111404730B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/20Network management software packages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0846Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a state synchronization method and device of a virtual router, electronic equipment and a storage medium. Managed by providing a first state synchronization software for a plurality of primary virtual routers and a second state synchronization software for a standby virtual router corresponding to each of the plurality of primary virtual routers. Therefore, the current equipment state information of the plurality of main virtual routers can be synchronized to the second state synchronization software through the first state synchronization software, so that the second state synchronization software updates the equipment state information of the standby virtual routers, the data synchronization is realized through only two pieces of software, and compared with a mode of establishing a plurality of daemon processes, the method saves the calculation and storage resources of a system.

Description

State synchronization method and device of virtual router, electronic equipment and storage medium
Technical Field
The application relates to the technical field of cloud computing, in particular to a state synchronization method and device of a virtual router, electronic equipment and a storage medium.
Background
The virtual router is a conventional virtual device in cloud computing technology, and can provide the same service as the physical device by creating the virtual router.
In order to ensure high availability of the created virtual router, while creating one virtual router, one or more standby virtual routers need to be created corresponding to the virtual router, and then the virtual router serves as a primary virtual router, and one primary virtual router and one or more standby virtual routers corresponding to the primary virtual router can be understood as a pair of primary-standby virtual routers. In the presence of a master-slave, a daemon thread such as a keepalive thread and a conntrack thread needs to be created between each pair of master-slave virtual routers to ensure that data on each pair of master-slave virtual routers can keep synchronous.
However, this is problematic in that if the number of the master-standby virtual routers is large, many daemon threads need to be created and maintained, which inevitably consumes a large amount of computing and storage resources of the system.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for synchronizing states of virtual routers, an electronic device, and a storage medium, so as to save computation and storage resources of a system while maintaining synchronization of data of a master virtual router and a slave virtual router.
In a first aspect, an embodiment of the present application provides a state synchronization method for a virtual router, which is applied to a first state synchronization software, and the method includes:
acquiring current equipment state information of each main virtual router in a plurality of main virtual routers on a cloud platform; and sending the equipment state information to second state synchronization software, wherein the second state synchronization software is used for correspondingly updating the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
In the embodiment of the application, first state synchronization software is provided for a plurality of primary virtual routers for management, and second state synchronization software is provided for standby virtual routers corresponding to the plurality of primary virtual routers for management. Therefore, the current equipment state information of the plurality of main virtual routers can be synchronized to the second state synchronization software through the first state synchronization software, so that the second state synchronization software updates the equipment state information of the standby virtual routers, the data synchronization is realized through only two pieces of software, and compared with a mode of establishing a plurality of daemon processes, the method saves the calculation and storage resources of a system.
With reference to the first aspect, in a first possible implementation manner, the obtaining current device state information of each of a plurality of master virtual routers on a cloud platform includes:
for each master virtual router: obtaining current working state information of a main virtual router by accessing the main virtual router; if the working state information indicates that the main virtual router is in a working state currently, acquiring communication information between the main virtual router and other equipment; and if the working state information indicates that the main virtual router is in a non-working state currently, not acquiring the communication information.
In the embodiment of the present application, if the master virtual router is in an inoperative state, the communication information of the master virtual router cannot be acquired from the master virtual router. Therefore, when the main virtual router is determined to be in the non-working state through the working state information, the communication information of the main virtual router is not acquired, on one hand, invalid actions can be avoided being executed, execution efficiency is improved, on the other hand, the acquired device state information only contains the working state information, and the amount of transmitted information is reduced, so that the calculation and storage resources of the system are further saved.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, after obtaining current device state information of each of a plurality of primary virtual routers on a cloud platform, the method further includes:
if the current working state information indicates that a main virtual router in the plurality of main virtual routers is in a non-working state currently, the main virtual router in the non-working state is adjusted to be a standby virtual router.
In the embodiment of the application, as the data synchronization is to synchronize new information generated by the master virtual router in the working state to the standby virtual router which is not in the working state, the master virtual router which is not in the working state can be timely adjusted to be the standby virtual router, so that the master virtual router can be ensured to be the virtual router in the working state, and the correct data synchronization can be realized.
With reference to the first aspect, in a third possible implementation manner, besides the multiple primary virtual routers, the cloud platform further includes other primary virtual routers managed by the second state synchronization software, and other standby virtual routers, corresponding to the other primary virtual routers, on the cloud platform are managed by the first state synchronization software, where the method further includes:
receiving the current equipment state information of the other main virtual routers, which is sent by the second state synchronization software; and updating the equipment state information of the other standby virtual routers according to the current equipment state information of the other main virtual routers.
In the embodiment of the application, the data synchronization is more comprehensively realized by updating the equipment state information of other standby virtual routers managed by the router.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, after receiving the current device state information of the other primary virtual router sent by the second state synchronization software, the method further includes:
and if the current equipment state information of the other main virtual routers indicates that the other main virtual routers are in a non-working state currently, starting the other standby virtual routers.
In the embodiment of the application, when other main virtual routers do not work currently, other corresponding standby virtual routers are started, so that the high availability of the virtual routers can be ensured, and service interruption is avoided.
With reference to the third possible implementation manner of the first aspect, in a fifth possible implementation manner, after receiving the current device state information of the other primary virtual router sent by the second state synchronization software, the method further includes:
if the current equipment state information of the other main virtual routers indicates that the other main virtual routers are in a non-working state currently, the other standby virtual routers are adjusted to be the main virtual router managed by the first state synchronization software.
In the embodiment of the application, as the data synchronization is to synchronize new information generated by the master virtual router in the working state to the standby virtual router which is not in the working state, the standby virtual router in the working state can be timely adjusted to be the master virtual router, so that the master virtual router can be ensured to be the virtual router in the working state, and the correct data synchronization can be realized.
With reference to the first aspect, in a sixth possible implementation manner, before obtaining current device state information of each of a plurality of primary virtual routers on a cloud platform, the method further includes: and traversing the preset management table entry of the virtual router to determine the plurality of main virtual routers managed by the first state synchronization software.
In the embodiment of the application, a plurality of main virtual routers are quickly determined by traversing the management table entries.
In a second aspect, an embodiment of the present application provides a state synchronization apparatus for a virtual router, which is applied to a first state synchronization software, and the apparatus includes: the information acquisition module is used for acquiring the current equipment state information of each main virtual router in a plurality of main virtual routers on the cloud platform; and the information updating module is used for sending the equipment state information to second state synchronization software, wherein the second state synchronization software is used for correspondingly updating the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
With reference to the second aspect, in a first possible implementation manner,
for each master virtual router: the information acquisition module is used for acquiring the current working state information of the main virtual router by accessing the main virtual router; if the working state information indicates that the main virtual router is in a working state currently, acquiring communication information between the main virtual router and other equipment; and if the working state information indicates that the main virtual router is in a non-working state currently, not acquiring the communication information.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner,
after the information obtaining module obtains the current device state information of each of the plurality of master virtual routers on the cloud platform, the information updating module is further configured to adjust the master virtual router currently in the non-working state to the standby virtual router if the current working state information indicates that one of the plurality of master virtual routers is currently in the non-working state.
With reference to the second aspect, in a third possible implementation manner,
the cloud platform is provided with other main virtual routers managed by the second state synchronization software besides the plurality of main virtual routers, and other standby virtual routers corresponding to the other main virtual routers on the cloud platform are managed by the first state synchronization software,
the information acquisition module is further configured to receive the current device state information of the other master virtual routers, which is sent by the second state synchronization software;
and the information updating module is also used for updating the equipment state information of the other standby virtual routers according to the current equipment state information of the other main virtual routers.
With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner,
after the information obtaining module receives the current device state information of the other primary virtual router sent by the second state synchronization software, the information updating module is further configured to start the other standby virtual router if the current device state information of the other primary virtual router indicates that the other primary virtual router is currently in a non-working state.
With reference to the third possible implementation manner of the second aspect, in a fifth possible implementation manner,
after the information obtaining module receives the current device state information of the other master virtual routers sent by the second state synchronization software, the information updating module is further configured to adjust the other slave virtual routers to the master virtual router managed by the first state synchronization software if the current device state information of the other master virtual routers indicates that the other master virtual routers are currently in a non-working state.
With reference to the second aspect, in a sixth possible implementation manner,
before the information obtaining module obtains the current device state information of each of the plurality of master virtual routers on the cloud platform, the information updating module is configured to traverse a preset management table entry of the virtual router and determine the plurality of master virtual routers managed by the first state synchronization software.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus, the memory storing machine-readable instructions executable by the processor;
when the electronic device is running, the processor and the memory communicate via a bus, and the processor executes the machine-readable instructions to perform the method for synchronizing the state of the virtual router according to the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computer, the method for synchronizing states of a virtual router according to the first aspect or any possible implementation manner of the first aspect is performed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a block diagram of a cloud platform according to an embodiment of the present disclosure;
fig. 2 is an application scenario diagram of a state synchronization method for a virtual router according to an embodiment of the present application;
fig. 3 is a flowchart of a state synchronization method for a virtual router according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a state synchronization apparatus of a virtual router according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, according to the usage requirement of the user, a plurality of primary virtual routers are deployed on the cloud platform, and a standby virtual router corresponding to each primary virtual router is also deployed for each primary virtual router. In each pair of the master-slave virtual routers, the master virtual router represents a virtual router in a working state on the cloud platform, and the slave virtual router represents a virtual router in a non-working state on the cloud platform.
In this embodiment, each pair of master-slave virtual routers needs to implement not only data synchronization but also master-slave relationship synchronization. That is, when the operating state of each pair of the master-slave virtual routers changes, for example, one virtual router of two virtual routers corresponding to a certain pair of the master-slave virtual routers changes from the operating state to the non-operating state, and the other virtual router changes from the non-operating state to the operating state, the master-slave relationship of the pair of the master-slave virtual routers also needs to be correspondingly adjusted, the original master virtual router is adjusted to be the slave virtual router, and the original slave virtual router is adjusted to be the master virtual router.
Referring to fig. 1 and fig. 2 and fig. 3, an embodiment of the present application provides a state synchronization method for a virtual router, where the state synchronization method for the virtual router may be executed by two state synchronization software deployed on an electronic device, such as a terminal or a server, to implement data synchronization of each pair of master-slave virtual routers and implement master-slave relationship adjustment of each pair of master-slave virtual routers.
Specifically, the step of executing the state synchronization method of the virtual router may include:
step S100: the first state synchronization software acquires the current equipment state information of each main virtual router in a plurality of main virtual routers on the cloud platform.
Step S200: the first state synchronization software sends the device state information to the second state synchronization software.
Step S300: and the second state synchronization software correspondingly updates the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
It can be understood that, when the state synchronization method of the virtual router is executed, the state synchronization software is not limited to the two described in this embodiment, and may also be multiple state synchronization software, each master virtual router or standby virtual router is managed by corresponding one state synchronization software, and the number of the state synchronization software management is smaller than the number of all the master virtual routers on the cloud platform.
For example, there are three state synchronization software, and the first state synchronization software may send the current device state information of the master virtual router managed by the first state synchronization software to the remaining second and third state synchronization software; or, the first state synchronization software may also send the device state information to the second state synchronization software, and the second state synchronization software forwards the device state information to the third state synchronization software. In this way, both the second and third state synchronization software can obtain the device state information. If the standby virtual router corresponding to the primary virtual router managed by the first state synchronization software is managed by the third state synchronization software, the third state synchronization software updates the device state information of the corresponding standby virtual router based on the received device state information.
Of course, in order to facilitate understanding of the present solution, the present embodiment takes two state synchronization software as an example to illustrate the technical solution of the present application. And since the logic of each state synchronization software executing the state synchronization method of the virtual router is substantially the same, for the convenience of understanding, the present application is mainly described from the perspective of the first state synchronization software.
In this embodiment, a management table entry of a virtual router is preset in the first state synchronization software, and the management table entry records whether each virtual router managed by the first state synchronization software is currently a primary virtual router or a standby virtual router.
For example, the record of the management entry may be as shown in table 1 below:
serial number Virtual router numbering Master-slave mark
0 XXX-FFF-1 1
1 XXX-FFF-2 1
2 XXX-FFF-3 1
3 XXX-FFF-4 0
4 XXX-FFF-5 0
TABLE 1
The state identifier is 1, which indicates that the virtual router is currently the main virtual router, and the state identifier is 0, which indicates that the virtual router is currently the standby virtual router. Obviously, of the 5 virtual routers managed by the first state synchronization software, the three virtual routers XXX-FFF-1, XXX-FFF-2 and XXX-FFF-3 are currently main virtual routers, and the two virtual routers XXX-FFF-4 and XXX-FFF-5 are currently standby virtual routers.
In this embodiment, the first state synchronization software may periodically acquire the device state information of each of the plurality of primary virtual routers managed by the first state synchronization software, so as to perform data synchronization. Then, when the current time reaches a set time point of the current cycle (the set time point is a time point at which the device state information acquisition needs to be performed, which may be a start time or an end time of each cycle), the electronic device may traverse the management table entry to determine a plurality of primary virtual routers that are currently primary (obtaining a virtual router number of each primary virtual router from the management table entry is to determine each primary virtual router).
Step S100: the first state synchronization software acquires the current equipment state information of each main virtual router in a plurality of main virtual routers on the cloud platform.
In this embodiment, the first state synchronization software pre-establishes a mapping relationship between a virtual router number and an address of each master virtual router managed by the first state synchronization software. After the virtual router number of each main virtual router is obtained, based on the mapping relation, the first state synchronization software can determine the address of each main virtual router, and then access is initiated to each main virtual router based on the address so as to obtain the current equipment state information of each main virtual router.
For example, since the logic for acquiring the device state information of each master virtual router managed by the first state synchronization software is substantially the same, for understanding, the present embodiment will be described by taking the example that the first state synchronization software acquires the device state information of a certain master virtual router.
In particular, based on the address of the primary virtual router, the first state synchronization software can generate and send an access request to the primary virtual router.
If the main virtual router is currently and actually in a working state, the main virtual router can return an access response to the first state synchronization software based on the access request. If the master virtual router is currently in an inoperative state, such as shutdown or failure, the master virtual router cannot return an access response to the first state synchronization software based on the access request.
Therefore, after sending the access request, the first state synchronization software may obtain the current operating state information of the primary virtual router by determining whether an access response returned by the primary virtual router is received.
Specifically, if the first state synchronization software receives an access response returned by the master virtual router, the first state synchronization software generates working state information for indicating that the master virtual router is currently in a working state; and if the first state synchronization software does not receive the access response returned by the main virtual router after time out, the first state synchronization software generates working state information for indicating that the main virtual router is in a non-working state currently.
Further, if the master virtual router is currently in an operating state, the first state synchronization software may generate a communication information obtaining request, where the communication information obtaining request is used to obtain communication information generated by communication between the master virtual router and other devices. By sending the communication information acquisition request to the master virtual router, the first state synchronization software can correspondingly receive the communication information returned by the master virtual router based on the communication information acquisition request, wherein the communication information records the time and the data of the master virtual router interacted with the device. In other words, when the master virtual router is currently in the working state, the acquiring, by the first state synchronization software, the current device state information of the master virtual router includes: the current operating state information and communication information of the primary virtual router.
If the main virtual router is currently in a non-working state, the first state synchronization software cannot acquire the communication information of the main virtual router even if the first state synchronization software continues to access the main virtual router. Therefore, after determining that the primary virtual router is currently in the non-operating state, the first state synchronization software does not need to acquire the information of the primary virtual router. In other words, when the master virtual router is currently in a non-working state, the first state synchronization software acquires that the current device state information of the master virtual router includes the current working state information of the master virtual router.
After the first state synchronization software obtains the current working state information of each master virtual router managed by the first state synchronization software, the first state synchronization software may execute step S200.
Step S200: the first state synchronization software sends the device state information to the second state synchronization software.
In order to facilitate data synchronization, after the current working state information of each master virtual router managed by the first state synchronization software is acquired, the first state synchronization software may send the current working state information of each master virtual router to the second state synchronization software for a first time.
In addition, since the current working state information can reflect whether the master virtual router is currently in a working state, in the process of generating the current working state information of each master virtual router managed by the first state synchronization software, the first state synchronization software can also determine which master virtual routers which are originally in the working state are currently in a non-working state.
If the primary virtual router originally in the working state is currently and actually in the non-working state, it is indicated that the primary virtual router is actually the standby virtual router. Therefore, the first state synchronization software needs to correspondingly adjust the primary/secondary relationship of the primary virtual router, that is, the primary/secondary identifier of the primary virtual router currently in the non-working state is adjusted from 1 to 0 in the management table entry, so as to adjust the primary virtual router to be the secondary virtual router.
For example, in table 1, two virtual routers XXX-FFF-1 and XXX-FFF-2 are currently in an inactive state, the first state synchronization software adjusts the active/standby identifiers of the two virtual routers from 1 to 0, so that the two virtual routers XXX-FFF-1 and XXX-FFF-2 are changed from the active virtual router to the standby virtual router. Table 2 obtained is as follows:
serial number Virtual router numbering Master-slave mark
0 XXX-FFF-1 0
1 XXX-FFF-2 0
2 XXX-FFF-3 1
3 XXX-FFF-4 0
4 XXX-FFF-5 0
TABLE 2
Step S300: and the second state synchronization software correspondingly updates the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
In this embodiment, the second state synchronization software is pre-established with a corresponding relationship between each pair of the master-slave virtual routers. After the second state synchronization software receives the current device state information of each main virtual router, the second state synchronization software may search for a corresponding relationship according to the virtual router number of the main virtual router in the current device state information of each main virtual router, and determine a standby virtual router corresponding to each main virtual router.
In this embodiment, since the update logics of the device state information of each standby virtual router managed by the second state synchronization software are substantially the same, for convenience of understanding, the embodiment will be described by taking the example that the second state synchronization software updates the device state information of a certain standby virtual router.
Specifically, if the current device state information of the master virtual router corresponding to the standby virtual router includes: the current working state information and the communication information of the main virtual router indicate that the main virtual router is actually in a working state at present, and in this case, the second state synchronization software does not need to control the standby virtual router to start and continues to keep the standby virtual router in a non-working state of shutdown or standby. And the second state synchronization software can also update the communication information of the standby virtual router stored in the second state synchronization software by using the communication information of the main virtual router so as to realize data synchronization.
If the current device state information of the main virtual router corresponding to the standby virtual router only comprises: the current working state information of the main virtual router indicates that the main virtual router is actually in a non-working state currently. In one aspect, the second state synchronization software may control the standby virtual router to start up to ensure that service is not interrupted for a long time. On the other hand, the second state synchronization software updates the device state information of the standby virtual router, that is, the main-standby relationship of the standby virtual router is correspondingly adjusted. For example, the second state synchronization software may adjust the active/standby identifier of the standby virtual router from 0 to 1 in a management table entry preset by the second state synchronization software, so as to adjust the standby virtual router to the primary virtual router managed by the second state synchronization software.
In this embodiment, because there are other master virtual routers managed by the second state synchronization software besides the plurality of master virtual routers managed by the first state synchronization software on the cloud platform, and other standby virtual routers corresponding to the other master virtual routers on the cloud platform are also managed by the first state synchronization software, the first state synchronization software may also send current device state information of the other master virtual routers based on the second state synchronization software, and update the device state information of the other standby virtual routers.
Specifically, the first state synchronization software is pre-established with a corresponding relationship between each pair of the master-slave virtual routers. After the first state synchronization software receives the current device state information of the other main virtual router sent by the second state synchronization software, the first state synchronization software may search for the corresponding relationship according to the virtual router numbers of the other main virtual router in the current device state information of the other main virtual router, thereby determining the other standby virtual router corresponding to the other main virtual router.
Further, if the current device state information of the other virtual routers includes: the current working state information and the communication information of the other main virtual routers indicate that the other main virtual routers are actually in a working state at present, and in this case, the first state synchronization software does not need to control the other standby virtual routers to be started, and continues to keep the other standby virtual routers in a shutdown or standby non-working state. And the first state synchronization software can also update the communication information of the other standby virtual router stored on the first state synchronization software by using the communication information of the other main virtual router so as to realize the synchronization of data.
If the current device state information of the other main virtual router only includes: the current working state information of the other main virtual router indicates that the main virtual router is actually in a non-working state currently. In this case, on the one hand, the first state synchronization software may also control the other standby virtual routers to start up, so as to ensure that the service is not interrupted for a long time. On the other hand, the first state synchronization software updates the device state information of the other standby virtual router, that is, correspondingly adjusts the main-standby relationship of the other standby virtual router. For example, the first state synchronization software may also adjust the active/standby identifier of the other standby virtual router from 0 to 1 in a management table entry preset by the first state synchronization software, so as to adjust the other standby virtual router to another primary virtual router managed by the first state synchronization software.
Referring to fig. 4, based on the same inventive concept, the present embodiment provides an electronic device 10, and the electronic device 10 may include a communication interface 11 connected to a network, one or more processors 12 for executing program instructions, a bus 13, and a memory 14 in different forms, such as a disk, a ROM, or a RAM, or any combination thereof. Illustratively, the computer platform may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof.
The memory 14 is used for storing programs, and the processor 12 is used for calling and running the programs in the memory 14 to execute the aforementioned state synchronization method of the virtual router.
Referring to fig. 5, based on the same inventive concept, an embodiment of the present invention provides a state synchronization apparatus 100 for a virtual router, where the state synchronization apparatus 100 for a virtual router can be applied to an electronic device, and the state synchronization apparatus 100 for a virtual router can include: an information obtaining module 110, configured to obtain current device state information of each of a plurality of master virtual routers on a cloud platform; an information updating module 120, configured to send the device state information to second state synchronization software, where the second state synchronization software is configured to update the device state information of the standby virtual router corresponding to each primary virtual router according to the current device state information of the primary virtual router.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Some embodiments of the present application further provide a computer readable storage medium of a computer executable nonvolatile program code, which can be a general-purpose storage medium such as a removable disk, a hard disk, etc., and the computer readable storage medium has a program code stored thereon, and when the program code is executed by a computer, the foregoing method for synchronizing the state of a virtual router is performed.
The program code product of the state synchronization method for a virtual router provided in the embodiment of the present application includes a computer-readable storage medium storing the program code, where instructions included in the program code may be used to execute the method in the foregoing method embodiment, and specific implementation may refer to the method embodiment, which is not described herein again.
In summary, the embodiments of the present application provide a method and an apparatus for synchronizing states of a virtual router, an electronic device, and a storage medium. Managed by providing a first state synchronization software for a plurality of primary virtual routers and a second state synchronization software for a standby virtual router corresponding to each of the plurality of primary virtual routers. Therefore, the current equipment state information of the plurality of main virtual routers can be synchronized to the second state synchronization software through the first state synchronization software, so that the second state synchronization software updates the equipment state information of the standby virtual routers, the data synchronization is realized through only two pieces of software, and compared with a mode of establishing a plurality of daemon processes, the method saves the calculation and storage resources of a system.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for synchronizing states of a virtual router, applied to a first state synchronization software, the method comprising:
acquiring current equipment state information of each main virtual router in a plurality of main virtual routers on a cloud platform;
and sending the equipment state information to second state synchronization software, wherein the second state synchronization software is used for correspondingly updating the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
2. The method for synchronizing states of virtual routers according to claim 1, wherein obtaining current device state information of each of a plurality of master virtual routers on a cloud platform includes:
for each master virtual router:
obtaining current working state information of a main virtual router by accessing the main virtual router;
if the working state information indicates that the main virtual router is in a working state currently, acquiring communication information between the main virtual router and other equipment; and if the working state information indicates that the main virtual router is in a non-working state currently, not acquiring the communication information.
3. The method for synchronizing states of virtual routers according to claim 2, wherein after obtaining the current device state information of each of the plurality of master virtual routers on the cloud platform, the method further comprises:
if the current working state information indicates that a main virtual router in the plurality of main virtual routers is in a non-working state currently, the main virtual router in the non-working state is adjusted to be a standby virtual router.
4. The method for state synchronization of virtual routers according to claim 1, wherein the cloud platform further includes, in addition to the plurality of primary virtual routers, other primary virtual routers managed by the second state synchronization software, and other standby virtual routers on the cloud platform corresponding to the other primary virtual routers are managed by the first state synchronization software, the method further comprising:
receiving the current equipment state information of the other main virtual routers, which is sent by the second state synchronization software;
and updating the equipment state information of the other standby virtual routers according to the current equipment state information of the other main virtual routers.
5. The method for synchronizing the states of virtual routers according to claim 4, wherein after receiving the current device state information of other primary virtual routers sent by the second state synchronization software, the method further comprises:
and if the current equipment state information of the other main virtual routers indicates that the other main virtual routers are in a non-working state currently, starting the other standby virtual routers.
6. The method for synchronizing the states of virtual routers according to claim 4, wherein after receiving the current device state information of other primary virtual routers sent by the second state synchronization software, the method further comprises:
if the current equipment state information of the other main virtual routers indicates that the other main virtual routers are in a non-working state currently, the other standby virtual routers are adjusted to be the main virtual router managed by the first state synchronization software.
7. The method for synchronizing states of virtual routers according to claim 1, wherein before obtaining current device state information of each of a plurality of master virtual routers on a cloud platform, the method further comprises:
and traversing the preset management table entry of the virtual router to determine the plurality of main virtual routers managed by the first state synchronization software.
8. A state synchronization apparatus of a virtual router, applied to a first state synchronization software, the apparatus comprising:
the information acquisition module is used for acquiring the current equipment state information of each main virtual router in a plurality of main virtual routers on the cloud platform;
and the information updating module is used for sending the equipment state information to second state synchronization software, wherein the second state synchronization software is used for correspondingly updating the equipment state information of the standby virtual router corresponding to each main virtual router according to the current equipment state information of the main virtual router.
9. An electronic device, comprising: a processor, a memory, and a bus, the memory storing machine-readable instructions executable by the processor;
when the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine readable instructions to perform the state synchronization method of the virtual router according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a computer, performs a method of state synchronization of a virtual router according to any one of claims 1 to 7.
CN202010145722.1A 2020-03-04 2020-03-04 State synchronization method and device of virtual router, electronic equipment and storage medium Active CN111404730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010145722.1A CN111404730B (en) 2020-03-04 2020-03-04 State synchronization method and device of virtual router, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010145722.1A CN111404730B (en) 2020-03-04 2020-03-04 State synchronization method and device of virtual router, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111404730A true CN111404730A (en) 2020-07-10
CN111404730B CN111404730B (en) 2022-12-27

Family

ID=71430489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010145722.1A Active CN111404730B (en) 2020-03-04 2020-03-04 State synchronization method and device of virtual router, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111404730B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857933A (en) * 2020-07-28 2020-10-30 中国人民解放军陆军工程大学 System and method for synchronizing remote states of virtual training system in cloud mode
CN113157391A (en) * 2021-04-09 2021-07-23 上海云轴信息科技有限公司 Cloud routing high-availability method and equipment
CN114785807A (en) * 2022-03-16 2022-07-22 深信服科技股份有限公司 Data processing method and device, electronic equipment and storage medium
CN115665048A (en) * 2022-10-09 2023-01-31 浪潮云信息技术股份公司 Synchronous conntrack method, system and device based on four-layer load balancing cluster

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090154341A1 (en) * 2007-12-12 2009-06-18 Cisco Technology, Inc. Method And Apparatus For Providing Network Redundancy
CN102571598A (en) * 2012-02-06 2012-07-11 杭州华三通信技术有限公司 VRRP group flow synchronous switching method and route equipment
CN102571377A (en) * 2010-12-09 2012-07-11 上海杉达学院 Hot standby system for routers
CN103927216A (en) * 2013-01-16 2014-07-16 国际商业机器公司 Method And System For Managing Virtual Devices
US20140321265A1 (en) * 2013-04-29 2014-10-30 Telefonaktiebolaget L M Ericsson (Publ) Fast traffic recovery in vrrp based routers
CN105634848A (en) * 2014-11-04 2016-06-01 中国移动通信集团四川有限公司 Virtual router monitoring method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090154341A1 (en) * 2007-12-12 2009-06-18 Cisco Technology, Inc. Method And Apparatus For Providing Network Redundancy
CN102571377A (en) * 2010-12-09 2012-07-11 上海杉达学院 Hot standby system for routers
CN102571598A (en) * 2012-02-06 2012-07-11 杭州华三通信技术有限公司 VRRP group flow synchronous switching method and route equipment
CN103927216A (en) * 2013-01-16 2014-07-16 国际商业机器公司 Method And System For Managing Virtual Devices
US20140321265A1 (en) * 2013-04-29 2014-10-30 Telefonaktiebolaget L M Ericsson (Publ) Fast traffic recovery in vrrp based routers
CN105634848A (en) * 2014-11-04 2016-06-01 中国移动通信集团四川有限公司 Virtual router monitoring method and apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857933A (en) * 2020-07-28 2020-10-30 中国人民解放军陆军工程大学 System and method for synchronizing remote states of virtual training system in cloud mode
CN113157391A (en) * 2021-04-09 2021-07-23 上海云轴信息科技有限公司 Cloud routing high-availability method and equipment
CN114785807A (en) * 2022-03-16 2022-07-22 深信服科技股份有限公司 Data processing method and device, electronic equipment and storage medium
CN115665048A (en) * 2022-10-09 2023-01-31 浪潮云信息技术股份公司 Synchronous conntrack method, system and device based on four-layer load balancing cluster

Also Published As

Publication number Publication date
CN111404730B (en) 2022-12-27

Similar Documents

Publication Publication Date Title
CN111404730B (en) State synchronization method and device of virtual router, electronic equipment and storage medium
CN106789362B (en) Equipment management method and network management system
WO2017185961A1 (en) Method and apparatus for processing service discovery
CN111190736A (en) Low-intrusion distributed timing task scheduling system and method based on microservice
US9367261B2 (en) Computer system, data management method and data management program
CN108664660A (en) Distributed implementation method, apparatus, equipment and the storage medium of time series database
EP3598301B1 (en) Cloud management platform, virtual machine management method, system thereof
US20130219224A1 (en) Job continuation management apparatus, job continuation management method and job continuation management program
CN104486108A (en) Node configuration method base on Zookeeper and node configuration system based on Zookeeper
CN113987064A (en) Data processing method, system and equipment
US20210089379A1 (en) Computer system
CN111680015A (en) File resource processing method, device, equipment and medium
CN107807931B (en) Method and system for template information management
CN107786350B (en) Method and device for restoring factory configuration of network equipment and network equipment
CN109120680B (en) Control system, method and related equipment
CN113132356B (en) UDP message distribution method, device and storage medium
CN107451254B (en) Method for generating unique identifier of database table data
WO2022037359A1 (en) Configuration data access method, apparatus, and device, configuration center, and storage medium
CN112000444B (en) Database transaction processing method and device, storage medium and electronic equipment
CN113420029A (en) Global ID generation method, device, equipment and medium for distributed system
CN111241200B (en) Master-slave synchronous processing method and device based on SQLite database
CN112230978A (en) Multi-data-source dynamic switching method, electronic equipment and storage medium
CN115314361A (en) Server cluster management method and related components thereof
CN114253690A (en) Task scheduling method and device, electronic equipment and computer readable storage medium
CN107710165A (en) Method and apparatus for the request of memory node synchronous service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 214100 No. 6, science and education software park, Binhu District, Wuxi City, Jiangsu Province

Applicant after: Huayun data holding group Co.,Ltd.

Address before: No. 6 Science and Education Software Park, Binhu District, Wuxi City, Jiangsu Province

Applicant before: WUXI CHINAC DATA TECHNICAL SERVICE Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant