CN112911624B - Network connection method and device of electronic equipment - Google Patents

Network connection method and device of electronic equipment Download PDF

Info

Publication number
CN112911624B
CN112911624B CN202110064543.XA CN202110064543A CN112911624B CN 112911624 B CN112911624 B CN 112911624B CN 202110064543 A CN202110064543 A CN 202110064543A CN 112911624 B CN112911624 B CN 112911624B
Authority
CN
China
Prior art keywords
equipment
node
devices
wireless network
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110064543.XA
Other languages
Chinese (zh)
Other versions
CN112911624A (en
Inventor
韦春梅
黄智聪
卢军志
刘洪钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202110064543.XA priority Critical patent/CN112911624B/en
Publication of CN112911624A publication Critical patent/CN112911624A/en
Application granted granted Critical
Publication of CN112911624B publication Critical patent/CN112911624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application relates to a network connection method and a network connection device of electronic equipment, wherein the method comprises the following steps: determining that a first device is a master node of a wireless network from a plurality of devices connected to the wireless network; connecting other devices of the plurality of devices except the first device to the first device; under the condition that the first equipment cannot be connected to the wireless network, acquiring second equipment from other equipment as a main node; devices of the plurality of devices other than the second device are connected to the second device. The method and the device solve the technical problem that the network connection stability of the electronic equipment in the related art is low.

Description

Network connection method and device of electronic equipment
Technical Field
The present application relates to the field of computers, and in particular, to a network connection method and apparatus for an electronic device.
Background
At present, intelligent devices are increasing, wireless devices such as WIFI or Bluetooth are brought to electrical equipment in a home, a plurality of devices are connected in a tree-shaped mode, namely, a plurality of sub-devices are connected below the WIFI, and more slave devices can be connected below the sub-devices continuously. The increasing number of intelligent devices in the home leads to more complex networks. Once a sub-device fails, the series of slave devices cannot be connected to the network for use.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The application provides a network connection method and device of electronic equipment, which are used for at least solving the technical problem of low network connection stability of the electronic equipment in the related technology.
According to an aspect of an embodiment of the present application, there is provided a network connection method of an electronic device, including:
determining that a first device is a master node of a wireless network from a plurality of devices connected to the wireless network;
connecting other devices of the plurality of devices except the first device to the first device;
acquiring a second device from the other devices as the master node under the condition that the first device is confirmed to be incapable of connecting to the wireless network;
connecting devices of the plurality of devices other than the second device to the second device.
Optionally, determining that the first device is a master node of the wireless network from the plurality of devices connected to the wireless network comprises:
acquiring the equipment level of each of the plurality of equipment, wherein the equipment level of the equipment connected with the wireless network is a root node, the equipment level of the equipment connected with the root node is a child node, and the equipment level of the equipment connected with the child node is a slave node;
and acquiring the first equipment from the equipment with the equipment level as the root node as the main node.
Optionally, the obtaining the first device from a device whose device level is a root node as the master node includes one of:
randomly selecting the first equipment from the equipment with the equipment level as a root node as the main node;
and selecting the first equipment which is normally connected with the wireless network and has the highest connection priority from the equipment with the equipment level as the root node according to the connection priority of the equipment as the main node.
Optionally, connecting the other devices of the plurality of devices except the first device to the first device comprises:
connecting devices except the first device among the devices with the device level of the root node in the plurality of devices to the first device, wherein the device level of the device connected with the wireless network is the root node, the device level of the device connected with the root node is a child node, and the device level of the device connected with the child node is a slave node;
connecting the equipment with the equipment level of the child node in the plurality of equipment to the corresponding root node;
and connecting the equipment with the slave node in the equipment level in the plurality of equipment to the corresponding child node.
Optionally, connecting a device of the plurality of devices other than the second device to the second device comprises:
converting child node equipment corresponding to the first equipment in equipment with equipment levels of child nodes into slave node equipment, wherein the equipment level of the equipment connected with the wireless network is a root node, the equipment level of the equipment connected with the root node is a child node, and the equipment level of the equipment connected with the child nodes is a slave node;
and connecting the slave node equipment to the child node equipment corresponding to the second equipment.
Optionally, after connecting a device other than the second device among the plurality of devices to the second device, the method further comprises:
re-determining the first device as the master node upon confirming that the first device resumes connection with the wireless network;
connecting other devices of the plurality of devices except the first device to the first device.
Optionally, after connecting other devices of the plurality of devices except the first device to the first device, the method further comprises:
the method comprises the steps that under the condition that it is confirmed that all devices of the wireless network with all device levels as root nodes cannot be connected with the wireless network, all devices of the wireless network with all device levels as the root nodes are connected to a mobile network module, wherein the mobile network module is powered by an independent standby battery, the mobile network module is used for being connected with the internet through a mobile network, and the devices of the devices connected with the wireless network are in the device levels as the root nodes.
According to another aspect of the embodiments of the present application, there is also provided a network connection device for an electronic device, including:
the wireless network control device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining that a first device is a main node of a wireless network from a plurality of devices connected with the wireless network;
a first connection module for connecting other devices of the plurality of devices except the first device to the first device;
an obtaining module, configured to obtain a second device from the other devices as the master node when it is determined that the first device cannot be connected to the wireless network;
a second connection module for connecting a device other than the second device among the plurality of devices to the second device.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, a first device is determined to be a main node of a wireless network from a plurality of devices connected with the wireless network; connecting other devices of the plurality of devices except the first device to the first device; under the condition that the first equipment cannot be connected to the wireless network, acquiring second equipment from other equipment as a main node; the method comprises the steps of determining first equipment in the plurality of equipment connected with the wireless network as a main node of the wireless network, connecting other equipment to the first equipment, enabling each equipment to be capable of communicating with the wireless network through the first equipment under normal conditions, and if the first equipment is determined to be incapable of being connected to the wireless network, reacquiring the second equipment from the other equipment except the first equipment as the main node, and connecting the equipment in the wireless network to a new main node, so that the purpose of rapidly recovering network connection for the equipment incapable of being connected with the network is achieved, the technical effect of improving the network connection stability of the electronic equipment is achieved, and the technical problem that the network connection stability of the electronic equipment in related technologies is low is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware environment of a network connection method of an electronic device according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method for network connection of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a WIFI cluster networking control process according to an alternative embodiment of the present application;
fig. 4 is a schematic diagram of another WIFI cluster networking control process according to an alternative embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative network connection device for an electronic device according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of embodiments of the present application, an embodiment of a method for network connection of an electronic device is provided.
Alternatively, in this embodiment, the network connection method of the electronic device described above may be applied to a hardware environment constituted by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The network connection method of the electronic device according to the embodiment of the present application may be executed by the server 103, the terminal 101, or both the server 103 and the terminal 101. The terminal 101 executing the network connection method of the electronic device according to the embodiment of the present application may also be executed by a client installed thereon.
Fig. 2 is a flowchart of an alternative network connection method of an electronic device according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, determining a first device as a main node of a wireless network from a plurality of devices connected with the wireless network;
step S204, connecting other devices except the first device in the plurality of devices to the first device;
step S206, under the condition that the first device is confirmed to be unable to be connected to the wireless network, acquiring a second device from the other devices as the main node;
step S208, connecting the devices other than the second device among the plurality of devices to the second device.
Through the steps S202 to S208, the first device of the multiple devices connected to the wireless network is determined as the master node of the wireless network, and the other devices are connected to the first device, under normal conditions, each device can communicate with the wireless network through the first device, if it is determined that the first device cannot be connected to the wireless network, the second device is obtained again from the devices except the first device as the master node, and the devices in the wireless network are connected to a new master node, so that the purpose of quickly recovering network connection for the devices which cannot be connected to the network is achieved, thereby achieving the technical effect of improving the network connection stability of the electronic device, and further solving the technical problem of low network connection stability of the electronic device in the related technology.
In the technical solution provided in step S202, the wireless network may include, but is not limited to: a WIFI network, a mobile terminal hotspot network and the like.
Optionally, in this embodiment, the multiple devices connected to the wireless network may include, but are not limited to: mobile terminal, panel computer, PC computer, intelligent wearing equipment, intelligent home equipment, intelligent furniture, intelligent household electrical appliances and so on.
Optionally, in this embodiment, the first device may be, but is not limited to, any random device among a plurality of devices connected to the wireless network, or may also be, but is not limited to, determined according to a certain preset rule.
As an optional embodiment, the determining that the first device is a master node of the wireless network from the plurality of devices connected to the wireless network comprises:
s11, acquiring the equipment grade of each of the plurality of equipment, wherein the equipment grade of the equipment connected with the wireless network is a root node, the equipment grade of the equipment connected with the root node is a child node, and the equipment grade of the equipment connected with the child node is a slave node;
and S12, acquiring the first equipment from the equipment with the equipment level as the root node as the main node.
Optionally, in this embodiment, multiple devices connected to the wireless network are layered, and a device called a root node device, a device called a child node device connected to the root node, a device called a slave node device connected to the child node, and so on of the wireless network are directly connected to the root node device. The first device may be, but is not limited to being, determined from a specified layer, such as: determine the first device from the root node devices, and so on.
For example: device a, device B, device C, device D, device E, device F, device G, and device H are linked under the wireless network, where device a and device B are root node devices directly connected to the wireless network, device C, device D, and device E are child node devices connected to device a, device F, and device G are child node devices connected to device B, and device H is a slave node device connected to device G. The first device that is the master node may be selected from, but not limited to, device a and device B.
As an optional embodiment, acquiring the first device from a device whose device level is a root node as the master node includes one of:
s21, randomly selecting the first equipment from the equipment with the equipment level as a root node as the main node;
and S22, selecting the first equipment which is normally connected with the wireless network and has the highest connection priority from the equipment with the equipment level as the root node according to the connection priority of the equipment as the main node.
Optionally, in this embodiment, one manner of selecting the first device serving as the master node from the devices whose slave device level is the root node may be random. Such as: and randomly selecting the equipment A from the equipment A and the equipment B as a main node. Another way to select the first device as the master node from the devices having the device level as the root node may be to select the first device according to the connection priority of the devices and whether the devices can normally connect to the wireless network. Such as: and if the connection priority of the equipment A is lower than that of the equipment B and the equipment B can be normally connected with the wireless network, selecting the equipment B as the main node.
In the technical solution provided in step S204, other devices in the wireless network except the master node are connected to the master node. The connection between the other devices and the master node may be direct or indirect. The root node device of the other devices may connect to the wireless network while connecting to the master node, or may only connect to the master node and disconnect from the wireless network.
Optionally, in this embodiment, confirming that the first device is unable to connect to the wireless network may be an active operation, such as: network connection information of the first device is acquired, and the like. It may also be a passive operation, such as: and receiving the network connection information of the first device and the like sent by other devices. And if the network connection information of the first device cannot be acquired, or the network connection information of the first device is used for indicating the first device to disconnect the wireless network connection, confirming that the first device cannot be connected to the wireless network.
As an alternative embodiment, connecting the other devices of the plurality of devices except the first device to the first device includes:
s31, connecting, to the first device, devices except the first device, of the devices having a device level of a root node among the plurality of devices, where the device level of the device connected to the wireless network is the root node, the device level of the device connected to the root node is a child node, and the device level of the device connected to the child node is a slave node;
s32, connecting the equipment with the equipment level of the child node in the plurality of equipment to the corresponding root node;
and S33, connecting the equipment with the slave node in the equipment level in the plurality of equipment to the corresponding child node.
Optionally, in this embodiment, when other devices in the plurality of devices except the first device are connected to the first device, the connection between the devices may be, but is not limited to, connection according to a device class, the other root nodes are connected to the first device serving as the master node, the device with the device class of the child node is connected to the corresponding root node according to its own connection rule, the device with the device class of the slave node is connected to the corresponding child node according to its own connection rule, and so on.
As an alternative embodiment, after connecting the other devices of the plurality of devices except the first device to the first device, the method further comprises:
and S41, under the condition that the equipment with all equipment levels as the root nodes of the wireless network cannot be connected with the wireless network, connecting the equipment with all equipment levels as the root nodes of the wireless network to a mobile network module, wherein the mobile network module is powered by an independent standby battery, the mobile network module is used for connecting the Internet through a mobile network, and the equipment level of the equipment connected with the wireless network is the root node.
Optionally, in this embodiment, after connecting another device to the first device, if it is determined that all devices of the wireless network having a device level of the root node cannot be connected to the wireless network, the mobile network module may be enabled, and the mobile network module is powered by an independent backup battery and is capable of connecting to the internet through the mobile network, so as to ensure reliability of the network. Therefore, when no electricity exists in the house, the user can know the specific loss of the intelligent device.
Optionally, in this embodiment, it may be an active operation to confirm that all devices of the wireless network in the device class of the root node cannot connect to the wireless network, for example: and acquiring network connection information of the equipment with each equipment level as a root node and the like. It may also be a passive operation, such as: and receiving network connection information and the like of the equipment with each equipment level as the root node, which are sent by other equipment. If all the network connection information of the devices with the device levels as the root nodes cannot be obtained, or the network connection information of the devices with the device levels as the root nodes is used for indicating the corresponding devices to disconnect the wireless network connection, it is determined that all the devices with the device levels as the root nodes of the wireless network cannot be connected with the wireless network.
Alternatively, in this embodiment, the mobile network module may be not limited to connect to the internet through a GPRS (General Packet Radio Service) network.
In the technical solution provided in step S206, it may be, but is not limited to, detect whether the first device can normally perform network connection through other root node devices, and report when the first device cannot perform network connection.
Optionally, in this embodiment, if it is determined that the first device cannot be connected to the wireless network, the master node is automatically replaced when the first device is considered to have a fault, so as to ensure the network connection stability of other devices.
Alternatively, in this embodiment, the second device serving as the master node may be reselected, but not limited to, among other root node devices other than the first device. If there is no other root node device than the first device, then the second device is obtained from the child node device, and so on.
In the technical solution provided in step S208, the devices except the second device among the plurality of devices are connected to the reselected master node second device, so as to ensure normal network connection of the devices.
As an alternative embodiment, connecting the devices of the plurality of devices other than the second device to the second device includes:
s51, converting child node equipment corresponding to the first equipment in the equipment with the equipment level of child nodes into slave node equipment, wherein the equipment level of the equipment connected with the wireless network is a root node, the equipment level of the equipment connected with the root node is a child node, and the equipment level of the equipment connected with the child nodes is a slave node;
and S52, connecting the slave node equipment to the child node equipment corresponding to the second equipment.
Optionally, in this embodiment, the manner of connecting the devices other than the second device among the multiple devices to the second device may be, but is not limited to, only performing connection conversion on the device connected below the first device, and for the device connected below the first device, the device may be connected to the second device by descending one level in sequence according to the device class. And for the child node device corresponding to the first device, converting the child node device into a slave node device connected to the child node device corresponding to the second device, thereby completing the connection with the second device, and so on.
As an alternative embodiment, after connecting the devices other than the second device among the plurality of devices to the second device, the method further includes:
s61, under the condition that the first equipment is confirmed to recover the connection with the wireless network, the first equipment is determined as the main node again;
s62, connecting the other devices except the first device to the first device.
Optionally, in this embodiment, if the first device recovers the network connection, the first device is taken as the master node again, and the other devices are reconnected to the first device again.
Optionally, in this embodiment, confirming that the first device recovers the connection with the wireless network may be an active operation, such as: network connection information of the first device is acquired, and the like. It may also be a passive operation, such as: and receiving network connection information sent by the first equipment, and the like. And if the network connection information of the first device can be acquired, or the network connection information sent by the first device is used for indicating that the first device can be connected to the wireless network, confirming that the first device recovers the connection with the wireless network.
In the process, in order to avoid network congestion, in a WIFI range, one root node device is selected as a main node, other nodes with the same level are connected with the main node, and when the main node breaks down, the other nodes automatically select new main nodes. The control process can also be emergency with a GPRS module having an independent battery supply.
Fig. 3 is a schematic diagram of a WIFI cluster networking control process according to an alternative embodiment of the present application, as shown in fig. 3, in a general case, intelligent household appliances are all related to each other in a unit of a home, and there is only one router in each home on average, that is, only one WIFI network signal range. Many devices are connected with the router through WIFI, the devices comprise computers, mobile phones, air conditioners, refrigerators, sound boxes and the like, the computers and the mobile phones are main connection devices, and the rest devices are basically daily household appliance use devices. The number of devices that can be connected by the router may be limited, and when the number of connected devices is too large, the situation of network failure or network disconnection may occur. Therefore, in order to avoid the situation, one root node is selected as the main node (A1 node) within a WIFI range, and other root nodes (such as an A2 node and an A3 node) with the same level are connected with the main node (A1 node); the various sub-nodes (sub-nodes B, C, D, etc.) required by the system are connected below each root node. Under normal conditions, the node A is set as a root node of a high-level node. When A1 is selected as the main node, other nodes (such as A2 node and Ai node) in the same level are connected with the main node (A1 node), and a sub-node (sub-node B) in the lower level is connected below each root node 10 Etc.). Sub-node down-connection slave node (slave node C) 10 Etc.). Each lower level node (node B, C, etc.) will transmit data through the network to its corresponding root node (e.g., A1 node, A2 node, ai node), which will transmit information to the master node (A1 node).
Fig. 4 is a schematic diagram of another WIFI cluster networking control process according to an alternative embodiment of the present application, and as shown in fig. 4, when an A1 node fails and A2 node and an Ai node cannot connect to a network, the A2 node is updated to a master node according to a predetermined priority order; the child nodes (e.g., node B10, node B11, node B1 i) originally connected below node A1 are down-ranked from the node (e.g., node C10, node C11, node C1 i) to the child node of node A2, and so on until the network can be connected.
Optionally, in this optional embodiment, when all root nodes fail to connect to the router, the router is considered to be in a failure state or in a power-off state at this time. The GPRS communication mode on the standby node can be started, corresponding information is directly connected to the Internet, and the corresponding node can be guaranteed to be normally used when the router fails.
Optionally, in this optional embodiment, the standby node has a stand-alone standby battery powered GPRS mode. Under the normal condition, GPRS is out of work, and uses commercial power and router WIFI to carry out normal work, in case when all nodes have appeared all can't be connected to router WIFI, then uses the GPRS module of reserve node to carry out the networking operation, further ensures the reliability of network. Therefore, when no electricity exists in the house, the user can know the specific loss of the intelligent device.
Optionally, in this optional embodiment, after the failed node recovers to perform normal communication, the connection is recovered according to the original level, and the above operations are repeated.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling an electronic device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a network connection apparatus of an electronic device for implementing the network connection method of the electronic device. Fig. 5 is a schematic diagram of an alternative network connection apparatus of an electronic device according to an embodiment of the present application, and as shown in fig. 5, the apparatus may include:
a first determining module 52, configured to determine, from multiple devices connected to a wireless network, that a first device is a master node of the wireless network;
a first connection module 54 configured to connect other devices of the plurality of devices except the first device to the first device;
an obtaining module 56, configured to obtain a second device from the other devices as the master node when it is determined that the first device cannot connect to the wireless network;
a second connecting module 58, configured to connect a device other than the second device in the plurality of devices to the second device.
It should be noted that the first determining module 52 in this embodiment may be configured to execute the step S202 in this embodiment, the first connecting module 54 in this embodiment may be configured to execute the step S204 in this embodiment, the obtaining module 56 in this embodiment may be configured to execute the step S206 in this embodiment, and the second connecting module 58 in this embodiment may be configured to execute the step S208 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, a first device in a plurality of devices connected with the wireless network is determined as a main node of the wireless network, other devices are connected to the first device, under normal conditions, all the devices can communicate with the wireless network through the first device, if the first device is determined to be incapable of being connected to the wireless network, a second device is obtained again from other devices except the first device to serve as the main node, the devices in the wireless network are connected to a new main node, the purpose of rapidly recovering network connection for the devices incapable of being connected to the network is achieved, and therefore the technical effect of improving the network connection stability of the electronic device is achieved, and the technical problem that the network connection stability of the electronic device in the related technology is low is solved.
As an alternative embodiment, the first determining module includes:
a first obtaining unit, configured to obtain a device level of each device in the multiple devices, where the device level of the device connected to the wireless network is a root node, the device level of the device connected to the root node is a child node, and the device level of the device connected to the child node is a slave node;
a second obtaining unit, configured to obtain the first device as the master node from a device whose device level is a root node.
As an alternative embodiment, the second obtaining unit is configured to:
randomly selecting the first equipment from the equipment with the equipment level as a root node as the main node;
and selecting the first equipment which is normally connected with the wireless network and has the highest connection priority from the equipment with the equipment level as the root node according to the connection priority of the equipment as the main node.
As an alternative embodiment, the first connection module comprises:
a first connection unit, configured to connect, to a first device, a device other than the first device, of devices whose device ranks are root nodes among the multiple devices, where a device rank of a device connected to the wireless network is a root node, a device rank of a device connected to the root node is a child node, and a device rank of a device connected to the child node is a slave node;
a second connection unit, configured to connect a device of which a device level is a child node among the multiple devices to a corresponding root node;
and the third connecting unit is used for connecting the equipment with the slave node in the equipment level in the plurality of equipment to the corresponding child node.
As an alternative embodiment, the second connection module comprises:
a conversion unit, configured to convert a child node device corresponding to the first device in devices having device levels that are child nodes into a slave node device, where the device level of a device connected to the wireless network is a root node, the device level of a device connected to the root node is a child node, and the device level of a device connected to a child node is a slave node;
a fourth connecting unit, configured to connect the slave node device to a child node device corresponding to the second device.
As an alternative embodiment, the apparatus further comprises:
a second determination module configured to, after connecting a device other than the second device among the plurality of devices to the second device, re-determine the first device as the master node in a case where it is confirmed that the first device resumes the connection with the wireless network;
a third connecting module, configured to connect other devices of the multiple devices except the first device to the first device.
As an alternative embodiment, the apparatus further comprises:
and a fourth connection module, configured to connect, after connecting the other devices except the first device to the first device, the device with the root node in all the device classes of the wireless network to a mobile network module under the condition that it is determined that the devices with the root node in all the device classes of the wireless network cannot be connected to the wireless network, where the mobile network module is powered by an independent backup battery, the mobile network module is configured to connect to the internet through a mobile network, and the device class of the device connected to the wireless network is the root node.
It should be noted that the modules described above are the same as examples and application scenarios realized by corresponding steps, but are not limited to what is disclosed in the foregoing embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus for implementing the network connection method of the electronic device.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present application, where as shown in fig. 6, the electronic device may include: one or more processors 601 (only one of which is shown), a memory 603, and a transmission 605. As shown in fig. 6, the electronic apparatus may also include an input output device 607.
The memory 603 may be used to store software programs and modules, such as program instructions/modules corresponding to the network connection method and apparatus of the electronic device in the embodiment of the present application, and the processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 603, that is, implements the network connection method of the electronic device. The memory 603 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 603 may further include memory located remotely from the processor 601, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The above-mentioned transmission device 605 is used for receiving or sending data via a network, and may also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 605 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 605 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Among them, the memory 603 is used to store an application program, in particular.
The processor 601 may call the application stored in the memory 603 through the transmission device 605 to perform the following steps:
determining that a first device is a master node of a wireless network from a plurality of devices connected to the wireless network;
connecting devices of the plurality of devices other than the first device to the first device;
under the condition that the first equipment cannot be connected to the wireless network, acquiring second equipment from other equipment as the main node;
connecting devices of the plurality of devices other than the second device to the second device.
By adopting the embodiment of the application, a scheme for network connection of the electronic equipment is provided. The method comprises the steps of determining a first device in a plurality of devices connected with a wireless network as a main node of the wireless network, connecting other devices to the first device, under normal conditions, enabling each device to be communicated with the wireless network through the first device, if the first device is determined to be incapable of being connected to the wireless network, reacquiring a second device from the devices except the first device as the main node, connecting the devices in the wireless network to a new main node, and achieving the purpose of rapidly recovering network connection for the devices incapable of being connected to the network, thereby achieving the technical effect of improving the network connection stability of the electronic device, and further solving the technical problem that the network connection stability of the electronic device in the related technology is low.
Optionally, for a specific example in this embodiment, reference may be made to the example described in the foregoing embodiment, and this embodiment is not described herein again.
It will be understood by those skilled in the art that the structure shown in fig. 6 is merely an illustration, and the electronic device may be a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 6 is a diagram illustrating the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program for instructing hardware associated with an electronic device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing a network connection method of an electronic device.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
determining a first device as a master node of a wireless network from a plurality of devices connected to the wireless network;
connecting devices of the plurality of devices other than the first device to the first device;
acquiring a second device from the other devices as the master node under the condition that the first device is confirmed to be incapable of connecting to the wireless network;
connecting a device of the plurality of devices other than the second device to the second device.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solutions of the present application, which are essential or part of the technical solutions contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the methods described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (9)

