A configuration distribution method, apparatus and equipment

CN121125818BActive Publication Date: 2026-08-14NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,如何快速正确的找到网络设备接入的设备接入实例,在相关技术中没有有效的实现方式,即无法快速正确的找到设备接入实例

Benefits of technology

[0014]由以上技术方案可见,本申请实施例中,在网络设备从第一设备接入实例上线时,第一设备接入实例基于唯一设备标识从设备管理实例列表中选取第二设备管理实例,向第二设备管理实例发送唯一设备标识与第一设备接入实例的实例标识的配对关系。在通过第一设备管理实例接收到配置下发消息时,第一设备管理实例基于唯一设备标识从设备管理实例列表中选取第二设备管理实例,向第二设备管理实例发送配置下发消息。第二设备管理实例确定唯一设备标识对应的第一设备接入实例,向第一设备接入实例发送配置下发消息,以使第一设备接入实例向网络设备发送配置下发消息。这样,能够快速正确的找到网络设备接入的设备接入实例(即第一设备接入实例),且支持大量网络设备的接入,满足网络设备大规模上云管理的需求。通过在设备接入实例和设备管理实例中采用相同算法,来保证同一网络设备的配置下发消息和上线消息都由同一个设备管理实列进行处理,可以保证处理性能的大幅度提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125818B_ABST
    Figure CN121125818B_ABST
Patent Text Reader

Abstract

This application provides a configuration distribution method, apparatus, and device. The method includes: upon receiving a configuration distribution message through a first device management instance, wherein the configuration distribution message includes a unique device identifier of a network device; selecting a second device management instance from a list of device management instances based on the unique device identifier through the first device management instance; and sending the configuration distribution message to the second device management instance; upon receiving the configuration distribution message through the second device management instance; determining a first device access instance corresponding to the unique device identifier through the second device management instance; and sending the configuration distribution message to the first device access instance through the second device management instance, so that the first device access instance sends the configuration distribution message to the network device. The technical solution of this application can quickly and accurately locate the device access instance for network device access and supports the access of a large number of network devices, meeting the needs of large-scale cloud management of network devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a configuration distribution method, apparatus and device. Background Technology

[0002] The device management platform (i.e., the management device) is responsible for the access and management of network devices (such as routers and switches). The device management platform can send configurations to be distributed to network devices, which then configure themselves based on these configurations. In device management scenarios, to accommodate a large number of network devices, the device management platform adopts a distributed architecture, decoupling device access and device management functions, with each function supporting the deployment of multiple instances. For example, the device management platform includes multiple device access instances for implementing device access functions and multiple device management instances for implementing device management functions.

[0003] In this deployment scenario, network devices randomly connect to a device access instance. When the device management instance sends a configuration to be distributed to a network device, it needs to locate the device access instance to which the network device is connected, send the configuration to that access instance, and then have the access instance send the configuration to the network device. However, there is no effective way in relevant technologies to quickly and correctly locate the device access instance to which the network device is connected; that is, it is not possible to quickly and correctly locate the device access instance. Summary of the Invention

[0004] This application provides a configuration distribution method applied to a management device, wherein the management device includes multiple device access instances and multiple device management instances, and the method includes:

[0005] When a configuration delivery message is received through a first device management instance, the configuration delivery message includes a unique device identifier of the network device. The first device management instance selects a second device management instance from a list of device management instances based on the unique device identifier and sends the configuration delivery message to the second device management instance. The list of device management instances includes instance identifiers of multiple device management instances.

[0006] When the configuration distribution message is received through the second device management instance, the second device management instance determines the first device access instance corresponding to the unique device identifier based on the maintained pairing relationship between the unique device identifier and the instance identifier. Specifically, when a network device comes online from the first device access instance, the first device access instance selects a second device management instance from the device management instance list based on the unique device identifier and sends the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance.

[0007] The configuration distribution message is sent from the second device management instance to the first device access instance, so that the first device access instance sends the configuration distribution message to the network device; wherein, the configuration distribution message includes a configuration to be distributed, which is used to configure the network device.

[0008] This application provides a configuration distribution device for use in a management device, the management device including multiple device access instances and multiple device management instances, the device comprising:

[0009] The device management module is configured to: upon receiving a configuration distribution message through a first device management instance (the configuration distribution message includes a unique device identifier for the network device), select a second device management instance from a list of device management instances based on the unique device identifier, and send the configuration distribution message to the second device management instance; upon receiving the configuration distribution message through a second device management instance (the device management instance list includes instance identifiers for multiple device management instances), determine a first device access instance corresponding to the unique device identifier based on a maintained pairing relationship between unique device identifiers and instance identifiers, and send the configuration distribution message to the first device access instance through the second device management instance.

[0010] The device access module is configured to, when a network device comes online from a first device access instance, select a second device management instance from a list of device management instances based on the unique device identifier through the first device access instance, and send the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance; when the configuration distribution message is received through the first device access instance, the module sends the configuration distribution message to the network device through the first device access instance; wherein the configuration distribution message includes a configuration to be distributed, and the configuration to be distributed is used to configure the network device.

[0011] This application provides a management device, including: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the configuration distribution method of the above example of this application.

[0012] This application provides a computer program product, which may include a computer program that, when executed by a processor, implements the configuration distribution method described in the above example of this application.

[0013] This application provides a machine-readable storage medium storing machine-executable instructions that can be executed by a processor; wherein the processor is used to execute the machine-executable instructions to implement the configuration distribution method of the above example of this application when the machine-executable instructions are executed.

[0014] As can be seen from the above technical solutions, in this embodiment, when a network device comes online from a first device access instance, the first device access instance selects a second device management instance from the device management instance list based on a unique device identifier, and sends the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance. When a configuration delivery message is received through the first device management instance, the first device management instance selects a second device management instance from the device management instance list based on the unique device identifier, and sends the configuration delivery message to the second device management instance. The second device management instance determines the first device access instance corresponding to the unique device identifier and sends the configuration delivery message to the first device access instance, so that the first device access instance sends the configuration delivery message to the network device. In this way, the device access instance (i.e., the first device access instance) to which the network device is accessed can be found quickly and correctly, and the access of a large number of network devices can be supported, meeting the needs of large-scale cloud management of network devices. By using the same algorithm in the device access instance and the device management instance, it is ensured that the configuration delivery message and the online message of the same network device are processed by the same device management instance, which can guarantee a significant improvement in processing performance. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a configuration distribution method in one embodiment of this application;

[0016] Figure 2A This is a schematic diagram of the structure of the device management platform in one embodiment of this application;

[0017] Figure 2B This is a schematic diagram of the structure of the device management platform in one embodiment of this application;

[0018] Figure 3 This is a schematic diagram of the structure of the device management platform in one embodiment of this application;

[0019] Figure 4 This is a schematic diagram of the initialization process in one embodiment of this application;

[0020] Figure 5 This is a schematic diagram of the device online process in one embodiment of this application;

[0021] Figure 6 This is a schematic diagram of the configuration distribution process in one embodiment of this application;

