Network switching method and apparatus, electronic device, and medium

By broadcasting centralized network configuration information in a distributed network, a centralized network is automatically created, solving the problem of cumbersome switching caused by manual operation by users, and achieving a convenient network switching experience and speed improvement.

CN115226078BActive Publication Date: 2025-12-12SHENZHEN LUMIUNITED TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110418024.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-19
Publication Date
2025-12-12
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

In existing technologies, users need to manually switch devices from a distributed network to a centralized network, which is cumbersome and affects the user experience.

Method used

By establishing a communication connection in a distributed network, broadcasting preset centralized network configuration information, and automatically creating a centralized network, devices in the distributed network can switch to the centralized network according to the configuration information.

Benefits of technology

It enables network switching without manual user intervention, improving user experience and increasing network switching speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115226078B_ABST
    Figure CN115226078B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a network switching method and device, electronic equipment and medium, the method comprising: a first device establishes a communication connection between at least one second device in a distributed network; the first device broadcasts preset centralized network configuration information in the distributed network based on the communication connection; the first device creates a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information. By broadcasting the preset centralized network configuration information in the distributed network, the devices in the distributed network can automatically switch from the distributed network to the centralized network according to the centralized network configuration information, without manual operation and convenient operation, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the network technical field, and in particular to a network switching method and device, electronic equipment and computer readable storage medium. BACKGROUND

[0002] Distributed network and centralized network are two different types of networks, and application scenarios are different. Compared with centralized network, distributed network has low security coefficient and short control distance. If there is an application scenario that a user originally uses a distributed network control device and now wants to switch to a centralized network control device, since a device does not allow to exist in a distributed network and a centralized network at the same time, the user needs to perform off-network operation on the existing device that has joined the distributed network, that is, the device exits the original distributed network, and then performs network operation on the device, that is, the device joins the newly created centralized network. The above network switching process needs to be manually operated by the user and is tedious, which affects the user experience. SUMMARY

[0003] To solve the existing technical problems, the present application provides a network switching method and device without manual operation of the user, electronic equipment and computer readable storage medium.

[0004] To achieve the above purpose, the technical scheme of the embodiments of the present application is as follows:

[0005] In a first aspect, the embodiments of the present application provide a network switching method applied to a first device, and the method comprises:

[0006] establishing a communication connection with at least one second device in a distributed network;

[0007] broadcasting preset centralized network configuration information in the distributed network based on the communication connection;

[0008] creating a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

[0009] In a second aspect, the embodiments of the present application provide a network switching method applied to a second device, and the method comprises:

[0010] establishing a communication connection with a first device in a distributed network;

[0011] obtaining preset centralized network configuration information broadcasted in the distributed network by the first device through the communication connection;

[0012] switching from the distributed network to a centralized network created by the first device according to the centralized network configuration information.

[0013] In a third aspect, an embodiment of the present application provides a network switching apparatus applied to a first device, the apparatus comprising:

[0014] a first communication module configured to establish a communication connection with at least one second device in a distributed network;

[0015] a first communication module configured to establish a communication connection with at least one second device in a distributed network;

[0016] a broadcast module configured to broadcast preset centralized network configuration information in the distributed network based on the communication connection;

[0017] a first processing module configured to create a centralized network, and all the second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

[0018] In a fourth aspect, an embodiment of the present application provides a network switching apparatus applied to a second device, the apparatus comprising:

[0019] a second communication module configured to establish a communication connection with a first device in a distributed network;

[0020] a obtaining module configured to obtain preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection;

[0021] a second processing module configured to switch from the distributed network to a centralized network created by the first device according to the centralized network configuration information.

[0022] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, and when the computer program is executed by the processor, the network switching method described in any one of the embodiments of the present application applied to the first electronic device and the second electronic device is implemented.

[0023] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the network switching method described in any one of the embodiments of the present application is implemented.

[0024] The network switching method, apparatus, electronic device, and medium provided in the above embodiments of this application involve a first device establishing a communication connection with at least one second device in a distributed network. Based on this communication connection, a preset centralized network configuration information is broadcast in the distributed network to create a centralized network. All second devices in the distributed network switch to the centralized network according to the centralized network configuration information. Thus, the device needing to create a centralized network broadcasts the preset centralized network configuration information in the distributed network, enabling devices in the distributed network to automatically switch to the centralized network based on the centralized network configuration information. This eliminates the need for manual user operation, making the process convenient and improving the user experience. Furthermore, since the device does not need to execute a network connection procedure, the network switching speed is improved.