1. A network connection method of an electronic device, comprising:
determining a first device as a master node of a wireless network from a plurality of devices connected to the wireless network;
connecting devices of the plurality of devices other than the first device to the first device;
under the condition that the first equipment cannot be connected to the wireless network, acquiring second equipment from other equipment as the main node;
connecting a device of the plurality of devices other than the second device to the second device;
wherein connecting a device other than the second device among the plurality of devices to the second device comprises:
converting child node equipment corresponding to the first equipment in equipment with equipment levels of child nodes into slave node equipment, wherein the equipment level of the equipment connected with the wireless network is a root node, the equipment level of the equipment connected with the root node is a child node, and the equipment level of the equipment connected with the child nodes is a slave node;
and connecting the slave node equipment to the child node equipment corresponding to the second equipment.
2. The method of claim 1, wherein determining that the first device is the master node for the wireless network from the plurality of devices connected to the wireless network comprises:
acquiring the equipment level of each of the plurality of equipment, wherein the equipment level of the equipment connected with the wireless network is a root node, the equipment level of the equipment connected with the root node is a child node, and the equipment level of the equipment connected with the child node is a slave node;
and acquiring the first equipment from the equipment with the equipment level as the root node as the main node.
3. The method of claim 2, wherein obtaining the first device from a device having a device level of a root node as the master node comprises one of:
randomly selecting the first equipment from the equipment with the equipment level as a root node as the main node;
and selecting the first equipment which is normally connected with the wireless network and has the highest connection priority from the equipment with the equipment level as the root node according to the connection priority of the equipment as the main node.
4. The method of claim 1, wherein connecting other devices of the plurality of devices other than the first device to the first device comprises:
connecting devices except the first device among the devices with the device level of a root node among the plurality of devices to the first device, wherein the device level of the device connected with the wireless network is the root node, the device level of the device connected with the root node is a child node, and the device level of the device connected with the child node is a slave node;
connecting the equipment with the equipment level of the child nodes in the plurality of equipment to the corresponding root nodes;
and connecting the equipment with the slave node in the equipment level in the plurality of equipment to the corresponding child node.
5. The method of claim 1, wherein after connecting the device of the plurality of devices other than the second device to the second device, the method further comprises:
re-determining the first device as the master node upon confirming that the first device resumes connection with the wireless network;
connecting other devices of the plurality of devices except the first device to the first device.
6. The method of claim 1, wherein after connecting the other of the plurality of devices except the first device to the first device, the method further comprises:
the method comprises the steps that under the condition that it is confirmed that all devices of the wireless network, of which all device levels are root nodes, cannot be connected with the wireless network, all devices of the wireless network, of which all device levels are root nodes, are connected with a mobile network module, wherein the mobile network module is powered by an independent standby battery, the mobile network module is used for being connected with the Internet through a mobile network, and the devices of the devices connected with the wireless network are root nodes.
7. A network connection apparatus of an electronic device, comprising:
the wireless network control device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining that a first device is a main node of a wireless network from a plurality of devices connected with the wireless network;
a first connection module for connecting other devices of the plurality of devices except the first device to the first device;
an obtaining module, configured to obtain a second device from the other devices as the master node when it is determined that the first device cannot be connected to the wireless network;
a second connection module for connecting a device other than the second device among the plurality of devices to the second device;
wherein the second connection module comprises:
a conversion unit, configured to convert a child node device corresponding to the first device in devices having device levels that are child nodes into a slave node device, where the device level of a device connected to the wireless network is a root node, the device level of a device connected to the root node is a child node, and the device level of a device connected to a child node is a slave node;
and the fourth connecting unit is used for connecting the slave node equipment to the child node equipment corresponding to the second equipment.
8. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 6 by means of the computer program.
CN202110064543.XA 2021-01-18 2021-01-18 Network connection method and device of electronic equipment Active CN112911624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110064543.XA CN112911624B (en) 2021-01-18 2021-01-18 Network connection method and device of electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110064543.XA CN112911624B (en) 2021-01-18 2021-01-18 Network connection method and device of electronic equipment

