Distributed communication method and system based on Internet of Things

By using the WebSocket protocol to establish a long connection between the Internet of Things devices and clients, the problem of low efficiency and difficulty in realizing the sharing of data from multiple devices in existing Internet of Things communication is solved, and low-latency and high-efficiency Internet of Things communication is achieved.

CN119967017APending Publication Date: 2025-05-09当趣网络科技(杭州)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411963774.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In existing Internet of Things communication, the HTTP protocol is used between the client APP and the server, which makes the server unable to actively send messages to the designated client. The client needs to continuously poll, resulting in high network costs and large delays, and it is difficult to realize data sharing among multiple devices.

Method used

By using the WebSocket protocol to establish a long connection between the Internet of Things devices and clients, the IoT device establishes a long connection with the IoT WebSocket service cluster, the client and the client WebSocket service cluster, to realize communication with the application server, thereby allowing the server to actively push messages.

Benefits of technology

It reduces the delay and network costs of IoT communication, improves communication efficiency, supports multiple devices to share data, and realizes server-side capacity expansion, and supports millions of equipment to be online at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119967017A_ABST
    Figure CN119967017A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed communication method and system based on the Internet of Things, and relates to the field of Internet of Things communication, and the system comprises an IoT device, a client, a service cluster and an application server. The service cluster comprises an IoT (Internet of Things) WebSocket service cluster and a client WebSocket service cluster; the IoT device establishes a long connection with the IoT WebSocket service cluster, and communicates with the application server side through the IoT WebSocket service cluster; and the client establishes a long connection with the client WebSocket service cluster, and communicates with the application server through the client WebSocket service cluster. According to the invention, the problem of low communication efficiency of the Internet of Things is solved. The long connection is established and maintained among the client, the IoT device and the server through the WebSocket protocol, the server can actively send the message to the specified client, and the communication delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet of Things (IoT) communication, and in particular to distributed communication methods, systems, electronic devices, and storage media based on IoT. Background Technology

[0002] The core of the Internet of Things (IoT) lies in the interconnection of objects with networks through information sensing devices and in accordance with agreed protocols. Objects exchange and communicate information through information transmission media to achieve functions such as intelligent identification, positioning, tracking, and monitoring.

[0003] In related technologies, client apps and servers typically communicate using the HTTP network protocol. Since HTTP is stateless, meaning the server cannot proactively send messages to a specific client, client apps generally have to obtain updated data by continuously polling. This method is costly, has high latency, and can put significant pressure on the server when the request volume is large. Furthermore, it makes it difficult to share data across multiple devices.

[0004] Currently, no effective solution has been proposed to address the low communication efficiency of IoT technologies. Summary of the Invention

[0005] This application provides a distributed communication method, system, electronic device, and storage medium based on the Internet of Things (IoT) to at least solve the problem of low communication efficiency in the related art.

[0006] In a first aspect, embodiments of this application provide a distributed communication system based on the Internet of Things (IoT), the system comprising: IoT devices, clients, a service cluster, and an application server.

[0007] The service cluster includes an IoT WebSocket service cluster and a client WebSocket service cluster;

[0008] The IoT device is used to establish a long connection with the IoT WebSocket service cluster and communicate with the application server through the IoT WebSocket service cluster;

[0009] The client is used to establish a long connection with the client WebSocket service cluster and communicate with the application server through the client WebSocket service cluster.

[0010] In some embodiments, the application server includes:

[0011] The first parsing module is configured to receive a first instruction sent by the IoT device through the IoT WebSocket service cluster, update data according to the first instruction, and send the updated data to the client through the client WebSocket service cluster; and / or

[0012] The second parsing module is used to receive the second instruction sent by the client through the client WebSocket service cluster, parse the second instruction to obtain the parsing result, and send the second instruction to the IoT device corresponding to the parsing result through the IoT WebSocket service cluster.

[0013] In some embodiments, the IoT device includes: a first connection module and a first communication module.