[0025] The computer-readable storage medium provided in the above embodiments is used to implement the network switching method provided in the embodiments of this application, and has the same technical effects as the network switching method. To avoid repetition, it will not be described again here. Attached Figure Description

[0026] Figure 1 This is a schematic diagram illustrating the application environment applicable to the embodiments of this application;

[0027] Figure 2 This is a flowchart of a network switching method in one embodiment of this application;

[0028] Figure 3 This is a flowchart of a network switching method in another embodiment of this application;

[0029] Figure 4 This is a schematic diagram of a network switching device in one embodiment of this application;

[0030] Figure 5 This is a schematic diagram of a network switching device in another embodiment of this application;

[0031] Figure 6 This is a flowchart of a network switching method in an optional example of this application;

[0032] Figure 7 This is a schematic diagram of the network switching state in an optional example of this application. Figure 1 ;

[0033] Figure 8 This is a schematic diagram of the network switching state in an optional example of this application. Figure 2 ;

[0034] Figure 9 This is a flowchart of a network switching method in another optional example of this application;

[0035] Figure 10 This is an illustration of the network switching state in another optional example of this application.Figure 1 ;

[0036] Figure 11 Network switching state in another optional example of the present application Figure 2 ;

[0037] Figure 12 Structure diagram of an electronic device in an embodiment of the present application

[0038] Figure 13 Structure diagram of an electronic device in another embodiment of the present application DETAILED DESCRIPTION

[0039] The technical solutions of the present application are further described in detail below in combination with the accompanying drawings and specific embodiments of the present application.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the description of the present application herein only for the purpose of describing specific embodiments of the present application, and is not intended to limit the implementation of the present application. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0041] In the description of the present application, it should be understood that the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In the description of the present application, unless otherwise stated, the meaning of "a plurality of" is two or more.

[0042] In the description of the present application, it should be noted that unless otherwise specified and limited, the terms "mounting", "connection", "connection" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be directly connected, or indirectly connected through an intermediate medium; it can be the communication between the two elements inside. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0043] Please refer to Figure 1 , Figure 1 An application environment suitable for an embodiment of the present application is shown. The network switching method provided by the embodiment of the present application can be applied to a smart home system as shown in Figure 1 , which includes a first device 1 and a second device 2.

[0044] The first device 1 can be used to join a distributed network and / or create a centralized network, and the second device 2 can be used to join the distributed network and / or the centralized network. The first device 1 can be a gateway device or the like, and the second device 2 can be a personal computer (PC), a mobile phone, a tablet computer, a wearable electronic device, a routing device, a server or the like, and can also be a hibernation type device that wakes up when working, turns on the wireless receiving and transmitting function when waking up, and turns off the wireless receiving and transmitting function when hibernating, and can join the distributed network or the centralized network. In the embodiment of the application, the routing device mainly refers to a device that plays a network forwarding and broadcasting function in a small network, such as a router device in a zigbee network, which is not limited in the embodiment of the application. The first device 1 can broadcast preset centralized network configuration information in the distributed network by joining the distributed network or establishing a communication connection with the second device 2 in the distributed network, so that the second device 2 in the distributed network obtains the centralized network configuration information, and then switches from the distributed network to the centralized network based on the centralized network configuration information. The centralized network architecture refers to storing projects in a central server, and when working, everyone can operate on their own computer, download the latest version from the same place, and then start working, and submit the completed work to the central server for storage, which has higher network security, and needs to ensure networking to work; and the distributed network architecture refers to providing a computer as a server for storing versions, but the function of the server is only to facilitate the exchange of modifications, and without it, work can still be done, but the exchange of modifications is not convenient, and each computer has an independent development environment, which does not need to be connected, and can be directly run locally, and has a higher safety factor than the centralized network. For example, a zigbee 3.0 network usually belongs to a distributed network.

[0045] The first device 1 and the second device 2 can communicate with each other through wireless methods such as Bluetooth, NFC, infrared and the like. For example, data transmission between the first device 1 and the second device 2 can be in the form of Bluetooth, or can be through NFC, which is not limited in the embodiment of the application. It can be understood that the above application environment is only an exemplary description for the convenience of understanding the following embodiments, and does not constitute any limitation on the actual application environment of the embodiment of the application.