Publications (2)

Publication Number Publication Date
CN112911624A CN112911624A (en) 2021-06-04
CN112911624B true CN112911624B (en) 2023-03-10

Family

ID=76115687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110064543.XA Active CN112911624B (en) 2021-01-18 2021-01-18 Network connection method and device of electronic equipment

Country Status (1)

Country Link
CN (1) CN112911624B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114157559A (en) * 2021-12-15 2022-03-08 深圳绿米联创科技有限公司 Network processing method, network processing system, electronic device, and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105052205A (en) * 2013-03-15 2015-11-11 思科技术公司 Providing a backup network topology without serviece disruption

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005510956A (en) * 2001-11-28 2005-04-21 ミレニアル・ネット Network protocol for ad hoc wireless networks
CN102387042B (en) * 2011-11-22 2014-03-12 华为技术有限公司 Automatic configuration method and system as well as network node
CN103813325B (en) * 2012-11-07 2017-06-06 株式会社理光 The network management of limited area self-organizing network, communication equipment and system
WO2018023971A1 (en) * 2016-08-04 2018-02-08 中兴通讯股份有限公司 Method and apparatus for determining cooperating node

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105052205A (en) * 2013-03-15 2015-11-11 思科技术公司 Providing a backup network topology without serviece disruption

Also Published As

