Equipment management method and device, computer readable medium and electronic equipment
The device management platform supports device access with different communication protocols, and caches and restores configuration information between the cloud controller and network devices. This solves the problem of network device access differences and configuration information transmission during abnormal recovery, and improves business performance. Recovery efficiency and system scalability reduce operation and maintenance costs.
Patent Information
- Application Number
- CN202310458583.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2024-10-22
AI Technical Summary
Differences in communication protocols supported by different network devices result in the need for different access devices when accessing the cloud controller, resulting in poor system scalability and high operation and maintenance costs. It also makes it difficult to send configuration information in a timely manner when the network device recovers abnormally, affecting business availability. .
Provide a device management method and device that supports device access with different communication protocols through the device management platform, receives configuration information sent by the cloud controller and stores it in the configuration information storage space of the designated device, ensuring that the configuration information is sent in time when communication is normal. , and send the stored configuration information when communication is restored to ensure business availability.
It improves business recovery efficiency, reduces operation and maintenance costs, enhances system scalability and flexibility, and ensures business availability.
Smart Images

Figure CN118827352A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a device management method, apparatus, computer-readable medium and electronic device. Background Art
[0002] During the service execution process, the cloud controller usually needs to send configuration information to network devices (such as switches, routers, etc.), and then the network devices perform service-related configuration operations based on the configuration information. After the network devices perform the configuration operations, the corresponding service operations can be completed. However, due to the differences in the communication protocols supported by different network devices, different network devices need to connect to different access devices when accessing the cloud controller, resulting in poor scalability and high operation and maintenance costs. In addition, when the network device recovers abnormally, it is difficult to ensure that the configuration information is sent to the network device in time, which will affect the availability of the service. Summary of the invention
[0003] The embodiments of the present application provide a device management method, apparatus, computer-readable medium and electronic device, which can improve the efficiency of business recovery while ensuring business availability, and can improve the scalability of the system and reduce operation and maintenance costs.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] In the first aspect, an embodiment of the present application provides a device management method, which is executed by a device management platform, and the device management platform is used for access of devices with different communication protocols. The device management method includes: receiving configuration information for a specified device sent by a cloud controller; storing the configuration information in a configuration information storage space corresponding to the specified device; wherein the configuration information storage spaces corresponding to different devices accessing the device management platform are different; if the communication with the specified device is normal, sending the received configuration information to the specified device; if the communication with the specified device recovers from abnormality to normal, sending the configuration information stored in the configuration information storage space corresponding to the specified device to the specified device.
[0006] In the second aspect, an embodiment of the present application provides a device management method, including: when communication with a device management platform is normal, receiving configuration information sent by the device management platform, the configuration information is sent by a cloud controller to the device management platform, and after receiving the configuration information sent by the cloud controller, the device management platform stores the configuration information in a corresponding configuration information storage space, and the configuration information storage spaces corresponding to different devices connected to the device management platform are different; when communication with the device management platform recovers from abnormality to normal, receiving configuration information selected and sent by the device management platform from the corresponding configuration information storage space; and performing corresponding configuration operations according to the received configuration information.
[0007] In the third aspect, an embodiment of the present application provides a device management device, which is applied to a device management platform, and the device management platform is used for access of devices with different communication protocols. The device management device includes: a receiving unit, configured to receive configuration information for a designated device sent by a cloud controller; a storage unit, configured to store the configuration information in a configuration information storage space corresponding to the designated device; wherein the configuration information storage spaces corresponding to different devices accessing the device management platform are different; a sending unit, configured to send the received configuration information to the designated device if the communication between the device management platform and the designated device is normal; and if the communication between the device management platform and the designated device recovers from abnormality to normal, send the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device.
[0008] In the fourth aspect, an embodiment of the present application provides a device management apparatus, comprising: a receiving unit, configured to receive configuration information sent by the device management platform when communication with the device management platform is normal, the configuration information is sent by the cloud controller to the device management platform, and after receiving the configuration information sent by the cloud controller, the device management platform stores the configuration information in a corresponding configuration information storage space, and the configuration information storage spaces corresponding to different devices connected to the device management platform are different; and when communication with the device management platform recovers from abnormality to normal, receive the configuration information selected and sent by the device management platform from the corresponding configuration information storage space; a processing unit, configured to perform corresponding configuration operations according to the received configuration information.
[0009] In a fifth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, the device management method as described in the above embodiment is implemented.
[0010] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the device management method as described in the above embodiments.
[0011] In a seventh aspect, an embodiment of the present application provides a computer program product, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the device management method provided in the above-mentioned various optional embodiments.
[0012] In the technical solutions provided in some embodiments of the present application, since the device management platform can be accessed by devices with different communication protocols, the differences at the device level can be shielded for the cloud controller, thereby improving the scalability of the system and reducing operation and maintenance costs. The device management platform stores the received configuration information for the specified device in the configuration information storage space corresponding to the specified device, and the configuration information storage spaces corresponding to different devices accessing the device management platform are different, so that the device management platform can reasonably and orderly store the configuration information corresponding to different devices, thereby improving the flexibility and versatility in coping with device expansion.
[0013] In addition, when the communication between the device management platform and the designated device is normal, the device management platform sends the received configuration information to the designated device, so that the designated device can receive the configuration information from the cloud controller in a timely manner, thereby ensuring that the device processes the corresponding business in a timely manner according to the received configuration information, thereby ensuring the availability of the business. When the communication between the device management platform and the designated device is restored from abnormality to normal, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device, so that the designated device can receive the relevant configuration information in a timely manner after restoration to normal, and perform the relevant configuration operations to ensure the availability of the business, thereby improving the efficiency of business recovery and reducing operation and maintenance costs.
[0014] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of the architecture of a device management system is shown;
[0016] Figure 2 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0017] Figure 3 A flow chart of a device management method according to an embodiment of the present application is shown;
[0018] Figure 4 A flow chart of a device management method according to an embodiment of the present application is shown;
[0019] Figure 5 A flow chart of a device management method according to an embodiment of the present application is shown;
[0020] Figure 6 A schematic diagram of setting a configuration issuing module in a device management platform according to an embodiment of the present application is shown;
[0021] Figure 7 A schematic diagram of a cache queue of configuration information according to an embodiment of the present application is shown;
[0022] Figure 8 A schematic diagram of performing health detection on a device according to an embodiment of the present application is shown;
[0023] Fig. 9 An overall flow chart of a device management method according to an embodiment of the present application is shown;
[0024] Fig.10 A block diagram of a device management apparatus according to an embodiment of the present application is shown;
[0025] Fig.11 A block diagram of a device management apparatus according to an embodiment of the present application is shown;
[0026] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The exemplary embodiments are now described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be understood as being limited to these examples; on the contrary, the purpose of providing these embodiments is to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0028] In addition, the features, structures or characteristics described in the present application may be combined in one or more embodiments in any suitable manner. In the following description, there are many specific details so that the embodiments of the present application can be fully understood. However, those skilled in the art will appreciate that when implementing the technical scheme of the present application, all the detailed features in the embodiments may not be needed, one or more specific details may be omitted, or other methods, elements, devices, steps, etc. may be adopted.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0031] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0032] It can be understood that in the specific implementation of this application, related data such as device configuration information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0033] In the network device management scenario, such as Figure 1 As shown, operation and maintenance personnel usually need to send configuration information to network devices (such as switches, routers, etc.) through the cloud controller, and then the network devices perform business-related configuration operations based on the configuration information. After the network devices perform the configuration operations, the corresponding business operations can be completed. However, due to the differences in the communication protocols supported by different network devices, different network devices need to be connected to different access devices when accessing the cloud controller. For example, switch-type network devices are connected to access device A, and router-type network devices are connected to access device B, while access device A and access device B are connected to the cloud controller. If more types of devices need to be connected, then more access devices need to be developed and deployed. As the business develops, most cloud vendors' network solutions need to connect to multiple types of devices, which brings unnecessary overhead to development and operation and maintenance. It can be seen Figure 1 The system architecture shown results in poor scalability and high operation and maintenance costs. In addition, it is difficult to ensure that the configuration information is sent to the network device in a timely manner when the network device recovers abnormally, which in turn affects the availability of the service.
[0034] Based on this, in one embodiment of the present application, Figure 2 As shown in the figure, the device management platform can support device access of multiple protocols, such as HTTP (Hyper Text Transfer Protocol), GRPC (a high-performance, general-purpose open source RPC (Remote Procedure Call) framework), WebSocket (a protocol for full-duplex communication on a single TCP (Transmission Control Protocol) connection), MQTT (Message Queuing Telemetry Transport), Kafka (a high-throughput distributed publish-subscribe messaging system) protocol, etc.
[0035] Optionally, when the device management platform adapts to different types of devices, most devices can use these common communication protocols. For devices using niche or proprietary protocols, on the one hand, the device side can choose to support a common protocol, and on the other hand, the supported protocols can be expanded on the device management platform to support the protocol of the device.
[0036] Continue to refer to Figure 2 As shown, the device management platform can communicate with the cloud controller under the premise of supporting the access of multiple protocol devices, and can support the flexible expansion of the cloud controller. When the operation and maintenance personnel need to send configuration information to the device through the cloud controller, the cloud controller will send the configuration information for the specified device to the device management platform. After receiving the configuration information for the specified device sent by the cloud controller, the device management platform can store the configuration information in the configuration information storage space corresponding to the specified device; wherein, the configuration information storage space corresponding to different devices connected to the device management platform is different.
[0037] Furthermore, if the communication between the device management platform and the designated device is normal, the received configuration information can be sent directly to the designated device to ensure that the designated device processes the corresponding business in a timely manner according to the received configuration information, thereby ensuring the availability of the business. If the communication between the device management platform and the designated device is restored from abnormality to normal, the configuration information stored in the configuration information storage space corresponding to the designated device can be sent to the designated device, so that the designated device can receive the relevant configuration information in a timely manner after returning to normal, and perform the relevant configuration operations to ensure the availability of the business, thereby improving the efficiency of business recovery and reducing operation and maintenance costs.
[0038] Understandably, Figure 2The devices (such as switches, routers, etc.), the device management platform and the cloud controller shown in the figure are connected through network communication, and the network may include various connection types, such as wireless communication links, wired and optical fiber cables, etc. In addition to switches and routers, devices may also be hubs, network interface cards (NIC), wireless access points (WAP), modems, optical terminals, optical transceivers, bridges, servers, smart phones, computers, notebooks, computers, vehicle terminals, aircraft, etc. Among them, the cloud controller may be a server that provides various services, which may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), big data and artificial intelligence platforms, etc.
[0039] The device management platform can be deployed on any electronic device, where the electronic device can be a smart phone, tablet, laptop, computer, intelligent voice interaction device, smart home appliance, smart wearable device, aircraft, etc. Or the electronic device can also be a server that provides various services; among them, it can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms.
[0040] It should be noted that Figure 2 The number of devices, cloud controllers, and device management platforms in the embodiment is merely illustrative, and any number of devices, cloud controllers, and device management platforms may be provided according to actual needs.
[0041] Figure 2 The technical solutions of the illustrated embodiments can be applied to various scenarios, including but not limited to smart transportation, assisted driving, cloud technology, artificial intelligence, etc.; in actual applications, corresponding adjustments can be made according to specific application scenarios.
[0042] For example, if applied to smart transportation or assisted driving scenarios, the device can be a vehicle-mounted terminal, a navigation terminal, etc., and then by implementing the technical solutions of the embodiments of the present application, the management of the vehicle-mounted terminal and the navigation terminal is more reasonable, thereby ensuring the normal execution of the Internet of Vehicles services.
[0043] For example, if applied in cloud technology or artificial intelligence scenarios, the network device can be a smart phone, a computer, or a computer; and by implementing the technical solutions of the embodiments of the present application, the management of smart phones, computers, and computers is more rational, ensuring the normal execution of terminal services.
[0044] Exemplarily, if applied in cloud technology or artificial intelligence scenarios, the network device may be a router, a hub, a bridge, etc.; and by implementing the technical solutions of the embodiments of the present application, the management of routers, hubs, and bridges is more rational, thereby ensuring the normal execution of services such as cloud games for terminal devices.
[0045] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0046] Figure 3 A flow chart of a device management method according to an embodiment of the present application is shown. The device management method can be executed by a device management platform, and the device management platform can be accessed by devices with different communication protocols. Figure 3 As shown, the device management method at least includes S310 to S340, which are described in detail as follows:
[0047] In S310 , configuration information for a designated device sent by a cloud controller is received.
[0048] In some optional embodiments, the configuration information is information sent by the cloud controller to instruct the device to perform business-related configuration operations.
[0049] For example, for service 1, the cloud controller instructs the device to execute configuration operation ab related to service 1 by sending configuration information. After the device executes configuration operation ab related to service 1, it continues to execute service 1 to complete the processing of service 1.
[0050] For another example, for service 2, the cloud controller instructs the device to execute configuration operation ad related to service 2 by sending configuration information. After the device executes configuration operation ad related to service 2, it continues to execute service 2 to complete the processing of service 2.
[0051] In S320, the configuration information is stored in a configuration information storage space corresponding to the designated device; wherein the configuration information storage spaces corresponding to different devices connected to the device management platform are different.
[0052] In the embodiment of the present application, since the configuration information storage spaces corresponding to different devices accessing the device management platform are different, the device management platform can reasonably and orderly store the configuration information corresponding to different devices, thereby improving the flexibility and versatility of coping with device expansion.
[0053] In some optional embodiments, the configuration information storage space corresponding to each device accessing the device management platform includes multiple storage lists and index fields corresponding to the multiple storage lists; wherein the index field includes: a first field pointing to the head of the storage list currently used, and a second field pointing to the tail of the storage list currently used. The technical solution of this embodiment can avoid the problem of slow access speed and memory overflow caused by the excessive index field in the storage space when using a single storage list, and the head and tail of the storage list currently used by each device can be easily determined through the indication of the first field and the second field.
[0054] In some optional embodiments, multiple storage lists in the configuration information storage space corresponding to each device are connected in series to form a storage queue, and the multiple storage lists are used to store the received configuration information in the order in which the configuration information is received. The technical solution of this embodiment enables the orderliness of configuration information storage to be ensured through multiple storage lists.
[0055] For example, there are three devices connected to the device management platform, and these three devices correspond to independent configuration information storage spaces. Assuming that there are four storage lists L1, L2, L3 and L4 in the configuration information storage space corresponding to device 1, then these four storage lists L1, L2, L3 and L4 can be connected in series to form a storage queue to store the received configuration information in the order in which the configuration information is received.
[0056] In S330, if the communication with the designated device is normal, the received configuration information is sent to the designated device.
[0057] In this embodiment, if the communication between the device management platform and the designated device is normal, the device management platform sends the received configuration information to the designated device, so that the designated device can receive the configuration information from the cloud controller in a timely manner, thereby ensuring that the device processes the corresponding business in a timely manner according to the received configuration information, thereby ensuring the availability of the business.
[0058] In S340, if the communication with the designated device is restored from abnormality to normal, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device.
[0059] In this embodiment, if the communication between the device management platform and the designated device is restored from abnormality to normal, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device, so that the designated device can receive the relevant configuration information in time after it is restored to normal, and perform relevant configuration operations to ensure the availability of the business, thereby improving the efficiency of business recovery and reducing operation and maintenance costs.
[0060] In some optional embodiments, the process of sending the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device may specifically be: selecting configuration information from the configuration information storage space corresponding to the designated device in a first-in-first-out order and sending it to the designated device; if the remaining configuration information not sent to the designated device is less than or equal to a set threshold, write-locking the configuration information storage space corresponding to the designated device; after write-locking the configuration information storage space corresponding to the designated device, obtaining all the configuration information in the configuration information storage space corresponding to the designated device and sending it to the designated device.
[0061] Optionally, when selecting configuration information from the configuration information storage space corresponding to the designated device in a first-in-first-out order and sending it to the designated device, a certain amount of configuration information can be taken out in a first-in-first-out order each time and then sent to the designated device. When the amount of remaining unsent configuration information is less than or equal to a set threshold, the configuration information storage space corresponding to the designated device is write-locked, so that reading and writing in parallel can be avoided to prevent abnormalities in the reading and writing of configuration information.
[0062] In some optional embodiments, after all the configuration information in the configuration information storage space corresponding to the designated device is sent to the designated device, the write lock on the configuration information storage space corresponding to the designated device is released. The technical solution of this embodiment ensures that after all the configuration information in the configuration information storage space corresponding to the designated device is sent to the designated device, the received configuration information can be stored in the configuration information storage space corresponding to the designated device in a timely manner.
[0063] It should be noted that: Figure 3 In the technical solution of the illustrated embodiment, after receiving the configuration information sent by the cloud controller, the device management platform stores it in the configuration information storage space corresponding to the designated device, and then sends the received configuration information to the designated device when the communication between the device management platform and the designated device is normal. In other embodiments of the present application, after receiving the configuration information for the designated device sent by the cloud controller, the device management platform may first determine the communication status with the designated device. If the communication with the designated device is normal, the received configuration information may be sent to the designated device and then stored in the configuration information storage space corresponding to the designated device; if the communication with the designated device is abnormal, the configuration information may be directly stored in the configuration information storage space corresponding to the designated device.
[0064] exist Figure 3 Based on the embodiment shown, Figure 4 As shown, the device management method according to an embodiment of the present application includes the following S410 to S430:
[0065] S410: Generate a configuration information saving instruction, where the configuration information saving instruction is used to instruct a specified device to store specified configuration information.
[0066] In some optional embodiments, the device management platform may periodically generate configuration information saving instructions to periodically instruct a specified device to store specified configuration information.
[0067] S420: Send a configuration information saving instruction to a designated device.
[0068] S430: If the designated device successfully stores the designated configuration information, the designated configuration information is deleted from the configuration information storage space corresponding to the designated device.
[0069] The technical solution of this embodiment enables the device management platform to periodically instruct the device to store configuration information, and further delete the configuration information already stored by the device from the configuration information storage space to reduce the occupation of the configuration information storage space.
[0070] based on Figure 3 According to the technical solution of the illustrated embodiment, the device management platform can call the query interface provided by the specified device according to the set inspection cycle to obtain the health check information of the specified device, so as to determine whether the communication with the specified device is normal based on the health check information; or the device management platform can also receive the health check information reported by the specified device according to the set reporting cycle to determine whether the communication with the specified device is normal.
[0071] In some optional embodiments, when a designated device accesses a device management platform, the device management platform may obtain a device health check template selected by the designated device, where the device health check template includes a device health check method; if the device health check method is an active reporting method, the device management platform may receive health check information reported by the designated device according to a set reporting period; if the device health check method is a platform query method, the device management platform may call the query interface provided by the designated device according to a set inspection period to obtain the health check information of the designated device.
[0072] In some optional embodiments, the health check information may also include the most recent startup time of the specified device; then the device management platform can determine whether the specified device has been restarted based on the most recent startup time of the specified device. If the specified device has been restarted, the device management platform can send the configuration information stored in the configuration information storage space corresponding to the specified device to the specified device.
[0073] In some optional embodiments, after the designated device accesses the device management platform, a heartbeat message sent by the designated device can be received; if an abnormality occurs in the heartbeat message, the device status corresponding to the designated device is modified to communication abnormality. In this case, the device management platform does not send configuration information to the designated device; if the heartbeat message returns to normal, it is determined that the communication with the designated device has returned to normal, and after the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device, the device status corresponding to the designated device is modified to normal communication.
[0074] Figure 5 A flow chart of a device management method according to an embodiment of the present application is shown, and the device management method can be executed by a managed device. Figure 5 As shown, the device management method at least includes S510 to S530, which are described in detail as follows:
[0075] In S510, when the communication with the device management platform is normal, the configuration information sent by the device management platform is received. The configuration information is sent by the cloud controller to the device management platform. After receiving the configuration information sent by the cloud controller, the device management platform stores it in the corresponding configuration information storage space. The configuration information storage space corresponding to different devices connected to the device management platform is different.
[0076] In S520, when the communication with the device management platform is restored from abnormality to normal, the configuration information selected and sent by the device management platform from the corresponding configuration information storage space is received.
[0077] In S530, a corresponding configuration operation is performed according to the received configuration information.
[0078] Figure 5 The implementation details of the technical solution of the illustrated embodiment have been described in the relevant embodiments of the device management platform side, and specific reference may be made to the technical solution of the aforementioned embodiment.
[0079] The following combination Figures 6 to 9 The implementation details of the technical solution of the embodiment of the present application are further described:
[0080] Based on the aforementioned Figure 2 The system architecture shown in FIG. 1 shows that the device management platform can support the access of devices with multiple protocols, and the device management platform can communicate with the cloud controller. Figure 6As shown in the figure, a configuration delivery module can be designed in the device management platform. When the cloud controller delivers configuration information to the controlled device, it will first send it to the device management platform. Then, in addition to delivering the configuration information to the device, the configuration delivery module in the device management platform also establishes a cache queue for each device, and stores each configuration information delivered to the device in sequence. The process of delivering and caching configuration information is performed by default on the device management platform, which is invisible to the cloud controller responsible for the business, and the business does not need to be aware of it at all.
[0081] Since the running devices are always forwarding a large amount of business traffic, each time the configuration information is sent to the device, if the device saves the configuration information in real time after applying it, it may affect the forwarding performance of the device. Therefore, the device can save the configuration information to the local hard disk in an asynchronous manner. The purpose of setting up a cache queue in the embodiment of the present application is: if the device unexpectedly crashes and restarts before saving the configuration information to the local hard disk, the device management platform can quickly restore the device's configuration information to the device through the cache queue, so that the device starts forwarding traffic immediately. In this case, the device management platform can take over the timed saving work of the device, that is, by sending instructions to the device at regular intervals to let the device save the configuration information. Each time the configuration information is successfully saved, the device management platform will clean up the cache queue once to reduce the occupancy of the cache queue.
[0082] When implementing the cache queue, you can choose Redis cache and use the List structure of Redis cache for storage. The List sequential structure is very suitable for storing sequentially issued configuration information. In order to prevent the problem of Redis index keys being too large due to the length of the List during use, and to avoid the risk of slow access and memory overflow caused by a single Redis Key data being too large, such as Figure 7 As shown, multiple Lists can be used to form a circular queue. Figure 7 As shown, for device 1, a circular queue consisting of List-0, List-1, ..., List-n is used; for device 2, a circular queue consisting of List-0, List-1, ..., List-n can also be used; for device 3, a circular queue consisting of List-0, List-1, ..., List-n is also used. Optionally, the length of a single List can be limited to 20,000, and 50 Lists can be allocated for each device, that is, a maximum of 1 million configuration caches can be stored. In addition, two additional Keys (Head_Key and Tail_Key) can be set for each device to store the index positions of the head and tail of the currently used List.
[0083] In order to detect the running status of the device and restore the configuration information of the device in time when the device recovers abnormally, a health check module can be set in the device management platform. There are two ways to check the health of the health check module: the first is that the device provides a query interface, and the platform starts a timer to periodically call the device interface to obtain the health status, such as Figure 8 The method used by device 1 shown in the figure; the second method is that the device supports regular reporting of health status, and the server address for receiving reports on the device management platform is configured on the device, and the device automatically reports, such as Figure 8 The method adopted by device 2 in the example.
[0084] The device management platform can also provide a device health check template. When the device is connected to the device management platform, select the corresponding template to start the health check. The content of the device health check template includes: health check method (such as active reporting method or platform query method), health check protocol (that is, communication protocol, such as HTTP protocol, GRPC protocol, etc.), health check cycle (that is, how often a health check is performed, such as once an hour, etc.), and the number of failure judgments (that is, how many times an abnormality is detected and judged as a device failure). During each health check, the device management platform can also obtain the device's most recent startup time. When the device management platform actively queries, the device carries the most recent startup time in the returned result, and when the device actively reports, it carries the most recent startup time in the report message. The device management platform records the most recent startup time of each device to determine whether the device has experienced downtime and restart.
[0085] Fig. 9 The overall flow chart of the device management method according to an embodiment of the present application is shown, which specifically includes the following steps:
[0086] S901, in the initial state, assuming that the device has been properly connected to the device management platform and the heartbeat is normal, the cloud controller sends the device configuration information to the device management platform.
[0087] S902a, after receiving the configuration information, the device management platform sends the configuration information to the device through a connection with the device.
[0088] S902b, the device management platform saves the configuration information of the device into the Redis cache queue.
[0089] It should be noted that: S902a and S902b can be performed simultaneously; S902a can be executed first, and then S902b, that is, the configuration information is saved in the Redis cache queue after it is successfully sent to the device; S902b can be executed first, and then S902a, that is, the configuration information is saved in the Redis cache queue before being sent to the device.
[0090] S903, if the heartbeat status of the device is abnormal at a certain moment, the device management platform will immediately modify the status of the device in the database after receiving the heartbeat abnormality message.
[0091] S904, the cloud controller sends device configuration information to the device management platform.
[0092] S905, after receiving the configuration information, the device management platform queries the database and finds that the heartbeat of the device is abnormal. Therefore, this configuration information is not sent to the device, but is directly saved in the Redis cache queue.
[0093] S906: If the device returns to normal at a certain moment, the device reports to the device management platform that the heartbeat status has returned to normal.
[0094] S907, after receiving the message, the device management platform reads the configuration information in the Redis cache queue corresponding to the device.
[0095] S908, the device management platform sends the read configuration information to the device in sequence. Optionally, the process of the device management platform sending configuration information to the device is divided into two processes: first, considering the offline time of the device, a large amount of configuration information may have been stored in the cache queue. The device management platform starts from the beginning to read the cached configuration information in batches in a loop, and then sends it to the device; if the end of the queue has been read or the number of configuration information to be read is less than the specified threshold, a device-level lock is added to the cache queue. After the lock is added, the thread that writes data to the cache queue is blocked, and then all the remaining configuration information in the cache queue is taken out and sent to the device. After all the configuration information has been sent, the device management platform sets the status of the device to a healthy state, and the subsequent configuration information can be sent normally.
[0096] In summary, the device management platform proposed by the technical solution of the embodiment of the present application can provide a variety of standard access capabilities to support the access of various types of devices, shield the differences at the device level from the upper-layer business cloud controller, and provide universal device configuration delivery and heartbeat detection capabilities. In addition, a configuration information cache queue is added during the device configuration information delivery process. When the device fails to deliver the configuration information normally or the configuration information is lost due to an abnormal operation, the device configuration information can be automatically repaired through the cache queue, making the business level unaware, which greatly improves the business development efficiency and the availability of the business.
[0097] The following describes an apparatus embodiment of the present application, which can be used to execute the device management method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the device management method of the present application.
[0098] Fig.10A block diagram of a device management apparatus according to an embodiment of the present application is shown. The device management apparatus is applied to a device management platform, and the device management platform is used for access by devices with different communication protocols.
[0099] Reference Fig.10 As shown, according to an embodiment of the present application, a device management apparatus 1000 includes: a receiving unit 1002 , a storage unit 1004 and a sending unit 1006 .
[0100] Among them, the receiving unit 1002 is configured to receive configuration information for the designated device sent by the cloud controller; the storage unit 1004 is configured to store the configuration information in the configuration information storage space corresponding to the designated device; wherein the configuration information storage spaces corresponding to different devices connected to the device management platform are different; the sending unit 1006 is configured to send the received configuration information to the designated device if the communication between the device management platform and the designated device is normal; and if the communication between the device management platform and the designated device is restored from abnormal to normal, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device.
[0101] In some embodiments of the present application, based on the aforementioned scheme, the device management device 1000 also includes: a generation unit, configured to generate a configuration information saving instruction, and the configuration information saving instruction is used to instruct the designated device to store the designated configuration information; the sending unit 1006 is also configured to: send the configuration information saving instruction to the designated device; the storage unit 1004 is also configured to: if the designated device successfully stores the designated configuration information, then delete the designated configuration information from the configuration information storage space corresponding to the designated device.
[0102] In some embodiments of the present application, based on the aforementioned scheme, the configuration information storage space corresponding to each device connected to the device management platform contains multiple storage lists and index fields corresponding to the multiple storage lists; wherein the index field includes: a first field pointing to the head of the storage list currently used, and a second field pointing to the tail of the storage list currently used.
[0103] In some embodiments of the present application, based on the aforementioned solution, the multiple storage lists are connected in series to form a storage queue, and the multiple storage lists are used to store the received configuration information in the order in which the configuration information is received.
[0104] In some embodiments of the present application, based on the aforementioned scheme, the equipment management device 1000 also includes: an acquisition unit, configured to obtain health check information of the designated device in at least one of the following ways, and the health check information is used to determine whether the communication with the designated device is normal: calling the query interface provided by the designated device according to the set inspection period to obtain the health check information of the designated device; receiving the health check information reported by the designated device according to the set reporting period.
[0105] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit is configured as: when the designated device accesses the device management platform, obtaining the device health check template selected by the designated device, the device health check template including the device health check method; if the device health check method is an active reporting method, receiving the health check information reported by the designated device according to the set reporting period; if the device health check method is a platform query method, calling the query interface provided by the designated device according to the set inspection period to obtain the health check information of the designated device.
[0106] In some embodiments of the present application, based on the aforementioned scheme, the health check information also includes the most recent startup time of the designated device; the sending unit 1006 is also configured to: determine whether the designated device has been restarted based on the most recent startup time of the designated device; if the designated device has been restarted, send the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device.
[0107] In some embodiments of the present application, based on the aforementioned scheme, the device management device 1000 also includes: a processing unit; the receiving unit 1002 is also configured to: receive a heartbeat message sent by the designated device after the designated device connects to the device management platform; the processing unit is configured to: if an abnormality occurs in the heartbeat message, modify the device status corresponding to the designated device to communication abnormality; if the heartbeat message returns to normal, determine that the communication with the designated device has returned to normal, and after sending the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device, modify the device status corresponding to the designated device to normal communication.
[0108] In some embodiments of the present application, based on the aforementioned scheme, the process in which the sending unit 1006 sends the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device includes: selecting configuration information from the configuration information storage space corresponding to the designated device in a first-in-first-out order and sending it to the designated device; if the remaining configuration information not sent to the designated device is less than or equal to a set threshold, write-locking the configuration information storage space corresponding to the designated device; after write-locking the configuration information storage space corresponding to the designated device, obtaining all configuration information in the configuration information storage space corresponding to the designated device and sending it to the designated device.
[0109] In some embodiments of the present application, based on the aforementioned solution, after all configuration information in the configuration information storage space corresponding to the designated device is sent to the designated device, the write lock on the configuration information storage space corresponding to the designated device is released.
[0110] Fig.11 A block diagram of a device management apparatus according to an embodiment of the present application is shown, and the device management apparatus is applied to a managed device.
[0111] Reference Fig.11 As shown, according to an embodiment of the present application, a device management apparatus 1100 includes: a receiving unit 1102 and a processing unit 1104 .
[0112] Among them, the receiving unit 1102 is configured to receive the configuration information sent by the device management platform when the communication between the device management platform and the cloud controller is normal, and the configuration information is sent to the device management platform. After receiving the configuration information sent by the cloud controller, the device management platform stores the configuration information in the corresponding configuration information storage space, and the configuration information storage spaces corresponding to different devices connected to the device management platform are different; and when the communication between the device management platform and the device management platform is restored from abnormality to normal, receive the configuration information selected and sent by the device management platform from the corresponding configuration information storage space; the processing unit 1104 is configured to perform corresponding configuration operations according to the received configuration information.
[0113] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0114] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0115] like Fig.12As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method described in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.
[0116] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0117] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0118] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0119] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0120] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0121] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more computer programs, and when the above one or more computer programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0122] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0123] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0125] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A device management method, characterized in that: The device management method is executed by a device management platform, and the device management platform is used for accessing devices with different communication protocols. The device management method includes: Receive configuration information for a specified device sent by the cloud controller; The configuration information is stored in the configuration information storage space corresponding to the designated device; wherein the configuration information storage spaces corresponding to different devices connected to the device management platform are different; If the communication with the designated device is normal, sending the received configuration information to the designated device; If the communication with the designated device is restored from abnormality to normal, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device.
2. The device management method according to claim 1, characterized in that: The device management method further includes: Generate a configuration information saving instruction, wherein the configuration information saving instruction is used to instruct the specified device to store the specified configuration information; Sending the configuration information saving instruction to the designated device; If the designated device successfully stores the designated configuration information, the designated configuration information is deleted from the configuration information storage space corresponding to the designated device.
3. The device management method according to claim 1, characterized in that: The configuration information storage space corresponding to each device connected to the device management platform includes multiple storage lists and index fields corresponding to the multiple storage lists; The index field includes: a first field pointing to the head of the storage list currently in use, and a second field pointing to the tail of the storage list currently in use.
4. The device management method according to claim 3, characterized in that: The multiple storage lists are connected in series to form a storage queue, and the multiple storage lists are used to store the received configuration information according to the order in which the configuration information is received.
5. The device management method according to claim 1, characterized in that: Obtain health check information of the specified device in at least one of the following ways, where the health check information is used to determine whether the communication with the specified device is normal: Calling the query interface provided by the designated device to obtain health check information of the designated device according to the set check period; Receive health check information reported by the designated device according to a set reporting period.
6. The device management method according to claim 5, characterized in that: The device management method further includes: When the designated device is connected to the device management platform, obtaining a device health check template selected by the designated device, the device health check template including a device health check method; If the device health check mode is an active reporting mode, receiving health check information reported by the designated device according to a set reporting period; If the device health check mode is a platform query mode, the query interface provided by the designated device is called according to the set check period to obtain the health check information of the designated device.
7. The device management method according to claim 6, characterized in that: The health check information also includes the most recent startup time of the specified device; The device management method further includes: determining whether the designated device has been restarted according to the most recent startup time of the designated device; If the designated device is restarted, the configuration information stored in the configuration information storage space corresponding to the designated device is sent to the designated device.
8. The device management method according to claim 1, characterized in that: The device management method further includes: After the designated device is connected to the device management platform, receiving a heartbeat message sent by the designated device; If the heartbeat message is abnormal, the device status corresponding to the designated device is modified to communication abnormality; If the heartbeat message returns to normal, it is determined that the communication with the designated device has returned to normal, and after sending the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device, the device state corresponding to the designated device is modified to normal communication.
9. The device management method according to any one of claims 1 to 8, characterized in that: Sending the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device includes: Selecting configuration information from the configuration information storage space corresponding to the designated device in a first-in-first-out order and sending it to the designated device; If the remaining configuration information not sent to the designated device is less than or equal to a set threshold, write-locking the configuration information storage space corresponding to the designated device; After the configuration information storage space corresponding to the designated device is write-locked, all configuration information in the configuration information storage space corresponding to the designated device is acquired and sent to the designated device.
10. The device management method according to claim 9, characterized in that: The device management method further includes: After all configuration information in the configuration information storage space corresponding to the designated device is sent to the designated device, the write lock on the configuration information storage space corresponding to the designated device is released.
11. A device management method, characterized in that: include: When the communication with the device management platform is normal, the configuration information sent by the device management platform is received. The configuration information is sent by the cloud controller to the device management platform. After receiving the configuration information sent by the cloud controller, the device management platform stores the configuration information in the corresponding configuration information storage space. Different devices connected to the device management platform have different configuration information storage spaces. When the communication with the device management platform is restored from abnormality to normal, receiving the configuration information selected and sent by the device management platform from the corresponding configuration information storage space; Execute corresponding configuration operations according to the received configuration information.
12. A device management apparatus, characterized in that: The device management device is applied to a device management platform, and the device management platform is used for accessing devices with different communication protocols. The device management device includes: A receiving unit configured to receive configuration information for a designated device sent by a cloud controller; A storage unit configured to store the configuration information in a configuration information storage space corresponding to the designated device; wherein different devices connected to the device management platform have different configuration information storage spaces corresponding to them; The sending unit is configured to send the received configuration information to the designated device if the communication between the device management platform and the designated device is normal; and to send the configuration information stored in the configuration information storage space corresponding to the designated device to the designated device if the communication between the device management platform and the designated device is restored from abnormal to normal.
13. A device management apparatus, characterized in that: include: A receiving unit, configured to receive configuration information sent by the device management platform when the communication between the device management platform and the cloud controller is normal, wherein the configuration information is sent by the cloud controller to the device management platform, and the device management platform stores the configuration information in a corresponding configuration information storage space after receiving the configuration information sent by the cloud controller, and the configuration information storage spaces corresponding to different devices connected to the device management platform are different; and when the communication between the device management platform and the cloud controller is restored from abnormality to normal, receive the configuration information selected and sent by the device management platform from the corresponding configuration information storage space; The processing unit is configured to perform corresponding configuration operations according to the received configuration information.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the device management method according to any one of claims 1 to 11 is implemented.
15. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the device management method as described in any one of claims 1 to 11.