[0046] Please refer to Figure 2 A network switching method provided by an embodiment of the application can be applied to Figure 1 The first device shown in the figure, the network switching method includes but is not limited to S101, S103 and S105, and the details are as follows:

[0047] S101, the first device establishes a communication connection with at least one second device in the distributed network.

[0048] The first device is a device to be created or started a centralized network, and can be a gateway device, etc. The first device establishes a communication connection with at least one second device in the distributed network, which can be that the first device establishes a communication connection with at least one second device in the distributed network without joining the distributed network, or that the first device joins the distributed network to establish a communication connection with at least one second device in the distributed network. It can be understood that when the first device joins the distributed network, the first device will automatically establish a communication connection with at least one second device in the distributed network, and at this time the first device can directly transmit information with multiple second devices, and the information transmission speed is fast. When the first device does not join the distributed network, it is not necessary to perform the operation required for joining the distributed network, and resources can be effectively saved.

[0049] S103, the first device broadcasts preset centralized network configuration information in the distributed network based on the communication connection.

[0050] The first device broadcasts preset centralized network configuration information in the distributed network based on the communication connection, which can be achieved in the following two ways: first, in the case that the first device joins the distributed network, the first device directly sends the preset centralized network configuration information to at least one second device in the distributed network through the communication connection established with the at least one second device, so as to broadcast the centralized network configuration information in the distributed network, which can effectively improve the information transmission efficiency; second, in the case that the first device does not join the distributed network, the first device sends the preset centralized network configuration information to at least one second device in the distributed network through the communication connection established with the at least one second device, so that the second device broadcasts the centralized network configuration information in the distributed network, which can effectively improve the stability and security of information transmission. The centralized network configuration information is used to indicate how to join the centralized network created by the first device.

[0051] S105, the first device creates a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

[0052] The first device can actively create the centralized network or passively create the centralized network. If the first device actively creates the centralized network, the first device can switch to a coordinator after broadcasting the preset centralized network configuration information in the distributed network, and start to build the centralized network, that is, create the centralized network corresponding to the preset centralized network configuration information. All the second devices in the distributed network can join the centralized network according to the centralized network configuration information after searching for the centralized network, thereby realizing switching from the distributed network to the centralized network. In this way, the creation efficiency of the centralized network can be effectively improved, and the convenience is high. If the first device passively creates the centralized network, the first device can create the centralized network based on a received centralized network creation instruction after broadcasting the preset centralized network configuration information in the distributed network. All the second devices in the distributed network switch to the centralized network according to the centralized network configuration information. In this way, the centralized network is created after receiving the centralized network creation instruction, which can effectively save resource consumption and improve the flexibility of creating the centralized network.

[0053] In some embodiments, before the first device creates the centralized network, the first device further exits the distributed network. If the first device has joined the distributed network, the first device needs to exit the distributed network according to a preset mode before creating the centralized network corresponding to the centralized network configuration information. If the first device has joined the distributed network, the first device needs to exit the distributed network before creating the centralized network corresponding to the centralized network configuration information after broadcasting the preset centralized network configuration information in the distributed network. In this way, the centralized network is created after exiting the distributed network, which can effectively save resource consumption.

[0054] In the above embodiments of the present application, the first device establishes a communication connection with at least one second device in the distributed network, broadcasts preset centralized network configuration information in the distributed network based on the communication connection, creates a centralized network, and all the second devices in the distributed network switch to the centralized network according to the centralized network configuration information. In this way, the device that needs to create the centralized network broadcasts the preset centralized network configuration information in the distributed network, so that the devices in the distributed network can automatically switch from the distributed network to the centralized network according to the centralized network configuration information, without manual operation of the user and with convenient operation. For the user, the process is transparent, and the user experience is improved.

[0055] In some embodiments, the first device establishes a communication connection with at least one second device in the distributed network, including:

[0056] The first device receives a network access operation instruction sent by the terminal device, the network access operation instruction being used to indicate joining the distributed network;

[0057] The first device joins the distributed network in response to the network access operation instruction, to establish a communication connection with at least one second device in the distributed network.