[0022] Figure 7 This is a schematic diagram of the configuration and distribution device in one embodiment of this application;

[0023] Figure 8 This is a hardware structure diagram of the management device in one embodiment of this application. Detailed Implementation

[0024] This application proposes a configuration distribution method, which can be applied to management devices (such as device management platforms). The management device includes multiple device access instances and multiple device management instances. See [link to relevant documentation]. Figure 1 The diagram shown is a flowchart of the method, which may include:

[0025] Step 101: When a configuration delivery message is received through the first device management instance, the configuration delivery message includes the unique device identifier of the network device. Then, the first device management instance selects a second device management instance from the device management instance list based on the unique device identifier and sends the configuration delivery message to the second device management instance. The device management instance list includes instance identifiers of multiple device management instances.

[0026] Step 102: Upon receiving a configuration distribution message through the second device management instance, the second device management instance determines the first device access instance corresponding to the unique device identifier based on the maintained pairing relationship between unique device identifiers and instance identifiers. Specifically, when a network device comes online from the first device access instance, the first device access instance selects the second device management instance from the device management instance list based on the unique device identifier and sends the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance. Based on this, and according to the pairing relationship between the unique device identifier and the instance identifier of the first device access instance, the second device management instance can determine the first device access instance corresponding to the unique device identifier when receiving the configuration distribution message.

[0027] Step 103: Send a configuration distribution message to the first device access instance through the second device management instance, so that the first device access instance sends the configuration distribution message to the network device; wherein, the configuration distribution message may include the configuration to be distributed, and the configuration to be distributed is used to configure the network device.

[0028] In one example, sending a configuration delivery message from a first device management instance to a second device management instance may include, but is not limited to: writing a configuration delivery message to a message queue through the first device management instance, the configuration delivery message corresponding to a first message topic of the second device management instance; and sending the configuration delivery message to the second device management instance corresponding to the first message topic through the message queue.

[0029] In one example, sending a pairing relationship between a unique device identifier and an instance identifier of the first device access instance to a second device management instance through a first device access instance may include, but is not limited to: writing an online message to a message queue through the first device access instance, the online message corresponding to a first message topic of the second device management instance; and sending an online message to the second device management instance corresponding to the first message topic through the message queue, the online message including a unique device identifier and an instance identifier of the first device access instance.

[0030] In one example, sending a configuration distribution message to a first device access instance through a second device management instance may include, but is not limited to: writing a configuration distribution message to a message queue through the second device management instance, the configuration distribution message corresponding to a second message topic of the first device access instance; and sending the configuration distribution message to the first device access instance corresponding to the second message topic through the message queue.

[0031] In one example, selecting a second device management instance from a list of device management instances based on a unique device identifier using a first device management instance may include, but is not limited to: for each device management instance in the list of device management instances, determining the node position of that device management instance on the hash ring using the first device management instance, and determining the data position of the unique device identifier on the hash ring using the first device management instance; and selecting a device management instance from the list of device management instances as the second device management instance based on the positional relationship between the data position and the node position of each device management instance.

[0032] In one example, selecting a second device management instance from the list of device management instances based on a unique device identifier through a first device access instance may include, but is not limited to: for each device management instance in the list of device management instances, determining the node position of the device management instance on the hash ring through the first device access instance, determining the data position of the unique device identifier on the hash ring through the first device access instance; and selecting a device management instance from the list of device management instances as the second device management instance based on the positional relationship between the data position and the node position of each device management instance.

[0033] In one example, for each device management instance, the instance identifier of the device management instance is periodically sent to the registered device so that the registered device updates the instance identifier of the device management instance in the device management instance list, thus obtaining the updated device management instance list.

[0034] Based on this, for each device access instance, the updated list of device management instances is periodically obtained from the registered devices through the device access instance; for each device management instance, the updated list of device management instances is periodically obtained from the registered devices through the device management instance.

[0035] In one example, when an existing device management instance goes offline, if the registered device does not receive the instance identifier of the existing device management instance within a preset time, it will delete the instance identifier of the existing device management instance from the device management instance list, resulting in an updated device management instance list; when a new device management instance comes online, the registered device will receive the instance identifier of the new device management instance and add the instance identifier of the new device management instance to the device management instance list, resulting in an updated device management instance list.

[0036] Specifically, a second device management instance can be selected from the updated list of device management instances based on a unique device identifier by the first device management instance; or a second device management instance can be selected from the updated list of device management instances based on a unique device identifier by the first device access instance.

[0037] In one example, when sending a configuration delivery message from a first device management instance to a second device management instance, a configuration message header is added to the message. This header may include, but is not limited to, the sequence number of the configuration to be delivered, the instance identifier of the second device management instance, and a unique device identifier. When sending a configuration delivery message from the second device management instance to a first device access instance, the header can also be sent to the first device access instance, so that the first device access instance stores it upon receipt. When the first device access instance receives a configuration result message in response to the delivery message, this result message may include the unique device identifier. The first device access instance queries the configuration message header corresponding to the unique device identifier and sends the configuration result message and the sequence number from the header to the second device management instance corresponding to the instance identifier, enabling the second device management instance to determine that the configuration to be delivered corresponding to the sequence number has been successfully delivered.

[0038] As can be seen from the above technical solutions, in this embodiment, when a network device comes online from a first device access instance, the first device access instance selects a second device management instance from the device management instance list based on a unique device identifier, and sends the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance. When a configuration delivery message is received through the first device management instance, the first device management instance selects a second device management instance from the device management instance list based on the unique device identifier, and sends the configuration delivery message to the second device management instance. The second device management instance determines the first device access instance corresponding to the unique device identifier and sends the configuration delivery message to the first device access instance, so that the first device access instance sends the configuration delivery message to the network device. In this way, the device access instance (i.e., the first device access instance) to which the network device is accessed can be found quickly and correctly, and the access of a large number of network devices can be supported, meeting the needs of large-scale cloud management of network devices. By using the same algorithm in the device access instance and the device management instance, it is ensured that the configuration delivery message and the online message of the same network device are processed by the same device management instance, which can guarantee a significant improvement in processing performance.

[0039] The technical solutions described above in the embodiments of this application will be explained below in conjunction with specific application scenarios.

[0040] The device management platform is responsible for the access and management of network devices. In large-scale device management scenarios, such as public cloud-based device management SaaS (Software as a Service) platforms, a distributed architecture is adopted to handle a large number of network devices. This architecture decouples device access and device management functions, with each function supporting the deployment of multiple instances. For example, multiple device access instances are used to implement device access functions, and multiple device management instances are used to implement device management functions. In such a deployment scenario, network devices will randomly connect to a device access instance. When a device management instance sends a configuration to be distributed to a network device, it needs to find the device access instance to which the network device is connected, send the configuration to be distributed to that device access instance, and then that device access instance sends the configuration to be distributed to the network device.

[0041] In one example, see Figure 2A The diagram shows the structure of a device management platform. The platform includes multiple device management instances and multiple device access instances. Taking m device management instances and n device access instances as an example, where m and n are both positive integers greater than 1, the device management platform includes device management instance 1, device management instance 2, ..., device management instance m, device access instance 1, device access instance 2, ..., device access instance n. Furthermore, the device management platform may also include a message queue.

[0042] See Figure 2B The diagram illustrates the structure of a device management platform. Besides m device management instances, n device access instances, and a message queue, the platform may include a Redis (Remote Dictionary Server) cache. In this scenario, when a network device comes online on a device access instance (e.g., device access instance 1), device access instance 1 records the network device's unique device identifier and its instance identifier in the Redis cache. When a device management instance (e.g., device management instance 2) sends a configuration to be distributed to a network device, it queries the Redis cache for the instance identifier corresponding to the network device's unique device identifier, such as the instance identifier of device access instance 1. Device management instance 2 writes the configuration to be distributed to the message queue, and the configuration corresponds to the message topic of device access instance 1.

[0043] When there is a configuration to be distributed in the message queue, it can be sent to the device access instance 1 corresponding to the message topic through the message queue. Device access instance 1 can then send the configuration to be distributed to the network device, which will then configure itself based on the configuration.

[0044] The above method relies on Redis caching. When there are a large number of network devices, the Redis cache needs to be updated when each network device comes online (i.e., the unique device identifier of the network device and the instance identifier of the device access instance are recorded in the Redis cache). The Redis cache also needs to be queried when the configuration is distributed (i.e., the instance identifier corresponding to the unique device identifier of the network device is retrieved from the Redis cache). The updating and querying of the Redis cache generates a large number of IO operations, and the Redis cache will become a performance bottleneck, resulting in a limitation on the number of network devices that can access the network.

[0045] In response to the above findings, this application proposes a device configuration distribution method in a distributed environment. This method does not rely on Redis caching to centrally store the unique device identifier of the network device and the instance identifier of the device access instance. Instead, it uses a consistent hash algorithm and local caching to solve the problem of limited access quantity.

[0046] In one example, see Figure 3 The diagram shows the structure of the device management platform. The device management platform (i.e., managing devices) includes multiple device management instances, multiple device access instances, and message queues. Taking m device management instances and n device access instances as an example, m and n are both positive integers greater than 1. That is, the device management platform can include device management instance 1, device management instance 2, ..., device management instance m, device access instance 1, device access instance 2, ..., device access instance n.

[0047] For each device access instance, there is a unique instance identifier, which is used to uniquely identify the device access instance. For each device management instance, there is a unique instance identifier, which is used to uniquely identify the device management instance. For example, the instance identifier can be the instance name, the instance identifier can be the instance sequence number, or the instance identifier can be both the instance name and the instance sequence number.

[0048] n device access instances are used to implement the device access function. That is, a device access instance is an entity used to implement the device access function. It can be implemented by software or hardware, without any restriction.

[0049] A device access instance, also known as a device access module, is responsible for connecting network devices. It implements the service functions of access protocols such as TCP (Transmission Control Protocol), UDP (User Datagram Protocol), and MQTT (Message Queuing Telemetry Transport). In other words, the device access instance connects to network devices via access protocols like TCP, UDP, and MQTT. Multiple device access instances can be deployed, and scaling up and down is supported; that is, multiple device access instances can be deployed, and adding or removing device access instances is also supported.

[0050] Each device access instance listens for its own message topic in the message queue, and the name of the message topic is consistent with the instance identifier of the device access instance. That is, when there is a message corresponding to the message topic of the device access instance in the message queue, the message is sent to the device access instance.

[0051] Each device access instance periodically obtains a list of device management instances from the registered device. This list is used for consistent hash calculations. The instance identifier remains unchanged before and after each device access instance restarts.

[0052] m device management instances are used to implement device management functions. That is, a device management instance is an entity used to implement device management functions. It can be implemented by software or hardware, without any restriction.

[0053] The device management instance, also known as the device management module, is responsible for configuring network devices, providing external configuration distribution interfaces, and saving configurations. Device management instances support multi-instance deployment and can be scaled up or down; that is, multiple device management instances can be deployed, and device management instances can be added or removed.

[0054] Each device management instance listens for its own message topic from the message queue, and the name of the message topic is consistent with the instance identifier of the device management instance. That is, when there is a message corresponding to the message topic of the device management instance in the message queue, the message is sent to the device management instance.

[0055] Each device management instance can periodically update its instance identifier to the registered device, thereby generating a device management instance list on the registered device. Each device management instance can also periodically retrieve the device management instance list from the registered device, and this list is used for consistent hash calculations. Each device management instance maintains its instance identifier before and after a restart.

[0056] Message queues can be message queues using Kafka (a distributed messaging system) or other types of message queues. Message queues are used to implement message routing between different instances.

[0057] See Figure 3 As shown, in addition to the device management platform, it can also involve registered devices (also known as registration centers) and multiple network devices. The registered device is used to maintain the instance list of device management instances, which can be called the device management instance list. If the device management instance does not receive an update message from the device management instance regularly, the device management instance will age out from the registered device. The registered device provides an external interface to obtain the device management instance list.

[0058] For each network device, which can be a router or switch, or a smart home device, there are no restrictions; it can be any device that can be remotely controlled.

[0059] In the above application scenario, this embodiment proposes a configuration distribution method, which may involve an initialization process, a device online process, a configuration distribution process, and an instance exception handling process. The initialization process, the device online process, the configuration distribution process, and the instance exception handling process are described below.

[0060] First, regarding the initialization process.

[0061] See Figure 4 The diagram shown illustrates the initialization process, which may include:

[0062] Step 401: For each device access instance, after the device access instance starts, it registers a message topic it listens on with the message queue. The message topic is the instance identifier of the device access instance. Thus, if a message needs to be sent to this device access instance, it only needs to be written to the corresponding message topic in the message queue, and the message queue can then send the message to the device access instance corresponding to that message topic. Clearly, since there is a one-to-one correspondence between the message topic (i.e., the instance identifier) ​​and the device access instance, messages can be sent to the device access instance corresponding to that message topic.

[0063] Step 402: For each device management instance, after the device management instance starts, it registers a message topic it listens on with the message queue. The message topic is the instance identifier of the device management instance. Thus, if a message needs to be sent to this device management instance, it only needs to be written to the corresponding message topic in the message queue, and the message queue can then send the message to the device management instance corresponding to that message topic. Clearly, since there is a one-to-one correspondence between the message topic (i.e., the instance identifier) ​​and the device management instance, messages can be sent to the device management instance corresponding to that message topic.

[0064] Step 403: For each device management instance, the device management instance periodically updates its instance identifier to the registered device. That is, the device management instance periodically sends its instance identifier to the registered device, such as sending the instance identifier to the registered device every 5 seconds.

[0065] In one example, the registered device can maintain a list of device management instances, which can include instance identifiers for multiple device management instances. For instance, the initial state of the device management instance list can be empty. When the registered device receives the instance identifier of device management instance 1, it adds the instance identifier of device management instance 1 to the list. When the registered device receives the instance identifier of device management instance 2, it adds the instance identifier of device management instance 2 to the list, and so on. When the registered device receives the instance identifier of device management instance m, it adds the instance identifier of device management instance m to the list.

[0066] After adding the instance identifier of Device Management Instance 1 to the Device Management Instance list, the registered device can also set a timer for Device Management Instance 1. The timer's timeout period is longer than the update time of the Device Management Instance (e.g., 30 seconds, meaning the Device Management Instance periodically sends the instance identifier to the registered device based on this update time). Thus, if the registered device receives the instance identifier of Device Management Instance 1 before the timer expires, and the instance identifier has not changed, it keeps the instance identifier of Device Management Instance 1 unchanged in the Device Management Instance list and restarts the timer for Device Management Instance 1. If the registered device receives the instance identifier of Device Management Instance 1 before the timer expires, and the instance identifier has changed, it updates the instance identifier of Device Management Instance 1 in the Device Management Instance list, replacing the previous instance identifier with the updated one, and restarts the timer for Device Management Instance 1. If the registered device does not receive the instance identifier of Device Management Instance 1 when the timer expires, it deletes the instance identifier of Device Management Instance 1 from the Device Management Instance list. In summary, registering a device can update the instance identifier of device management instance 1 in the device management instance list to obtain the updated device management instance list.

[0067] After adding the instance identifier of Device Management Instance 2 to the Device Management Instance List, the registered device can set a timer for Device Management Instance 2. If the registered device receives the instance identifier of Device Management Instance 2 before the timer expires, it will either keep the instance identifier of Device Management Instance 2 unchanged or update it. If the registered device does not receive the instance identifier of Device Management Instance 1 when the timer expires, it will delete the instance identifier of Device Management Instance 2. This process is repeated for each Device Management Instance. After performing the above steps for each Device Management Instance, the registered device can update the instance identifier of each Device Management Instance in the Device Management Instance List, resulting in an updated Device Management Instance List.

[0068] Step 404: For each device access instance, the device access instance periodically pulls the device management instance list from the registered device, that is, it periodically obtains the device management instance list from the registered device.

[0069] For example, every 5 seconds, a device access instance retrieves a list of device management instances from the registered device. This list can be the initial list retrieved by the registered device, or it can be the updated list retrieved by the registered device—the latest list is sufficient. After retrieving the list from the registered device, if the retrieved list matches the locally stored list, the locally stored list remains unchanged. If the retrieved list differs from the locally stored list, the locally stored list is replaced with the newer version.

[0070] Step 405: For each device management instance, the device management instance periodically pulls the device management instance list from the registered device, that is, it periodically obtains the device management instance list from the registered device.

[0071] For example, the device management instance retrieves a list of device management instances from the registered device every 5 seconds. This list can be the initial list retrieved by the registered device, or it can be the updated list retrieved by the registered device—the latest list is sufficient. After retrieving the list from the registered device, if the retrieved list matches the locally stored list, the locally stored list remains unchanged. If the retrieved list differs from the locally stored list, the locally stored list is replaced with the newer, more up-to-date list.

[0072] Second, regarding the equipment launch process.

[0073] See Figure 5 The diagram shown illustrates the device deployment process, which may include:

[0074] Step 501: When a network device comes online, the management device selects one device access instance from all device access instances as the device access instance for the network device. This device access instance can be recorded as the first device access instance. That is, the network device comes online from the first device access instance.

[0075] For example, when a network device comes online, the management device can randomly select one device access instance from all device access instances as the first device access instance. Alternatively, the management device can use a certain algorithm to select one device access instance from all device access instances as the first device access instance. For example, a round-robin algorithm can be used to select one device access instance from all device access instances as the first device access instance (i.e., the first network device corresponds to device access instance 1, the second network device corresponds to device access instance 2, and so on). A hash modulo algorithm can be used to select one device access instance from all device access instances as the first device access instance (e.g., taking the modulo operation between the network device's IP address and the total number of device access instances, with a remainder of 0 corresponding to device access instance 1, a remainder of 1 corresponding to device access instance 2, and so on).

[0076] For example, when a network device comes online from the first device access instance, connection information for the network device can be established, and the mapping between the network device's unique device identifier and the connection information can be stored in memory. For instance, the unique device identifier could be the network device's MAC address, device serial number (devSN), etc., without restriction, as long as it uniquely identifies the network device. The connection information for the network device can be connection information related to the network device, based on which messages can be sent to the network device.

[0077] Step 502: When a network device comes online from the first device access instance, the first device access instance selects a second device management instance from the device management instance list based on the unique device identifier of the network device. This second device management instance is the device management instance used to manage the network device.

[0078] In one example, the first device access instance can construct a hash ring. A hash ring is a circular data structure where each node represents a hash value, and the nodes are arranged in order of their hash values ​​to form a ring. When data needs to be mapped to a node, the hash value of the data can be calculated using a hash function, and then the first node on the hash ring with a hash value greater than or equal to that hash value can be found, and the data can be mapped to that node.

[0079] For each device management instance in the device management instance list, the first device access instance determines the node position of that device management instance on the hash ring. For example, a hash function is used to calculate the hash value of the instance identifier of the device management instance (i.e., performing a hash operation on the instance identifier to obtain the hash value). Then, the first node on the hash ring that is greater than or equal to this hash value is found; this node is the node position of the device management instance on the hash ring. Clearly, after performing the above operations for each device management instance in the device management instance list, the node position of each device management instance on the hash ring can be obtained.

[0080] The first device access instance can determine the data location of the network device's unique device identifier on the hash ring. For example, a hash function is used to calculate the hash value of the unique device identifier (i.e., a hash operation is performed on the unique device identifier to obtain the hash value). Then, the first node on the hash ring that is greater than or equal to the hash value is found. This node is the data location of the unique device identifier on the hash ring.

[0081] The first device access instance selects a device management instance as the second device management instance from the list of device management instances based on the positional relationship between the data location and the node location of each device management instance. For example, based on the distance between the data location and each node location, the device management instance corresponding to the node location with the smallest distance is selected as the second device management instance; the smallest distance means the fewest number of nodes separated by the hash ring. For example, the device management instance corresponding to the first node location preceding the data location is selected as the second device management instance, where the hash value of the node location preceding the data location is greater than the hash value of the data location. For example, the device management instance corresponding to the second node location preceding the data location is selected as the second device management instance. For example, the device management instance corresponding to the first node location following the data location is selected as the second device management instance; there are no restrictions on this.

[0082] In one example, when the first device access instance selects the second device management instance from the list of device management instances based on the unique device identifier of the network device, the first device access instance can calculate the second device management instance using a consistent hash algorithm based on the unique device identifier of the network device and the list of device management instances. That is, a device management instance in the list of device management instances is used as the second device management instance, and the second device management instance indicates which device management instance manages the network device.

[0083] Step 503: The first device access instance writes an online message to the message queue. This online message corresponds to the first message topic of the second device management instance (the message topic of the second device management instance is recorded as the first message topic). That is, the first device access instance writes the online message to the first message topic of the message queue. The online message includes the unique device identifier of the network device and the instance identifier of the first device access instance.

[0084] In one example, a message queue can include multiple message topics (each message topic can be understood as a sub-queue, meaning the message queue is composed of sub-queues of multiple message topics). Specifically, each device access instance can correspond to one message topic, and each device management instance can correspond to one message topic. Furthermore, a second device management instance can correspond to one message topic within the message queue, denoted as the first message topic. The first message topic corresponds to the instance identifier of the second device management instance.

[0085] After the first device access instance selects the second device management instance, the first device access instance writes the online message to the first message topic of the message queue, meaning the online message corresponds to the first message topic. For example, if the message queue includes multiple sub-queues for message topics, the first device access instance writes the online message to the sub-queue of the first message topic, ensuring the online message corresponds to the first message topic. Alternatively, the first device access instance writes the online message to the message queue and marks the online message with the first message topic, ensuring the online message corresponds to the first message topic. Of course, these are just a few examples, and the implementation method is not limited, as long as the online message corresponds to the first message topic.

[0086] For example, an online message indicates that a network device has come online, and the online message may include the unique device identifier of the network device and the instance identifier of the first device access instance. The online message indicates that the network device corresponding to this unique device identifier has come online in the first device access instance corresponding to this instance identifier.

[0087] Step 504: Send an online message to the second device management instance corresponding to the first message topic through the message queue. The online message includes the unique device identifier of the network device and the instance identifier of the first device access instance.

[0088] In one example, the message queue has a proactive message sending function. After an online message is written to the message queue, the message queue needs to send the online message to the corresponding consumer. Considering that the first message topic corresponds to the second device management instance, and the online message corresponds to the first message topic, the consumer of the online message is the second device management instance, and the online message is sent to the second device management instance through the message queue.

[0089] Step 505: After receiving the online message, the second device management instance can store the pairing relationship between the unique device identifier of the network device and the instance identifier of the first device access instance.

[0090] In one example, the second device management instance can parse the unique device identifier of the network device and the instance identifier of the first device access instance from the online message. This allows the instance management instance to store the pairing relationship between the unique device identifier of the network device and the instance identifier of the first device access instance. For instance, if the message header of the online message carries the unique device identifier of the network device and the instance identifier of the first device access instance, the second device management instance can parse these two identifiers from the message header.

[0091] Third, regarding the configuration distribution process.

[0092] See Figure 6 The diagram shown illustrates the configuration and distribution process, which may include:

[0093] Step 601: When the configuration is distributed, the management device selects one device management instance from all device management instances as the device management instance to receive the configuration. This device management instance can be recorded as the first device management instance, that is, the configuration distribution message is received through the first device management instance.

[0094] For example, during configuration distribution, the management device can randomly select one device management instance from all device management instances as the first device management instance, or it can use a certain algorithm to select one device management instance from all device management instances as the first device management instance. For example, a round-robin algorithm can be used to select one device management instance from all device management instances as the first device management instance, a hash modulo algorithm can be used to select one device management instance from all device management instances as the first device management instance (such as taking the modulo operation between the unique device identifier of the network device and the total number of device management instances, with a remainder of 0 corresponding to device management instance 1 and a remainder of 1 corresponding to device management instance 2), or a load balancing algorithm can be used to select one device management instance from all device management instances as the first device management instance.

[0095] For example, after selecting the first device management instance, configuration delivery messages can be received through this instance. These messages may include the configuration to be delivered and the unique device identifier of the network device, indicating that the configuration to be delivered will be sent to the network device corresponding to that unique device identifier. The configuration to be delivered can be Wi-Fi configuration, network configuration, VLAN configuration, WAN port configuration, etc.

[0096] Step 602: The first device management instance assigns a sequence number to the configuration to be issued in the configuration issuance message.

[0097] For example, the first device management instance generates a serial number for the configuration to be distributed. This serial number is a unique identifier for the configuration, such as a randomly generated one. Based on this, the mapping between the configuration to be distributed and the serial number can be saved in the memory of the first device management instance, and an aging timer can be set for this mapping. Before the aging timer expires, if the first device management instance receives a configuration result message in response to the configuration distribution message, and the configuration result message includes the serial number, it indicates that the configuration to be distributed corresponding to that serial number has been successfully distributed. The instance returns a message indicating successful configuration distribution to the user and deletes the mapping between the configuration to be distributed and the serial number. When the aging timer expires, if the first device management instance does not receive a configuration result message in response to the configuration distribution message, it indicates that the configuration to be distributed corresponding to that serial number has not been successfully distributed, i.e., the configuration distribution failed. The instance returns a message indicating configuration distribution failure to the user.

[0098] Step 603: When the configuration distribution message is received through the first device management instance, the first device management instance selects a second device management instance from the list of device management instances based on the unique device identifier of the network device. It should be noted that the first device management instance and the first device access instance use the same algorithm to select the second device management instance; therefore, the second device management instance selected by the first device management instance can be the same as the second device management instance selected by the first device access instance (see step 502).

[0099] In one example, the first device management instance can construct a hash ring, where each node represents a hash value. For each device management instance in the list of device management instances, the first device management instance determines its node position on the hash ring. For instance, it calculates the hash value of the instance identifier of the device management instance using a hash function, finds the first node on the hash ring that is greater than or equal to that hash value, and that node is the node position of the device management instance on the hash ring. The first device management instance can also determine the data position of the unique device identifier of a network device on the hash ring. For instance, it calculates the hash value of the unique device identifier using a hash function, finds the first node on the hash ring that is greater than or equal to that hash value, and that node is the data position of the unique device identifier on the hash ring. Based on the positional relationship between the data position and the node position of each device management instance, the first device management instance selects a device management instance from the list of device management instances as the second device management instance.

[0100] In one example, when the first device management instance selects the second device management instance from the list of device management instances based on the unique device identifier of the network device, the first device management instance can calculate the second device management instance using a consistent hash algorithm based on the unique device identifier of the network device and the list of device management instances. That is, a device management instance in the list of device management instances is selected as the second device management instance, and the second device management instance indicates which device management instance manages the network device.

[0101] Step 604: The first device management instance writes a configuration distribution message to the message queue. This configuration distribution message corresponds to the first message topic of the second device management instance; that is, the first device management instance writes the configuration distribution message to the first message topic of the message queue. For example, if the second device management instance is the same as the first device management instance, the first device management instance (or second device management instance) can directly receive the configuration distribution message. If the second device management instance is different from the first device management instance, the first device management instance needs to send the configuration distribution message to the second device management instance. In order to send the configuration distribution message to the second device management instance, the first device management instance writes the configuration distribution message to the message queue.

[0102] In one example, the message queue can include multiple message topics, meaning each device management instance can correspond to one message topic, and a second device management instance can correspond to a first message topic within the message queue, with the first message topic corresponding to the instance identifier of the second device management instance. Based on this, the first device management instance writes the configuration delivery message into the first message topic of the message queue, thus assigning the configuration delivery message to the first message topic. For example, the message queue includes sub-queues for multiple message topics, and the first device management instance writes the configuration delivery message into a sub-queue of the first message topic, ensuring the configuration delivery message corresponds to the first message topic. Alternatively, the first device management instance writes the configuration delivery message into the message queue and marks the configuration delivery message with the first message topic, ensuring the configuration delivery message corresponds to the first message topic. Of course, these are just a few examples, and the implementation method is not limited.

[0103] In one example, when the first device management instance writes a configuration delivery message to the message queue, it can also add a configuration message header to the message before writing the message with the header to the message queue. For instance, the configuration delivery message can carry a data portion, such as the actual content of the configuration to be delivered. This configuration message header can include, but is not limited to, the sequence number of the configuration to be delivered, the instance identifier of the second device management instance, and the unique device identifier of the network device, indicating that the configuration to be delivered is being sent to that network device.

[0104] Step 605: Send a configuration distribution message to the second device management instance corresponding to the first message topic through the message queue. The configuration distribution message may be a configuration distribution message carrying a configuration message header.

[0105] Step 606: After receiving the configuration distribution message, the second device management instance obtains the unique device identifier of the network device from the configuration distribution message and determines the first device access instance corresponding to the unique device identifier.

[0106] In one example, the second device management instance has pre-stored the pairing relationship between the unique device identifier of the network device and the instance identifier of the first device access instance, as shown in steps 501-505. After receiving the configuration distribution message, the second device management instance can parse the unique device identifier of the network device from the configuration message header of the configuration distribution message. Based on this, and according to the pairing relationship between the unique device identifier and the instance identifier of the first device access instance, the second device management instance can determine the instance identifier of the first device access instance corresponding to the unique device identifier, that is, determine the first device access instance.

[0107] Step 607: The second device management instance writes a configuration distribution message to the message queue (the configuration distribution message may carry a configuration message header). This configuration distribution message corresponds to the second message topic of the first device access instance (the message topic of the first device access instance is recorded as the second message topic). That is, the second device management instance writes the configuration distribution message to the second message topic of the message queue.

[0108] In one example, the message queue can include multiple message topics, that is, each device access instance can correspond to one message topic. The first device access instance can correspond to one message topic in the message queue, which is denoted as the second message topic. The second message topic corresponds to the instance identifier of the first device access instance.

[0109] The second device management instance can write configuration distribution messages to a second message topic in the message queue, meaning the configuration distribution message corresponds to the second message topic. For example, if the message queue includes multiple sub-queues for message topics, the second device management instance can write the configuration distribution message to a sub-queue of the second message topic, ensuring the correspondence between the configuration distribution message and the second message topic. Alternatively, the second device management instance can write the configuration distribution message to the message queue and mark the configuration distribution message with a second message topic, further confirming the correspondence. These are just a few examples, and the implementation method is not limited.

[0110] Step 608: Send the configuration delivery message to the first device access instance corresponding to the second message topic via the message queue. For example, the message queue has an active message sending function. After the configuration delivery message is written to the message queue, the message queue needs to send the configuration delivery message to the corresponding consumer. Considering that the second message topic corresponds to the first device access instance, and the configuration delivery message corresponds to the second message topic, the consumer is the first device access instance, and the configuration delivery message is sent to the first device access instance via the message queue.

[0111] Step 609: After receiving the configuration distribution message, the first device access instance can send the configuration distribution message to the network device. The configuration distribution message may include the configuration to be distributed.

[0112] In one example, when the first device access instance receives a configuration delivery message, the message may also include a configuration header. The first device access instance can then parse and store this header. When the first device access instance sends a configuration delivery message to the network device, this message does not include the header; it only includes the configuration to be delivered.

[0113] When the first device access instance sends a configuration distribution message to the network device, it can query the connection information corresponding to the unique device identifier by storing the correspondence between the unique device identifier and the connection information in memory. Based on this connection information, the first device access instance can send the message to the network device.

[0114] After receiving a configuration distribution message, a network device can parse the configuration to be distributed from the message, and this configuration is used to configure the network device. Therefore, the network device can configure itself based on this configuration, and there are no restrictions on this configuration process.

[0115] In one example, after completing the configuration, the network device can also return a configuration result message to the first device access instance, and the first device access instance can receive the configuration result message in response to the configuration delivery message. The configuration result message may include the unique device identifier of the network device.

[0116] The first device access instance can parse the unique device identifier of the network device from the configuration result message and query the configuration message header corresponding to that unique device identifier. For example, since the configuration message header may include the sequence number of the configuration to be issued, the instance identifier of the second device management instance, and the unique device identifier of the network device, the configuration message header corresponding to that unique device identifier can be queried.

[0117] The first device access instance can send the configuration result message and the sequence number in the configuration message header to the second device management instance corresponding to the instance identifier in the configuration message header. For example, the first device access instance can encapsulate the configuration message header in the configuration result message and send the configuration result message (i.e., the configuration result message carrying the configuration message header) to the second device management instance. Alternatively, the first device access instance can write the configuration result message to a message queue, where the configuration result message corresponds to the first message topic of the second device management instance, and send the configuration result message to the second device management instance corresponding to the first message topic through the message queue. In this way, the second device management instance can receive the configuration result message.

[0118] After receiving the configuration result message, the second device management instance can obtain the sequence number of the configuration to be distributed (e.g., by parsing the sequence number of the configuration to be distributed from the configuration message header), determine that the configuration to be distributed corresponding to the sequence number has been successfully distributed, return the information that the configuration was successfully distributed to the user, and save the configuration to be distributed to the database, indicating that the network device is using this configuration to be distributed.

[0119] The configuration result message may carry information indicating that the configuration was successfully delivered or that it failed to deliver. Based on this, if the configuration result message carries information indicating that the configuration was successfully delivered, it is determined that the configuration to be delivered corresponding to the sequence number has been successfully delivered. If the configuration result message carries information indicating that the configuration to be delivered corresponding to the sequence number failed to deliver, it is determined that the configuration to be delivered corresponding to the sequence number failed to deliver, and the information indicating that the configuration was delivered failed is returned to the user.

[0120] Fourth, regarding the instance exception handling process.

[0121] When an existing device management instance goes offline (e.g., due to a device management instance failure), if a registered device does not receive the instance identifier of the existing device management instance within a preset time, the instance identifier of the existing device management instance is deleted from the device management instance list, resulting in an updated device management instance list. When a new device management instance comes online, the registered device receives the instance identifier of the new device management instance, adds the instance identifier of the new device management instance to the device management instance list, resulting in an updated device management instance list.

[0122] Based on this, the first device management instance selects the second device management instance from the updated list of device management instances based on the unique device identifier of the network device. The first device access instance selects the second device management instance from the updated list of device management instances based on the unique device identifier of the network device.

[0123] In summary, during system operation, each device management instance and each device access instance periodically synchronizes the device management instance list of registered devices, retaining only the synchronized list from registered devices. The latest device management instance list can be used, and when using the consistent hash algorithm to find a second device management instance, it can be based on the latest device management instance list. Through this process, normal operation is possible even in the event of device management instance anomalies.

[0124] As can be seen from the above technical solutions, this embodiment of the application does not have a single point of Redis caching performance bottleneck, supports the access of a large number of network devices, and meets the needs of large-scale cloud management of network devices. By using the same consistent hash algorithm in the device access instance and the device management instance, it is ensured that the configuration distribution message and the online message of the same device are processed by the same device management instance. In this way, it is only necessary to maintain the correspondence between the instance identifier of the device access instance and the unique device identifier of the network device in the local memory of the device management instance, which can ensure that the processing performance is significantly improved compared to the centralized Redis caching method.

[0125] Based on the same application concept as the above method, this application proposes a configuration distribution device for use in a management device. The management device includes multiple device access instances and multiple device management instances. See [link to relevant documentation]. Figure 7 The diagram shown is a structural schematic of the configuration distribution device, which may include:

[0126] The device management module 71 is configured to, when receiving a configuration distribution message through a first device management instance (the configuration distribution message includes a unique device identifier for the network device), select a second device management instance from a list of device management instances based on the unique device identifier, and send the configuration distribution message to the second device management instance; the list of device management instances includes instance identifiers of multiple device management instances; and when receiving the configuration distribution message through a second device management instance, determine a first device access instance corresponding to the unique device identifier based on a maintained pairing relationship between unique device identifiers and instance identifiers, and send the configuration distribution message to the first device access instance through the second device management instance.

[0127] The device access module 72 is configured to, when a network device comes online from a first device access instance, select a second device management instance from a list of device management instances based on the unique device identifier through the first device access instance, and send the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance; when the configuration distribution message is received through the first device access instance, the configuration distribution message is sent to the network device through the first device access instance; wherein, the configuration distribution message includes a configuration to be distributed, and the configuration to be distributed is used to configure the network device.

[0128] In one example, the configuration distribution device further includes: a message queue management module 73;

[0129] The device management module 71 is further configured to write the configuration distribution message to the message queue through the first device management instance, wherein the configuration distribution message corresponds to the first message topic of the second device management instance; the message queue management module 73 is configured to send the configuration distribution message to the second device management instance corresponding to the first message topic through the message queue.

[0130] The device access module 72 is further configured to write an online message to a message queue through the first device access instance, the online message corresponding to a first message topic of the second device management instance; the message queue management module 73 is configured to send the online message to the second device management instance corresponding to the first message topic through the message queue; wherein, the online message includes a pairing relationship between the unique device identifier and the instance identifier of the first device access instance;

[0131] The device management module 71 is further configured to write the configuration distribution message to the message queue through the second device management instance, the configuration distribution message corresponding to the second message topic of the first device access instance; the message queue management module 73 is configured to send the configuration distribution message to the first device access instance corresponding to the second message topic through the message queue.

[0132] In one example, when the device management module 71 selects a second device management instance from the device management instance list based on the unique device identifier using a first device management instance, it specifically performs the following steps: for each device management instance in the device management instance list, it determines the node position of the device management instance on the hash ring using the first device management instance, and determines the data position of the unique device identifier on the hash ring using the first device management instance; based on the positional relationship between the data position and the node position of each device management instance, it selects a device management instance from the device management instance list as the second device management instance. Similarly, when the device access module 72 selects a second device management instance from the device management instance list based on the unique device identifier using the first device access instance, it specifically performs the following steps: for each device management instance in the device management instance list, it determines the node position of the device management instance on the hash ring using a first device access instance, and determines the data position of the unique device identifier on the hash ring using the first device access instance; based on the positional relationship between the data position and the node position of each device management instance, it selects a device management instance from the device management instance list as the second device management instance.

[0133] In one example, the device management module 71 is further configured to, for each device management instance, periodically send the instance identifier of the device management instance to the registered device, so that the registered device updates the instance identifier of the device management instance in the device management instance list to obtain an updated device management instance list; and for each device management instance, periodically obtain the updated device management instance list from the registered device through the device management instance.

[0134] The device access module 72 is also used to periodically obtain the updated list of device management instances from the registered device for each device access instance.

[0135] In one example, when an existing device management instance goes offline, if the registered device does not receive the instance identifier of the existing device management instance within a preset time, it deletes the instance identifier of the existing device management instance from the device management instance list, resulting in an updated device management instance list. When a new device management instance comes online, the registered device receives the instance identifier of the new device management instance and adds the instance identifier of the new device management instance to the device management instance list, resulting in an updated device management instance list. Based on this, the device management module 71 is further configured to select a second device management instance from the updated device management instance list using the first device management instance based on a unique device identifier; the device access module 72 is further configured to select a second device management instance from the updated device management instance list using the first device access instance based on a unique device identifier.

[0136] In one example, the device management module 71 is further configured to add a configuration message header to the configuration distribution message when sending the configuration distribution message from the first device management instance to the second device management instance. The configuration message header includes a sequence number of the configuration to be distributed, an instance identifier of the second device management instance, and a unique device identifier. The device management module 71 is further configured to send the configuration message header to the first device access instance when sending the configuration distribution message from the second device management instance to the first device access instance, so that the first device access instance stores the configuration message header upon receiving it. The device access module 72 is further configured to, when receiving a configuration result message in response to the configuration distribution message through the first device access instance, wherein the configuration result message includes the unique device identifier, query the configuration message header corresponding to the unique device identifier through the first device access instance, and send the configuration result message and the sequence number to the second device management instance corresponding to the instance identifier in the configuration message header, so that the second device management instance determines that the configuration to be distributed corresponding to the sequence number has been successfully distributed.

[0137] Based on the same application concept as the above method, this application proposes a management device, see [link to relevant documentation]. Figure 8 As shown, the management device includes a processor 81 and a machine-readable storage medium 82, wherein the machine-readable storage medium 82 stores machine-executable instructions that can be executed by the processor 81; the processor 81 is used to execute the machine-executable instructions to implement the configuration distribution method disclosed in the above example of this application.

[0138] Based on the same application concept as the above method, this application embodiment also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the configuration distribution method disclosed in the above examples of this application.

[0139] The aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0140] Based on the same concept as the methods described above, this application also provides a computer program product, which may include a computer program. When executed by a processor, the computer program implements the configuration distribution method disclosed in the examples above.