[0014] The first connection module is used to send a connection request to the IoT WebSocket service cluster and establish a long connection with the IoT WebSocket service cluster;

[0015] The first communication module is used to generate a first instruction based on user operation and send the first instruction to the application server through the IoT WebSocket service cluster.

[0016] In some embodiments, the client includes: a second connection module and a second communication module.

[0017] The second connection module is used to send a connection request to the client WebSocket service cluster and establish a long connection with the client WebSocket service cluster;

[0018] The second communication module is used to generate a second instruction based on user operation and send the second instruction to the application server through the client WebSocket service cluster.

[0019] Secondly, embodiments of this application provide a distributed communication method based on the Internet of Things (IoT), the method being applied to IoT devices; the method includes:

[0020] Send a connection request to the IoT WebSocket service cluster and establish a long connection with the IoT WebSocket service cluster;

[0021] A first instruction is generated based on user operation. The first instruction is sent to the application server through the IoT WebSocket service cluster to instruct the application server to update the data according to the first instruction, and then send the updated data to the client through the client WebSocket service cluster.

[0022] In some embodiments, establishing a long connection with the IoT WebSocket service cluster includes:

[0023] After receiving a successful connection response from the IoT WebSocket service cluster, a heartbeat message is sent to the IoT WebSocket service cluster, and a heartbeat response message is received from the IoT WebSocket service cluster.

[0024] In some embodiments, after establishing a long connection with the IoT WebSocket service cluster, the method further includes:

[0025] Send its own terminal device information to the IoT WebSocket service cluster, and instruct the IoT WebSocket service cluster to synchronize the terminal device information to the application server.

[0026] In some embodiments, the method further includes:

[0027] The second instruction sent by the client is received through the IoT WebSocket service cluster and the client WebSocket service cluster;

[0028] Respond to the second instruction.

[0029] Thirdly, embodiments of this application provide a distributed communication method based on the Internet of Things (IoT), the method being applied to a client; the method includes:

[0030] Send a connection request to the client WebSocket service cluster and establish a long connection with the client WebSocket service cluster;

[0031] A second instruction is generated based on the user's operation. The second instruction is sent to the application server through the client WebSocket service cluster, so that the application server can parse the second instruction to obtain the parsing result and send the second instruction to the IoT device corresponding to the parsing result through the IoTWebSocket service cluster.

[0032] In some embodiments, after establishing a long connection with the client WebSocket service cluster, the method further includes:

[0033] Send its own client device information to the client WebSocket service cluster, and instruct the client WebSocket service cluster to synchronize the client device information to the application server.

[0034] Fourthly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the distributed communication method based on the Internet of Things as described in the second or third aspect above.

[0035] Fifthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the distributed communication method based on the Internet of Things as described in the second or third aspect above.

[0036] Compared to related technologies, the distributed communication system based on the Internet of Things (IoT) provided in this application includes: IoT devices, clients, service clusters, and application servers. The service clusters include an IoT WebSocket service cluster and a client WebSocket service cluster. IoT devices establish long-lived connections with the IoT WebSocket service cluster and communicate with the application server through the IoT WebSocket service cluster. Clients establish long-lived connections with the client WebSocket service cluster and communicate with the application server through the client WebSocket service cluster, thus solving the problem of low communication efficiency in the IoT. By establishing and maintaining long-lived connections between the client, IoT devices, and servers through the WebSocket protocol, the server can proactively send messages to designated clients, reducing communication latency. Attached Figure Description

[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0038] Figure 1 This is a schematic diagram of the application environment of the distributed communication method based on the Internet of Things according to the embodiments of this application;

[0039] Figure 2 This is a structural block diagram of a distributed communication system based on the Internet of Things according to an embodiment of this application;

[0040] Figure 3 This is a flowchart of a distributed communication method based on the Internet of Things according to an embodiment of this application;

[0041] Figure 4 This is a flowchart illustrating the establishment and maintenance of a long connection between an IoT device and an IoT WebSocket service cluster, according to an embodiment of this application.

[0042] Figure 5 This is a flowchart illustrating the operation performed by an IoT device according to an embodiment of this application;

[0043] Figure 6 This is a flowchart of another distributed communication method based on the Internet of Things according to an embodiment of this application;

[0044] Figure 7 This is a flowchart illustrating the establishment and maintenance of a long connection between a client and a client WebSocket service cluster according to an embodiment of this application;

[0045] Figure 8 This is a flowchart illustrating a client-side operation according to an embodiment of this application;

[0046] Figure 9 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0048] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0049] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0050] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] This embodiment provides a distributed communication system based on the Internet of Things (IoT). This system is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0052] Figure 1 This is a schematic diagram illustrating an application environment for an IoT-based distributed communication method according to an embodiment of this application. The IoT-based distributed communication method provided in this application can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1As shown, the IoT WebSocket service cluster 102 communicates with the IoT device 101 and the application server 103 via the network, and the client WebSocket service cluster 104 communicates with the client 105 and the application server 103 via the network. The IoT device 101 establishes a long connection with the IoT WebSocket service cluster 102 and communicates with the application server 103 through the IoT WebSocket service cluster 102; the client 105 establishes a long connection with the client WebSocket service cluster 104 and communicates with the application server 102 through the client WebSocket service cluster 104.

[0053] Figure 2 This is a structural block diagram of an IoT-based distributed communication system according to an embodiment of this application, such as... Figure 2 As shown, the system includes: IoT device 21, client 22, service cluster 23 and application server 24.

[0054] Service cluster 23 includes an IoT WebSocket service cluster and a client WebSocket service cluster.

[0055] IoT device 21 is used to establish a long connection with the IoT WebSocket service cluster and communicate with the application server 24 through the IoT WebSocket service cluster.

[0056] In some embodiments, the IoT device 21 includes a first connection module and a first communication module.

[0057] The first connection module is used to send connection requests to the IoT WebSocket service cluster and establish a long connection with the IoT WebSocket service cluster.

[0058] When an IoT device is activated or started, it sends a connection request to the IoT WebSocket service cluster to establish and maintain a long connection. At the same time, the WebSocket service cluster synchronizes the device information to the application server.

[0059] The first communication module is used to generate a first instruction based on user operation and send the first instruction to the application server through the IoT WebSocket service cluster.

[0060] When a user interacts with an IoT device, the IoT device sends the corresponding command to the IoT WebSocket service cluster. The IoT WebSocket service cluster forwards the command to the application server. The application server parses the command, updates the data, and pushes the new data to the client app through the client WebSocket service cluster. The user can then view the updated data through the client app.

[0061] Client 22 is used to establish a long connection with the client WebSocket service cluster and communicate with the application server 24 through the client WebSocket service cluster.

[0062] In some embodiments, client 22 includes a second connection module and a second communication module.

[0063] The second connection module is used to send connection requests to the client WebSocket service cluster and establish a long connection with the client WebSocket service cluster.

[0064] The second communication module is used to generate a second instruction based on user operations and send the second instruction to the application server through the client WebSocket service cluster.

[0065] When a user interacts with the client app, the app sends the corresponding instructions to the client WebSocket service cluster. The client WebSocket service cluster forwards the instructions to the application server. The server parses the instructions, updates the data, and then sends the instructions to the IoT device for execution via the IoT WebSocket service cluster.

[0066] In some embodiments, the application server 24 includes:

[0067] The first parsing module is used to receive the first instruction sent by the IoT device through the IoT WebSocket service cluster, update the data according to the first instruction, and send the updated data to the client through the client WebSocket service cluster.

[0068] The second parsing module is used to receive the second instruction sent by the client through the client WebSocket service cluster, parse the second instruction to obtain the parsing result, and send the second instruction to the IoT device corresponding to the parsing result through the IoT WebSocket service cluster.

[0069] The first parsing module is used to parse the instructions sent by the IoT device, and the second parsing module is used to parse the instructions sent by the client.