[0058] Here, the terminal device can be installed with an application program used to manage the first device joining the distributed network and / or creating the centralized network, and a user can perform a configuration operation on the first device through an operation interface corresponding to the application program displayed on the terminal device, such as instructing the first device to join the distributed network. After receiving the network access operation instruction sent by the terminal device and used to indicate joining the distributed network, the first device can join the corresponding distributed network in response to the network access operation instruction, to establish a communication connection with at least one second device in the distributed network. It can be understood that when the first device joins the distributed network, the first device will automatically establish a communication connection with at least one second device in the distributed network. In addition, the network access operation instruction can include information of the distributed network to be joined, and the like. In this way, the first device can join the distributed network in time after obtaining the network access operation instruction, and the operation is simple, and the user experience is further improved. In addition, the first device can also be configured as a routing device to perform the network access operation by using an application program installed on the terminal device, such as a mobile phone app, and the first device can be used to join the distributed network.

[0059] In some embodiments, the first device establishes the communication connection with at least one second device in the distributed network, including:

[0060] The first device obtains a connection signal strength between the first device and all second devices in the distributed network that support close-range wireless communication;

[0061] The first device establishes a close-range wireless communication connection with at least one second device whose connection signal strength meets a preset connection condition.

[0062] It can be understood that in the distributed network, there can be multiple second devices supporting close-range wireless communication, and all of them are within the effective communication range of the first device, and the first device can only need to establish a close-range wireless communication connection with one of the second devices, at this time, the first device can first acquire the connection signal strength between all second devices supporting close-range wireless communication in the distributed network, and then select at least one second device whose connection signal strength meets the preset connection condition to establish a close-range wireless communication connection. The close-range wireless communication connection includes but is not limited to Bluetooth, NFC, infrared, etc. The preset connection condition refers to the signal strength condition required to establish a close-range wireless communication connection between the first device and the second device, which can be set according to actual needs, for example, the connection condition can be set to select the second device with the best connection signal strength, that is, to establish a close-range wireless communication connection with the second device with the best connection signal strength. After the first device acquires the connection signal strength values between all second devices supporting close-range wireless communication in the distributed network, it determines the maximum connection signal strength value and establishes a close-range wireless communication connection with the second device corresponding to the maximum connection signal strength value. In addition, after the first device acquires all second devices supporting close-range wireless communication in the distributed network, it can display all second devices supporting close-range wireless communication in the distributed network, and then establish a close-range wireless communication connection with the second device selected by the user. In this way, the first device establishes a close-range wireless communication connection by selecting at least one second device whose connection signal strength meets the preset connection condition, ensuring the reliability of the communication connection and further improving the user experience.

[0063] In some embodiments, the first device broadcasts, based on the communication connection, preset centralized network configuration information in the distributed network, including:

[0064] The first device sends, based on the communication connection, preset centralized network configuration information to at least one second device in the distributed network, and the at least one second device broadcasts the centralized network configuration information in the distributed network.

[0065] Specifically, in the case that the first device joins the distributed network, the first device sends the preset centralized network configuration information to at least one second device in the distributed network directly through the communication connection established between the first device and the at least one second device, so as to broadcast the centralized network configuration information in the distributed network; and in the case that the first device does not join the distributed network, the first device sends the preset centralized network configuration information to at least one second device in the distributed network through the communication connection established between the first device and the at least one second device, so as to broadcast the centralized network configuration information in the distributed network by the at least one second device. It can be understood that, since there is a direct or indirect communication connection between any two second devices in the distributed network, any one second device can transmit the centralized network configuration information to other second devices after obtaining the centralized network configuration information, so as to broadcast the centralized network configuration information in the distributed network. In this way, the first device sends the preset centralized network configuration information to at least one second device in the distributed network, so that the at least one second device broadcasts the centralized network configuration information in the distributed network, and all the second devices in the distributed network can obtain the centralized network configuration information, which is simple in operation and further improves user experience.

[0066] Please refer to Figure 3 In another aspect, the embodiment of the present application also provides a network switching method, which can be applied to Figure 1 The second device shown in FIG. 2 includes but is not limited to S201, S203 and S205, and the details are as follows:

[0067] S201, the second device establishes a communication connection with the first device in the distributed network.

[0068] The first device is a device to be created or started centralized network, and can be a gateway device and the like; the second device is a device that can join the distributed network and / or the centralized network, and can be a routing device or a hibernation type device and the like. When the second device in the distributed network establishes a communication connection with the first device, the first device can have joined the distributed network or can not have joined the distributed network. It can be understood that, when the first device joins the distributed network, the first device can automatically establish a communication connection with the second device in the distributed network.

[0069] S203, the second device obtains the preset centralized network configuration information broadcasted in the distributed network by the first device through the communication connection.

[0070] The second device acquires the preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection. The second device can directly or indirectly receive the preset centralized network configuration information sent by the first device through the communication connection to acquire the preset centralized network configuration information broadcast by the first device in the distributed network. The centralized network configuration information is used to indicate how to join the centralized network created by the first device. In some embodiments, the second device acquires the preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection. The second device receives the preset centralized network configuration information sent by the first device through the communication connection and broadcasts the centralized network configuration information in the distributed network. In the case that the first device joins or does not join the distributed network, after the second device receives the preset centralized network configuration information sent by the first device through the communication connection, the second device can directly broadcast the centralized network configuration information in the distributed network.

[0071] In S205, the second device switches from the distributed network to the centralized network created by the first device according to the centralized network configuration information.

[0072] Since the centralized network configuration information indicates how to join the centralized network created by the first device, the second device can switch from the distributed network to the centralized network created by the first device according to the centralized network configuration information, so as to realize switching from the distributed network to the centralized network.

[0073] In the above embodiments, after the second device in the distributed network establishes a communication connection with the first device, the second device acquires the preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection and switches from the distributed network to the centralized network created by the first device according to the centralized network configuration information. In this way, the device that needs to create a centralized network broadcasts preset centralized network configuration information in a distributed network, so that the devices in the distributed network can automatically switch from the distributed network to the centralized network according to the centralized network configuration information, without the need for manual operation and operation convenience. This process is transparent to users and improves user experience.

[0074] In some embodiments, the second device switches from the distributed network to the centralized network created by the first device according to the centralized network configuration information, including: after the second device exits the distributed network in a preset manner, the second device joins the centralized network created by the first device according to the centralized network configuration information.

[0075] Understandably, since one device does not allow to exist in the distributed network and the centralized network at the same time, if the second device wants to join the centralized network, it needs to exit the distributed network it has joined first, and then join the centralized network created by the first device according to the centralized network configuration information. Here, the preset mode can be set according to actual needs, such as performing the exit operation one by one in the order from front to back or from back to front according to the joining time, which is not limited in the embodiment. In this way, the second device exits the distributed network it has joined and then joins the centralized network, without the need for manual operation of the user, further improving the user experience.

[0076] In some embodiments, after the second device acquires the preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection, the second device further includes saving the centralized network configuration information.

[0077] Understandably, after the second device acquires the preset centralized network configuration information broadcast by the first device in the distributed network through the communication connection, the second device saves the centralized network configuration information in time, so that it can quickly join the centralized network created by the first device based on the centralized network configuration information in the subsequent.

[0078] Another aspect of the embodiments of the present application, please refer to Figure 4 Also provided is a network switching device applied to a first device, the device comprising: a first communication module 11 configured to establish a communication connection with at least one second device in a distributed network; a broadcast module 12 configured to broadcast preset centralized network configuration information in the distributed network based on the communication connection; and a first processing module 13 configured to create a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

[0079] In some embodiments, the first communication module 11 is specifically configured to:

[0080] receive a network access operation instruction sent by a terminal device for indicating joining a distributed network;

[0081] in response to the network access operation instruction, join the distributed network to establish a communication connection with at least one second device in the distributed network.

[0082] In some embodiments, the first communication module 11 is specifically configured to:

[0083] acquire connection signal strengths between all second devices supporting near field wireless communication in the distributed network;

[0084] establish a near field communication connection with at least one second device whose signal strength meets the preset connection condition.

[0085] In some embodiments, the broadcast module 12 is specifically configured to: based on the communication connection, send preset centralized network configuration information to at least one second device in the distributed network, and the at least one second device broadcasts the centralized network configuration information in the distributed network.

[0086] In some embodiments, the first processing module 13 is further configured to exit the distributed network.

[0087] It should be noted that the network switching device provided in the above embodiments is only exemplified by the division of the above program modules in the implementation of the network switching process. In actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the device can be divided into different program modules to complete all or part of the above described method steps. In addition, the network switching device and the network switching method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0088] Another aspect of the embodiments of the present application, please refer to Figure 5 Further provided is a network switching device applied to a second device, the device comprising: a second communication module 21 configured to establish a communication connection with a first device in a distributed network; an acquisition module 22 configured to acquire preset centralized network configuration information broadcasted by the first device in the distributed network through the communication connection; and a second processing module 23 configured to switch from the distributed network to a centralized network created by the first device according to the centralized network configuration information.

[0089] In some embodiments, the acquisition module 22 is specifically configured to:

[0090] receive the preset centralized network configuration information sent by the first device through the communication connection, and broadcast the centralized network configuration information in the distributed network.

[0091] In some embodiments, the acquisition module 22 is specifically configured to:

[0092] After exiting the distributed network in a preset manner, join the centralized network created by the first device according to the centralized network configuration information.

[0093] In some embodiments, the device further comprises a storage module 24 configured to save the centralized network configuration information.

[0094] It should be noted that the network switching device provided in the above embodiment is only used for example to illustrate the division of the above program modules in the implementation of the network switching process. In actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the device can be divided into different program modules to complete all or part of the above-described method steps. In addition, the network switching device and the network switching method provided in the above embodiment belong to the same concept, and the specific implementation process is described in the method embodiment, which will not be repeated here.

[0095] In order to have a more systematic understanding of the network switching method provided in the embodiments of the present application, the following will be described in combination with different application scenarios and through specific examples. It should be noted that the device in the present example can be a Router device or an Enddevice device. The Router device is generally a long power supply type device, and the wireless receiving and transmitting are always in an open state. It can open a distributed network or join a centralized network. The Enddevice device is a sleep type device, which wakes up when working. The wireless receiving and transmitting are turned on when waking up, and are turned off when sleeping. It can join a distributed network or a centralized network. The gateway generally contains multiple wireless technologies, and acts as a network hub to forward messages, playing a role of connecting the upper and lower layers. Users can realize remote control at any time and anywhere through the device.

[0096] Application scenario one

[0097] Assuming that only a distributed network exists in the current environment, the network switching principle is as follows: the user can previously configure the gateway as a routing device to perform network entry operation through a mobile phone app. After the gateway joins the distributed network, the gateway publishes the information of the centralized network to be created to the distributed network. The devices in the original distributed network save the information of the centralized network and exit the original distributed network after receiving the information. The gateway switches to a coordinator and starts to build a centralized network. The devices in the original distributed network can safely and quickly join the centralized network created by the gateway because they have previously saved the information of the centralized network. Thus, the entire network switching process is completed, and the user is completely unaware of the network switching. Moreover, the user does not need to participate in the network switching. After the network switching is completed, the user can realize remote control.

[0098] Based on the above network switching principle, please refer to Figure 6 A network switching method provided in an example of the present application includes the following steps:

[0099] Step S301, the gateway starts network entry operation.

[0100] Step S303, the gateway joins the distributed network.

[0101] Step S305, the gateway sends the centralized network information to the distributed network.

[0102] Step S307, all devices in the distributed network leave the original distributed network.

[0103] Step S309, the gateway starts the centralized network.

[0104] Step S311, the devices rejoin the centralized network created by the gateway.

[0105] Please refer to Figure 7 In the current environment where only the distributed network exists, the device 4 (here, the gateway) can first join the distributed network as a sub-device through a mobile phone or other external means, and then broadcast the centralized network information to be created in the entire distributed network. Each device in the network receives the information and exits the original network according to the pre-configured manner. Please refer to Figure 8 The devices 1, 2, 3, and 4 leave the original network (i.e., the distributed network), the device 4 starts the centralized network, and the devices 1, 2, and 3 can seamlessly leave the original distributed network and then join the centralized network started by the device 4 to communicate with the outside world, and the user can perform remote control.

[0106] Application scenario two

[0107] Suppose that in the current environment, only the distributed network exists and at least one routing device in the network supports Bluetooth or NFC, infrared, or other wireless communication technologies. The network switching principle is as follows: the gateway connects the routing device in the distributed network through Bluetooth or NFC, infrared, or other wireless communication technologies, and then sends the centralized network information to be created by the gateway to the routing device to broadcast the centralized network information in the distributed network. The devices originally in the distributed network receive the centralized network information, save it, and exit the original distributed network. The gateway starts to build the centralized network, and the devices originally in the distributed network can safely and quickly join the centralized network created by the gateway because they have previously saved the centralized network information. Thus, the entire network switching process is completed, and the user is completely unaware of the process. Moreover, the user does not need to participate in the process at all, and the network switching is completed. After the network switching is completed, the user can achieve remote control.