[0141] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0142] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A configuration distribution method, characterized in that, Applied to a management device, the management device including multiple device access instances and multiple device management instances, the method includes: When a configuration delivery message is received through a first device management instance, the configuration delivery message includes a unique device identifier of the network device. The first device management instance selects a second device management instance from a list of device management instances based on the unique device identifier and sends the configuration delivery message to the second device management instance. The list of device management instances includes instance identifiers of multiple device management instances. When the configuration distribution message is received through the second device management instance, the second device management instance determines the first device access instance corresponding to the unique device identifier based on the maintained pairing relationship between the unique device identifier and the instance identifier. Specifically, when a network device comes online from the first device access instance, the first device access instance selects a second device management instance from the device management instance list based on the unique device identifier and sends the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance. The configuration distribution message is sent from the second device management instance to the first device access instance, so that the first device access instance sends the configuration distribution message to the network device; wherein, the configuration distribution message includes a configuration to be distributed, which is used to configure the network device.

2. The method according to claim 1, characterized in that, Sending the configuration delivery message to the second device management instance includes: writing the configuration delivery message to a message queue through the first device management instance, wherein the configuration delivery message corresponds to a first message topic of the second device management instance; and sending the configuration delivery message to the second device management instance corresponding to the first message topic through the message queue. Sending the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance includes: writing an online message to a message queue through the first device access instance, the online message corresponding to a first message topic of the second device management instance; and sending the online message to the second device management instance corresponding to the first message topic through the message queue, the online message including the unique device identifier and the instance identifier of the first device access instance. Sending the configuration distribution message to the first device access instance through the second device management instance includes: writing the configuration distribution message to a message queue through the second device management instance, wherein the configuration distribution message corresponds to a second message topic of the first device access instance; and sending the configuration distribution message to the first device access instance corresponding to the second message topic through the message queue.