[0070] The system can be used not only for currently used IoT devices (such as smart fish tanks), but also for scenarios such as large-screen karaoke, song selection, and payment.

[0071] Through the above system, IoT devices establish long-lived connections with the IoT WebSocket service cluster, communicating with the application server through the IoT WebSocket service cluster; clients establish long-lived connections with the client WebSocket service cluster, communicating with the application server through the client WebSocket service cluster, thus solving the problem of low communication efficiency in the Internet of Things. By establishing and maintaining long-lived connections between the client, IoT devices, and the server through the WebSocket protocol, the server can proactively send messages to designated clients, reducing communication latency. Simultaneously, it enables horizontal scaling of the server, supporting millions of devices online simultaneously, and supports multiple client apps online simultaneously and data sharing.

[0072] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0073] This embodiment provides a distributed communication method based on the Internet of Things (IoT), which is applied to IoT devices. Figure 3 This is a flowchart of a distributed communication method based on the Internet of Things according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps:

[0074] Step S301: Send a connection request to the IoT WebSocket service cluster and establish a long connection with the IoT WebSocket service cluster.

[0075] When an IoT device is activated or started, it sends a connection request to the IoT WebSocket service cluster to establish and maintain a long connection. At the same time, the WebSocket service cluster synchronizes the device information to the application server.

[0076] In some embodiments, establishing a long connection with the IoT WebSocket service cluster in step S301 includes:

[0077] Step S3011: After receiving the successful connection response from the IoT WebSocket service cluster, send a heartbeat message to the IoT WebSocket service cluster and receive the heartbeat response message from the IoT WebSocket service cluster.

[0078] Once an IoT device successfully connects to the IoT WebSocket service cluster, the IoT device will send a heartbeat message (PING) to the IoT WebSocket service cluster, and the IoT WebSocket service cluster will respond with a heartbeat message (PONG).

[0079] In some embodiments, after establishing a long connection with the IoT WebSocket service cluster, the method further includes:

[0080] In step S3012, the terminal device information is sent to the IoT WebSocket service cluster, and the IoT WebSocket service cluster is instructed to synchronize the terminal device information to the application server.

[0081] Figure 4 This is a flowchart illustrating the establishment and maintenance of a long connection between an IoT device and an IoT WebSocket service cluster according to an embodiment of this application, such as... Figure 4 As shown, the process includes:

[0082] Step S401: The user activates or starts the IoT device.

[0083] In step S402, the IoT device requests to establish a connection with the IoT WebSocket service cluster.

[0084] In step S403, the IoT WebSocket service cluster accepts the request, establishes and maintains the connection, and sends the device information of the IoT device to the application server.

[0085] Step S404: The IoT device initiates a heartbeat message (PING).

[0086] Step S405: The IoT WebSocket service cluster responds with a heartbeat message (PONG).

[0087] Continue to refer to Figure 3 After establishing a long connection with the IoT WebSocket service cluster, step S302 is executed.

[0088] Step S302: Generate a first instruction based on the user's operation, and send the first instruction to the application server through the IoT WebSocket service cluster to instruct the application server to update the data according to the first instruction, and send the updated data to the client through the client WebSocket service cluster.

[0089] When a user operates an IoT device, the IoT device and the client communicate and exchange data with the server through a WebSocket service cluster, enabling real-time data updates. Figure 5This is a flowchart illustrating the operation performed by an IoT device according to an embodiment of this application, such as... Figure 5 As shown, the process includes:

[0090] Step S501: The user operates the IoT device.

[0091] In step S502, the IoT device sends the corresponding operation command to the IoT WebSocket service cluster.

[0092] Step S503: The IoT WebSocket service cluster forwards instructions to the application server.

[0093] In step S504, the application server parses the operation command, updates the data, and pushes the new data to the client APP through the client WebSocket service cluster.

[0094] In step S505, the user views the new data after the operation through the client APP.

[0095] In some embodiments, the method further includes:

[0096] The system receives and responds to a second instruction sent by the client via an IoT WebSocket service cluster and a client WebSocket service cluster.

[0097] When a user generates a second command by operating the client APP, the client sends the second command to the client WebSocket service cluster. The client WebSocket service cluster forwards the command to the application server. The application server parses the second command, updates the data, and sends the second command to the IoT device for execution through the IoT WebSocket service cluster.

[0098] Through the above steps, a connection request is sent to the IoT WebSocket service cluster to establish a long-lived connection. A first instruction is generated based on the user's operation and sent to the application server via the IoT WebSocket service cluster, instructing the application server to update data according to the instruction. The updated data is then sent to the client via the client WebSocket service cluster, thus solving the problem of low communication efficiency in the Internet of Things (IoT). By establishing and maintaining a long-lived connection between the client, IoT device, and server through the WebSocket protocol, the server can proactively send messages to designated clients, reducing communication latency.

[0099] This embodiment also provides another distributed communication method based on the Internet of Things, which is applied to the client. Figure 6This is a flowchart of another distributed communication method based on the Internet of Things according to an embodiment of this application, such as... Figure 6 As shown, the process includes the following steps:

[0100] Step S601: Send a connection request to the client WebSocket service cluster and establish a long connection with the client WebSocket service cluster.

[0101] In some embodiments, after establishing a long-lived connection with the client WebSocket service cluster, the method further includes:

[0102] Send its own client device information to the client WebSocket service cluster and instruct the client WebSocket service cluster to synchronize the client device information to the application server.

[0103] Figure 7 This is a flowchart illustrating the establishment and maintenance of a long connection between a client and a client WebSocket service cluster according to an embodiment of this application, such as... Figure 7 As shown, the process includes:

[0104] Step S701: The user opens the client APP.

[0105] In step S702, the client APP requests to establish a connection with the client WebSocket service cluster.

[0106] In step S703, the client WebSocket service cluster accepts the request, establishes and maintains the connection, and sends the client's device information to the application server.

[0107] Step S704: The client initiates a heartbeat message (PING).

[0108] In step S705, the client WebSocket service cluster responds with a heartbeat message (PONG).

[0109] Continue to refer to Figure 6 After establishing a long connection with the client's WebSocket service cluster, step S602 is executed.

[0110] Step S602: Generate a second instruction based on the user's operation, send the second instruction to the application server through the client WebSocket service cluster, so as to instruct the application server to parse the second instruction to obtain the parsing result, and send the second instruction to the IoT device corresponding to the parsing result through the IoTWebSocket service cluster.

[0111] When a user interacts with the client app, the IoT device and the client communicate and exchange data with the server via a WebSocket service cluster, enabling real-time data updates. Figure 8 This is a flowchart of a client performing an operation according to an embodiment of this application, such as... Figure 8 As shown, the process includes:

[0112] Step S801: The user operates the client APP.

[0113] In step S802, the client APP sends the corresponding operation command to the client WebSocket service cluster.

[0114] Step S803: The client WebSocket service cluster forwards instructions to the application server.

[0115] In step S804, the application server parses the operation command, updates the data, and sends the command to the IoT device for execution through the IoT WebSocket service cluster.

[0116] Through the above steps, a connection request is sent to the client WebSocket service cluster, establishing a long-lived connection. A second command is generated based on the user's operation and sent to the application server via the client WebSocket service cluster. This instructs the application server to parse the second command and obtain the parsing result. Finally, the second command is sent to the corresponding IoT device via the IoTWebSocket service cluster, solving the problem of low communication efficiency in the Internet of Things (IoT). By establishing and maintaining a long-lived connection between the client, IoT device, and server using the WebSocket protocol, the server can proactively send messages to designated clients, reducing communication latency.

[0117] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0118] This embodiment also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0119] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0120] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0121] S1 sends a connection request to the IoT WebSocket service cluster and establishes a long connection with the IoT WebSocket service cluster.