[0108] Based on the above network switching principle, please refer to Figure 9 A network switching method provided in an example of the present application includes the following steps:

[0109] Step S401, the gateway connects the routing device in the distributed network through Bluetooth, NFC, or infrared technology.

[0110] In step S403, the gateway sends the preset configuration centralized network information to the routing device.

[0111] In step S405, the routing device broadcasts the network after receiving the centralized network information, and other devices leave the original distributed network after receiving the centralized network information.

[0112] In step S407, the gateway starts the centralized network.

[0113] In step S409, all devices rejoin the centralized network created by the gateway.

[0114] Referring to Figure 10 In the current environment, only the distributed network exists, and at least one routing device supports Bluetooth or NFC, infrared, or other wireless communication technologies. The device 4 (here, the gateway) can send the pre-configured centralized network information to the routing device in the distributed network through Bluetooth connection or through NFC touch transmission, infrared, or other wireless technologies. If there are multiple routing devices in the distributed network that support Bluetooth connection or other wireless transmission technologies, the device 4 can select the routing device with the best signal strength to connect. The routing device in the distributed network receives the centralized network information and broadcasts the centralized network information to the whole network. Each device in the distributed network receives the centralized network information and exits the original network according to the pre-configured manner. Referring to Figure 11 The device 1, the device 2, and the device 3 leave the original network (i.e., the distributed network), and the device 4 starts the centralized network. The device 1, the device 2, and the device 3 have already saved the centralized network information created by the device 4, so they can seamlessly leave the original distributed network and then join the centralized network started by the device 4 to communicate with the outside world. The user can perform remote control.

[0115] In summary, the network switching method provided by the above embodiment has the following advantages: The user does not need to perform physical operations to complete network switching; the network switching speed is improved because the device has already saved the centralized network information and does not need to perform a network connection process; the switching mode can be freely configured, and the user can select automatic switching or manual switching, which has high operation freedom.

[0116] In another aspect of the embodiment of the present application, referring to Figure 12Further provided is an electronic device including a processor 211, a memory 212, and a computer program stored in the memory 212 and executable by the processor 211, wherein the computer program, when executed by the processor 211, implements the network switching method applied to the first device and / or the second device side according to any of the embodiments of the present application, and achieves the same technical effects. To avoid repetition, details are not described herein.

[0117] Referring to Figure 13 , Fig. 1 shows a schematic diagram of an optional hardware structure of the electronic device according to an embodiment of the present application. As shown in Figure 13 , the electronic device can have a large difference due to different configurations or performances, and can include one or more processors (Processing Units, CPU) 1110 (the processor 1110 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, one or more storage media 1120 (such as one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 can be temporary storage or persistent storage. The program stored in the storage medium 1120 can include one or more modules, each of which can include a series of instruction operations in network switching. Further, the processor 1110 can be configured to communicate with the storage medium 1120 and execute a series of instruction operations in the storage medium 1120 on the electronic device. The electronic device can also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1140, and / or one or more operating systems 1121, such as Windows ServerTM, Mac OSXTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0118] The input / output interface 1140 can be used to receive or send data via a network. The above-mentioned network examples can include a wireless network provided by a communication provider of the electronic device. In one example, the input / output interface 1140 includes a network adapter (Network Interface Controller, NIC) which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the input / output interface 1140 can be a radio frequency (Radio Frequency, RF) module for communicating with the Internet in a wireless manner.

[0119] Those skilled in the art can understand that Figure 13 the structure shown is only schematic, and does not limit the structure of the terminal device described above. For example, the electronic device can further include more or fewer components thanFigure 13 more or less components than those shown, or configured differently. Figure 13

[0120] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to realize each process of the network switching method embodiment and achieve the same technical effects. To avoid repetition, details are not described herein. The computer readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0121] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, and all changes or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.​

Claims

1. A network switching method, applied to a first device, characterized in that, The method comprises: establishing a communication connection with at least one second device in a distributed network; joining the distributed network based on the communication connection to broadcast preset centralized network configuration information in the distributed network, or sending the preset centralized network configuration information to the at least one second device based on the communication connection to broadcast the preset centralized network configuration information in the distributed network through the at least one second device; wherein the preset centralized network configuration information is used to indicate how to join the centralized network created by the first device; creating a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

