A configuration sending method and device
By implementing the configuration issuance method in the stacked equipment of the firewall, the problem of difficulty in issuing firewall configuration data is solved, ensuring the normal processing of business configuration and the high reliability of the system.
Patent Information
- Application Number
- CN202211328613.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-10-26
AI Technical Summary
In stacked devices, there is difficulty in issuing configuration data of firewalls, especially when the master device fails, the controller cannot issue new service configurations, and the slave device cannot effectively utilize it when the master device fails.
By implementing a configuration issuance method in the controller, it sends notification messages to the master device and the slave device, receives configuration data acquisition requests for the master virtual device, and distributes the configuration data to the master virtual device. The master virtual device and the slave virtual device synchronize the configuration data through the synchronization channel to ensure that the configuration data is sent normally in the stacking device.
The normal issuance of configuration data in the stacked device is realized, ensuring the normal processing of service configuration. Even if the master or slave device fails, the master virtual device can still obtain configuration data from the controller, ensuring the high reliability of the system.
Smart Images

Figure CN115632947B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a configuration delivery method and device. Background Art
[0002] Firewalls play an important role in network security, especially in data center networks, where they assume the security tasks of the entire data center server. To improve the high reliability of firewalls, two devices can be stacked together for use, taking two devices as an example. Firewalls that use stacking technology provide an external management plane, that is, from the perspective of controller management, the two stacked devices are like one device, and the two stacked devices can be managed using one management IP. After the two devices are stacked, they are used for user management and maintenance externally, and the business load function can be used internally, thereby improving the utilization of device resources. However, stacking firewalls also has many disadvantages. If the management plane fails, the controller cannot send configurations to the two devices; the upgrade of stacked devices is also very complicated, and the two devices need to be disassembled, upgraded separately, and then stacked together.
[0003] In order to solve the defects of stacking technology, a dual-machine hot standby solution was introduced, in which one of the two stacking devices is configured as the master device and the other is configured as the slave device. The master device synchronizes the configuration issued by the controller to the slave device. In this method, the controller can only issue configurations through the master device. When the master device fails, the controller cannot issue new business configurations. In addition, when the master device is working normally, the slave device only performs hot standby of configuration and data, and does not process business, so the device resources cannot be effectively utilized.
[0004] Therefore, how to implement normal delivery of configuration data in stacking devices is one of the technical issues worth considering. Summary of the invention
[0005] In view of this, the present application provides a configuration sending method and apparatus to achieve normal sending of configuration data in a stacking device.
[0006] Specifically, the present application is implemented through the following technical solutions:
[0007] According to a first aspect of the present application, a configuration delivery method is provided, which is applied to a controller, wherein the controller is used to deliver configuration to a master device and a slave device in a stacking device, wherein the master device integrates at least one virtual device, and the slave device integrates at least one virtual device, and a virtual device in the master device and a virtual device in the slave device constitute a virtual device group; the method comprises:
[0008] When configuration needs to be issued, notification messages are sent to the master device and slave device respectively;
[0009] Receiving a configuration data acquisition request sent by a master virtual device, wherein the master virtual device is a virtual device in a master state in a corresponding virtual device group;
[0010] The requested configuration data is sent to the primary virtual device.
[0011] According to a second aspect of the present application, another configuration delivery method is provided, which is applied to a network device in a stacking device, wherein the network device is a master device or a slave device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a virtual device group; the method includes:
[0012] Receive notification messages sent by the controller;
[0013] Determining a virtual device corresponding to the configuration data indicated by the notification message in the network device;
[0014] If the determined virtual device is the main virtual device, a data acquisition request is sent to the controller;
[0015] Receiving configuration data sent by the controller; and synchronizing the configuration data through a synchronization channel;
[0016] Configuration is performed according to the configuration data.
[0017] According to a third aspect of the present application, a configuration sending device is provided, which is arranged in a controller, and the controller is used to send configurations to a master device and a slave device in a stacking device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices; the device includes:
[0018] The sending module is used to send notification messages to the master device and the slave device respectively when the configuration needs to be sent down;
[0019] A receiving module, used to receive a configuration data acquisition request sent by a master virtual device, wherein the master virtual device is a virtual device in a master state in a corresponding virtual device group;
[0020] The sending module is further used to send the requested configuration data to the main virtual device.
[0021] According to a fourth aspect of the present application, another configuration issuing device is provided, which is arranged in a network device in a stacking device, wherein the network device is a master device or a slave device, wherein the master device integrates at least one virtual device, wherein the slave device integrates at least one virtual device, wherein one virtual device of the master device and one virtual device of the slave device constitute a group of virtual devices; wherein the device comprises:
[0022] A receiving module, used for receiving notification messages sent by the controller;
[0023] A determination module, used to determine the virtual device corresponding to the configuration data indicated by the notification message in the network device;
[0024] A sending module, configured to send a data acquisition request to the controller if the determined virtual device is a main virtual device;
[0025] The receiving module is further used to receive the configuration data sent by the controller; and synchronize the configuration data through the synchronization channel;
[0026] A configuration module is used to perform configuration according to the configuration data.
[0027] According to the fifth aspect of the present application, a machine-readable storage medium is provided, which stores a computer program. When called and executed by a processor, the computer program prompts the processor to execute the method provided in the first aspect of the embodiment of the present application.
[0028] Beneficial effects of the embodiments of the present application:
[0029] In the configuration sending method and device provided in the embodiment of the present application, when it is necessary to send the configuration, a notification message is sent to the master device and the slave device respectively; a configuration data acquisition request sent by the master virtual device is received, and the master virtual device is a virtual device in the corresponding virtual device group that is in the master state; and the requested configuration data is sent to the master virtual device. In the present application, the controller can send notification messages to the master device and the slave device respectively, and then the master virtual device in the master state obtains the configuration data from the controller. Since the master virtual device in each virtual device group can belong to the master device or the slave device, even if the master device or the slave device fails, since the master virtual device may be in another device, the master virtual device can still obtain the configuration data from the controller, thereby realizing the normal sending of the configuration data in the stacking device, and then ensuring the normal processing of the business after the relevant configuration based on the configuration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flowchart of a configuration delivery method provided in an embodiment of the present application;
[0031] Figure 2 It is a flowchart of another configuration delivery method provided in an embodiment of the present application;
[0032] Figure 3 It is a structural diagram of a configuration issuing device provided in an embodiment of the present application;
[0033] Figure 4 It is a structural diagram of another configuration issuing device provided in an embodiment of the present application;
[0034] Figure 5 It is a hardware structure diagram of an electronic device for implementing a configuration delivery method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0036] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0037] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0038] The configuration delivery method provided by this application is described in detail below.
[0039] See also Figure 1 , Figure 1 This is a flowchart of a configuration delivery method provided by the present application. The method can be applied to a controller, and the controller is used to deliver configurations to a master device and a slave device in a stacked device. The master device integrates at least one virtual device, and the slave device integrates at least one virtual device. A virtual device in the master device and a virtual device in the slave device constitute a group of virtual devices. When executing the method, the controller may include the following steps:
[0040] S101. When configuration needs to be issued, a notification message is sent to the master device and the slave device respectively.
[0041] In this step, in this embodiment, in order to fully improve the device utilization rate of the master device and the slave device, at least one virtual device will be created in the master device and the slave device respectively. At the same time, in order to ensure the backup of configuration and other information between the master and the slave devices, a virtual device in the master device will form a virtual device group with a virtual device in the slave device. Then, the roles of the two virtual devices in each virtual device group are the master virtual device and the slave virtual device respectively, and the master virtual device and the slave virtual device will back up each other's configuration, session and other information.
[0042] In addition, when the master virtual device in the virtual device group belongs to the master device, the slave virtual device belongs to the slave device; when the master virtual device in the virtual device group belongs to the slave device, the slave virtual device belongs to the master device.
[0043] Based on this, since the master virtual device may be a master device or a slave device, when the controller needs to issue a configuration, it can send a notification message to the master device and the slave device respectively, so that the master device or the slave device performs a configuration data acquisition operation.
[0044] S102: Receive a configuration data acquisition request sent by a master virtual device, where the master virtual device is a virtual device in a master state in a corresponding virtual device group.
[0045] In this step, after receiving the notification message sent by the controller, the master device and the slave device can respectively determine the virtual device group in their own devices for obtaining the corresponding configuration data, and then determine the role of the virtual device in the virtual device group. Taking the master device as an example, when the master device determines that the role of the virtual device belonging to the master device in the virtual device group is the master virtual device, the master virtual device sends a data acquisition request to the controller; if it is confirmed that the role of the virtual device belonging to the master device in the virtual device group is a slave virtual device, it means that the master virtual device belongs to the slave device, and the master virtual device belonging to the slave device in the virtual device group in the slave device sends a data acquisition request to the controller.
[0046] S103: Send the requested configuration data to the primary virtual device.
[0047] In this step, after receiving the data acquisition request, the controller can send the corresponding configuration data to the master virtual device. In this way, the master virtual device can perform relevant configurations based on the acquired configuration data. At the same time, the master virtual device can also synchronize the acquired configuration data to the slave virtual device through the synchronization channel between it and the slave virtual device.
[0048] By implementing the configuration sending method provided by the present application, when the configuration needs to be sent, a notification message is sent to the master device and the slave device respectively; a configuration data acquisition request sent by the master virtual device is received, and the master virtual device is a virtual device in the master state in the corresponding virtual device group; and the requested configuration data is sent to the master virtual device. In the present application, the controller can send notification messages to the master device and the slave device respectively, and then the master virtual device in the master state obtains the configuration data from the controller. Since the master virtual device in each virtual device group can belong to the master device or the slave device, even if the master device or the slave device fails, since the master virtual device may be in another device, the master virtual device can still obtain the configuration data from the controller, thereby realizing the normal sending of the configuration data in the stacking device, and then ensuring the normal processing of the business after the relevant configuration based on the configuration data.
[0049] It should be noted that multiple virtual devices can be created in the master device and the slave device respectively, and accordingly, multiple virtual device groups can be formed, each virtual device group can process corresponding services, for example, one service can correspond to multiple virtual device groups; or one virtual device group can process multiple services. Moreover, the creation of virtual devices can be performed under the control of the controller.
[0050] Specifically, the controller can assign a corresponding virtual device group to each service. Then in an example, the correspondence between the service identifier of each service and the group identifier of the virtual device group is recorded in the controller. In this way, when the controller has configuration data to be issued, it can carry the group identifier corresponding to the service identifier of the service to which the configuration data belongs in the notification message and send it to the master device and the slave device. In this way, after receiving the notification message, the master device can parse the group identifier from the notification message; the master device and the slave device can record the virtual device identifier of each virtual device in the virtual device group. Then, the virtual device in the corresponding virtual device group can be determined based on the group identifier.
[0051] In another example, after the controller sends a creation message to the master device and the slave device, and the master device and the slave device create a virtual device, the virtual device identifier of the virtual device can be sent to the controller. In this way, the controller can send the business identifier of the business that needs to be processed by the virtual device to the master device and the slave device, so that the master device and the slave device respectively maintain the corresponding relationship between the business identifier and the virtual device identifier of the virtual device. In this way, when the controller has configuration data to be sent, the business identifier of the business to which the configuration data belongs can be determined. Then the business identifier is carried in the notification message and sent to the master device and the slave device. Since the master device and the slave device respectively store the corresponding relationship between the virtual device identifier and the business identifier of their own virtual device, in this way, after the master device or the slave device parses the business identifier from the notification message, it can determine the corresponding virtual device based on the corresponding relationship stored in itself.
[0052] Alternatively, after allocating a virtual device to each service, the controller can record the correspondence between the service identifier of each service in the controller and the virtual device identifier of the virtual device used to process the service. In this way, when the controller has configuration data to be issued, the service identifier of the service to which the configuration data belongs can be determined. Then, based on the aforementioned correspondence stored locally, the virtual device identifier of the virtual device used to process the service is determined. The virtual device identifier is then carried in a notification message and sent to the master device and the slave device. In this way, after receiving the notification message, the master device and the slave device can parse the virtual device identifier from the notification message and then determine the corresponding virtual device.
[0053] It should be noted that the virtual device identifiers of the two virtual devices in each virtual device group are the same, and only one of them is the master virtual device at the same time, while the other is the slave virtual device. Optionally, on this basis, the virtual device identifier can be used as the group identifier.
[0054] On this basis, when the master device or slave device determines its own virtual device, it can query whether the role of the virtual device is the master virtual device, thereby determining the master virtual device for processing the corresponding business. The master virtual device then sends a data acquisition request to the controller.
[0055] In addition, when the business burden processed on each virtual device is relatively heavy, the controller can also send a virtual device creation message to the master device and the slave device when there is a new business that needs to be processed by the virtual device. In this way, after receiving the virtual device creation message, the master device and the slave device can create virtual devices in the master device and the slave device respectively, and the created virtual devices constitute a new virtual device group.
[0056] Optionally, based on any of the above embodiments, in this embodiment, it can be determined that the configuration needs to be sent according to the following method: query whether there is configuration data in the data waiting data queue; if there is, determine that the configuration needs to be sent.
[0057] Specifically, a waiting data queue is maintained in the controller. When the configuration data of any business needs to be updated, the configuration data can be written into the waiting data queue. Then when the controller finds that there is configuration data in the waiting data queue, it can confirm that the configuration needs to be sent down. It should be noted that there can be multiple threads in the controller, among which the waiting data queue can be maintained by a proxy thread proxy, and then the proxy thread will periodically or periodically query whether there is configuration data in the waiting data queue. If it exists, it is confirmed that the configuration needs to be sent down.
[0058] On this basis, the configuration delivery method provided in this embodiment may further include the following process: generating a configuration message according to the configuration data in the waiting data queue, wherein the configuration message includes the configuration data; and writing the configuration message into the running message queue.
[0059] Specifically, the controller also maintains a running message queue, which is used to cache the configuration message containing configuration data currently being issued. Specifically, the proxy thread reads the configuration data from the waiting data queue, generates a configuration message based on the configuration data, and then writes the configuration message into the running message queue to wait for issuance.
[0060] Further, step S103 may be performed according to the following process: reading the requested configuration message from the running message queue, and sending the configuration message to the primary virtual device.
[0061] Specifically, after receiving the data acquisition request sent by the master virtual device, the controller can read the corresponding configuration message from the running message queue, and then send the configuration message containing the configuration data to the master virtual device.
[0062] In this way, by maintaining the waiting data queue and the running message queue, the normal processing of the configuration data is guaranteed and the accumulation of configuration data is not caused.
[0063] Optionally, based on the above embodiment, the configuration delivery method provided in this embodiment may further include the following process: if a configuration result of configuration failure for the configuration data in the configuration message is received, the configuration message is read from the running message queue and written into the configuration failure message queue.
[0064] Specifically, the proxy thread monitors whether it has received the processing results fed back by the main virtual device. When a successful configuration result is received, the proxy thread deletes the corresponding configuration message from the running message queue, thereby avoiding the situation where the running message queue cache space is insufficient. If the proxy thread does not receive the configuration result or receives a configuration result of failed configuration, the proxy thread reads the configuration message from the running message queue, marks it, and then writes it to the configuration failure message queue. The subsequent proxy thread will batch write the messages in the configuration failure message queue to the database for the administrator to audit the reasons later, and also avoid the situation where the cache space in the configuration failure message queue is insufficient.
[0065] Optionally, based on any of the above embodiments, the configuration sending method in this embodiment may also include the following processes: receiving the device operating status reported by the master device or the slave device and the channel status of the synchronization channel between the master device and the slave device; receiving a query request sent by the slave device; querying the device operating status and channel status of the master device according to the query request, and sending them to the slave device, so that if the slave device determines that the received device operating status is offline, it will switch the slave device to the master device; if it is determined that the device operating status of the master device is offline, and / or the channel status of the synchronization channel is abnormal, an alarm signal is output.
[0066] Specifically, the master device and the slave device can report their respective running states to the controller regularly or periodically, which is recorded as the above-mentioned device running state. At the same time, the channel state of the synchronization channel between the master device and the slave device can also be reported, and the master device and the slave device send heartbeat messages through the synchronization channel to detect the state of the other device. Take the slave device as an example for explanation. When the slave device does not receive the heartbeat message of the master device through the synchronization channel within the set time, in order to avoid the situation where the normal original master device cannot perform the business due to the mistaken belief that the master device is offline and switches itself to the master device, this embodiment proposes that the slave device can send a query request to the controller to confirm the state of the master device. When the slave device receives the query result sent by the controller, if it is determined that the device running state of the master device is offline, it can be determined that the master device is offline at this time. In order to ensure the normal processing of the business, the slave device can switch its role to the master device. If it is confirmed that the device running state of the master device is normal, the role of the slave device remains unchanged. In addition, if the controller confirms that the channel state of the synchronization channel between it and the master device is abnormal, it can output an alarm signal so that the operation and maintenance personnel can maintain the synchronization channel according to the alarm signal. In addition, if the controller confirms that the device operation status of the main device is offline, the main device may be abnormal. At this time, the controller can also output an alarm signal so that the operation and maintenance personnel can maintain the main device.
[0067] It should be noted that when outputting the alarm signal, it can be, but is not limited to, using email or text message.
[0068] Optionally, the synchronization channel may be, but is not limited to, a high-availability HA channel or the like.
[0069] Optionally, based on any of the above embodiments, in this embodiment, the controller can communicate with the master device and the slave device and manage the master device and the slave device through the Netconf method. Correspondingly, the master device or the slave device can also report its own device operation status and channel status through the Netconf method; at the same time, query the controller for the device operation status and / or channel status of the slave device or the master device through the Netconf method.
[0070] In addition, the controller is responsible for managing the master device and slave device, and is also used to send user service configuration to the device. The master device and slave device can be understood as physical firewall devices, but not limited to them, and the internal virtual device can be understood as the implementation of firewall virtualization, which can be implemented in the vSystem way, and is a lightweight virtual firewall. The virtual device isolates the traffic of user services through the VRF method. Accordingly, the configuration layer can be isolated according to the virtual device identifier. When the virtual device is a vSystem, the virtual device identifier can be the vSystem ID.
[0071] Optionally, when the controller interacts with the master device or the slave device, the message field of each message may include the following content: message identifier, virtual device identifier, message body and error information, etc. The specific content can be referred to as shown in Table 1.
[0072] Table 1
[0073]
[0074] Based on the same inventive concept, this embodiment also provides a configuration delivery method, which is applied to a network device in a stacking device, and the network device can be a master device or a slave device. The master device integrates at least one virtual device, and the slave device integrates at least one virtual device. A virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices. When implementing the above method, the network device can follow Figure 2 The process shown executes:
[0075] S201. Receive a notification message sent by a controller.
[0076] In this step, when the configuration needs to be delivered, the controller sends a notification message to the network devices in the stacking device.
[0077] S202: Determine the virtual device corresponding to the configuration data indicated by the notification message in the network device.
[0078] In this step, since the role of the network device can be either a master device or a slave device, for the sake of convenience, the master device can be used as an example. After receiving the notification message, the master device can determine the virtual device in any of the following ways:
[0079] In one example, the master device and the slave device can record the virtual device identifier of each virtual device in the virtual device group. Then, the controller records the correspondence between the service identifier of each service and the group identifier of the virtual device group. In this way, when the controller has configuration data to be sent, it can carry the group identifier corresponding to the service identifier of the service to which the configuration data belongs in the notification message and send it to the master device and the slave device. In this way, the master device and the slave device can respectively parse the group identifier from the notification message, and then determine the virtual device in the corresponding virtual device group based on the group identifier.
[0080] In another example, when the notification message sent by the controller to the master device and the slave device includes a service identifier, the master device and the slave device respectively store the correspondence between the virtual device identifier and the service identifier of their own virtual device. In this way, after the master device or the slave device parses the service identifier from the notification message, it can determine the corresponding virtual device based on the correspondence stored in itself.
[0081] In another example, when the notification message sent by the controller includes a virtual device identifier, after receiving the notification message, the master device and the slave device can parse the virtual device identifier from the notification message and further determine the corresponding virtual device.
[0082] It should be noted that the virtual device identifiers of the two virtual devices in each virtual device group are the same, and only one of them is the master virtual device at the same time, and the other is the slave virtual device. Optionally, on this basis, the virtual device identifier can be used as the above group identifier. It is worth noting that the master virtual device is used for business processing, while the slave virtual device only needs to back up the configuration and session. So that when the master device fails, all the master virtual devices on the failed device are switched to the slave device.
[0083] S203: If the determined virtual device is a main virtual device, send a data acquisition request to the controller.
[0084] In this step, after the master device or slave device determines its own virtual device, it can query whether the role of the virtual device is the master virtual device, thereby determining the master virtual device for processing the corresponding business. The master virtual device then sends a data acquisition request to the controller.
[0085] S204, receiving the configuration data sent by the controller; and synchronizing the configuration data through a synchronization channel.
[0086] In this step, after receiving the configuration data, the master virtual device may synchronize the configuration data with the slave virtual devices belonging to the same virtual device group through the synchronization channel.
[0087] S205: Perform configuration according to the configuration data.
[0088] In this step, after receiving the configuration data, the main virtual device can perform relevant configuration on the business processing flow corresponding to the configuration data in the main virtual device, so that the subsequent traffic of the business can be processed based on the configured business processing flow.
[0089] By implementing the configuration sending method provided in this embodiment, a notification message sent by a controller is received; the virtual device corresponding to the configuration data indicated by the notification message in the network device is determined; if the determined virtual device is a master virtual device, a data acquisition request is sent to the controller; the configuration data sent by the controller is received; and the configuration data is synchronized through a synchronization channel; and configuration is performed according to the configuration data. In this embodiment, the controller can send notification messages to the master device and the slave device respectively, and then the master virtual device in the master state obtains the configuration data from the controller. Since the master virtual device in each virtual device group can belong to the master device or the slave device, even if the master device or the slave device fails, since the master virtual device may be in another device, the master virtual device can still obtain the configuration data from the controller, thereby realizing the normal sending of the configuration data in the stacking device, and then ensuring the normal processing of the business after the relevant configuration based on the configuration data.
[0090] Optionally, based on the above embodiment, the configuration delivery method provided in this embodiment may further include the following process: receiving a virtual device creation message sent by a controller; and creating a virtual device in the network device according to the creation message.
[0091] Specifically, when the business burden processed on each virtual device is relatively large, the controller can also send a virtual device creation message to the master device and the slave device when there is a new business that needs to be processed by the virtual device. In this way, after receiving the virtual device creation message, the master device and the slave device can create virtual devices in the master device and the slave device respectively, and the created virtual devices constitute a new virtual device group.
[0092] Optionally, based on any of the above embodiments, each virtual device group in this embodiment includes a master virtual device and a slave virtual device; when the master virtual device belongs to the master device, the slave virtual device belongs to the slave device; when the master virtual device belongs to the slave device, the slave virtual device belongs to the master device.
[0093] Optionally, based on any of the above embodiments, in this embodiment, step S201 may be performed according to the following method: receiving a configuration message; and parsing the configuration data from a message body of the configuration message.
[0094] Specifically, when the controller sends configuration data to the master device and the slave device, the controller may carry the configuration data in the configuration message and send it to the master device and the slave device. The format of the configuration message may refer to Table 1. In this way, when the master device and the slave device receive the configuration message, they can parse the configuration data from the message body.
[0095] Optionally, based on any of the above embodiments, the configuration delivery method provided in this embodiment may also include the following processes: reporting the device operating status of itself and the channel status of the synchronization channel to the controller; when the network device is a slave device, if no heartbeat message sent by the master device is received within the set time, sending a query request to the controller; receiving the device operating status of the master device fed back by the controller; if it is confirmed that the device operating status of the master device is offline, switching the slave device to the master device.
[0096] At this point, the problem of configuration failure during the master-slave switching process has been solved, thereby improving the reliability of configuration delivery. In addition, the network device in the present application provides a load and configuration synchronization solution based on virtual devices, which improves the utilization rate of network device resources. Furthermore, the situation where the dual master is unavailable in the device with a faulty synchronization channel is also improved, and the fault can be handled in a timely manner through the alarm mechanism of the controller.
[0097] Based on the same inventive concept, the present application also provides a configuration sending device corresponding to the configuration sending method on the controller side. The implementation of the configuration sending device can refer to the description of the configuration sending method on the controller, which will not be discussed here one by one.
[0098] See also Figure 3 , Figure 3 A configuration sending device provided by an exemplary embodiment of the present application is arranged in a controller, and the controller is used to send configurations to a master device and a slave device in a stacking device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices; the device includes:
[0099] The sending module 301 is used to send notification messages to the master device and the slave device respectively when the configuration needs to be sent;
[0100] The receiving module 302 is used to receive a configuration data acquisition request sent by a master virtual device, where the master virtual device is a virtual device in a master state in a corresponding virtual device group;
[0101] The sending module 301 is further configured to send the requested configuration data to the primary virtual device.
[0102] Optionally, based on the above embodiment, the configuration issuing device provided in this embodiment may further include:
[0103] The judgment module (not shown in the figure) is used to determine whether the configuration needs to be sent according to the following method: query whether there is configuration data in the data waiting data queue; if there is, determine that the configuration needs to be sent.
[0104] Optionally, based on the above embodiment, the configuration issuing device provided in this embodiment may further include:
[0105] A generating module (not shown in the figure), configured to generate a configuration message according to the configuration data in the waiting data queue, wherein the configuration message includes the configuration data;
[0106] A queue processing module (not shown in the figure), used for writing the configuration message into the running message queue;
[0107] On this basis, the sending module 301 is specifically configured to read the requested configuration message from the running message queue, and send the configuration message to the primary virtual device.
[0108] Furthermore, the queue processing module (not shown) is also used to read the configuration message from the running message queue and write it into the configuration failure message queue if a configuration result indicating configuration failure for the configuration data in the configuration message is received.
[0109] Optionally, based on any of the above embodiments, the receiving module 302 of this embodiment is further used to receive the device operation status reported by the master device or the slave device and the channel status of the synchronization channel between the master device and the slave device; receive the query request sent by the slave device;
[0110] On this basis, the configuration delivery device provided in this embodiment may further include:
[0111] A query module (not shown in the figure), used to query the device operation status and channel status of the master device according to the query request, and send them to the slave device, so that if the slave device determines that the received device operation status is offline, it will switch the slave device to the master device;
[0112] The output module (not shown in the figure) is used to output an alarm signal if it is determined that the device operation status of the main device is offline and / or the channel status of the synchronization channel is abnormal.
[0113] Based on the same inventive concept, the present application also provides a configuration issuing device corresponding to the configuration issuing method on the network device side. The implementation of the configuration issuing device can refer to the description of the configuration issuing method on the network device, which will not be discussed here one by one.
[0114] See also Figure 4 , Figure 4 A configuration issuing device is provided by an exemplary embodiment of the present application, and is arranged in a network device in a stacking device, wherein the network device is a master device or a slave device, wherein the master device integrates at least one virtual device, and the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices; the device comprises:
[0115] The receiving module 401 is used to receive the notification message sent by the controller;
[0116] A determination module 402, configured to determine a virtual device corresponding to the configuration data indicated by the notification message in the network device;
[0117] A sending module 403 is used to send a data acquisition request to the controller if the determined virtual device is a main virtual device;
[0118] The receiving module 401 is further used to receive the configuration data sent by the controller; and synchronize the configuration data through the synchronization channel;
[0119] The configuration module 404 is used to perform configuration according to the configuration data.
[0120] Optionally, based on the above embodiment, the receiving module 401 in this embodiment is further used to receive a virtual device creation message sent by the controller;
[0121] On this basis, the configuration delivery device provided in this embodiment may further include:
[0122] A creation module (not shown in the figure) is used to create a virtual device in the network device according to the creation message.
[0123] Optionally, based on any of the above embodiments, each virtual device group in this embodiment includes a master virtual device and a slave virtual device; when the master virtual device belongs to the master device, the slave virtual device belongs to the slave device; when the master virtual device belongs to the slave device, the slave virtual device belongs to the master device.
[0124] Optionally, based on any of the above embodiments, the receiving module 401 in this embodiment is further used to receive a configuration message; and parse the configuration data from the message body of the configuration message.
[0125] Optionally, based on any of the above embodiments, the sending module 403 in this embodiment is further used to report its own device operation status and the channel status of the synchronization channel to the controller;
[0126] On this basis, the configuration delivery device provided in this embodiment may further include:
[0127] A detection module (not shown in the figure), used for detecting whether a heartbeat message sent by a master device is received within a set time when the network device is a slave device;
[0128] The sending module 403 is further configured to send a query request to the controller if the heartbeat message is not received;
[0129] The receiving module 401 is further used to receive the device operation status of the main device fed back by the controller;
[0130] The switching module (not shown in the figure) is used to switch the slave device to the master device if it is confirmed that the device operation status of the master device is offline.
[0131] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which may be, but is not limited to, the above-mentioned controller or network device. Figure 5 As shown, the electronic device includes a processor 501 and a machine-readable storage medium 502, the machine-readable storage medium 502 stores a computer program that can be executed by the processor 501, and the processor 501 is prompted by the computer program to execute the configuration delivery method provided in any embodiment of the present application. In addition, the electronic device also includes a communication interface 503 and a communication bus 504, wherein the processor 501, the communication interface 503, and the machine-readable storage medium 502 communicate with each other through the communication bus 504.
[0132] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0133] The communication interface is used for communication between the above electronic device and other devices.
[0134] The machine-readable storage medium 502 may be a memory, which may include a random access memory (RAM), a DDR SRAM (Double Data Rate Synchronous Dynamic Random Access Memory), or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.
[0135] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0136] As for the electronic device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0137] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0138] The implementation process of the functions and effects of each unit / module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0139] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units / modules described as separate components may or may not be physically separated, and the components displayed as units / modules may or may not be physical units / modules, that is, they may be located in one place, or they may be distributed on multiple network units / modules. Some or all of the units / modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement it without creative work.
[0140] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A configuration delivery method, characterized in that: Applied in a controller, the controller is used to send configuration to a master device and a slave device in a stacking device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices; the method includes: When configuration needs to be issued, notification messages are sent to the master device and slave device respectively; Receiving a configuration data acquisition request sent by a master virtual device, wherein the master virtual device is a virtual device in a master state in a corresponding virtual device group; The requested configuration data is sent to the primary virtual device.
2. The method according to claim 1, characterized in that Determine the configuration that needs to be delivered using the following method: Check whether there is configuration data in the data waiting queue; If it exists, it is determined that the configuration needs to be delivered.
3. The method according to claim 2, characterized in that Also includes: Generate a configuration message according to the configuration data in the waiting data queue, wherein the configuration message includes the configuration data; Writing the configuration message into the running message queue; And, sending the requested configuration data to the master virtual device, including: The requested configuration message is read from the running message queue, and the configuration message is sent to the primary virtual device.
4. The method according to claim 3, characterized in that Also includes: If a configuration result indicating configuration failure for the configuration data in the configuration message is received, the configuration message is read from the running message queue and written into the configuration failure message queue.
5. The method according to claim 1, characterized in that Also includes: Receive the device operation status reported by the master device or the slave device and the channel status of the synchronization channel between the master device and the slave device; Receive a query request sent from the device; querying the device operation status and channel status of the master device according to the query request, and sending the query request to the slave device, so that if the slave device determines that the received device operation status is offline, the slave device is switched to the master device; If it is determined that the device operation status of the master device is offline, and / or the channel status of the synchronization channel is abnormal, an alarm signal is output.
6. A configuration delivery method, characterized in that: In a network device applied to a stacking device, the network device is a master device or a slave device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and a virtual device of the master device and a virtual device of the slave device constitute a group of virtual devices; the method comprises: Receive notification messages sent by the controller; Determining a virtual device corresponding to the configuration data indicated by the notification message in the network device; If the determined virtual device is the main virtual device, a data acquisition request is sent to the controller; Receiving configuration data sent by the controller; and synchronizing the configuration data through a synchronization channel; Configuration is performed according to the configuration data.
7. The method according to claim 6, characterized in that Also includes: Receive a virtual device creation message sent by the controller; According to the creation message, a virtual device is created in the network device.
8. The method according to claim 6, characterized in that Each virtual device group includes a master virtual device and a slave virtual device; when the master virtual device belongs to the master device, the slave virtual device belongs to the slave device; When the master virtual device belongs to the slave device, the slave virtual device belongs to the master device.
9. The method according to claim 6, characterized in that Receiving configuration data sent by the controller, including: Receive configuration messages; The configuration data is parsed from the message body of the configuration message.
10. The method according to claim 6, characterized in that Also includes: Report its own equipment operation status and the channel status of the synchronization channel to the controller; When the network device is a slave device, if it does not receive a heartbeat message sent by the master device within a set time, it sends a query request to the controller; Receive the device operating status of the main device fed back by the controller; If it is confirmed that the device operation status of the master device is offline, the slave device is switched to the master device.
11. A configuration issuing device, characterized in that: The controller is configured to send configurations to a master device and a slave device in a stacking device, wherein the master device integrates at least one virtual device, and the slave device integrates at least one virtual device, and a virtual device in the master device and a virtual device in the slave device constitute a virtual device group; The device comprises: The sending module is used to send notification messages to the master device and the slave device respectively when the configuration needs to be sent down; A receiving module, used to receive a configuration data acquisition request sent by a master virtual device, wherein the master virtual device is a virtual device in a master state in a corresponding virtual device group; The sending module is further used to send the requested configuration data to the main virtual device.
12. A configuration issuing device, characterized in that: In a network device arranged in a stacking device, the network device is a master device or a slave device, the master device integrates at least one virtual device, the slave device integrates at least one virtual device, and one virtual device of the master device and one virtual device of the slave device constitute a group of virtual devices; the device comprises: A receiving module, used for receiving notification messages sent by the controller; A determination module, used to determine the virtual device corresponding to the configuration data indicated by the notification message in the network device; A sending module, configured to send a data acquisition request to the controller if the determined virtual device is a main virtual device; The receiving module is further used to receive the configuration data sent by the controller; and synchronize the configuration data through the synchronization channel; A configuration module is used to perform configuration according to the configuration data.
Citation Information
Patent Citations
A method, device and system realizing the upgrading of stacking device software
CN101217411A
Main / standby main control configuration synchronization method and device based on frame-type equipment
CN110795212A