3. The method according to claim 1, characterized in that, The step of selecting a second device management instance from the device management instance list based on the unique device identifier using a first device management instance includes: for each device management instance in the device management instance list, determining the node position of the device management instance on the hash ring using the first device management instance, and determining the data position of the unique device identifier on the hash ring using the first device management instance; and selecting a device management instance from the device management instance list as the second device management instance based on the positional relationship between the data position and the node position of each device management instance. The step of selecting a second device management instance from the device management instance list based on the unique device identifier through the first device access instance includes: for each device management instance in the device management instance list, determining the node position of the device management instance on the hash ring through the first device access instance, determining the data position of the unique device identifier on the hash ring through the first device access instance; and selecting a device management instance from the device management instance list as the second device management instance based on the positional relationship between the data position and the node position of each device management instance.

4. The method according to claim 1 or 3, characterized in that, The method further includes: For each device management instance, the instance identifier of the device management instance is periodically sent to the registered device so that the registered device updates the instance identifier of the device management instance in the device management instance list, thereby obtaining an updated device management instance list; For each device access instance, the updated list of device management instances is periodically obtained from the registered device through the device access instance; for each device management instance, the updated list of device management instances is periodically obtained from the registered device through the device management instance.

5. The method according to claim 4, characterized in that, When an existing device management instance goes offline, if the registered device does not receive the instance identifier of the existing device management instance within a preset time, it will delete the instance identifier of the existing device management instance from the device management instance list and obtain an updated device management instance list; when a new device management instance comes online, the registered device will receive the instance identifier of the new device management instance and add the instance identifier of the new device management instance to the device management instance list and obtain an updated device management instance list. Specifically, the first device management instance selects a second device management instance from the updated list of device management instances based on a unique device identifier; the first device access instance selects a second device management instance from the updated list of device management instances based on a unique device identifier.

