A communication method, device and equipment of a distributed device registry center and a medium
Through the four-layer load balancing and consistent hashing algorithm of the distributed device registration center, the performance bottleneck and single point failure problems of the IoT platform when the number of device access increases are solved, the free expansion and fault tolerance of device connections are achieved, and the stable operation of the platform is ensured.
Patent Information
- Application Number
- CN202211407703.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-11-10
AI Technical Summary
IoT platforms experience performance bottlenecks when the number of connected devices increases, and server downtime or failures can cause the platform to become unavailable. Existing solutions cannot effectively address the risk of single-point failure in device connections.
It adopts a distributed device registration center, utilizes four-layer load balancing software, network components and device shadow components, and implements load balancing and automatic migration of device connections through polling strategy and consistent hashing algorithm to avoid single point failure.
It realizes the free expansion of IoT devices and eliminates the risk of single point failure, ensuring that the platform can still operate normally when the number of device connections increases, and improving the fault tolerance and scalability of the system.
Smart Images

Figure CN115865996B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer, and particularly relates to a communication method, device and equipment of a distributed device registration center and a medium. BACKGROUND
[0002] Generally, an Internet of Things device connects an Internet of Things platform using TCP, MQTT, CoAP and the like. Using these protocols requires the device to establish a long connection with the platform. When the number of devices connected to the platform increases, an Internet of Things platform that only supports a single node will inevitably have a performance bottleneck. If the server of the deployed platform is down or the platform service fails, the entire platform will be unavailable. SUMMARY
[0003] One or more embodiments of the present specification provide a communication method, device and equipment of a distributed device registration center and a medium to solve the technical problems proposed in the background.
[0004] One or more embodiments of the present specification adopt the following technical solutions:
[0005] The communication method of the distributed device registration center provided by one or more embodiments of the present specification includes four-layer load balancing software, network components, device shadow components and seven-layer load balancing software, and includes the following steps:
[0006] When a network connection request of a specified Internet of Things device is received, the network connection request is randomly forwarded to any one specified network component through a polling strategy of the four-layer load balancing software;
[0007] The network connection request is processed by the specified network component, and the specified Internet of Things device is connected to the registration center to generate networking information of the specified Internet of Things device;
[0008] The networking information of the specified Internet of Things device and device real-time data of the specified Internet of Things device are sent to a specified device shadow component, so that the networking information and the device real-time data are managed by the specified device shadow component, and when a control request of the specified Internet of Things device is issued by a user, the control request is randomly forwarded to any one device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any one device shadow component is the specified device shadow component, the control request is sent to the specified network component through the networking information and the device real-time data of the specified device shadow component to determine the specified network component, and the control request is sent to the specified Internet of Things device through the specified network component.
[0009] The one or more embodiments of the specification provide a communication device of a distributed device registration center, the distributed device registration center comprising four-layer load balancing software, network components, device shadow components, seven-layer load balancing software, the device comprising:
[0010] A request forwarding unit, when receiving a network connection request of a specified Internet of Things device, randomly forwards the network connection request to any specified network component through a polling strategy of the four-layer load balancing software;
[0011] A networking information generating unit, processing the network connection request through the specified network component, and establishing a connection between the specified Internet of Things device and the registration center to generate networking information of the specified Internet of Things device;
[0012] A device deployment unit, sending the networking information of the specified Internet of Things device and device real-time data of the specified Internet of Things device to a specified device shadow component, so as to manage the networking information and the device real-time data by the specified device shadow component, and when a user issues a control request of the specified Internet of Things device, randomly forwarding the control request to any device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any device shadow component is the specified device shadow component, determining the specified network component through the networking information and the device real-time data in the specified device shadow component, sending the control request to the specified network component, and issuing the control request to the specified Internet of Things device through the specified network component.
[0013] The one or more embodiments of the specification provide a communication device of a distributed device registration center, the distributed device registration center comprising four-layer load balancing software, network components, device shadow components, seven-layer load balancing software, comprising:
[0014] At least one processor; and,
[0015] The memory is in communication with the at least one processor; wherein,
[0016] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0017] When receiving a network connection request of a specified Internet of Things device, randomly forwarding the network connection request to any specified network component through a polling strategy of the four-layer load balancing software;
[0018] Processing the network connection request through the specified network component, and establishing a connection between the specified Internet of Things device and the registration center to generate networking information of the specified Internet of Things device;
[0019] The networking information of the specified IoT device and the device real-time data of the specified IoT device are sent to a specified device shadow component, so that the networking information and the device real-time data are managed by the specified device shadow component, and when a user issues a control request for the specified IoT device, the control request is randomly forwarded to any device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any device shadow component is the specified device shadow component, the specified network component is determined by the specified device shadow component through the networking information and the device real-time data, the control request is sent to the specified network component, and the control request is sent to the specified IoT device through the specified network group.
[0020] One or more embodiments of the present specification provide a non-volatile computer storage medium, which stores computer executable instructions, the computer executable instructions are configured to:
[0021] The application is applied to a distributed device registration center, and the distributed device registration center includes four-layer load balancing software, a network component, a device shadow component, and seven-layer load balancing software.
[0022] When receiving a network connection request of a specified IoT device, the network connection request is randomly forwarded to any specified network component through a polling strategy of the four-layer load balancing software.
[0023] The network connection request is processed through the specified network component, and the specified IoT device is connected with the registration center to generate networking information of the specified IoT device.
[0024] The networking information of the specified IoT device and the device real-time data of the specified IoT device are sent to a specified device shadow component, so that the networking information and the device real-time data are managed by the specified device shadow component, and when a user issues a control request for the specified IoT device, the control request is randomly forwarded to any device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any device shadow component is the specified device shadow component, the specified network component is determined by the specified device shadow component through the networking information and the device real-time data, the control request is sent to the specified network component, and the control request is sent to the specified IoT device through the specified network group.
[0025] The at least one technical solution adopted by the embodiments of the present specification can achieve the following beneficial effects: when the embodiments of the present specification specify the network connection of the Internet of Things device, the specified Internet of Things device is networked through the specified network component, and the generated networking information of the specified Internet of Things device is sent to the specified device shadow component, so that when the user subsequently controls the specified Internet of Things device, the specified network component is determined through the networking information in the specified device shadow component, and finally the control request is sent to the specified Internet of Things device through the specified network component, to complete the control of the specified Internet of Things device. When the number of Internet of Things device connections increases, it can be freely expanded and there is no single point of failure risk. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor. In the drawings:
[0027] Figure 1 Flowchart of a communication method of a distributed device registration center provided for one or more embodiments of the present specification
[0028] Figure 2 Architecture diagram of a distributed device registration center provided for one or more embodiments of the present specification
[0029] Figure 3 Flowchart of Internet of Things device data uplink provided for one or more embodiments of the present specification
[0030] Figure 4 Flowchart of Internet of Things device data downlink provided for one or more embodiments of the present specification
[0031] Figure 5 Structure diagram of a communication device of a distributed device registration center provided for one or more embodiments of the present specification
[0032] Figure 6 Structure diagram of a communication device of a distributed device registration center provided for one or more embodiments of the present specification DETAILED DESCRIPTION
[0033] The embodiments of the present specification provide a communication method, device, equipment and medium of a distributed device registration center.
[0034] Generally, the Internet of Things device connects the Internet of Things platform using TCP, MQTT, CoAP and other protocols. Using these protocols requires the device to establish a long connection with the platform. When the platform accesses the device quantity increases, the Internet of Things platform supporting only a single node will inevitably cause performance bottlenecks. If the server of the deployed platform is down or the platform service fails, the entire platform will be unavailable.
[0035] In the face of the problem of increasing the number of device connections, the general solution of the current industry is to deploy multiple network connection instances. The device is artificially divided into connection platform instances. This solution can solve the concurrent pressure of increasing the number of connections, but the path of connecting the device to the platform is fixed and cannot reduce the risk of local downtime because the device connection cannot be automatically migrated after a certain node failure.
[0036] In order for those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in conjunction with the drawings in the specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all embodiments. Based on the embodiments of the specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the specification.
[0037] Figure 1 A flowchart of a communication method of a distributed device registration center provided for one or more embodiments of the specification, which can be executed by a communication system of the distributed device registration center. Some input parameters or intermediate results in the flow allow manual intervention to adjust to help improve accuracy.
[0038] The distributed device registration center of the embodiments of the specification can include four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software. The method flow steps of the embodiments of the specification are as follows:
[0039] S102, when receiving a network connection request of a specified Internet of Things device, randomly forwarding the network connection request to any specified network component through a round-robin strategy of the four-layer load balancing software.
[0040] In the embodiments of the specification, the specified Internet of Things device can include smart home devices, industrial sensors, smart cars, smart cameras, and manufacturing robots. When the specified Internet of Things device is an industrial sensor, users can use the connected sensor device to collect data of their factory equipment and monitor potential problems of the assembly line. Internet of Things sensors can help improve operational visibility, maintenance planning, and logistics by monitoring equipment and specific resource consumption rates.
[0041] In the embodiments of the present application, the network connection request can be a request for a specified IoT device to connect to an IoT platform. The network component can be used for the connection between the platform and the specified IoT device, and the maintained state information is persisted in the database, which is updated when the specified IoT device is disconnected or reconnected.
[0042] In the embodiments of the present application, the network connection request is forwarded to the specified network component through the round-robin strategy of the four-layer load balancing software. Since the four-layer load balancing software uses the round-robin strategy to distribute requests, each network component is equally replaceable, and there is no single point risk.
[0043] It should be noted that the four-layer load balancing software can be IP+port-based load balancing: on the basis of three-layer load balancing, the IP address of the three-layer is published, and then the port number of the four-layer is added. The target address and port in the message, and the network component selection method set by the load balancing device, determine the final selection of the specified network component.
[0044] S104, processing the network connection request through the specified network component, and establishing a connection between the specified IoT device and the registration center to generate networking information of the specified IoT device.
[0045] In the embodiments of the present application, when the network component processes the network connection request, the association between the specified IoT device and the specified network component can be recorded in the database, and the networking information can include the association between the specified IoT device and the specified network component, and the metadata of the specified IoT device.
[0046] S106, sending the networking information of the specified IoT device and the real-time device data of the specified IoT device to the specified device shadow component, so that the networking information and the real-time device data are managed by the specified device shadow component, and when a user issues a control request for the specified IoT device, the control request is randomly forwarded to any device shadow component through the round-robin strategy of the seven-layer load balancing software. If it is determined that the any device shadow component is the specified device shadow component, the control request is sent to the specified network component through the networking information and the real-time device data of the specified device shadow component, and the control request is sent to the specified IoT device through the specified network component.
[0047] In the embodiments of the present application, the device shadow component is a virtual mapping (which can be understood as a json document) of the specified Internet of Things device in the cloud, which is used to record the recent state and expected state of the specified Internet of Things device, and the cloud can control the state of the specified Internet of Things device through the device shadow component. The seven-layer load balancing software can be a virtual URL or host IP-based load balancing: on the basis of four-layer load balancing, the characteristics of the application layer are also considered, that is, the meaningful application layer content in the control request is controlled, and the device shadow component selection mode set by the load balancing device is used to determine the final selected specified device shadow component.
[0048] Before the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device are sent to the specified device shadow component, the ID of the specified device shadow component can be subjected to hash calculation to obtain a first hash value; the first hash value is subjected to modulo operation on 2^32 of the hash ring to obtain a first modulo result, and the first modulo result is mapped to the hash ring; the ID of the specified Internet of Things device is subjected to hash calculation to obtain a second hash value; the second hash value is subjected to modulo operation on 2^32 of the hash ring to obtain a second modulo result; finally, the second modulo result is clockwise searched to obtain the adjacent first modulo result, and the specified Internet of Things device is associated with the specified device shadow component. The algorithm is a consistent hash algorithm, which organizes the entire hash value space into a hash ring in a clockwise direction, and the hash ring is composed of 2^32 points.
[0049] It should be noted that through the above process, only a small part of data in the ring space needs to be relocated when the device shadow component is added or deleted, and only part of the cache will be invalidated, so that all pressure is not concentrated on the backend server at the same time, and good fault tolerance and scalability are achieved.
[0050] In the embodiments of the present application, when it is determined that the arbitrary device shadow component is the specified device shadow component, the second modulo result can be clockwise searched to obtain a third modulo result of the adjacent arbitrary device shadow component; if it is determined that the arbitrary device shadow component stores the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device, it is determined that the arbitrary device shadow component is the specified device shadow component.
[0051] Further, in the embodiments of the present application, if it is determined that the arbitrary device shadow component is not the specified device shadow component, the remaining device shadow components can be determined whether there is the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device, so as to determine the specified device shadow component in the remaining device shadow components, and the control request is forwarded to the specified device shadow component.
[0052] In the embodiments of the present specification, the data continuously reported by the specified Internet of Things device often has a causal relationship. Once the data of the specified Internet of Things device is allocated to different instances, the device event cannot be closed. Therefore, after the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device are sent to the specified device shadow component, the specified device shadow component can be partitioned according to the networking information and the device real-time data to determine a first partition of the specified Internet of Things device in the specified device shadow component, and the networking information and the device real-time data are stored in the first partition. Finally, after generating other networking information and device data of the specified Internet of Things device, the other networking information and real-time data of the specified Internet of Things device are stored in the first partition.
[0053] In the embodiments of the present specification, if the specified device shadow component is disconnected, since the networking information of the specified Internet of Things device is processed by a consistent hashing algorithm, the platform has good fault tolerance and scalability. In the implementation process, other normally working device shadow components can be determined first, and then the networking information is sent to the other normally working device shadow components, and the other normally working device shadow components are partitioned according to the networking information to determine a second partition of the specified Internet of Things device in the other normally working device shadow components, and the networking information is stored in the second partition. After generating other networking information of the specified Internet of Things device, the other networking information of the specified Internet of Things device is stored in the second partition.
[0054] It should be noted that the connection between the Internet of Things device and the Internet of Things platform in the embodiments of the present specification is stateful, and cannot directly use simple load balancing to share server pressure. In the face of a large number of Internet of Things device connection scenarios, the distributed device registry center can arbitrarily scale the number of application instances. After a single node fails, it can automatically adjust and reallocate instance tasks, thereby avoiding the risk of the entire system being unavailable and reducing system failure time.
[0055] It should be noted that in combination with the above technical features, the embodiments of the present specification propose a distributed device registry center of an Internet of Things platform. When the number of device connections increases, the device registry center can be freely expanded and has no single point of failure risk.
[0056] The distributed device registry center is composed of four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software.
[0057] The functions of each component are introduced as follows.
[0058] The four-layer load balancing software is used to forward network connection requests from the Internet of Things device.
[0059] The network component is the actual receiver of the service from the IoT device connection. The four-layer load balancing software uses a round-robin strategy for the request distribution of the network component, so all network components are equal, and the addition and deletion of nodes will not affect the entire service.
[0060] The device shadow component maintains the metadata and real-time data of the device. The "shadow" of the specified IoT device in the information system is constructed through the calculation of these data. The platform must ensure that the data reported by the same specified IoT device is always distributed to a certain device shadow component, because the data continuously reported by the specified IoT device often has a causal relationship, and once the specified IoT device data is allocated to different instances, it will cause the specified IoT device event to be unable to close. In addition, the metadata of the specified IoT device can be cached in the application according to the partition, to speed up the data access speed in the calculation process. In order to ensure that the data reported by the same specified IoT device is always distributed to the same device shadow component, the platform uses a consistent hashing algorithm to partition the device shadow instance managed by the device shadow component. When the device shadow component is added or deleted, the re-partitioning of the device shadow will be automatically triggered. Finally, the continuous availability of the device shadow component is ensured.
[0061] The seven-layer load balancing software is used to distribute the request data from the user.
[0062] The relationship between the components in the distributed device registration center can be seen in Figure 2 The distributed device registration center architecture diagram is shown.
[0063] The process of IoT device data uplink and downlink is introduced as follows:
[0064] The IoT device data uplink flowchart is shown in Figure 3 , and the details are as follows:
[0065] 1. The device is connected to the four-layer load balancing software;
[0066] 2. The four-layer load balancing software uses a round-robin strategy to forward the connection service to a network component;
[0067] 3. The network component records the association relationship between the IoT device and the current network component in the database;
[0068] 4. The network component processes the network connection from the IoT device, and uses a consistent hashing algorithm to send the device data to a device shadow node;
[0069] 5. The device shadow node processes and stores the IoT device data.
[0070] The IoT device data downlink flowchart is shown in Figure 4 , and the details are as follows:
[0071] 1. The user initiates a control device request to the platform;
[0072] 2. The seven-layer load balancing software uses a round-robin strategy to forward the request to a device shadow node;
[0073] 3. The device shadow node determines whether the device to be controlled is managed by the node, and if not, forwards to the actual management shadow node. The basis for the determination is a consistent hashing algorithm;
[0074] 4. The shadow node obtains the Internet of Things device information for verification, obtains the actual network components connected by the Internet of Things device, and notifies the request to the network component;
[0075] 5. The network component issues a device control instruction.
[0076] The following describes how each component solves the single point of failure to achieve automatic expansion:
[0077] 1. Network component: This component is used for the connection between the platform and the device, and the state information maintained is persisted to the database. The device disconnection or reconnection updates the information. Since the four-layer load balancing software uses a round-robin strategy to distribute requests, each network component is equally replaceable and there is no single point of risk.
[0078] 2. Device shadow component: Each device shadow component specifically manages the shadow of which device, depending on the unique ID of the device and the number of device shadow components in the cluster. As known from the consistent hashing algorithm, when the device is determined and the number of device shadow components in the cluster is determined, a unique device shadow component can be obtained. When the number of device shadow components in the cluster changes, the relationship can be recalculated and there is no single point of risk.
[0079] Figure 5 A structural diagram of a communication device of a distributed device registration center is provided for one or more embodiments of the present specification, the distributed device registration center comprising four-layer load balancing software, a network component, a device shadow component, and seven-layer load balancing software. The device comprises a request forwarding unit 502, a networking information generation unit 504, and a device deployment unit 506.
[0080] The request forwarding unit 502, upon receiving a network connection request for a specified Internet of Things device, randomly forwards the network connection request to any specified network component through the round-robin strategy of the four-layer load balancing software;
[0081] The networking information generation unit 504 processes the network connection request through the specified network component and establishes a connection between the specified Internet of Things device and the registration center to generate the networking information of the specified Internet of Things device;
[0082] The device deployment unit 506 sends the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device to the specified device shadow component, so that the networking information and the device real-time data are managed by the specified device shadow component, and when a user issues a control request for the specified Internet of Things device, the control request is randomly forwarded to any device shadow component through the polling strategy of the seven-layer load balancing software, if it is determined that the any device shadow component is the specified device shadow component, the control request is sent to the specified network component through the networking information and the device real-time data of the specified device shadow component, and the control request is sent to the specified Internet of Things device through the specified network component.
[0083] Further, before the device deployment unit 506 performs the sending of the networking information of the specified Internet of Things device and the device real-time data of the specified Internet of Things device to the specified device shadow component, the apparatus further comprises a device association unit.
[0084] The device association unit is configured to perform hash calculation on the ID of the specified device shadow component to obtain a first hash value, perform modulo operation on the first hash value with respect to 2^32 of a hash ring to obtain a first modulo result, and map the first modulo result to the hash ring, perform hash calculation on the ID of the specified Internet of Things device to obtain a second hash value, perform modulo operation on the second hash value with respect to 2^32 of the hash ring to obtain a second modulo result, and find the adjacent first modulo result according to the second modulo result in a clockwise direction, and associate the specified Internet of Things device with the specified device shadow component.
[0085] Figure 6 A structural schematic diagram of a communication device of a distributed device registration center is provided for one or more embodiments of the present specification, the distributed device registration center comprising four-layer load balancing software, a network component, a device shadow component, and seven-layer load balancing software, comprising:
[0086] at least one processor; and
[0087] a memory connected in communication with the at least one processor; wherein
[0088] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0089] When a network connection request of a specified Internet of Things device is received, the network connection request is randomly forwarded to any specified network component through the polling strategy of the four-layer load balancing software;
[0090] processing the network connection request through the specified network component, and establishing a connection between the specified IoT device and the registration center to generate networking information of the specified IoT device;
[0091] sending the networking information of the specified IoT device and device real-time data of the specified IoT device to a specified device shadow component, so as to manage the networking information and the device real-time data by the specified device shadow component, and when a user issues a control request for the specified IoT device, randomly forwarding the control request to any one device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any one device shadow component is the specified device shadow component, sending the control request to the specified network component through the specified device shadow component by determining the specified network component through the networking information and the device real-time data, and downlinking the control request to the specified IoT device through the specified network component.
[0092] The one or more embodiments of the present specification provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:
[0093] applied to a distributed device registration center, the distributed device registration center includes four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software;
[0094] when receiving a network connection request of a specified IoT device, randomly forwarding the network connection request to any one specified network component through a polling strategy of the four-layer load balancing software;
[0095] processing the network connection request through the specified network component, and establishing a connection between the specified IoT device and the registration center to generate networking information of the specified IoT device;
[0096] sending the networking information of the specified IoT device and device real-time data of the specified IoT device to a specified device shadow component, so as to manage the networking information and the device real-time data by the specified device shadow component, and when a user issues a control request for the specified IoT device, randomly forwarding the control request to any one device shadow component through a polling strategy of the seven-layer load balancing software, if it is determined that the any one device shadow component is the specified device shadow component, sending the control request to the specified network component through the specified device shadow component by determining the specified network component through the networking information and the device real-time data, and downlinking the control request to the specified IoT device through the specified network component.
[0097] Each of the various embodiments in this specification are described in a progressive manner, and the same or similar parts among the various embodiments can be mutually referred to, and each of the various embodiments focuses on the differences from other embodiments. In particular, for the device, apparatus, and non-transitory computer storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0098] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous or necessary.
[0099] The above only describes one or more embodiments of the present specification and is not intended to limit the present specification. One or more embodiments of the present specification can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A communication method for a distributed device registration center, characterized in that: The distributed device registration center includes four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software. The method includes: Upon receiving a network connection request from a designated IoT device, randomly forwarding the network connection request to any designated network component through the polling strategy of the four-layer load balancing software; Processing the network connection request through the designated network component and establishing a connection between the designated IoT device and a distributed device registration center to generate networking information of the designated IoT device; Sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, so that the networking information and the real-time device data are managed by the designated device shadow component, and when a user issues a control request for the designated IoT device, randomly forwarding the control request to any device shadow component through the polling strategy of the seven-layer load balancing software; if it is determined that any one of the device shadow components is the designated device shadow component, the designated device shadow component determines the designated network component through the networking information and the real-time device data, sends the control request to the designated network component, and sends the control request to the designated IoT device through the designated network group; Before sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Performing a hash calculation on the ID of the specified device shadow component to obtain a first hash value; Performing a modulo operation on the first hash value with respect to 2^32 of the hash ring to obtain a first modulo result, and mapping the first modulo result to the hash ring; performing a hash calculation on the ID of the designated IoT device to obtain a second hash value; Performing a modulo operation on the second hash value with respect to 2^32 of the hash ring to obtain a second modulo result; Search clockwise based on the second modulo result to obtain the adjacent first modulo result, and associate the specified IoT device with the specified device shadow component; The determining that any one of the device shadow components is the designated device shadow component specifically includes: Search clockwise based on the second modulo result to obtain a third modulo result of any adjacent device shadow component; If it is determined that any one of the device shadow components stores the networking information and the real-time data of the device of the designated IoT device, determining that the any one of the device shadow components is the designated device shadow component; After sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Partitioning the designated device shadow component according to the networking information and the device real-time data to determine a first partition of the designated IoT device in the designated device shadow component, and storing the networking information and the device real-time data in the first partition; After generating other networking information and device data of the designated IoT device, storing the other networking information and real-time data of the designated IoT device in the first partition; If the designated device shadow component is disconnected, the method further includes: Sending the networking information to other normally functioning device shadow components, partitioning the other normally functioning device shadow components according to the networking information to determine a second partition of the designated IoT device in the other normally functioning device shadow components, and storing the networking information in the second partition; After generating other networking information of the designated Internet of Things device, the other networking information of the designated Internet of Things device is stored in the second partition.
2. The method according to claim 1, characterized in that If it is determined that any one of the device shadow components is not the designated device shadow component, the method further includes: Determine the designated device shadow component among the remaining device shadow components; Forward the control request to the specified device shadow component.
3. A communication device for a distributed device registration center, characterized in that: The distributed device registration center includes four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software. The device includes: a request forwarding unit, which, upon receiving a network connection request from a designated IoT device, randomly forwards the network connection request to any designated network component through the polling strategy of the four-layer load balancing software; a networking information generating unit, which processes the network connection request through the designated network component and establishes a connection between the designated IoT device and a distributed device registration center to generate networking information of the designated IoT device; The device deployment unit sends the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, so that the networking information and the real-time device data are managed by the designated device shadow component. When a user issues a control request for the designated IoT device, the device deployment unit randomly forwards the control request to any device shadow component through the polling strategy of the seven-layer load balancing software. If the any device shadow component is determined to be the designated device shadow component, the designated device shadow component determines the designated network component through the networking information and the real-time device data, sends the control request to the designated network component, and then issues the control request to the designated IoT device through the designated network group. Before the device deployment unit executes the sending of the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the apparatus further includes: a device association unit; The device association unit is configured to perform a hash calculation on the ID of the specified device shadow component to obtain a first hash value; perform a modulo operation on the first hash value with respect to 2^32 of the hash ring to obtain a first modulo result, and map the first modulo result to the hash ring; perform a hash calculation on the ID of the specified IoT device to obtain a second hash value; perform a modulo operation on the second hash value with respect to 2^32 of the hash ring to obtain a second modulo result; perform a clockwise search based on the second modulo result to obtain an adjacent first modulo result, and associate the specified IoT device with the specified device shadow component; The determining that any one of the device shadow components is the designated device shadow component specifically includes: Search clockwise based on the second modulo result to obtain a third modulo result of any adjacent device shadow component; If it is determined that any one of the device shadow components stores the networking information and the real-time data of the device of the designated IoT device, determining that the any one of the device shadow components is the designated device shadow component; After sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Partitioning the designated device shadow component according to the networking information and the device real-time data to determine a first partition of the designated IoT device in the designated device shadow component, and storing the networking information and the device real-time data in the first partition; After generating other networking information and device data of the designated IoT device, storing the other networking information and real-time data of the designated IoT device in the first partition; If the specified device shadow component is disconnected, the method further includes: Sending the networking information to other normally functioning device shadow components, partitioning the other normally functioning device shadow components according to the networking information to determine a second partition of the designated IoT device in the other normally functioning device shadow components, and storing the networking information in the second partition; After generating other networking information of the designated Internet of Things device, the other networking information of the designated Internet of Things device is stored in the second partition.
4. A communication device of a distributed device registration center, characterized in that: The distributed device registration center includes four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software, including: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Upon receiving a network connection request from a designated IoT device, randomly forwarding the network connection request to any designated network component through the polling strategy of the four-layer load balancing software; Processing the network connection request through the designated network component and establishing a connection between the designated IoT device and a distributed device registration center to generate networking information of the designated IoT device; Sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, so that the networking information and the real-time device data are managed by the designated device shadow component, and when a user issues a control request for the designated IoT device, randomly forwarding the control request to any device shadow component through the polling strategy of the seven-layer load balancing software; if it is determined that any one of the device shadow components is the designated device shadow component, the designated device shadow component determines the designated network component through the networking information and the real-time device data, sends the control request to the designated network component, and sends the control request to the designated IoT device through the designated network group; Before sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Performing a hash calculation on the ID of the specified device shadow component to obtain a first hash value; Performing a modulo operation on the first hash value with respect to 2^32 of the hash ring to obtain a first modulo result, and mapping the first modulo result to the hash ring; performing a hash calculation on the ID of the designated IoT device to obtain a second hash value; Performing a modulo operation on the second hash value with respect to 2^32 of the hash ring to obtain a second modulo result; Search clockwise based on the second modulo result to obtain the adjacent first modulo result, and associate the specified IoT device with the specified device shadow component; The determining that any one of the device shadow components is the designated device shadow component specifically includes: Search clockwise based on the second modulo result to obtain a third modulo result of any adjacent device shadow component; If it is determined that any one of the device shadow components stores the networking information and the real-time data of the device of the designated IoT device, determining that the any one of the device shadow components is the designated device shadow component; After sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Partitioning the designated device shadow component according to the networking information and the device real-time data to determine a first partition of the designated IoT device in the designated device shadow component, and storing the networking information and the device real-time data in the first partition; After generating other networking information and device data of the designated IoT device, storing the other networking information and real-time data of the designated IoT device in the first partition; If the specified device shadow component is disconnected, the method further includes: Sending the networking information to other normally functioning device shadow components, partitioning the other normally functioning device shadow components according to the networking information to determine a second partition of the designated IoT device in the other normally functioning device shadow components, and storing the networking information in the second partition; After generating other networking information of the designated Internet of Things device, the other networking information of the designated Internet of Things device is stored in the second partition.
5. A non-volatile computer storage medium, characterized in that Computer-executable instructions are stored, and the computer-executable instructions are configured to: Applied to a distributed device registration center, which includes four-layer load balancing software, network components, device shadow components, and seven-layer load balancing software; Upon receiving a network connection request from a designated IoT device, randomly forwarding the network connection request to any designated network component through the polling strategy of the four-layer load balancing software; Processing the network connection request through the designated network component and establishing a connection between the designated IoT device and a distributed device registration center to generate networking information of the designated IoT device; Sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, so that the networking information and the real-time device data are managed by the designated device shadow component, and when a user issues a control request for the designated IoT device, randomly forwarding the control request to any device shadow component through the polling strategy of the seven-layer load balancing software; if it is determined that any one of the device shadow components is the designated device shadow component, the designated device shadow component determines the designated network component through the networking information and the real-time device data, sends the control request to the designated network component, and sends the control request to the designated IoT device through the designated network group; Before sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Performing a hash calculation on the ID of the specified device shadow component to obtain a first hash value; Performing a modulo operation on the first hash value with respect to 2^32 of the hash ring to obtain a first modulo result, and mapping the first modulo result to the hash ring; performing a hash calculation on the ID of the designated IoT device to obtain a second hash value; Performing a modulo operation on the second hash value with respect to 2^32 of the hash ring to obtain a second modulo result; Search clockwise based on the second modulo result to obtain the adjacent first modulo result, and associate the specified IoT device with the specified device shadow component; The determining that any one of the device shadow components is the designated device shadow component specifically includes: Search clockwise based on the second modulo result to obtain a third modulo result of any adjacent device shadow component; If it is determined that any one of the device shadow components stores the networking information and the real-time data of the device of the designated IoT device, determining that the any one of the device shadow components is the designated device shadow component; After sending the networking information of the designated IoT device and the real-time device data of the designated IoT device to the designated device shadow component, the method further includes: Partitioning the designated device shadow component according to the networking information and the device real-time data to determine a first partition of the designated IoT device in the designated device shadow component, and storing the networking information and the device real-time data in the first partition; After generating other networking information and device data of the designated IoT device, storing the other networking information and real-time data of the designated IoT device in the first partition; If the specified device shadow component is disconnected, the method further includes: Sending the networking information to other normally functioning device shadow components, partitioning the other normally functioning device shadow components according to the networking information to determine a second partition of the designated IoT device in the other normally functioning device shadow components, and storing the networking information in the second partition; After generating other networking information of the designated Internet of Things device, the other networking information of the designated Internet of Things device is stored in the second partition.
Citation Information
Patent Citations
Internet of Things platform equipment interaction control method
CN111953752A
Intelligent equipment shadow management method, system and device, equipment and medium
CN114726806A