Network access method, cloud server, gateway, master device and system
The trust relationship is determined through the first gateway and the cloud server, and the binding process of the sub-device is automatically completed, solving the problem of manual unbinding after the sub-device is disconnected in the prior art, and the convenient gateway switching and efficient network access are achieved.
Patent Information
- Application Number
- CN202410045057.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-07-18
AI Technical Summary
In the Internet of Things scenario, after the sub-device is disconnected from the gateway, the existing technology requires the user to manually unbind and rebind the process, resulting in low work efficiency.
The first gateway sends a request to the cloud server, determines whether there is a trust relationship between the target sub-device and the gateway, and automatically completes the binding process under the management of the cloud server, without the need for manual operation by the user.
It realizes that sub-device automatically accesses the network without the user's perception, simplifies the gateway switching process and improves work efficiency.
Smart Images

Figure CN120342858A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things technology, and in particular, to a method for accessing a network, a cloud server, a gateway, a master device, a system, a storage medium, and a program product. Background Art
[0002] In some Internet of Things scenarios, the terminal device itself does not have the ability to directly communicate with the cloud server. In this case, these terminal devices can be used as sub-devices of an Internet of Things gateway (hereinafter simply referred to as a gateway), and the gateway proxies the sub-devices to access the cloud server.
[0003] After the gateway proxies the sub-devices to access the cloud server, the sub-devices may be disconnected from the gateway. For example, the gateway is damaged, the gateway is powered off, or the distance between the sub-device and the gateway becomes farther. In this case, the sub-device needs to be bound to a new gateway.
[0004] Among them, the process of binding the sub-device to the new gateway includes: the user first needs to manually unbind the sub-device from the original old gateway, and then the user controls the new gateway through the master device to perform device scanning. When the new gateway scans the sub-device, the user then manually binds the sub-device to the new gateway. This process requires the user to perform multiple user operations, and the process is relatively cumbersome. Summary of the Invention
[0005] This application provides a method for accessing a network, a cloud server, a gateway, a master device, a system, a storage medium, and a program product, aiming to solve the technical problem of cumbersome process caused by the need for the user to perform multiple user operations when adding a disconnected sub-device to a new gateway.
[0006] To achieve the above object, this application adopts the following technical solutions:
[0007] In a first aspect, a method for accessing a network is provided, which is applied to a first gateway in an Internet of Things system. The Internet of Things system further includes a cloud server, and there is a communication connection between the first gateway and the cloud server. The method includes: performing device scanning when a preset condition is met, sending a first request to the cloud server for a target sub-device with a connection requirement scanned, where the first request carries identification information of the target sub-device, and the first request instructs the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway; receiving a first message sent by the cloud server, establishing an effective connection with the target sub-device in response to the first message, and sending a second message to the cloud server, where the first message indicates that there is a trust relationship between the target sub-device and the first gateway, and the second message indicates that an effective connection has been established between the first gateway and the target sub-device.
[0008] Based on the above technical solution, when the first gateway scans a target sub-device with a connection requirement, it sends a first request to the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway through the cloud server. When there is a trust relationship between the target sub-device and the first gateway, it means that the target sub-device can be taken over by the first gateway. In this case, the first gateway establishes an effective connection with the target sub-device, and binds the target sub-device to the first gateway on the cloud server. At this point, the target sub-device can access the cloud server through the first gateway, that is, access the network. The access process does not require manual operation by the user, and the gateway switching can be completed relatively conveniently.
[0009] In a possible implementation of the first aspect, the Internet of Things system also includes a second gateway and a main device, wherein the second gateway and the main device are respectively communicated with a cloud server, the main device manages the sub-device through the cloud server, and at least one second sub-device is bound to the second gateway. When a preset condition is met, device scanning is performed, including: receiving a second instruction sent by the cloud server, and performing device scanning according to the second instruction; wherein the second instruction is sent by the cloud server after receiving a first instruction sent by the main device, the first instruction carries identification information of the second gateway, the first instruction instructs the cloud server to determine a target gateway corresponding to the second gateway and send the second instruction to the target gateway, the target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or is a gateway registered on the cloud server using a different user account having an associated relationship with the second gateway, the target gateway includes the first gateway, the first instruction is sent by the main device after receiving a third message sent by the cloud server, the third message is sent by the cloud server to the main device when detecting that the second gateway is disconnected from at least one second sub-device, and instructs the second gateway to disconnect from at least one second sub-device.
[0010] Based on the above technical solution, the disconnected second sub-device can complete the process of reconnecting to the cloud server through the interaction between the first gateway, the second gateway, the cloud server and the main device without the user's awareness. This is completed without the user's awareness, reducing user participation and improving work efficiency.
[0011] In a possible implementation of the first aspect, before sending a first request to the cloud server for a scanned target sub-device with a connection requirement, the method also includes: detecting whether each scanned candidate sub-device has an effective connection with the first gateway, or detecting whether the candidate sub-device has an effective connection with other gateways; if the candidate sub-device does not have an effective connection with the first gateway and does not have an effective connection with other gateways, determining the candidate sub-device as a target sub-device with a connection requirement.
[0012] Based on the above technical solution, the first gateway detects whether candidate sub-devices have connection requirements locally, and then sends a first request to the cloud server only for the target sub-devices with connection requirements. On the one hand, the function of the first gateway is extended. On the other hand, the computing amount of the cloud server and the data interaction amount between the cloud server and the first gateway can be effectively reduced, the process is simplified, the efficiency is improved, and the network burden is reduced.
[0013] In a possible implementation manner of the first aspect, the method further includes: receiving a fourth message sent by the cloud server, where the fourth message is sent by the cloud server after receiving the second message, and the fourth message indicates that the cloud server confirms the effective connection established between the first gateway and the target sub-device; in response to the fourth message, record the target sub-device locally.
[0014] In a second aspect, a method for accessing a network is provided, which is applied to a cloud server in an Internet of Things system. The Internet of Things system further includes a first gateway, and there is a communication connection between the first gateway and the cloud server. The method includes: obtaining a first request from the first gateway, where the first request carries the identification information of the target sub-device, and the target sub-device is a sub-device scanned by the first gateway with a connection requirement; determining whether there is a trust relationship between the target sub-device and the first gateway according to the first request; when there is a trust relationship between the target sub-device and the first gateway, send a first message to the first gateway, where the first message indicates that there is a trust relationship between the target sub-device and the first gateway; receive a second message from the first gateway, and in response to the second message, bind the target sub-device to the first gateway locally. The second message is sent by the first gateway after establishing an effective connection with the target sub-device in response to the first message, and indicates that an effective connection has been established between the first gateway and the target sub-device.
[0015] Based on the above technical solution, after receiving the first request, the cloud server determines whether there is a trust relationship between the target sub-device corresponding to the first request and the first gateway that sends the first request. This determination process is based on whether they belong to the same home group or whether they belong to the same trust domain. Any sub-device can access the cloud server through any gateway within the same trust domain. Therefore, when there is a trust relationship between the target sub-device and the first gateway, the target sub-device can be taken over by the first gateway to access the cloud server through the first gateway. In this way, the first gateway establishes an effective connection with the target sub-device, and the cloud server locally binds the target sub-device under the first gateway, so that the target sub-device accesses the cloud server through the first gateway, that is, accesses the network. This access process does not require manual operation by the user and can complete the gateway switch more conveniently.
[0016] In a possible implementation of the second aspect, determining whether there is a trust relationship between the target sub-device and the first gateway according to the first request includes: in response to the first request, detecting whether the target sub-device and the first gateway are registered on the cloud server using the same user account, or whether they are registered on the cloud server using different user accounts with an associated relationship; if the target sub-device and the first gateway are registered on the cloud server using the same user account, or using different user accounts with an associated relationship, determining that there is a trust relationship between the target sub-device and the first gateway; if the target sub-device and the first gateway are not registered on the cloud server using the same user account, and there is no associated relationship between the user account used by the target sub-device and the user account used by the first gateway, determining that there is no trust relationship between the target sub-device and the first gateway.
[0017] Based on the above technical solution, the cloud server determines whether there is a trust relationship between the target sub-device and the first gateway by detecting whether the target sub-device and the first gateway belong to the same home group or whether they belong to the same trust domain. Among them, any sub-device can access the cloud server through any gateway within the same trust domain. By determining the trust relationship between the two, it can be determined whether the target sub-device can be bound to the first gateway, and then the corresponding process is triggered. This process does not require manual operation by the user and can complete the gateway switch more conveniently.
[0018] In a possible implementation of the second aspect, the Internet of Things system further includes a second gateway and a master device. Among them, the second gateway and the master device are respectively in communication connection with the cloud server. The master device manages the sub-devices through the cloud server. At least one second sub-device is bound under the second gateway. Before obtaining the first request from the first gateway, the method further includes: when detecting that the second gateway is disconnected from at least one second sub-device, sending a third message to the master device, where the third message indicates that the second gateway is disconnected from at least one second sub-device; receiving a first instruction sent by the master device in response to the third message, where the first instruction carries the identification information of the second gateway; determining the target gateway corresponding to the second gateway according to the first instruction, and sending a second instruction to the target gateway, where the target gateway is the gateway registered on the cloud server using the same user account as the second gateway, or the gateway registered on the cloud server using a different user account with an associated relationship with the second gateway. The target gateway includes the first gateway, and the second instruction instructs the target gateway to perform device scanning.
[0019] Based on the above technical solution, the disconnected second sub-device can complete the process of reconnecting to the cloud server through the interaction between the first gateway, the second gateway, the cloud server, and the master device without the user's awareness. It is completed in a state where the user is unaware. Reducing user participation improves work efficiency.
[0020] In a possible implementation of the second aspect, the method further includes: when there is no trust relationship between the target sub-device and the first gateway, detecting whether the target sub-device is an unregistered sub-device according to the identification information of the target sub-device; if the target sub-device is an unregistered sub-device, generating a reminder message to remind the user to register the target sub-device.
[0021] Based on the above technical solution, when an unregistered sub-device is found, a reminder message is generated to facilitate reminding the user to register the target sub-device, timely and efficiently discovering the unregistered sub-device and generating a reminder message, which is beneficial to the registration efficiency of the Internet of Things platform and improves convenience.
[0022] In a possible implementation of the second aspect, the cloud server receives first requests from at least two gateways, where the at least two gateways are registered on the cloud server using the same user account or different user accounts with an associated relationship, and the at least two gateways include the first gateway, and the first request from the first gateway is the earliest to reach the cloud server among the first requests from the at least two gateways.
[0023] Based on the above technical solution, it is possible to avoid the cloud server from repeating work, reduce the computing amount of the cloud server, and improve efficiency.
[0024] In a possible implementation of the second aspect, after receiving the second message from the first gateway, the method further includes: sending a fourth message to the first gateway, where the fourth message indicates that the cloud server confirms the valid connection established between the first gateway and the target sub-device.
[0025] In a third aspect, a method for accessing a network is provided, which is applied to a master device in an Internet of Things system. The Internet of Things system further includes a cloud server and a second gateway, where the second gateway and the master device are respectively in communication connection with the cloud server, the master device manages sub-devices through the cloud server, and at least one second sub-device is bound under the second gateway. The method includes: receiving a third message from the cloud server, where the third message is sent by the cloud server when detecting that the second gateway is disconnected from at least one second sub-device, and indicates that the second gateway is disconnected from at least one second sub-device; in response to the third message, sending a first instruction to the cloud server, where the first instruction carries the identification information of the second gateway, and the first instruction instructs the cloud server to determine the target gateway corresponding to the second gateway and send a second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using a different user account with an associated relationship with the second gateway, and the second instruction instructs the target gateway to perform device scanning.
[0026] Based on the above technical solution, the master device can automatically respond to the third message to trigger the cloud server to control the target gateway to perform device scanning through the first instruction, without relying on the user, expanding the functions of the master device and improving the efficiency.
[0027] In a fourth aspect, a cloud server is provided, including a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the method for accessing the network in the second aspect or any possible implementation manner in the second aspect.
[0028] In a fifth aspect, a gateway is provided, including a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the method for accessing the network in the first aspect or any possible implementation manner in the first aspect.
[0029] In a sixth aspect, a master device is provided, including a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the method for accessing the network described in the third aspect.
[0030] In a seventh aspect, an Internet of Things system is provided, including a first gateway and a cloud server. The first gateway is communicatively connected to the cloud server. Among them, the first gateway executes the steps in the first aspect or any possible implementation manner in the first aspect, and the cloud server executes the steps in the second aspect or any possible implementation manner in the second aspect.
[0031] In a possible implementation manner of the seventh aspect, it further includes a master device. The master device is communicatively connected to the cloud server. The master device manages sub-devices through the cloud server, and the master device executes the steps in the third aspect.
[0032] In an eighth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program runs on a processor, it executes the method for accessing the network in any possible implementation manner from the first aspect to the third aspect above.
[0033] In a ninth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code runs on a computer, it causes the computer to execute the method for accessing the network in any possible implementation manner from the first aspect to the third aspect above.
[0034] Based on the implementation manners provided in the above aspects of the present application, further combinations can be made to provide more implementation manners. Description of the Drawings
[0035] Figure 1 A schematic diagram showing the disconnection of a sub-device is shown;
[0036] Figure 2 Shows a schematic diagram of a user manually triggering an unbinding process;
[0037] Figure 3 Shows a schematic diagram of a user manually triggering a binding process;
[0038] Figure 4 Shows a schematic diagram of an Internet of Things system in an embodiment of the present application;
[0039] Figure 5 Shows a flowchart of a method for accessing a network;
[0040] Figure 6 Shows a flowchart of a method for a first gateway to establish an effective connection with a target sub-device;
[0041] Figure 7 Shows an interaction schematic diagram of an Internet of Things system;
[0042] Figure 8 Shows a schematic diagram of a gateway device provided in an embodiment of the present application;
[0043] Figure 9 Shows a schematic diagram of a server device provided in an embodiment of the present application;
[0044] Figure 10 Shows a schematic diagram of a master device provided in an embodiment of the present application;
[0045] Figure 11 Shows a structural block diagram of a cloud server;
[0046] Figure 12 Shows a structural block diagram of a gateway;
[0047] Figure 13 Shows a structural block diagram of a master device. Detailed implementation
[0048] Next, the technical solutions in the present application will be described in conjunction with the accompanying drawings.
[0049] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B can represent A or B; herein, "and / or" is only a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0050] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise specified, "a plurality" means two or more.
[0051] With the development of the Internet of Things industry, more and more network devices are connected to the Internet of Things platform. Among them, these network devices generally use various different communication protocols, such as Wi-Fi protocol, Bluetooth protocol, Zigbee protocol, etc. When the communication protocol used by the network device does not match the communication protocol used by the cloud server corresponding to the Internet of Things platform (hereinafter simply referred to as the cloud server), the network device cannot be directly connected to the cloud server. In this case, these network devices can be used as sub-devices of the Internet of Things gateway (hereinafter simply referred to as the gateway), and the gateway can proxy these network devices (i.e., sub-devices) to access the cloud server.
[0052] During the process of the gateway proxying the sub-devices to access the cloud server, the situation of sub-device disconnection may occur. The reasons for sub-device disconnection may include the following: One is that the gateway is damaged or the gateway is powered off, etc. Another is that the sub-device is a mobile device, and the sub-device disconnects from the gateway when it moves out of the scanning range of the gateway. Generally speaking, when the sub-device disconnects from the current gateway, in order to ensure the normal management of the sub-device, it is necessary to bind the sub-device to other available gateways, and the other available gateways continue to proxy the sub-device to access the cloud server. For the convenience of description, the gateway to which the sub-device is bound before disconnection is hereinafter referred to as the old gateway, and the gateway to which the sub-device needs to be rebound after disconnection is hereinafter referred to as the new gateway.
[0053] As Figure 1 shown, Figure 1 shows a schematic diagram of sub-device disconnection. Among them, gateway A and gateway B are registered under the cloud server, sub-devices A and B are bound under gateway A, and sub-device C is bound under gateway B. When sub-device B disconnects from gateway A, it is necessary to bind sub-device B under gateway B.
[0054] The process of binding sub-device B to gateway B in the related art will be described below.
[0055] In the related art, before rebinding sub-device B to the new gateway, it is necessary to unbind sub-device B from the old gateway first, and the unbinding process requires user operation.
[0056] As Figure 2 shown, Figure 2The figure shows a schematic diagram of a user manually triggering an unbinding process. Among them, the user needs to manually operate to send a sub-device deletion instruction to the cloud server through the master device. The cloud server forwards the sub-device deletion instruction to the old gateway (Gateway A). The old gateway unbinds from Sub-device B according to the preset process and reports a successful sub-device deletion message to the cloud server. After receiving the successful sub-device deletion message, the cloud server clears the binding information between Sub-device B and Gateway A and reports the successful sub-device deletion to the master device. Among them, in the unbinding process, the cloud server can clear the binding relationship of Sub-device B, so as to prepare for subsequent re-binding.
[0057] After the user receives the feedback of successful sub-device deletion through the master device, the user needs to operate to initiate a binding process to bind Sub-device B to the new gateway (Gateway B). This binding process includes two parts: sub-device discovery and sub-device addition. Correspondingly, the user needs to perform at least two user operations. The implementation process is as follows:
[0058] As Figure 3 shown, Figure 3 The figure shows a schematic diagram of a user manually triggering a binding process. Among them, the user needs to manually operate to send a sub-device discovery instruction to the cloud server through the master device. The sub-device discovery instruction is used to indicate discovering sub-devices. The cloud server forwards the sub-device discovery instruction to Gateway B. Gateway B performs device scanning in response to this instruction. After Gateway B scans Sub-device B, it reports the sub-device information to the cloud server. The cloud server reports the sub-device information to the master device, so that the user can know that a new device has been discovered.
[0059] It should be noted that the cloud server does not only send sub-device discovery instructions to Gateway B. When there are other available gateways, the cloud server will also send sub-device discovery instructions to other available gateways. In this application, Gateway B is taken as an example to illustrate the process.
[0060] On this basis, the user again operates through the master device to send an instruction to add a sub-device to the cloud server. Among them, the user needs to manually determine the gateway that can take over Sub-device B and trigger the instruction to add a sub-device through the user operation. Specify the gateway that can take over Sub-device B, such as Gateway B, in the instruction to add a sub-device, so as to bind Sub-device B to Gateway B. After receiving the instruction to add a sub-device, the cloud server interacts with Gateway B based on the preset interaction process to bind Sub-device B to Gateway B.
[0061] Combined with Figure 2 and Figure 3 it can be seen that in the related art, the process of re-binding the disconnected Sub-device B to the new gateway (Gateway B) cannot be separated from the participation of the user, and at least 3 user operations are required to realize re-binding Sub-device B to Gateway B. It can be seen that the processing process in the related art seriously depends on the participation of the user, and the process is relatively cumbersome.
[0062] In addition, when batch processing of multiple sub-devices is required, the user needs to perform the above process multiple times for each sub-device, which obviously results in low work efficiency.
[0063] To solve the above technical problems, an embodiment of the present application provides a method for accessing a network. This method is applied to an Internet of Things system, which includes a first gateway and a cloud server. When the first gateway scans a target sub-device with a connection requirement, it sends a first request to the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway through the cloud server. When there is a trust relationship between the target sub-device and the first gateway, it means that the target sub-device can be taken over by the first gateway. In this case, the first gateway establishes an effective connection with the target sub-device and binds the target sub-device to the first gateway on the cloud server. Thus, the target sub-device can access the cloud server through the first gateway, that is, access the network. This access process does not require manual operation by the user and can conveniently complete the gateway switch.
[0064] The Internet of Things system involved in the embodiment of the present application will be described below.
[0065] Please refer to Figure 4 , Figure 4 which shows a schematic diagram of an Internet of Things system in an embodiment of the present application. The Internet of Things system includes a main device, a cloud server, a gateway, and sub-devices bound under the gateway.
[0066] In an embodiment of the present application, the main device is a device held by the user, such as a wearable device, a smart phone, a computer, a tablet, etc. The main device is configured with an application program corresponding to the Internet of Things platform. In one implementation, the user can perform user operations to manage the gateway and the sub-devices bound under the gateway through the application program in the main device.
[0067] In one implementation, the main device includes a touch screen, where the touch screen can display the gateway and the sub-devices bound under the gateway registered under the user account corresponding to the main device. Optionally, the touch screen can also display the gateway and the sub-devices bound under the gateway registered under other user accounts associated with the user account corresponding to the main device.
[0068] In the implementation provided by the embodiment of the present application, the main device can automatically trigger the management process of the gateway and the sub-devices bound under the gateway under preset conditions without relying on user operations.
[0069] In one implementation, the main device includes a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the method for accessing the network provided by the embodiment of the present application.
[0070] In the embodiments of the present application, an Internet of Things platform is configured on the cloud server, and various service functions supported by the Internet of Things platform can be realized. The cloud server can be an independent server or a server cluster.
[0071] Among them, before the main device, the gateway, and the sub-devices bound under the gateway are connected to the cloud server, they all need to be registered on the Internet of Things platform corresponding to the cloud server, and the registration process requires user participation.
[0072] In the embodiments of the present application, when the main device is first connected to the cloud server, the user can trigger the application program in the main device to register in the cloud server. The cloud server assigns a unique identifier to the main device. In the embodiments of the present application, this unique identifier is called the user account. In addition, the cloud server will also establish a user account database based on the user account of the main device, and the user account database is used to store all the gateways and sub-devices registered under this user account.
[0073] In the embodiments of the present application, the cloud server is also responsible for managing and maintaining the user account database. When a new sub-device or a new gateway is registered to a certain user account, the new sub-device or the new gateway is recorded in the corresponding user account database.
[0074] For example, for any gateway, when the gateway is first connected to the cloud server, the user needs to specify the user account corresponding to the gateway, and the cloud server registers the gateway under the corresponding user account based on the user instruction. At the same time, the cloud server will also record the gateway in the user account database corresponding to this user account.
[0075] Based on a similar principle, for any sub-device, when the sub-device is first connected to the cloud server, it also needs to be registered in the cloud server. This registration process is completed through the gateway. Among them, the user specifies the gateway corresponding to the sub-device, and the cloud server binds the sub-device to the gateway specified by the user based on the user instruction. In this case, the sub-device is defaultly registered under the user account corresponding to the gateway specified by the user, and the cloud server will record the sub-device in the user account database corresponding to this user account.
[0076] Among them, the gateways and sub-devices registered under the same user account are considered to belong to the same home group, or are considered to belong to the same trust domain. Among them, there is a trust relationship between the gateways belonging to the same home group, between the sub-devices, and between any gateway and any sub-device. In the embodiments of the present application, any sub-device can be connected to the cloud server through any gateway within the same trust domain.
[0077] In the embodiments of the present application, for any sub-device, if there is a trust relationship between the sub-device and a certain gateway, it means that the sub-device can be taken over by the certain gateway. Here, "taken over" means that the certain gateway can establish an effective connection with the sub-device, and the cloud server can bind the sub-device to the certain gateway.
[0078] Generally speaking, one user account corresponds to one home group, different user accounts correspond to different home groups, and members of different home groups do not interact with each other. For any sub-device, if there is no trust relationship between the sub-device and a certain gateway, then the sub-device cannot be taken over by the certain gateway.
[0079] In another implementation manner of the present application, a user can establish an association relationship between different user accounts, and the cloud server can maintain the association relationship between user accounts in response to a user instruction.
[0080] Among them, the cloud server can define the gateways and sub-devices registered under different user accounts with an association relationship as belonging to the same home group. Correspondingly, the gateways and sub-devices registered under different user accounts with an association relationship can be understood as belonging to the same trust domain, and there is a trust relationship between the gateways and sub-devices belonging to the same home group or belonging to the same trust domain.
[0081] In one implementation manner, the cloud server includes a memory and a processor. The memory stores a computer program, and the computer program executes the method for accessing the network provided by the embodiments of the present application when running on the processor.
[0082] In the embodiments of the present application, a gateway is a network device that has a communication connection with the cloud server. It can connect different types of networks together so that they can communicate with each other. The main function of the gateway is to transfer data between two or more networks, and it can also perform some security and management tasks.
[0083] Figure 4 The gateway shown in [ID] can refer to the first gateway or the second gateway. When Figure 4 the gateway shown in [ID] refers to the first gateway, the sub-devices bound under the gateway refer to the first sub-devices bound under the first gateway. When Figure 4 the gateway shown in [ID] refers to the second gateway, the sub-devices bound under the gateway refer to the second sub-devices bound under the second gateway.
[0084] Optionally, Figure 4 when there are multiple gateways shown in [ID], one or more of them are used to refer to the first gateway, and the other part is used to refer to the second gateway.
[0085] In one implementation, the gateway includes a memory and a processor. The memory stores a computer program which, when running on the processor, executes the method for accessing the network provided by the embodiments of the present application.
[0086] In the embodiments of the present application, the sub-devices are network terminal devices, such as floor-sweeping robots, refrigerators, washing machines, air conditioners, etc. The sub-devices access the cloud server through the gateway.
[0087] In one implementation, after the sub-device is bound to the gateway, the gateway needs to record the sub-device information of the sub-device locally. The sub-device information of the sub-device includes identification information and other device parameter information, where the identification information includes at least one of product identification, product serial number, and device identification. Optionally, the gateway also needs to record the topological relationship between it and all the bound sub-devices, and report the topological relationship between it and the sub-devices to the cloud server for the cloud server to confirm and record. Optionally, the cloud server can record the topological relationship of the gateway in the user account database corresponding to the gateway.
[0088] When status changes such as unbinding, disconnection, deletion, and addition occur to the sub-devices under the gateway, the gateway can report to the cloud server, and the corresponding cloud server can update the topological relationship of the gateway in the user account database. However, it should be noted that when the cloud server updates the user account database, it will not delete the gateway or sub-devices registered under the user account.
[0089] In the embodiments of the present application, the sub-devices periodically send broadcast signals. When the sub-devices are in a disconnected state or not bound to any gateway, the broadcast signals sent by the sub-devices carry a target field. The target field is used to indicate that the sub-devices have connection requirements. When the sub-devices are in a normal connection state with the gateway, the broadcast signals sent by the sub-devices do not include the target field.
[0090] Combined with the above-mentioned Internet of Things system, the method for accessing the network provided by the embodiments of the present application will be described below.
[0091] Please refer to Figure 5 , Figure 5 which shows a flowchart of a method for accessing the network. The method for accessing the network is applied to an Internet of Things system, and the Internet of Things system includes a first gateway and a cloud server. Figure 4 The gateway shown in
[0092] is used to refer to the first gateway, and the method includes steps 501 to 509.
[0093] Step 501, the first gateway performs device scanning when a preset condition is met.
[0094] Among them, the first request carries the identification information of the target sub-device, and the first request instructs the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway.
[0095] In the first implementation, the first gateway performs periodic scanning. When the scanning period arrives, it means that the preset condition is met, and then the first gateway performs device scanning.
[0096] In the second implementation, when the first gateway receives the second instruction sent by the cloud server, it means that the preset condition is met, and then the first gateway performs device scanning.
[0097] Among them, when the cloud server detects that the second gateway is disconnected from at least one second sub-device, the cloud server sends a third message to the main device. The third message indicates that the second gateway is disconnected from at least one second sub-device. The main device responds to the third message and sends a first instruction to the cloud server. The first instruction carries the identification information of the second gateway. The cloud server sends a second instruction to the first gateway according to the first instruction. The second instruction instructs the target gateway to perform device scanning. It should be noted that this process is completed in a state where the user is unaware and does not require user participation.
[0098] In the third implementation, when the first gateway receives the scanning instruction sent by the main device, it means that the preset condition is met, and then the first gateway performs device scanning.
[0099] Among them, when the cloud server detects that the second gateway is disconnected from at least one second sub-device, the cloud server sends a third message to the main device. The third message indicates that the second gateway is disconnected from at least one second sub-device. After receiving the third message, the main device can display the content indicated by the third message to the user through the touch screen to remind the user. In this solution, the user can determine the target gateway by himself. The target gateway is the gateway selected by the user to take over the second sub-device. The user can select the target gateway through the touch screen of the main device. The main device responds to the user's selection operation and sends a scanning instruction to the target gateway. This target gateway is the first gateway in this embodiment.
[0100] In the embodiment of the present application, the process of the first gateway performing device scanning includes: the sub-device periodically sends a broadcast signal, and when the first gateway scans and receives the broadcast signal sent by the sub-device, it means that the first gateway has scanned the sub-device.
[0101] In one embodiment, the number of the first gateways can be multiple. Among them, each first gateway can perform device scanning when the preset condition is met, and the first gateways are independent of each other and do not interfere with each other.
[0102] Among them, some of the first gateways may scan their corresponding target sub-devices, while some of the first gateways may not scan their corresponding target sub-devices. Those first gateways that scan the target sub-devices can all send a first request to the cloud server.
[0103] In the embodiment of the present application, when the first gateway performs device scanning, it can scan multiple candidate sub-devices. Then, the first gateway needs to determine the candidate sub-devices with connection requirements from the multiple candidate sub-devices, define the candidate sub-devices with connection requirements as target sub-devices, and send a first request to the cloud server for the target sub-devices.
[0104] The process of the first gateway determining the target sub-devices is described below. This process includes the first gateway detecting whether each scanned candidate sub-device has an effective connection with the first gateway, or detecting whether the candidate sub-device has an effective connection with other gateways. If the candidate sub-device does not have an effective connection with the first gateway and does not have an effective connection with other gateways, the first gateway determines the candidate sub-device as the target sub-device with connection requirements.
[0105] In the embodiment of the present application, when the first gateway performs device scanning, it can scan all sub-devices within a preset distance range. In the present application, all sub-devices scanned by the first gateway are defined as candidate sub-devices.
[0106] Among these candidate sub-devices, there may be some candidate sub-devices that are already bound to the first gateway, some candidate sub-devices that are already bound to other gateways, some candidate sub-devices that are bound to other gateways but are disconnected from the bound gateways, and some candidate sub-devices that are not bound to any gateway. The first gateway needs to distinguish the scanned candidate sub-devices to determine the target sub-devices.
[0107] In one implementation, the first gateway can obtain the broadcast signals sent by each candidate sub-device during scanning, and determine whether each candidate sub-device has a connection requirement by identifying whether the broadcast signal contains a target field. For any candidate sub-device, if the broadcast signal sent by the candidate sub-device carries a target field, the first gateway determines that the candidate sub-device has a connection requirement, defines the candidate sub-device as a target sub-device, and sends a first request to the cloud server for the target sub-device. If the broadcast signal sent by the candidate sub-device does not carry a target field, the first gateway determines that the candidate sub-device does not have a connection requirement and ignores the candidate sub-device.
[0108] In another implementation, for each candidate sub-device, the first gateway can query whether the device exists locally in the gateway. If the device exists locally in the gateway, it means that the candidate sub-device is a sub-device already bound under the first gateway, and then the candidate sub-device is ignored. If the device does not exist locally in the gateway, the candidate sub-device is defined as a target sub-device, and a first request is sent to the cloud server for the target sub-device.
[0109] In one embodiment, after the first gateway scans multiple candidate sub-devices, it can send the identification information of the multiple candidate sub-devices to the cloud server, and request the cloud server to determine the target sub-devices with connection requirements from the multiple candidate sub-devices, and the cloud server determines whether there is a trust relationship between the target sub-devices and the first gateway. In this implementation, the cloud server needs to perform a large amount of computing processing, and the efficiency is low. Especially when the number of first gateways is large, the response speed of the cloud server will be greatly reduced.
[0110] In the embodiment of the present application, the first gateway detects whether there is a connection requirement for the candidate sub-device locally, and then only sends a first request to the cloud server for the target sub-device with a connection requirement. On the one hand, the function of the first gateway is extended, and on the other hand, the computing amount of the cloud server and the data interaction amount between the cloud server can be effectively reduced, the process is simplified, the efficiency is improved, and the network burden is reduced.
[0111] In the embodiment of the present application, when the first gateway scans the target sub-device with a connection requirement, it will automatically trigger the process of connecting the target sub-device to itself, and this process includes sending a first request to the cloud server for the target sub-device. Among them, the essence of the first request is a trust query request, which is used to query whether there is a trust relationship between the target sub-device and the first gateway.
[0112] In one implementation, the first gateway may scan multiple target sub-devices with connection requirements. The first gateway can send a first request to the cloud server once for each target sub-device, and each first request carries the identification information of the corresponding target sub-device.
[0113] In another implementation, the first gateway may scan multiple target sub-devices with connection requirements, and then the first gateway can send only one first request, and the identification information of multiple target sub-devices is carried in this first request.
[0114] Step 503, the cloud server determines whether there is a trust relationship between the target sub-device and the first gateway according to the first request.
[0115] Step 504, when there is a trust relationship between the target sub-device and the first gateway, send a first message to the first gateway.
[0116] Among them, the first message indicates that there is a trust relationship between the target sub-device and the first gateway.
[0117] In the embodiments of the present application, the number of the first requests may be one or more, and the number of the identification information of the target sub-devices carried in one first request may be one or more.
[0118] Among them, if the first request carries the identification information of multiple target sub-devices, the cloud server needs to judge one by one whether there is a trust relationship between each target sub-device and the first gateway. There may be a situation where some target sub-devices have a trust relationship with the first gateway, while some target sub-devices do not have a trust relationship with the first gateway.
[0119] In one implementation manner, for these target sub-devices that have a trust relationship with the first gateway, the cloud server may send a first message to the first gateway, and the first message indicates that there is a trust relationship between multiple target sub-devices and the first gateway. Correspondingly, for these target sub-devices that do not have a trust relationship with the first gateway, the cloud server may send a distrust message to the first gateway, and the distrust message indicates that there is no trust relationship between multiple target sub-devices and the first gateway.
[0120] That is to say, the first message received by the first gateway may indicate that there is a trust relationship between multiple target sub-devices and the first gateway. In this case, the first gateway needs to establish effective connections with each target sub-device with a trust relationship respectively. This process is actually a batch processing process, which does not require user participation and improves work efficiency.
[0121] In another implementation manner, for these target sub-devices that have a trust relationship with the first gateway, the cloud server may send first messages to the first gateway one by one, and each first message corresponds to the trusted state of a target sub-device. For these target sub-devices that do not have a trust relationship with the first gateway, the cloud server may send distrust messages to the first gateway one by one, and each distrust message corresponds to the untrusted state of a target sub-device.
[0122] Optionally, the number of the first gateways may be multiple. Among them, each first gateway can perform device scanning when meeting the preset conditions, and the first gateways are independent of each other and do not interfere with each other. There may be some first gateways that scan their corresponding target sub-devices, and some first gateways that do not scan their corresponding target sub-devices. These first gateways that scan the target sub-devices can all send first requests to the cloud server. The identification information of the target sub-devices carried in the first requests sent by different first gateways may be the same or different.
[0123] Among them, if the cloud server receives first requests from multiple first gateways, it can detect whether the identification information of the target sub-devices carried in each first request is the same. If the identification information of the target sub-devices carried in each first request is different, then for each first request, the cloud server determines whether there is a trust relationship between the target sub-device and the first gateway according to the first request. If there is a trust relationship between the target sub-device and the first gateway, the cloud server sends a first message to the first gateway. If the identification information of the target sub-devices carried in all or some of the first requests is the same, then for the first request of the first gateway that arrives first, the cloud server determines whether there is a trust relationship between the target sub-device and the first gateway according to the first request. If there is a trust relationship between the target sub-device and the first gateway, the cloud server sends a first message to the first gateway.
[0124] It should be noted that when there is a trust relationship between the target sub-device and the first gateway, it means that the target sub-device can be taken over by the first gateway, and the target sub-device can access the cloud server through the first gateway.
[0125] Optionally, in one implementation, the cloud server receives first requests from at least two gateways. The at least two gateways are registered on the cloud server using the same user account or different user accounts with an associated relationship. The at least two gateways include the first gateway, and the first request from the first gateway is the earliest to arrive at the cloud server among the first requests from the at least two gateways. This can avoid the cloud server from repeating work, reduce the computing amount of the cloud server, and improve efficiency.
[0126] Among them, that the at least two gateways are registered on the cloud server using the same user account means that when the at least two gateways are registered on the cloud server, they are registered under the same user account.
[0127] That the at least two gateways are registered on the cloud server using different user accounts with an associated relationship means that when the at least two gateways are registered on the cloud server, they are registered under different user accounts, and there is an associated relationship between these different user accounts.
[0128] In the embodiment of the present application, after the cloud server receives the first request, a trust query process will be triggered. The process of the cloud server executing the trust query process includes: in response to the first request, detecting whether the target sub-device and the first gateway are registered on the cloud server using the same user account, or whether they are registered on the cloud server using different user accounts with an associated relationship. If the target sub-device and the first gateway are registered on the cloud server using the same user account, or using different user accounts with an associated relationship, it is determined that there is a trust relationship between the target sub-device and the first gateway. If the target sub-device and the first gateway are not registered on the cloud server using the same user account, and there is no associated relationship between the user account used by the target sub-device and the user account used by the first gateway, it is determined that there is no trust relationship between the target sub-device and the first gateway.
[0129] Among them, when there is a trust relationship between the target sub-device and the first gateway, the cloud server sends a first message to the first gateway. When there is no trust relationship between the target sub-device and the first gateway, the cloud server sends a distrust message to the first gateway. If the target sub-device and the first gateway are registered on the cloud server using the same user account, or using different user accounts with an associated relationship, it is determined that there is a trust relationship between the target sub-device and the first gateway.
[0130] If the target sub-device and the first gateway are not registered on the cloud server using the same user account, and there is no associated relationship between the user account used by the target sub-device and the user account used by the first gateway, it is determined that there is no trust relationship between the target sub-device and the first gateway.
[0131] It should be noted that in the embodiment of the present application, that the target sub-device and the first gateway are registered on the cloud server using the same user account means that when the target sub-device and the first gateway are registered on the cloud server, they are registered under the same user account.
[0132] That the target sub-device and the first gateway are registered on the cloud server using different user accounts with an associated relationship means that when the target sub-device and the first gateway are registered on the cloud server, they are registered under different user accounts, but there is an associated relationship between these different user accounts.
[0133] Among them, the cloud server can detect whether the target sub-device and the first gateway are registered on the cloud server using the same user account, or whether they are registered on the cloud server using different user accounts with an associated relationship in the following two ways:
[0134] The first method: The cloud server can determine the user account used by the first gateway when registering on the cloud server. For the convenience of description, in the following text, the user account used by the first gateway when registering on the cloud server is defined as the first user account, and other user accounts having an associated relationship with the first user account are defined as the second user accounts. Then the cloud server can search for the target sub-device in the user account database corresponding to the first user account. Based on the above description, all gateways and sub-devices registered under the first user account are stored in the user account database corresponding to the first user account. That is to say, if the target sub-device has been registered under the first user account, it can be found in the user account database corresponding to the first user account; otherwise, it cannot be found.
[0135] When the cloud server finds the target sub-device in the user account database corresponding to the first user account, it indicates that the target sub-device and the first gateway belong to the same home group and are within the same trust domain. Therefore, there is a trust relationship between the target sub-device and the first gateway.
[0136] When the cloud server does not find the target sub-device in the user account database corresponding to the first user account, it indicates that the target sub-device and the first gateway do not belong to the same home group and are not within the same trust domain. Therefore, there is no trust relationship between the target sub-device and the first gateway.
[0137] In addition, when there are second user accounts having an associated relationship with the first user account, the cloud server also needs to search in the user account databases corresponding to the second user accounts.
[0138] The second method: The cloud server can determine the first user account, and then the cloud server traverses the pre-stored user account databases according to the identification information of the target sub-device to determine the user account database in which the target sub-device is recorded. For the convenience of description, the user account corresponding to the user account database in which the target sub-device is recorded is defined as the third user account.
[0139] The cloud server can determine whether the first user account and the third user account are the same user account, or whether there is an associated relationship between the first user account and the third user account.
[0140] If the first user account and the third user account are the same user account, or there is an associated relationship between the first user account and the third user account, it indicates that the target sub-device and the first gateway belong to the same home group and are within the same trust domain. Therefore, there is a trust relationship between the target sub-device and the first gateway.
[0141] If the first user account and the third user account are different user accounts and there is no association relationship between them, it means that the target sub-device and the first gateway do not belong to the same home group and they are not in the same trust domain. Therefore, there is no trust relationship between the target sub-device and the first gateway.
[0142] It should be noted that when the cloud server traverses the pre-stored user account database according to the identification information of the target sub-device, it is possible that the target sub-device cannot be found in all user account databases. In this case, the cloud server determines that there is no trust relationship between the target sub-device and the first gateway.
[0143] In an optional implementation manner, when there is no trust relationship between the target sub-device and the first gateway, the cloud server detects whether the target sub-device is an unregistered sub-device according to the identification information of the target sub-device. If the target sub-device is an unregistered sub-device, a reminder message is generated.
[0144] In the embodiments of the present application, when the cloud server traverses the pre-stored user account database according to the identification information of the target sub-device, if the target sub-device cannot be found in all user account databases, it means that the target sub-device is not registered.
[0145] When the cloud server determines that the target sub-device is an unregistered sub-device, on the one hand, it can send a distrust message to the first gateway, and on the other hand, it will generate a reminder message for reminding the user to register the target sub-device.
[0146] Optionally, in the embodiments of the present application, the cloud server can send the reminder message to the master device. After receiving the reminder message, the master device can display the content indicated by the reminder message so that the user can know that an unregistered sub-device is found.
[0147] Optionally, in the embodiments of the present application, after receiving the reminder message, the master device can display the content indicated by the reminder message in the form of a reminder card on the touch screen.
[0148] Optionally, the reminder message may carry the identification information of the unregistered sub-device so that the user can determine the identity of the unregistered sub-device and lay a foundation for the subsequent registration process.
[0149] In the embodiments of the present application, when an unregistered sub-device is found, a reminder message is generated to remind the user to register the target sub-device. Timely and efficiently finding the unregistered sub-device and generating the reminder message are beneficial to the registration efficiency of the Internet of Things platform and improve convenience.
[0150] Step 505, establish an effective connection with the target sub-device in response to the first message.
[0151] Step 506, send a second message to the cloud server.
[0152] The second message indicates that the first gateway has established an effective connection with the target sub-device.
[0153] In the embodiment of the present application, after the first gateway receives the first message, it means that the target sub-device can be taken over by the first gateway. In this case, the first gateway establishes an effective connection with the target sub-device.
[0154] The process of the first gateway establishing an effective connection with the target sub-device can be as Figure 6 shown Figure 6 shows a flowchart of a method for the first gateway to establish an effective connection with the target sub-device. The first gateway sends a connection request to the target sub-device, and the target sub-device sends sub-device information to the first gateway in response to the connection request. After receiving the sub-device information, the first gateway adds the target sub-device to the topological relationship between the first gateway and the sub-devices locally and records the sub-device information of the target sub-device.
[0155] In the embodiment of the present application, after the first gateway establishes an effective connection with the target sub-device, it will send a second message to the cloud server to report to the cloud server that the first gateway has established an effective connection with the target sub-device. In addition, the first gateway will also confirm the successful connection to the target sub-device.
[0156] It should be noted that in the embodiment of the present application, the process of the first gateway establishing an effective connection with the target sub-device will be affected by the communication protocol used by the target sub-device.
[0157] In one case, the broadcast signal periodically sent by the target sub-device carries the identification information of the target sub-device. When the first gateway scans the target sub-device, it obtains the identification information of the target sub-device from the broadcast signal and sends a first request to the cloud server. In this process, the first gateway does not establish any connection relationship with the target sub-device. When the first gateway receives the first message from the cloud server, the first gateway and the target sub-device establish a connection based on the communication protocol of the target sub-device, and this connection is an effective connection.
[0158] In another case, when the first gateway scans a target sub-device, it needs to first establish a preliminary connection with the target sub-device. Based on this preliminary connection, the first gateway can obtain the identification information of the target sub-device, and then generate a first request based on the identification information of the target sub-device and send the first request to the cloud server. Among them, this preliminary connection is not a valid connection. When the first gateway receives the first message from the cloud server, it will convert this preliminary connection into a valid connection. Optionally, after receiving the first message, the first gateway can interact with the target sub-device to obtain the sub-device information of the target sub-device and complete the valid connection with the target sub-device based on the sub-device information.
[0159] In the embodiment of the present application, when the first gateway receives a distrust message, it means that the target sub-device cannot be taken over by the first gateway, and then the first gateway ignores the target sub-device. It should be noted that there are generally two cases where the target sub-device cannot be taken over by the first gateway. The first case is that the target sub-device and the first gateway belong to different home groups and do not belong to the same trust domain. The second case is that the target sub-device is an unregistered sub-device.
[0160] Step 507, the cloud server sends a fourth message to the first gateway in response to the second message.
[0161] Step 508, bind the target sub-device to the first gateway locally.
[0162] In the embodiment of the present application, the essence of the second message is to report the online status of the target sub-device to the cloud server. After receiving the second message, the cloud server can bind the target sub-device to the first gateway locally.
[0163] Among them, binding the target sub-device to the first gateway locally means recording locally that the target sub-device is bound to the first gateway and updating the topological relationship of the sub-devices bound under the first gateway.
[0164] Optionally, after receiving the second message, the cloud server can also send a fourth message to the first gateway. The fourth message indicates that the cloud server confirms the valid connection established between the first gateway and the target sub-device. When the first gateway receives the fourth message, it records the sub-device information of the target sub-device locally. Optionally, after receiving the fourth message from the cloud server, the first gateway can also update its own topological relationship to add the target sub-device.
[0165] Optionally, in the embodiment of the present application, the cloud server can also report to the master device that the target sub-device goes online successfully and that there is a binding relationship between the target sub-device and the first gateway.
[0166] Step 509, the first gateway records the sub-device information of the target sub-device locally in response to the fourth message.
[0167] Optionally, after receiving the fourth message from the cloud server, the first gateway may also update its own topology relationship to add the target sub-device.
[0168] The embodiment of the present application provides a method for accessing a network, which is applied to an Internet of Things system, and the Internet of Things system includes a first gateway and a cloud server, wherein the first gateway sends a first request to the cloud server when scanning a target sub-device with a connection requirement, so as to determine whether there is a trust relationship between the target sub-device and the first gateway through the cloud server. When there is a trust relationship between the target sub-device and the first gateway, it means that the target sub-device can be taken over by the first gateway. In this case, the first gateway establishes an effective connection with the target sub-device, and binds the target sub-device to the first gateway on the cloud server. At this point, the target sub-device can access the cloud server through the first gateway, that is, access the network. The access process does not require manual operation by the user, and the switching of the gateway can be completed relatively conveniently.
[0169] It should be noted that binding the target sub-device with the first gateway includes two parts. One part is that the first gateway establishes an effective connection with the target sub-device. Only when the connection is effective can the first gateway and the target sub-device perform data transmission. The other part is that the cloud server locally binds the target sub-device to the first gateway. Only when the binding process is completed on the cloud server side can the master device identify the target sub-device and the binding relationship between the target sub-device and the first gateway. In this way, the signaling path from the master device to the target sub-device is unobstructed, and the master device can manage the target sub-device.
[0170] Based on the above embodiments, the present application also provides another method for accessing a network, which is applied to an Internet of Things system. Figure 7 As shown, Figure 7 An interaction schematic diagram of an Internet of Things system is shown, wherein the Internet of Things system includes a main device, a cloud server, a first gateway and a second gateway, wherein at least one first sub-device is bound to the first gateway, and at least one second sub-device is bound to the second gateway.
[0171] Step 701: When the cloud server detects that the second gateway is disconnected from at least one second sub-device, the cloud server sends a third message to the main device.
[0172] In the embodiment of the present application, the second gateway is disconnected from at least one second sub-device generally including two situations, one situation is that the second sub-device is actively disconnected from the second gateway, and the other situation is that the second sub-device is passively disconnected from the second gateway.
[0173] Among them, the situation where the second sub-device actively disconnects from the second gateway is, for example: the second sub-device is a mobile device. During the movement of the second sub-device, it may be far away from the second gateway, so that it disconnects from the second gateway. When one or more second sub-devices disconnect from the second gateway, the second gateway can report the status of the disconnected second sub-devices to the cloud server. In this way, the cloud server can confirm that it has detected the disconnection between the second gateway and at least one second sub-device.
[0174] Among them, the situation where the second sub-device disconnects from the second gateway passively is, for example: when the second gateway is damaged or the second gateway loses power, the second gateway disconnects from the cloud server. When the cloud server does not receive the breathing information reported by the second gateway within a preset time period, the cloud server defaults to detecting the disconnection between the second gateway and at least one second sub-device. This is because when the second gateway is damaged or the second gateway loses power, the second sub-device cannot establish an effective connection with the second gateway and cannot access the cloud server through the second gateway. Therefore, the second sub-device changes from the connected state to the disconnected state passively.
[0175] Among them, when the second sub-device disconnects from the second gateway, the broadcast signal sent by the second sub-device will carry a target field.
[0176] In the embodiment of the present application, when the cloud server detects the disconnection between the second gateway and at least one second sub-device, it will automatically report a message indicating the change in the status of the sub-device, that is, the third message, to the master device.
[0177] Among them, the third message indicates the disconnection between the second gateway and at least one second sub-device. The third message carries the identification information of the second sub-device. Optionally, when there are multiple disconnected second sub-devices, the third message may carry the identification information of multiple second sub-devices.
[0178] Step 702, the master device sends a first instruction to the cloud server in response to the third message.
[0179] Among them, the third message is sent by the cloud server when it detects the disconnection between the second gateway and at least one second sub-device, and indicates the disconnection between the second gateway and at least one second sub-device. The first instruction carries the identification information of the second gateway.
[0180] In the embodiment of the present application, the third message can automatically trigger the master device to execute a preset processing flow. The preset processing flow includes sending a first instruction to the cloud server. Among them, the master device sends a first instruction to the cloud server, which is executed without the user's awareness and is not triggered by the user. This process does not require user participation.
[0181] In one implementation, after receiving the third message, the master device can obtain the identification information of the disconnected second gateway from the third message, and then generate a first instruction based on the identification information of the disconnected second gateway and send it to the cloud server.
[0182] In another implementation, after receiving the third message, the master device can generate a scan instruction and send the scan instruction to all gateways that the master device can manage. Among these all gateways, the first gateway and the second gateway are included. In this solution, the master device directly sends the scan instruction to the gateway without going through the cloud server, and this processing process does not require user participation. After receiving the scan instruction, each gateway performs device scanning.
[0183] In another implementation, after receiving the third message, the master device can display the content indicated by the third message to the user through the touch screen to remind the user. Optionally, the master device can wait for the user instruction and send a scan instruction to the first gateway according to the user instruction. Among them, the user can determine the target gateway by himself / herself. The target gateway is the gateway selected by the user for taking over the second sub-device. The user can select the target gateway through the touch screen of the master device, and the master device sends a scan instruction to the target gateway in response to the user's selection operation. The target gateway is the first gateway in this embodiment. Optionally, while displaying the content indicated by the third message, the master device can also automatically execute a preset processing flow without waiting for the user instruction. The process of automatically executing the preset processing flow can refer to the above description and will not be elaborated here.
[0184] Step 703, the cloud server determines the target gateway corresponding to the second gateway according to the first instruction.
[0185] Step 704, send a second instruction to the target gateway.
[0186] Among them, the second instruction instructs the target gateway to perform device scanning.
[0187] In the embodiment of the present application, the first instruction is a sub-device discovery instruction for instructing to discover sub-devices.
[0188] After receiving the first instruction, the cloud server first determines the target gateway according to the identification of the second gateway carried in the first instruction, and then sends a second instruction to the target gateway. Among them, after receiving the second instruction, the target gateway performs device scanning.
[0189] In the embodiment of the present application, the target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. This means that the target gateway and the second gateway belong to the same trust domain. Among them, the target gateway includes the first gateway.
[0190] Step 705: The first gateway performs device scanning according to the second instruction.
[0191] In the embodiments of the present application, the target gateway includes the first gateway. Optionally, the target gateway can be determined as the first gateway. Optionally, the target gateway that scans the target sub-device with a connection requirement can be determined as the first gateway.
[0192] In the embodiments of the present application, the target gateway performs device scanning after receiving the second instruction. Each target gateway can detect and process multiple candidate sub-devices scanned by itself to determine the target sub-device with a connection requirement that is scanned. The implementation process can refer to the content disclosed in the foregoing embodiments.
[0193] Step 706: The first gateway sends a first request to the cloud server for the target sub-device with a connection requirement that is scanned.
[0194] Among them, the target sub-device with a connection requirement includes the second sub-device that was disconnected above.
[0195] It should be noted that the same sub-device may be scanned by different target gateways. Different target gateways may scan different target sub-devices. Each target gateway performs scanning and detection processing independently. When a target sub-device with a connection requirement is scanned, the target gateway, as the first gateway, can independently send a first request to the cloud server.
[0196] Among them, the cloud server may receive first requests from at least two target gateways. The at least two target gateways include the first gateway. The first request from the first gateway is the earliest to reach the cloud server among the first requests from the at least two target gateways.
[0197] It should be noted that in the embodiments of the present application, the target sub-devices include, but are not limited to, the disconnected second sub-devices.
[0198] It should be understood that although this solution is triggered when it is detected that the second sub-device is disconnected, when the target gateway performs device scanning, it does not specifically scan the disconnected second sub-device and may also scan new unregistered sub-devices.
[0199] Step 707: The cloud server determines whether there is a trust relationship between the target sub-device and the first gateway according to the first request.
[0200] Step 708: When there is a trust relationship between the target sub-device and the first gateway, send a first message to the first gateway.
[0201] Step 709: The first gateway establishes an effective connection with the target sub-device in response to the first message.
[0202] Step 710: Send a second message to the cloud server.
[0203] Step 711: In response to the second message, the cloud server sends a fourth message to the first gateway.
[0204] Step 712: Bind the target sub-device to the first gateway locally.
[0205] Step 713: In response to the fourth message, the first gateway records the sub-device information of the target sub-device locally.
[0206] In the embodiments of the present application, Steps 707 to 713 may refer to Figure 5 the content disclosed in the corresponding embodiments, which will not be elaborated herein.
[0207] Combined with Figure 7 It can be seen that the disconnected second sub-device can complete the process of reconnecting to the cloud server through the interaction between the first gateway, the second gateway, the cloud server, and the master device without the user's awareness. It is completed in a state where the user is unaware. This reduces user participation and improves work efficiency.
[0208] In the embodiments of the present application, the master device can automatically respond to the third message to trigger the cloud server to control the target gateway to perform device scanning through the first instruction, without relying on the user, which expands the function of the master device and improves the efficiency.
[0209] It should be understood that the above examples are for helping those skilled in the art to understand the embodiments of the present application, rather than limiting the embodiments of the present application to the specific numerical values or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0210] Figure 8 FIG. shows a schematic diagram of a gateway device provided by an embodiment of the present application. The gateway device is applied to the first gateway in an Internet of Things system. The Internet of Things system further includes a cloud server, and there is a communication connection between the first gateway and the cloud server. The gateway device includes a scanning module 801 and a processing module 802. Among them, the scanning module 801 is used to perform device scanning when a preset condition is met, and send a first request to the cloud server for a target sub-device with a connection requirement detected during the scanning. The first request carries the identification information of the target sub-device, and the first request instructs the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway; the processing module 802 is used to receive the first message sent by the cloud server, establish an effective connection with the target sub-device in response to the first message, and send a second message to the cloud server. The first message indicates that there is a trust relationship between the target sub-device and the first gateway, and the second message indicates that an effective connection has been established between the first gateway and the target sub-device.
[0211] Optionally, in some embodiments, the Internet of Things system further includes a second gateway and a master device. The second gateway and the master device are respectively in communication connection with the cloud server. The master device manages the slave devices through the cloud server. At least one second slave device is bound under the second gateway. The scanning module 801 is specifically configured to receive a second instruction sent by the cloud server and perform device scanning according to the second instruction. The second instruction is sent by the cloud server after receiving a first instruction sent by the master device. The first instruction carries identification information of the second gateway, and the first instruction instructs the cloud server to determine a target gateway corresponding to the second gateway and send the second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. The target gateway includes the first gateway. The first instruction is sent by the master device after receiving a third message sent by the cloud server. The third message is sent by the cloud server when it detects that the second gateway is disconnected from at least one second slave device, and indicates that the second gateway is disconnected from at least one second slave device.
[0212] Optionally, in some embodiments, the scanning module 801 is specifically configured to detect whether each candidate slave device scanned is in an effective connection with the first gateway, or detect whether the candidate slave device is in an effective connection with other gateways. If the candidate slave device is not in an effective connection with the first gateway and is not in an effective connection with other gateways, the candidate slave device is determined as a target slave device with a connection requirement.
[0213] Optionally, in some embodiments, the processing module 802 is specifically configured to receive a fourth message sent by the cloud server. The fourth message is sent by the cloud server after receiving the second message, and the fourth message indicates that the cloud server confirms the effective connection established between the first gateway and the target slave device. In response to the fourth message, the target slave device is recorded locally.
[0214] The gateway device in the embodiments of the present application can correspondingly execute the method for accessing the network described in the embodiments of the present application, and the above and other operations and / or functions of each unit in the gateway device respectively implement the corresponding processes of the above method. For the sake of brevity, they will not be elaborated here.
[0215] Figure 9The figure shows a schematic diagram of a server device provided by an embodiment of the present application. The server is applied to a cloud server in an Internet of Things system. The Internet of Things system further includes a first gateway, and there is a communication connection between the first gateway and the cloud server. The server includes an acquisition module 901, a determination module 902, a sending module 903, and a receiving module 904. Among them, the acquisition module 901 is used to acquire a first request from the first gateway. The first request carries identification information of a target sub-device, and the target sub-device is a sub-device with a connection requirement scanned by the first gateway; the determination module 902 is used to determine whether there is a trust relationship between the target sub-device and the first gateway according to the first request; the sending module 903 is used to send a first message to the first gateway when there is a trust relationship between the target sub-device and the first gateway. The first message indicates that there is a trust relationship between the target sub-device and the first gateway; the receiving module 904 is used to receive a second message from the first gateway and bind the target sub-device to the first gateway locally in response to the second message. The second message is sent after the first gateway establishes an effective connection with the target sub-device in response to the first message and indicates that the first gateway has established an effective connection with the target sub-device.
[0216] Optionally, in some embodiments, the determination module 902 is specifically configured to, in response to the first request, detect whether the target sub-device and the first gateway are registered on the cloud server using the same user account, or whether they are registered on the cloud server using different user accounts with an associated relationship; if the target sub-device and the first gateway are registered on the cloud server using the same user account, or using different user accounts with an associated relationship, it is determined that there is a trust relationship between the target sub-device and the first gateway; if the target sub-device and the first gateway are not registered on the cloud server using the same user account, and there is no associated relationship between the user account used by the target sub-device and the user account used by the first gateway, it is determined that there is no trust relationship between the target sub-device and the first gateway.
[0217] Optionally, in some embodiments, the Internet of Things system further includes a second gateway and a master device. The second gateway and the master device are respectively in communication connection with the cloud server. The master device manages the slave devices through the cloud server. At least one second slave device is bound to the second gateway. The sending module 903 is further configured to send a third message to the master device when it detects that the second gateway is disconnected from at least one second slave device. The third message indicates that the second gateway is disconnected from at least one second slave device. The receiving module 904 is further configured to receive a first instruction sent by the master device in response to the third message. The first instruction carries the identification information of the second gateway. The determining module 902 is further configured to determine a target gateway corresponding to the second gateway according to the first instruction, and send a second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts having an associated relationship with the second gateway. The target gateway includes the first gateway. The second instruction instructs the target gateway to perform device scanning.
[0218] Optionally, in some embodiments, the determining module 902 is further configured to detect whether the target slave device is an unregistered slave device according to the identification information of the target slave device when there is no trust relationship between the target slave device and the first gateway. If the target slave device is an unregistered slave device, a reminder message is generated to remind the user to register the target slave device.
[0219] Optionally, in some embodiments, the cloud server receives first requests from at least two gateways. The at least two gateways are registered on the cloud server using the same user account or different user accounts having an associated relationship. The at least two gateways include the first gateway. The first request from the first gateway is the earliest to reach the cloud server among the first requests from the at least two gateways.
[0220] Optionally, in some embodiments, the sending module 903 is further configured to send a fourth message to the first gateway. The fourth message indicates that the cloud server confirms the valid connection established between the first gateway and the target slave device.
[0221] The server device in the embodiments of the present application can correspondingly execute the method for accessing the network described in the embodiments of the present application. The above and other operations and / or functions of each unit in the server device respectively implement the corresponding processes of the above method. For the sake of brevity, they are not described in detail here.
[0222] Figure 10The figure shows a schematic diagram of a master device provided by an embodiment of the present application. The device is applied to the master device in an Internet of Things system. The Internet of Things system further includes a cloud server and a second gateway. Among them, the second gateway and the master device are respectively communicatively connected to the cloud server. The master device manages sub-devices through the cloud server. At least one second sub-device is bound under the second gateway. The device includes a receiving module 1001 and a transmitting module 1002. Among them, the receiving module 1001 is configured to receive a third message from the cloud server. The third message is sent by the cloud server when it detects that the second gateway is disconnected from at least one second sub-device, and indicates that the second gateway is disconnected from at least one second sub-device. The transmitting module 1002 is configured to send a first instruction to the cloud server in response to the third message. The first instruction carries the identification information of the second gateway. The first instruction instructs the cloud server to determine the target gateway corresponding to the second gateway and send a second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. The second instruction instructs the target gateway to perform device scanning.
[0223] The master device of the embodiment of the present application can correspond to executing the method for accessing the network described in the embodiment of the present application. And the above and other operations and / or functions of each unit in the master device respectively implement the corresponding processes of the above method. For the sake of brevity, they will not be elaborated here.
[0224] Figure 11 The figure shows a block diagram of a cloud server. The cloud server includes a processor 1110, a memory 1120, a communication interface 1130, and a bus 1140.
[0225] Among them, the processor 1110 can be connected to the memory 1120. The memory 1120 can be used to store the program code and data. Therefore, the memory 1120 can be an internal storage unit of the processor 1110, an external storage unit independent of the processor 1110, or a component including an internal storage unit of the processor 1110 and an external storage unit independent of the processor 1110.
[0226] Optionally, the cloud server may further include a bus 1140. Among them, the memory 1120 and the communication interface 1130 can be connected to the processor 1110 through the bus 1140. The bus 1140 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation,Figure 11 It is represented by only one line, but it does not mean that there is only one bus or one type of bus.
[0227] It should be understood that in the embodiments of the present application, the processor 1110 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Or the processor 1110 adopts one or more integrated circuits to execute relevant programs to implement the technical solutions provided by the embodiments of the present application.
[0228] The memory 1120 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1110. A part of the processor 1110 may also include a non-volatile random access memory. For example, the processor 1110 may also store information about the device type.
[0229] When the cloud server is running, the processor 1110 executes the computer-executable instructions in the memory 1120 to perform the operation steps of the above method for accessing the network by using the hardware resources in the cloud server.
[0230] It should be understood that the cloud server in the embodiments of the present application corresponds to the corresponding main body that executes the method for accessing the network in the embodiments of the present application, and the above and other operations and / or functions of each module in the cloud server are respectively for implementing the corresponding processes of the above method. For the sake of brevity, they will not be elaborated here.
[0231] Figure 12 A structural block diagram of a gateway is shown. The gateway includes a processor 1210, a memory 1220, a communication interface 1230, and a bus 1240.
[0232] Among them, the processor 1210 may be connected to the memory 1220. The memory 1220 may be used to store the program code and data. Therefore, the memory 1220 may be an internal storage unit of the processor 1210, an external storage unit independent of the processor 1210, or a component including an internal storage unit of the processor 1210 and an external storage unit independent of the processor 1210.
[0233] Optionally, the gateway may further include a bus 1240. Among them, the memory 1220 and the communication interface 1230 may be connected to the processor 1210 through the bus 1240. The bus 1240 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 1240 may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 12 only one line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0234] It should be understood that in the embodiments of the present application, the processor 1210 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Or the processor 1210 adopts one or more integrated circuits to execute relevant programs to implement the technical solutions provided by the embodiments of the present application.
[0235] The memory 1220 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1210. A part of the processor 1210 may also include a non-volatile random access memory. For example, the processor 1210 may also store information about the device type.
[0236] When the gateway is running, the processor 1210 executes the computer-executable instructions in the memory 1220 to execute the operation steps of the above method for accessing the network by using the hardware resources in the gateway.
[0237] It should be understood that the gateway in the embodiments of the present application corresponds to the corresponding main body that executes the method for accessing the network in the embodiments of the present application, and the above and other operations and / or functions of each module in the gateway respectively implement the corresponding processes of the above method. For the sake of brevity, they will not be elaborated here.
[0238] Figure 13A structural block diagram of a master device is shown. The master device includes a processor 1310, a memory 1320, a communication interface 1330, and a bus 1340.
[0239] Among them, the processor 1310 can be connected to the memory 1320. The memory 1320 can be used to store the program code and data. Therefore, the memory 1320 can be an internal storage unit of the processor 1310, an external storage unit independent of the processor 1310, or a component including an internal storage unit of the processor 1310 and an external storage unit independent of the processor 1310.
[0240] Optionally, the master device may further include a bus 1340. Among them, the memory 1320 and the communication interface 1330 can be connected to the processor 1310 through the bus 1340. The bus 1340 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 1340 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 13 only one line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0241] It should be understood that in the embodiments of the present application, the processor 1310 can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Or the processor 1310 uses one or more integrated circuits to execute related programs to implement the technical solutions provided in the embodiments of the present application.
[0242] The memory 1320 can include a read-only memory and a random access memory and provide instructions and data to the processor 1310. A part of the processor 1310 can also include a non-volatile random access memory. For example, the processor 1310 can also store information about the device type.
[0243] When the master device is running, the processor 1310 executes the computer-executable instructions in the memory 1320 to perform the operation steps of the above method for accessing the network by using the hardware resources in the master device.
[0244] It should be understood that the master device in the embodiments of the present application corresponds to the corresponding entity that executes the method for accessing the network in the embodiments of the present application, and the above and other operations and / or functions of each module in the master device respectively implement the corresponding processes of the above method. For the sake of brevity, they will not be described in detail here.
[0245] The present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed, the method for accessing the network provided in the embodiments of the present application is implemented.
[0246] The present application also provides a computer program product. The computer program product includes: computer program code. When the computer program code runs on a computer, the computer is caused to execute the method for accessing the network provided in the embodiments of the present application.
[0247] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage such as a server or data center that includes one or more collections of available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid state drive (SSD).
[0248] Those of ordinary skill in the art will realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of this application.
[0249] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0250] In the several embodiments provided by the embodiments of this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.
[0251] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units. They can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0252] In addition, in each embodiment of the embodiments of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0253] When the above-mentioned function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a memory (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0254] As described above, the above is only the specific implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the embodiments of the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for accessing a network, characterized in that A first gateway applied to an Internet of Things (IoT) system. The IoT system further includes a cloud server, and the first gateway is communicatively connected to the cloud server. The method includes: Performing device scanning when a preset condition is satisfied, and sending a first request to the cloud server for a target sub-device with a connection requirement detected during the scanning. The first request carries identification information of the target sub-device, and the first request instructs the cloud server to determine whether there is a trust relationship between the target sub-device and the first gateway. Receiving a first message sent by the cloud server, establishing an effective connection with the target sub-device in response to the first message, and sending a second message to the cloud server. The first message indicates that there is a trust relationship between the target sub-device and the first gateway, and the second message indicates that an effective connection has been established between the first gateway and the target sub-device.
2. The method according to claim 1, wherein The IoT system further includes a second gateway and a master device. The second gateway and the master device are respectively communicatively connected to the cloud server. The master device manages sub-devices through the cloud server. At least one second sub-device is bound under the second gateway. The performing device scanning when a preset condition is satisfied includes: Receiving a second instruction sent by the cloud server and performing device scanning according to the second instruction. The second instruction is sent by the cloud server after receiving a first instruction sent by the master device. The first instruction carries identification information of the second gateway, and the first instruction instructs the cloud server to determine a target gateway corresponding to the second gateway and send the second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. The target gateway includes the first gateway. The first instruction is sent by the master device after receiving a third message sent by the cloud server. The third message is sent by the cloud server when detecting that the second gateway is disconnected from the at least one second sub-device, and indicates that the second gateway is disconnected from the at least one second sub-device.
3. The method according to claim 1 or 2, characterized in that, Before sending the first request to the cloud server for the target sub-device with a connection requirement detected during the scanning, the method further includes: Detecting whether each candidate sub-device detected during the scanning has an effective connection with the first gateway, or detecting whether the candidate sub-device has an effective connection with other gateways. If the candidate sub-device does not have an effective connection with the first gateway and does not have an effective connection with other gateways, then determining the candidate sub-device as the target sub-device with a connection requirement.
4. The method according to claim 1 or 2, characterized in that The method further includes: Receiving a fourth message sent by the cloud server. The fourth message is sent by the cloud server after receiving the second message, and the fourth message indicates that the cloud server confirms the effective connection established between the first gateway and the target sub-device. Record the target sub-device locally in response to the fourth message.
5. A method for accessing a network, characterized in that, Applied to a cloud server in an Internet of Things system, the Internet of Things system further includes a first gateway, and there is a communication connection between the first gateway and the cloud server. The method includes: Obtain a first request from the first gateway, where the first request carries identification information of a target sub-device, and the target sub-device is a sub-device with a connection requirement scanned by the first gateway; Determine whether there is a trust relationship between the target sub-device and the first gateway according to the first request; When there is a trust relationship between the target sub-device and the first gateway, send a first message to the first gateway, and the first message indicates that there is a trust relationship between the target sub-device and the first gateway; Receive a second message from the first gateway, and bind the target sub-device to the first gateway locally in response to the second message. The second message is sent by the first gateway after establishing an effective connection with the target sub-device in response to the first message, and indicates that an effective connection has been established between the first gateway and the target sub-device.
6. The method according to claim 5, characterized in that, The determining whether there is a trust relationship between the target sub-device and the first gateway according to the first request includes: In response to the first request, detect whether the target sub-device and the first gateway are registered on the cloud server using the same user account, or whether they are registered on the cloud server using different user accounts with an associated relationship; If the target sub-device and the first gateway are registered on the cloud server using the same user account, or using different user accounts with an associated relationship, determine that there is a trust relationship between the target sub-device and the first gateway; If the target sub-device and the first gateway are not registered on the cloud server using the same user account, and there is no associated relationship between the user account used by the target sub-device and the user account used by the first gateway, determine that there is no trust relationship between the target sub-device and the first gateway.
7. The method according to claim 5, wherein The Internet of Things system further includes a second gateway and a master device. Among them, the second gateway and the master device are respectively in communication connection with the cloud server. The master device manages sub-devices through the cloud server. At least one second sub-device is bound under the second gateway. Before obtaining the first request from the first gateway, the method further includes: When it is detected that the second gateway is disconnected from the at least one second sub-device, send a third message to the master device, and the third message indicates that the second gateway is disconnected from the at least one second sub-device; Receive a first instruction sent by the master device in response to the third message, and the first instruction carries identification information of the second gateway; Determine the target gateway corresponding to the second gateway according to the first instruction, and send a second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. The target gateway includes the first gateway, and the second instruction instructs the target gateway to perform device scanning.
8. The method according to any one of claims 5 to 7, characterized in that The method further includes: In the case where there is no trust relationship between the target sub-device and the first gateway, detect whether the target sub-device is an unregistered sub-device according to the identification information of the target sub-device; If the target sub-device is an unregistered sub-device, generate a reminder message to remind the user to register the target sub-device.
9. The method according to any one of claims 5 to 7, characterized in that The cloud server receives the first requests from at least two gateways. The at least two gateways are registered on the cloud server using the same user account or different user accounts with an associated relationship. The at least two gateways include the first gateway, and the first request from the first gateway is the earliest to reach the cloud server among the first requests from the at least two gateways.
10. The method according to any one of claims 5 to 7, characterized in that After receiving the second message from the first gateway, the method further includes: Send a fourth message to the first gateway, and the fourth message indicates that the cloud server confirms the valid connection established between the first gateway and the target sub-device.
11. A method for accessing a network, characterized in that Applied to the master device in the Internet of Things system. The Internet of Things system further includes a cloud server and a second gateway. The second gateway and the master device are respectively in communication connection with the cloud server. The master device manages sub-devices through the cloud server. At least one second sub-device is bound under the second gateway. The method includes: Receive a third message from the cloud server. The third message is sent by the cloud server when it detects that the second gateway is disconnected from the at least one second sub-device, and indicates that the second gateway is disconnected from the at least one second sub-device; In response to the third message, send a first instruction to the cloud server. The first instruction carries the identification information of the second gateway. The first instruction instructs the cloud server to determine the target gateway corresponding to the second gateway and send a second instruction to the target gateway. The target gateway is a gateway registered on the cloud server using the same user account as the second gateway, or a gateway registered on the cloud server using different user accounts with an associated relationship with the second gateway. The second instruction instructs the target gateway to perform device scanning.
12. A cloud server, characterized in that, It includes a memory and a processor. The memory stores a computer program, and the computer program executes the method for accessing the network according to any one of claims 5 to 10 when running on the processor.
13. A gateway, characterized in that, It includes a memory and a processor. The memory stores a computer program which, when running on the processor, executes the method for accessing a network according to any one of claims 1 to 4.
14. A master device, characterized in that, It includes a memory and a processor. The memory stores a computer program which, when running on the processor, executes the method for accessing a network according to claim 11.
15. An Internet of Things system, characterized in that, It includes a first gateway and a cloud server. There is a communication connection between the first gateway and the cloud server. Among them, the first gateway executes the steps as recited in claims 1 to 4, and the cloud server executes the steps as recited in claims 5 to 10.
16. The Internet of Things system according to claim 14, wherein It further includes a master device. There is a communication connection between the master device and the cloud server. The master device manages slave devices through the cloud server. The master device executes the steps as recited in claim 11.
17. A computer-readable storage medium, characterized in that It stores a computer program which, when running on a processor, executes the method for accessing a network according to any one of claims 1 to 4, or executes the method for accessing a network according to any one of claims 5 to 10, or executes the method for accessing a network according to claim 11.
18. A computer program product, characterized in that, The computer program product includes: computer program code which, when running on a computer, causes the computer to execute the method for accessing a network according to any one of claims 1 to 4, or execute the method for accessing a network according to any one of claims 5 to 10, or execute the method for accessing a network according to claim 11.