[0122] S2 generates a first instruction based on user operation, sends the first instruction to the application server through the IoT WebSocket service cluster, instructing the application server to update the data according to the first instruction, and sends the updated data to the client through the client WebSocket service cluster.

[0123] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0124] In one embodiment, Figure 9 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application, such as... Figure 9 As shown, an electronic device is provided, which can be a server, and its internal structure diagram can be as follows. Figure 9 As shown, this electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a distributed communication method based on the Internet of Things (IoT).

[0125] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0126] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0127] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0128] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A distributed communication system based on the Internet of Things, characterized in that: The system includes: IoT devices, clients, service clusters and application servers. The service cluster includes an IoT WebSocket service cluster and a client WebSocket service cluster; The IoT device is used to establish a persistent connection with the IoT WebSocket service cluster and communicate with the application server through the IoT WebSocket service cluster; The client is used to establish a persistent connection with the client WebSocket service cluster and communicate with the application server through the client WebSocket service cluster.

2. The system according to claim 1, characterized in that The application server includes: A first parsing module is configured to receive a first instruction sent by the IoT device through the IoT WebSocket service cluster, update data according to the first instruction, and send the updated data to the client through the client WebSocket service cluster; and / or The second parsing module is used to receive a second instruction sent by the client through the client WebSocket service cluster, parse the second instruction to obtain a parsing result, and send the second instruction to the IoT device corresponding to the parsing result through the IoT WebSocket service cluster.

3. The system according to claim 1, characterized in that The IoT device comprises: a first connection module and a first communication module, The first connection module is used to send a connection request to the IoT WebSocket service cluster to establish a persistent connection with the IoT WebSocket service cluster; The first communication module is used to generate a first instruction based on a user operation, and send the first instruction to the application server through the IoT WebSocket service cluster.

4. The system according to claim 1, characterized in that The client comprises: a second connection module and a second communication module, The second connection module is used to send a connection request to the client WebSocket service cluster to establish a persistent connection with the client WebSocket service cluster; The second communication module is used to generate a second instruction based on the user operation, and send the second instruction to the application server through the client WebSocket service cluster.

5. A distributed communication method based on the Internet of Things, characterized in that: The method is applied to IoT devices; the method comprises: Send a connection request to the IoT WebSocket service cluster to establish a persistent connection with the IoT WebSocket service cluster; A first instruction is generated based on a user operation, and the first instruction is sent to the application server through the IoT WebSocket service cluster to instruct the application server to update data according to the first instruction, and the updated data is sent to the client through the client WebSocket service cluster.

6. The method according to claim 5, characterized in that The establishing of a persistent connection with the IoT WebSocket service cluster includes: After receiving the connection success response sent by the IoT WebSocket service cluster, a heartbeat message is sent to the IoT WebSocket service cluster, and a heartbeat response message of the IoT WebSocket service cluster is received.

7. The method according to claim 5, characterized in that After establishing a persistent connection with the IoT WebSocket service cluster, the method further includes: Send its own terminal device information to the IoT WebSocket service cluster, and instruct the IoT WebSocket service cluster to synchronize the terminal device information to the application server.

8. The method according to claim 5, characterized in that The method further comprises: Receiving, through the IoT WebSocket service cluster and the client WebSocket service cluster, a second instruction sent by the client; Respond to the second instruction.

9. A distributed communication method based on the Internet of Things, characterized in that: The method is applied to a client; the method comprises: Send a connection request to the client WebSocket service cluster to establish a persistent connection with the client WebSocket service cluster; A second instruction is generated based on the user operation, and the second instruction is sent to the application server through the client WebSocket service cluster to instruct the application server to parse the second instruction to obtain a parsing result, and the second instruction is sent to the IoT device corresponding to the parsing result through the IoTWebSocket service cluster.

10. The method according to claim 9, characterized in that After establishing a persistent connection with the client WebSocket service cluster, the method further includes: Send its own client device information to the client WebSocket service cluster, and instruct the client WebSocket service cluster to synchronize the client device information to the application server.