6. The method according to claim 1, characterized in that, When sending the configuration delivery message to the second device management instance through the first device management instance, a configuration message header is added to the configuration delivery message. The configuration message header includes the sequence number of the configuration to be delivered, the instance identifier of the second device management instance, and the unique device identifier. When the configuration distribution message is sent to the first device access instance through the second device management instance, the configuration message header is sent to the first device access instance so that the first device access instance stores the configuration message header when it receives it. When a configuration result message is received in response to the configuration delivery message through the first device access instance, the configuration result message includes the unique device identifier. The first device access instance queries the configuration message header corresponding to the unique device identifier and sends the configuration result message and the serial number to the second device management instance corresponding to the instance identifier in the configuration message header, so that the second device management instance can determine that the configuration to be delivered corresponding to the serial number has been successfully delivered.

7. A configuration distribution device, characterized in that, Applied to a management device, the management device including multiple device access instances and multiple device management instances, the device includes: The device management module is configured to: upon receiving a configuration distribution message through a first device management instance (the configuration distribution message includes a unique device identifier for the network device), select a second device management instance from a list of device management instances based on the unique device identifier, and send the configuration distribution message to the second device management instance; upon receiving the configuration distribution message through a second device management instance (the device management instance list includes instance identifiers for multiple device management instances), determine a first device access instance corresponding to the unique device identifier based on a maintained pairing relationship between unique device identifiers and instance identifiers, and send the configuration distribution message to the first device access instance through the second device management instance. The device access module is configured to, when a network device comes online from a first device access instance, select a second device management instance from a list of device management instances based on the unique device identifier through the first device access instance, and send the pairing relationship between the unique device identifier and the instance identifier of the first device access instance to the second device management instance; when the configuration distribution message is received through the first device access instance, the module sends the configuration distribution message to the network device through the first device access instance; wherein the configuration distribution message includes a configuration to be distributed, and the configuration to be distributed is used to configure the network device.

8. The apparatus according to claim 7, characterized in that, The configuration distribution device further includes: a message queue management module; The device management module is further configured to write the configuration delivery message to the message queue through the first device management instance, wherein the configuration delivery message corresponds to the first message topic of the second device management instance; the message queue management module is configured to send the configuration delivery message to the second device management instance corresponding to the first message topic through the message queue. The device access module is further configured to write an online message to a message queue through the first device access instance, the online message corresponding to a first message topic of the second device management instance; the message queue management module is configured to send the online message to the second device management instance corresponding to the first message topic through the message queue; wherein, the online message includes a pairing relationship between the unique device identifier and the instance identifier of the first device access instance; The device management module is further configured to write the configuration distribution message to the message queue through the second device management instance, the configuration distribution message corresponding to the second message topic of the first device access instance; the message queue management module is configured to send the configuration distribution message to the first device access instance corresponding to the second message topic through the message queue.

9. The apparatus according to claim 7, characterized in that, When the device management module selects a second device management instance from the device management instance list based on the unique device identifier using the first device management instance, it specifically performs the following steps: for each device management instance in the device management instance list, it determines the node position of the device management instance on the hash ring using the first device management instance, and determines the data position of the unique device identifier on the hash ring using the first device management instance; based on the positional relationship between the data position and the node position of each device management instance, it selects a device management instance from the device management instance list as the second device management instance. When the device access module selects a second device management instance from the device management instance list based on the unique device identifier using the first device access instance, it specifically performs the following steps: for each device management instance in the device management instance list, it determines the node position of the device management instance on the hash ring using the first device access instance, and determines the data position of the unique device identifier on the hash ring using the first device access instance; based on the positional relationship between the data position and the node position of each device management instance, it selects a device management instance from the device management instance list as the second device management instance.

10. A management device, characterized in that, include: A processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; The processor is configured to execute machine-executable instructions to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Container unit management method and related equipment

    CN113037522A

  • Virtual network function management message distribution method, device and equipment

    CN113542013A