2. The method of claim 1, wherein, The establishment of the communication connection with the at least one second device in the distributed network comprises: receiving a network access operation instruction sent by a terminal device and used to indicate joining the distributed network; joining the distributed network in response to the network access operation instruction to establish the communication connection with the at least one second device in the distributed network.

3. The method of claim 2, wherein, Before the creation of the centralized network, the method further comprises: quitting the distributed network.

4. The method of claim 1, wherein, The first device is a gateway device, the second device is a routing device, and the communication connection is a close-range wireless communication connection; or The second device is a hibernation type device, and the communication connection is a close-range wireless communication connection.

5. The method of claim 4, wherein, The establishment of the communication connection with the at least one second device in the distributed network comprises: obtaining connection signal strengths between all second devices supporting close-range wireless communication in the distributed network; establishing a close-range wireless communication connection with at least one second device whose connection signal strength meets a preset connection condition.

6. The method according to any one of claims 1 to 5, characterized in that, The joining of the distributed network based on the communication connection to broadcast the preset centralized network configuration information in the distributed network comprises: sending the preset centralized network configuration information to at least one second device in the distributed network based on the communication connection, and the at least one second device broadcasts the centralized network configuration information in the distributed network.

7. A network switching method, applied to a second device, characterized in that, The method comprises: In a distributed network, the second device establishes a communication connection with a first device; obtaining preset centralized network configuration information broadcast by the first device, wherein the centralized network configuration information is centralized network configuration information broadcast in the distributed network by the first device after joining the distributed network through the communication connection; or obtaining preset centralized network configuration information sent by the first device, wherein the centralized network configuration information is preset centralized network configuration information broadcast in the distributed network by the second device after the first device sends the preset centralized network configuration information to the second device through the communication connection; wherein the centralized network configuration information is used to indicate how to join a centralized network created by the first device; The second device switches from the distributed network to the centralized network created by the first device according to the centralized network configuration information.

8. The method of claim 7, wherein, The preset centralized network configuration information broadcasted by the first device after joining the distributed network through the communication connection comprises: The preset centralized network configuration information sent by the first device through the communication connection is received, and the centralized network configuration information is broadcasted in the distributed network.

9. The method of claim 7, wherein, The switching from the distributed network to the centralized network created by the first device according to the centralized network configuration information comprises: After exiting the distributed network in a preset manner, the second device joins the centralized network created by the first device according to the centralized network configuration information.

10. The method of claim 7, wherein, After the preset centralized network configuration information broadcasted by the first device after joining the distributed network through the communication connection, the method further comprises: The centralized network configuration information is saved. 11.A network switching apparatus, applied to a first device, characterized in that, The apparatus comprises: A first communication module is configured to establish a communication connection with at least one second device in a distributed network; A broadcast module is configured to join the distributed network based on the communication connection to broadcast preset centralized network configuration information in the distributed network, or send the preset centralized network configuration information to the at least one second device based on the communication connection to broadcast the preset centralized network configuration information in the distributed network through the at least one second device; wherein the centralized network configuration information is used to indicate how to join a centralized network created by the first device; A first processing module is configured to create a centralized network, and all second devices in the distributed network switch to the centralized network according to the centralized network configuration information.

12. A network switching apparatus, applied to a second device, characterized in that, The apparatus comprises: A second communication module is configured to establish a communication connection with a first device in a distributed network; An acquisition module is configured to acquire preset centralized network configuration information broadcasted by the first device, wherein the centralized network configuration information is broadcasted in the distributed network by the first device after joining the distributed network through the communication connection; or acquire preset centralized network configuration information sent by the first device based on the communication connection, wherein the centralized network configuration information is broadcasted in the distributed network by the second device after the first device sends the preset centralized network configuration information to the second device through the communication connection; wherein the centralized network configuration information is used to indicate how to join a centralized network created by the first device; A second processing module is configured to switch from the distributed network to the centralized network created by the first device according to the centralized network configuration information.

13. An electronic device, comprising: The apparatus comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program is executed by the processor to implement the network switching method according to any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the network switching method in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method and device for upgrading access point

    CN101715199A

  • Network switching method, device and system and storage medium

    CN115915305A

  • Network control system, method and program

    US20200195502A1