Networking method and device
By broadcasting slave device identification information from the master device and using the slave device's response mechanism, the problem of long networking time in multi-master device environments is solved, thus improving networking efficiency.
Patent Information
- Application Number
- CN202311014110.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-08-10
AI Technical Summary
In whole-house smart home scenarios, the networking of smart devices takes a long time and has low efficiency due to the large number of main devices.
The master device broadcasts a message carrying the identification information of the slave devices it allows to access. The slave device determines whether it is an allowed access device based on the received message, and sends a network request message when it determines that it is allowed to access. The master device then determines whether to access based on the identification information of the slave device, thereby shortening the network connection time.
This method reduces the time spent by slave devices repeatedly attempting to connect to multiple master devices, thus improving networking efficiency.
Smart Images

Figure CN119484181B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, in particular to a networking method and device. BACKGROUND
[0002] With the popularity of smart home, more and more families choose to make the whole house intelligent. In the whole house intelligent scene, there are many intelligent devices, so the networking efficiency of the intelligent devices becomes an important selection factor when networking.
[0003] The intelligent devices can be divided into master devices and slave devices when networking. When the slave device requests to network with the master device, the master device can determine whether the slave device sending the request exists in the whitelist of the master device according to the whitelist saved by the master device, and then determine whether to network with the slave device sending the request according to the determination result. When there are many master devices, the slave device may need to send a networking request message to each master device in turn, and try one by one to find the corresponding master device, which will make the networking connection time-consuming and the networking efficiency low. SUMMARY
[0004] The present application provides a networking method and device to shorten the networking connection time and improve the networking efficiency.
[0005] In a first aspect, the present application provides a networking method, which can be applied to a master device. Specifically, the method comprises: first, broadcasting a first message, wherein the first message comprises identification information of at least one slave device allowed to access by the master device; then, receiving a second message sent by a first slave device, wherein the second message comprises identification information of the first slave device, and the second message is sent by the first slave device after determining its own identification information in the identification information of the at least one slave device allowed to access by the master device according to the first message; finally, establishing a connection with the first slave device when it is determined that the identification information of the first slave device is in the identification information of the at least one slave device allowed to access by the master device.
[0006] It should be understood that the first message refers to a broadcast message, and the second message refers to a registration networking request message. Figure 3 The first message in step 301 in the embodiment, and the registration networking request message in step 303 in the embodiment. Figure 4 The first message in step 401a, the second message in step 401b and the third message in step 401c in the embodiment. The second message received by the master device is a registration networking request message, which can be, for example, Figure 3 The registration networking request message in step 303 in the embodiment.
[0007] According to the technical solution, the master device can carry the identification information of at least one slave device allowed to access by the master device when broadcasting the first message, so that the device receiving the first message can determine whether the device is the slave device allowed to access by the master device. When it is determined that the device is the slave device allowed to access by the master device, the device sends a network establishment request message to the corresponding master device, thereby shortening the network establishment connection time and improving the efficiency.
[0008] In a possible design, the method further includes:
[0009] If it is determined that the identification information of the first slave device is not in the identification information of the at least one slave device allowed to access by the master device, a third message is sent to the first slave device, where the third message is used to indicate the rejection of access.
[0010] It should be understood that the third message can be the rejection of access message in the following embodiment.
[0011] According to the technical solution, when the master device determines that the first slave device is not in the devices allowed to access by the master device, the master device can reject the network establishment request of the first slave device, thereby avoiding that the first slave device repeatedly sends the network establishment request message to the master device, and shortening the network establishment connection time.
[0012] In a possible design, the method further includes:
[0013] The fourth message sent by the second slave device is received, where the fourth message includes the identification information of the second slave device, and the fourth message is sent by the second slave device after determining that the identification information of the second slave device is in the identification information of the at least one slave device allowed to access by the master device. When it is determined that the identification information of the second slave device is in the identification information of the at least one slave device allowed to access by the master device, a connection is established with the second slave device.
[0014] It should be understood that the fourth message is a network establishment request message, and the fourth message refers to the network establishment request message sent by the second slave device to the master device.
[0015] According to the technical solution, the master device can further receive the network establishment request message sent by other slave devices, and then establish a connection with the other slave devices when it is determined that the slave device sending the network establishment request message is in the devices allowed to access by the master device, so that the master device can establish a connection with multiple slave devices.
[0016] In a second aspect, the present application provides a networking method, which can be applied to a slave device. Specifically, the method can include: first, receiving a first message broadcast by a first master device, wherein the first message comprises identification information of at least one slave device allowed to access by the first master device; and then, when it is determined that the identification information of the slave device is in the identification information of the at least one slave device allowed to access by the first master device, sending a second message to the first master device, wherein the second message comprises the identification information of the slave device.
[0017] According to the above technical solution, after receiving the broadcast first message, the slave device can determine whether it is a slave device allowed to access by the first master device, and if so, send a networking request message to the first master device. In this way, in the case of a large number of master devices, the slave device can avoid sending a networking request message to each master device to find the corresponding master device, thereby improving the networking efficiency.
[0018] In a possible design, the method further includes:
[0019] If it is determined that the identification information of the slave device is not in the identification information of the at least one slave device allowed to access by the first master device, the slave device does not respond to the first message.
[0020] According to the above technical solution, if the slave device determines that it is not a slave device allowed to access by the first master device according to the broadcast first message, the slave device does not respond to the broadcast first message. In this way, the slave device can reduce the case of sending a networking request message to an incorrect master device, thereby improving the networking efficiency.
[0021] In a possible design, the method further includes:
[0022] receiving a fifth message broadcast by a second master device, wherein the fifth message comprises identification information of at least one slave device allowed to access by the second master device; and when it is determined that the identification information of the slave device is in the identification information of the at least one slave device allowed to access by the second master device, determining a target master device from the first master device and the second master device, and sending a sixth message to the target master device, wherein the sixth message comprises identification information of the target master device.
[0023] It should be understood that the fifth message is a broadcast message, which can be, for example, a Figure 4 second message in step 401b in the embodiment shown in FIG. 4, and the sixth message is a registration networking request message. For example, assuming that the target master device is the first master device in the embodiment shown in FIG. 4, the sixth message can be the registration networking request message in step 403 in the embodiment shown in FIG. 4. Figure 4 Figure 4
[0024] Through the technical solution, the slave device can receive a second message broadcast by a second master device other than the first master device, and then determine whether the slave device is in slave devices allowed to access by the second master device. When it is determined that the slave device is in slave devices allowed to access by the first master device and in slave devices allowed to access by the second master device, one target master device is determined from the first master device and the second master device, and a networking request message is sent to the target master device, so that the slave device can establish a connection with the target master device selected by the slave device.
[0025] In a third aspect, the present application also provides a master device, comprising one or more processors; one or more memories; and one or more programs; wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when invoked to execute by the one or more processors, cause the master device to perform the method of the first aspect or any possible design of the first aspect.
[0026] In a fourth aspect, the present application also provides a master device, comprising modules / cells for performing the method of the first aspect or any possible design of the first aspect; these modules / cells can be implemented by hardware, or by hardware executing corresponding software.
[0027] In a fifth aspect, the present application also provides a slave device, comprising one or more processors; one or more memories; and one or more programs; wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when invoked to execute by the one or more processors, cause the slave device to perform the method of the second aspect or any possible design of the second aspect.
[0028] In a sixth aspect, the present application also provides a slave device, comprising modules / cells for performing the method of the second aspect or any possible design of the second aspect; these modules / cells can be implemented by hardware, or by hardware executing corresponding software.
[0029] In a seventh aspect, the present application also provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions run on a master device, cause the master device to perform the method of the first aspect or any possible design of the first aspect.
[0030] In an eighth aspect, the present application also provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions run on a slave device, cause the slave device to perform the method of the second aspect or any possible design of the second aspect.
[0031] In a ninth aspect, the present application provides a program product, which, when running on a master device, causes the master device to perform the method of the first aspect of the embodiments of the present application and any possible implementation of the first aspect.
[0032] In a tenth aspect, the present application provides a program product, which, when running on a slave device, causes the slave device to perform the method of the second aspect of the embodiments of the present application and any possible implementation of the second aspect.
[0033] The technical effects achieved by each of the above-mentioned third to tenth aspects and each possible implementation of the aspects can be referred to the above-mentioned technical effect descriptions of the first aspect and any possible implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 An application scenario diagram provided by the embodiments of the present application;
[0035] Figure 2 A structure diagram of an intelligent device provided by the embodiments of the present application;
[0036] Figure 3 A networking method flowchart provided by the embodiments of the present application;
[0037] Figure 4 Another networking method flowchart provided by the embodiments of the present application;
[0038] Figure 5 A structure block diagram of a networking device provided by the embodiments of the present application;
[0039] Figure 6 Another structure diagram of an intelligent device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0040] The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings of the embodiments of the present application.
[0041] It should be understood that at least one of the following embodiments involves one or more, wherein the plurality refers to greater than or equal to two. In addition, it should be understood that in the description of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description.
[0042] In the following, first, some terms in the embodiments of the present application will be explained and described, so as to facilitate the understanding of the skilled in the art.
[0043] 1, power line communication (power line communication, PLC)
[0044] This refers to a communication method that uses power lines to transmit data and media signals. In this application, a PLC domain consists of one or more PLC nodes, which can be understood as PLC devices.
[0045] 2. Main equipment
[0046] The master device manages (coordinates) all nodes in the same domain. The master device can also be called the Domain Master (DM) node.
[0047] 3. From the equipment
[0048] A slave device is a non-domain master node in a PLC domain, also known as an end point (EP). End points can network with domain master nodes. Furthermore, end points are managed and coordinated by the domain master nodes.
[0049] For example, such as Figure 1 The diagram shown is an application scenario illustration provided by an embodiment of this application. (See attached image.) Figure 1 As shown, this application scenario may include at least one master device (e.g., master device 1, master device 2, master device 3) and at least one slave device (e.g., slave device 11, slave device 12, slave device 2, slave device 3). The multiple master devices and multiple slave devices are connected via a PLC.
[0050] It should be understood that Figure 1 This application only uses PLC connection as an example. In this embodiment, as long as the devices are selected using a whitelist method, regardless of the connection method between the master and slave devices, they can be included within the protection scope of this application. For example, multiple master devices and multiple slave devices can also be connected through a local area network, such as a wireless fidelity (Wi-Fi) hotspot network, or through Bluetooth (BT), etc. This application does not limit this.
[0051] exist Figure 1 In the diagram, master device 1, master device 2, and master device 3 can be located in the same space. For example, in a home setting, a router can be placed in the living room, and two separate routers can be placed in the two bedrooms. The network formed by devices connected under the same master device is the same domain. For example, if master device 1 is connected to slave devices 11 and 12 via power lines, then master device 1, slave devices 11, and 12 can form PLC domain 1. It should be understood that a single master device can connect to multiple slave devices.
[0052] In some embodiments, the master device 1, the master device 2, and the master device 3 can respectively broadcast messages (may also be referred to as broadcast packets), and the white list information carried in the respective broadcast messages can be used to represent at least one slave device information allowed to access by each master device. Then, the slave device 1 1, the slave device 12, the slave device 2, and the slave device 3 can receive the messages broadcast by the master device 1, the master device 2, and the master device 3 respectively. Taking the slave device 1 1 as an example, assuming that the message broadcast by the master device 1 is message 1, the message broadcast by the master device 2 is message 2, and the message broadcast by the master device 3 is message 3, after the slave device 1 1 receives the message 1, the message 2, and the message 3, the slave device 1 1 can determine whether the white list information in the broadcast message matches the device information of the slave device 1 1, and determine whether the device information of the slave device 1 1 is the slave device allowed to access by the corresponding master device. For example, if the slave device 1 1 determines that the white list information in the message 1 does not match the device information of the slave device 1 1, the slave device 1 1 does not respond to the message 1; if the slave device 1 1 determines that the white list information in the message 2 matches the device information of the slave device 1 1, the slave device 1 1 responds to the message 2 and sends a registration networking request message to the master device 2 broadcasting the message 2. Similarly, if the slave device 1 1 determines that the white list information in the message 3 does not match the device information of the slave device 1 1, the slave device 1 1 does not respond to the message 3. Similarly, the slave device 12, the slave device 2, and the slave device 3 have the same processing manner as the slave device 1 1 for the messages broadcast by the master device 1, the master device 2, and the master device 3, which will not be repeated here.
[0053] If the slave device 1 1 determines that the white list information in the message 2 matches the device information of the slave device 1 1, the slave device 1 1 can initiate a registration networking request message (may also be referred to as a networking request message) to the master device 2 broadcasting the message 2, and the registration networking request message can carry the identification information of the slave device 1 1. Correspondingly, after the master device 2 receives the registration networking request message, the master device 2 can determine whether the slave device 1 1 is a device controlled in the white list of the master device 2 according to the identification information of the slave device 1 1 carried in the registration networking request message. If the master device 2 determines that the identification information of the slave device 1 1 carried in the registration networking request message is a device controlled in the white list of the master device 2, the master device 2 accepts the registration networking request of the slave device 1 1, so that the slave device 1 1 and the master device 2 can successfully network; if the master device 2 determines that the identification information of the slave device 1 1 carried in the registration networking request message is not a device controlled in the white list of the master device 2, the master device 2 rejects the registration networking request of the slave device 1 1.
[0054] It should be understood that, Figure 1This is merely an illustrative example. The number of master devices and slave devices is not specifically limited in this application's embodiments. For example, there could be two master devices and six slave devices. In some embodiments of this application, the master device can be a device with a PLC chip; the slave device can be any electronic device with a PLC chip, such as a speaker, a whole-house music host, a mobile phone, a tablet computer, wearable devices (e.g., watches, bracelets, smart helmets, smart glasses, etc.), a laptop computer, etc. This application's embodiments do not limit this. Furthermore, exemplary embodiments of the slave device include, but are not limited to, devices equipped with… Or terminal devices using other operating systems.
[0055] The following is an introduction Figure 1 The hardware structure of the master and slave devices in the application scenario shown. Figure 2 The diagram shown is a hardware structure block diagram of a smart device provided in an embodiment of this application.
[0056] like Figure 2 As shown, the intelligent device 100 may include a processor 110, a memory 120, a power supply module 130, a communication module 140, buttons 150, etc. The intelligent device 100 can communicate with other intelligent devices via a power line connected to the PLC interface in the communication module 140.
[0057] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the intelligent device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has recently used or is repeatedly used. If processor 110 needs to reuse an instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0058] The PLC interface in the communication module 140 is an interface for wired connection (such as a power line connection) between different smart devices.
[0059] The memory 120 can be used to store executable program codes including instructions. The processor 110 executes various functional applications and data processing of the smart device 100 by running the instructions stored in the memory 120. The memory 120 can include a program storage area and a data storage area. The program storage area can store software codes of an operating system and the like. The data storage area can store data generated during use of the smart device 100 and the like. In addition, the memory 120 can include a high-speed random access memory and can further include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, and the like.
[0060] The power module 130 is used to supply power to the processor 110, the internal memory 121, the memory 120, and the communication module 140, and the like.
[0061] The keys 150 include a power-on key, a volume key, and the like. The keys 150 can be mechanical keys. Alternatively, the keys 150 can be touch keys. The smart device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the smart device 100.
[0062] It can be understood that, Figure 2 The components shown do not constitute a specific limitation on the smart device 100, Figure 2 The PLC device is only an example, and the smart device 100 can further include more or fewer components than those shown, or combine some components, or split some components, or different component arrangements. In the following embodiments, the smart device 100 is taken as an example for introduction. Figure 2 The smart device 100 is taken as an example for introduction.
[0063] As shown in Figure 3 A networking method flowchart provided by the embodiments of the present application is shown in Figure 3 The method can include the following steps:
[0064] For the convenience of description, Figure 3 In the embodiments shown, a master device (such as denoted as "first master device") and a slave device (such as denoted as "first slave device") are taken as examples to introduce the networking method in the embodiments of the present application. The implementation in the embodiments can be referred to for other master devices and other slave devices under the same communication network.
[0065] Step 301: The first master device broadcasts a first message.
[0066] The first message carries whitelist information configured by the first master device, and the whitelist information can include identification information of the slave device allowed to access by the first master device. It should be understood that the number of slave devices allowed to access by each master device is one or more, and therefore, the whitelist information can include identification information of at least one slave device allowed to access by the master device.
[0067] For example, the identification information of the slave device can be the last bit of the media access control (MAC) address of the device. It should be understood that the identification information of the slave device can also be other identification information, as long as the identification information can uniquely identify the device, which is within the protection scope of the present application. For example, the format of the first message can be a map frame, and the map frame can carry the last bit of the MAC address of the device in the whitelist configured by the first master device. In another example, the map frame can also include a sequence number, a topology mode, a domain name identifier, route authentication information, and a reserved field.
[0068] In some embodiments, after being powered on, the first master device can periodically broadcast the first message to the surrounding devices.
[0069] In step 302, the first slave device receives the first message, and determines whether the device itself is a slave device allowed to access by the first master device according to the first message. If the first slave device is not a slave device allowed to access by the first master device, the step ends; if the first slave device is a slave device allowed to access by the first master device, the step 303 is executed.
[0070] In some embodiments, the first slave device can receive the first message broadcast by the first master device, and then determine whether the first slave device is in the whitelist information carried in the first message according to the whitelist information configured by the first master device in the first message. If the first slave device is in the whitelist information, it means that the first slave device is a slave device allowed to access by the first master device; if the first slave device is not in the whitelist information, it means that the first slave device is not a slave device allowed to access by the first master device. Accordingly, if the first slave device is not in the whitelist information, the first slave device can not respond to the first message after receiving the first message.
[0071] For example, if the whitelist information of the first master device includes one identification information, the first slave device can compare the identification information of the first slave device with the one identification information. If the two identification information are consistent, it indicates that the first slave device is a slave device allowed to access by the first master device. If the whitelist information of the first master device includes multiple identification information, the first slave device can compare the identification information of the first slave device with each identification information in the whitelist information respectively. If the identification information of the first slave device is in at least one identification information in the whitelist information, it indicates that the first slave device is a slave device allowed to access by the first master device.
[0072] Step 303: The first slave device sends a registration networking request message to the first master device.
[0073] In the registration networking request message, the identification information of the first slave device can be carried. For example, the identification information of the first slave device can be the last bit of the MAC address of the first slave device.
[0074] In some embodiments, after the first slave device determines that the first slave device is a slave device allowed to access by the first master device, the first slave device can initiate a registration networking request message to the first master device in response to the received first message, to request to establish a connection with the first master device.
[0075] Step 304: The first master device determines whether the first slave device is a slave device allowed to access by the first master device according to the registration networking request message. If the first slave device is a slave device allowed to access by the first master device, the step 305 is executed; if the first slave device is not a slave device allowed to access by the first master device, the step is ended.
[0076] In some embodiments, after the first master device receives the registration networking request message sent by the first slave device, the first master device can determine whether the first slave device is a slave device allowed to access according to the configured whitelist information. If the first master device determines that the first slave device is in the whitelist, the first slave device is a slave device allowed to access, the registration networking request is accepted; if the first master device determines that the first slave device is not in the whitelist, the first slave device is not a slave device allowed to access, the registration networking request is rejected. For example, the first master device can send a rejection access message to the first slave device to reject the registration networking request of the first slave device.
[0077] As a possible implementation, the first master device can also not send a rejection access message to the first slave device. For example, the first slave device can find that no feedback message from the first master device is received after the timer is timed out (for example, more than 10s), and then it is determined that the first master device rejects to establish a networking connection with the first slave device. In comparison, the first master device sending a rejection access message to the first slave device can shorten the time for the first slave device to wait for the feedback from the first master device, and can improve the networking efficiency.
[0078] Step 305: The first master device establishes a connection with the first slave device.
[0079] When the first master device determines that the first slave device is a slave device allowed to access, the first slave device's registration networking request can be accepted, and a connection is established with the first slave device.
[0080] Through the above embodiments, in a multi-to-multi networking scenario using a whitelist mechanism, the slave device does not need to attempt to connect with multiple master devices multiple times, the time for the slave device to establish networking with the master device can be shortened, and the networking efficiency is improved.
[0081] As shown in FIG. 1, a flowchart of a networking method provided by an embodiment of the present application is shown, and as shown in FIG. 2, the method can include the following steps: Figure 4 Figure 4 As shown in FIG. 1, a flowchart of a networking method provided by an embodiment of the present application is shown, and as shown in FIG. 2, the method can include the following steps:
[0082] It should be understood that Figure 4 In the embodiment shown in FIG. 3, one slave device and three master devices are taken as examples to continue to introduce the networking method of the embodiment of the present application, and the implementation of other slave devices in the same communication network can refer to the introduction in the embodiment shown in FIG. 4. Figure 4
[0083] Step 401a: The first master device broadcasts a first message.
[0084] Step 401b: The second master device broadcasts a second message.
[0085] Step 401c: The third master device broadcasts a third message.
[0086] In some embodiments, after being powered on, the master device can periodically broadcast the whitelist information configured by itself, for example, the first master device can broadcast the first message carrying the whitelist information configured by the first master device, the second master device can broadcast the second message carrying the whitelist information configured by the second master device, and the third master device can broadcast the third message carrying the whitelist information configured by the third master device.
[0087] It should be understood that Figure 4 In the embodiment shown in FIG. 3, the first message, the second message, and the third message are all broadcast messages.
[0088] Step 402a: The first slave device receives the first message and determines whether the slave device is a slave device allowed to access by the first master device according to the first message.
[0089] Step 402b: The first slave device receives the second message and determines whether the slave device is a slave device allowed to access by the second master device according to the second message.
[0090] Step 402c: The first slave device receives the third message, and judges whether the device itself is a slave device allowed to access by the third master device according to the third message.
[0091] In some embodiments, when the first slave device receives the messages broadcasted by the first master device, the second master device and the third master device respectively, it can judge whether the device itself is a slave device allowed to access by the corresponding master device according to the whitelist information carried in each message. It should be understood that the first slave device can receive the messages broadcasted by the three master devices at different time points. For example, the first slave device can first receive the second message broadcasted by the second master device, then receive the first message broadcasted by the first master device, and finally receive the third message broadcasted by the third master device. Then, the first slave device can first judge whether the first slave device is a slave device allowed to access by the second master device according to the whitelist information carried in the second message. After the judgment is completed, it can continue to judge whether the first slave device is a slave device allowed to access by the first master device according to the whitelist information carried in the first message, and finally judge whether the first slave device is a slave device allowed to access by the third master device according to the whitelist information carried in the third message.
[0092] It should be understood that the above is only an example, and in actual scenarios, the first slave device can also first receive the message broadcasted by the first master device or the third master device, etc., which is not limited in the present application.
[0093] Step 403: The first slave device sends a registration networking request message to the first master device.
[0094] When the first slave device judges that the whitelist of which master device includes the device itself, it can respond to the broadcast message of the corresponding master device and send a registration networking request message to the corresponding master device. For the convenience of description, Figure 4 The embodiment shown is an example of the whitelist of the first master device including the first slave device. Therefore, assuming that among the first master device, the second master device and the third master device, the whitelist information of the first master device includes the first slave device, only the first master device allows the first slave device to access, then the first slave device can respond to the first message broadcasted by the first master device and send a registration networking request message carrying the identification information of the device itself to the first master device.
[0095] Step 404: The first master device judges whether the first slave device is a slave device allowed to access by the device itself according to the registration networking request message. If the first slave device is a slave device allowed to access by the device itself, it continues to execute step 405; if the first slave device is not a slave device allowed to access by the device itself, it ends the step.
[0096] Step 405: The first master device establishes a connection with the first slave device.
[0097] It should be understood that,Figure 4 The specific implementation of step 404 and step 405 in the illustrated embodiment can refer to the detailed description of step 304 and step 305 in the illustrated embodiment, which will not be repeated here. Figure 3 The detailed description of step 304 and step 305 in the illustrated embodiment will not be repeated here.
[0098] It should be understood that Figure 4 It should be understood that
[0099] For example, the first slave device can also receive the message 2 broadcast by the second master device, and the message 2 includes the identification information of at least one slave device allowed to access by the second master device. Assuming that the first slave device is included in the white list of the first master device and the second master device, when the identification information of the first slave device is included in the identification information of at least one slave device allowed to access by the first master device and is also included in the identification information of at least one slave device allowed to access by the second master device, the first slave device can select one of the first master device and the second master device as a target master device, and send a registration network request message to the target master device, and the registration network request message can include the identification information of the target master device. For example, the first slave device selects the first master device as the target master device, and the first slave device can send a registration network request message to the first master device as the target master device, and the registration network request message can include the identification information of the first master device.
[0100] As a possible implementation manner, the first slave device can select the device corresponding to the broadcast message received earliest as the target master device. For example, the first slave device receives the broadcast message 1 of the first master device first, and then receives the broadcast message 2 of the second master device, and the first slave device can select the first master device as the target master device.
[0101] As another possible implementation manner, the first slave device can select one of the plurality of master devices as the target master device. It should be understood that the above-mentioned manner of selecting the target master device is only an example, and the manner of selecting the target master device in the embodiment of the present application is not limited.
[0102] It should be explained that all or part of each of the above embodiments provided by the present application can be freely and arbitrarily combined. The combined technical solutions are also within the protection scope of the present application.
[0103] The above embodiments provided by the present application are introduced from the perspective of the electronic device as an execution subject. In order to realize each function in the method provided by the above embodiments of the present application, the electronic device can include a hardware structure and / or a software module, and realize each function in the form of the hardware structure, the software module, or the hardware structure plus the software module. Whether a certain function in each function is executed in the form of the hardware structure, the software module, or the hardware structure plus the software module depends on the specific application of the technical solution and the design constraint condition.
[0104] Based on the above embodiments, the present application further provides a networking device 500, which can be the master device (such as the first master device) or the slave device (such as the first slave device) in the above embodiments. Referring to FIG. 5, the networking device 500 can include a transceiver unit 501 and a processing unit 502. It should be understood that the networking device 500 can be applied to the master device (such as the first master device) or the slave device (such as the first slave device). Figure 5 As shown in FIG. 5, the networking device 500 can include a transceiver unit 501 and a processing unit 502. It should be understood that the networking device 500 can be applied to the master device (such as the first master device) or the slave device (such as the first slave device).
[0105] For example, when the networking device 500 is applied to the master device, the functions performed by each unit are as follows:
[0106] The transceiver unit 501 is configured to broadcast a first message and receive a second message sent by a first slave device. The first message includes identification information of at least one slave device allowed to access by the master device, and the second message includes identification information of the first slave device. The second message is sent by the first slave device after determining that the identification information of the first slave device is in the identification information of the at least one slave device allowed to access by the master device according to the first message. The processing unit 502 is configured to establish a connection with the first slave device when it is determined that the identification information of the first slave device is in the identification information of the at least one slave device allowed to access by the master device.
[0107] For example, when the networking device 500 is applied to the slave device, the functions performed by each unit are as follows:
[0108] The transceiver unit 501 is configured to receive a first message broadcast by a first master device. The first message includes identification information of at least one slave device allowed to access by the first master device. The processing unit 502 is configured to send a second message to the first master device when it is determined that the identification information of the slave device is in the identification information of the at least one slave device allowed to access by the first master device. The second message includes the identification information of the slave device.
[0109] As Figure 6 shown in the above embodiments, some embodiments of the present application disclose a smart device, which can be the master device in the above embodiments or the slave device in the above embodiments. Referring to Figure 6 shown in the above embodiments, the smart device 600 comprises a transceiver 601, a processor 602 and a memory 603. The transceiver 601, the processor 602 and the memory 603 are connected with each other.
[0110] It should be understood that the transceiver 601 is configured to perform the steps performed by the transceiving unit 501 in the above embodiments. The processor 602 is configured to perform the steps performed by the processing unit 502 in the above embodiments. For example, the transceiver 601 is configured to broadcast the first message and receive the second message sent by the first slave device or receive the first message broadcast by the first master device. The processor 602 is configured to establish a connection with the first slave device when it is determined that the first slave device is in the identification information of the at least one slave device allowed to access by the first master device, or send the second message to the first master device when it is determined that the identification information of the smart device is in the identification information of the at least one slave device allowed to access by the first master device. Figure 5 Figure 4 It should be understood that the transceiver 601 is configured to perform the steps performed by the transceiving unit 501 in the above embodiments. The processor 602 is configured to perform the steps performed by the processing unit 502 in the above embodiments. For example, the transceiver 601 is configured to broadcast the first message and receive the second message sent by the first slave device or receive the first message broadcast by the first master device. The processor 602 is configured to establish a connection with the first slave device when it is determined that the first slave device is in the identification information of the at least one slave device allowed to access by the first master device, or send the second message to the first master device when it is determined that the identification information of the smart device is in the identification information of the at least one slave device allowed to access by the first master device.
[0111] Optionally, the transceiver 601, the processor 602 and the memory 603 are connected with each other through a bus 604. The bus 604 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 6 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0112] The memory 603 is configured to store program instructions and data, etc. Specifically, the program instructions can include program codes, which include computer operation instructions. The memory 603 can include a random access memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. The processor 602 executes the program instructions and data stored in the memory 603 to realize the above functions, thereby realizing the networking method provided by the above embodiments.
[0113] In the embodiments of the present application, the processor 602 can be a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor. The software module can be located in the memory 603, and the processor 602 reads the program instruction in the memory 603 to complete the steps of the above method in combination with the hardware.
[0114] In the embodiments of the present application, the memory 603 can be a non-volatile memory such as a hard disk drive (HDD) or a solid-state drive (SSD), and can also be a volatile memory such as a RAM. The memory can also be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, used for storing instructions and / or data.
[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0116] Based on the above embodiments, the present application further provides a networking system, which can include the master device and the slave device in the foregoing embodiments.
[0117] Based on the above embodiments, the present application further provides a storage medium, which stores a program, and the program is executed by a device to make the device execute the networking method provided in the above embodiments.
[0118] The present application also provides a program product including instructions that, when executed on a device, cause the device to perform the networking method provided in the above embodiments.
[0119] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams according to the methods, devices (systems), and program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by instructions.
Claims
1. A method of networking, characterized by, The application is applied to a master device, comprising: broadcasting a first message, wherein the first message comprises identification information of at least one slave device allowed to access by the master device; receiving a second message sent by a first slave device, wherein the second message comprises identification information of the first slave device, and the second message is sent by the first slave device after determining the identification information of the first slave device in the identification information of at least one slave device allowed to access by the master device according to the first message; establishing a connection with the first slave device when it is determined that the identification information of the first slave device is in the identification information of at least one slave device allowed to access by the master device.
2. The method of claim 1, wherein, The method further comprises: if it is determined that the identification information of the first slave device is not in the identification information of at least one slave device allowed to access by the master device, sending a third message to the first slave device, wherein the third message is used to indicate rejection of access.
3. The method of claim 1 or 2, wherein, The method further comprises: receiving a fourth message sent by a second slave device, wherein the fourth message comprises identification information of the second slave device, and the fourth message is sent by the second slave device after determining the identification information of the second slave device in the identification information of at least one slave device allowed to access by the master device according to the first message; establishing a connection with the second slave device when it is determined that the identification information of the second slave device is in the identification information of at least one slave device allowed to access by the master device.
4. A method of networking, characterized by, The application is applied to a slave device, comprising: receiving a first message broadcast by a first master device, wherein the first message comprises identification information of at least one slave device allowed to access by the first master device; if it is determined that the identification information of the slave device is in the identification information of at least one slave device allowed to access by the first master device, sending a second message to the first master device, wherein the second message comprises the identification information of the slave device; establishing a connection with the first master device when it is determined that the identification information of the slave device is in the identification information of at least one slave device allowed to access by the first master device.
5. The method of claim 4, wherein, The method further comprises: if it is determined that the identification information of the slave device is not in the identification information of at least one slave device allowed to access by the first master device, not responding to the first message.
6. The method of claim 4 or 5, wherein, Before sending the second message to the first master device, the method further comprises: receiving a fifth message broadcast by a second master device, wherein the fifth message comprises identification information of at least one slave device allowed to access by the second master device; if it is determined that the identification information of the slave device is in the identification information of at least one slave device allowed to access by the second master device, determining a target master device from the first master device and the second master device, and sending a sixth message to the target master device, wherein the sixth message comprises identification information of the target master device.
7. A host device, comprising: The master device comprises one or more processors; one or more memories; and one or more programs; wherein the one or more programs are stored in the one or more memories, and the one or more programs comprise instructions, which, when invoked to be executed by the one or more processors, cause the master device to perform the method according to any one of claims 1 to 3.
8. A slave device, comprising: The slave device comprises one or more processors; one or more memories; and one or more programs; wherein the one or more programs, stored in the one or more memories, include instructions that, when executed by the one or more processors, cause the slave device to perform the method of any one of claims 4 to 6.
9. A program product, characterized by When the program product is run on a device, the device is caused to perform the method of any one of claims 1 to 3, or the method of any one of claims 4 to 6.
10. A readable storage medium, having stored therein instructions, characterized in that, When the instructions are run on a device, the device is caused to perform the method of any one of claims 1 to 3, or the method of any one of claims 4 to 6.
Citation Information
Patent Citations
Adjusting and testing method for communication equipment networking as well as device
CN109347706A
Bluetooth networking method and system
CN111885562A