Publication number Publication date
CN112911624A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
CN102571452B (en) Multi-node management method and system
CN101977124B (en) Service clustering method and system based on ZooKeeper technology
CN102739453B (en) Main/standby switching method, equipment and system
CN109218126B (en) Method, device and system for monitoring node survival state
CN103905447A (en) Service link selection control method and device
CN106961658B (en) Internet of things home appliance equipment off-line restoration methods and networking module
US10049068B2 (en) SAS system, SAS system traversal method, and apparatus
CN110769033A (en) Intelligent networking method and system
CN112491700A (en) Network path adjusting method, system, device, electronic equipment and storage medium
CN106331152B (en) Method and device for realizing information synchronization between modules
CN112911624B (en) Network connection method and device of electronic equipment
CN110891006B (en) HINOC communication method, HINOC communication device, HINOC communication equipment and computer readable storage medium
CN113746821A (en) Intelligent device control method and device, storage medium and electronic device
US9132550B2 (en) Apparatus and method for managing robot components
CN110708177B (en) Exception handling method, system and device in distributed system
CN104702647A (en) Information request method and information request system
CN113794597A (en) Alarm information processing method, system, electronic device and storage medium
CN108667640B (en) Communication method and device, and network access system
CN114244686B (en) Communication fault detection method, device and system
CN114124803B (en) Device management method and device, electronic device and storage medium
CN111324504A (en) Method and device for monitoring running state of power communication network
CN111327487A (en) Power communication network running state monitoring method and device based on deep learning
JP2017069863A (en) Communication system, communication method, and program
CN107431634A (en) A kind of method, apparatus and system of the interface established between VNFM
CN104468221A (en) Server fault hot-switching method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant