Instruction sending method and device, storage medium and electronic device
By obtaining the router information sent by the target device and adjusting the transmission power of the wireless signal according to the signal strength, the problem of low success rate of wireless network connection is solved, and a more stable and efficient network connection is achieved.
Patent Information
- Application Number
- CN202510168340.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-16
AI Technical Summary
The success rate of wireless network connection is low, especially when smart appliances are far away from the router or have obstacles, resulting in weak and unstable wireless signal strength.
By obtaining the router information sent by the target device, determine the WIFI signal strength of the target router. If it is less than the preset threshold, send instructions to the target device, turn on the enhancement mode, and increase the transmission power of the wireless signal to improve the connection success rate.
When the WIFI signal of the target router is weak, the transmission power of the wireless signal is increased through the enhancement mode, which significantly improves the connection success rate and network stability of the smart device and the router.
Smart Images

Figure CN120018244A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for sending instructions, a storage medium, and an electronic device. Background Art
[0002] With the popularization of wireless networks, people are increasingly relying on wireless networks in their work, life and study. Indicators such as the stability, speed, security and connection success rate of wireless networks largely determine the actual user experience of wireless networks.
[0003] The router of a wireless network is the core device of the wireless network. The current mainstream configuration binding is to convey the router's Service Set Identifier (SSID) and preset password (PWD) to the smart device through various means, and then the device connects to the router. In some cases, especially when smart home appliances are placed in the kitchen or bathroom, they are far away from the home router, or there are various obstacles, load-bearing walls, doors, etc. in the middle, resulting in the wireless fidelity (Wireless Fidelity, referred to as WIFI) signal of the router searched by the device to be weak and unstable. The wireless signal transmission power of the router, the wireless signal strength of the router, the stability of the wireless signal of the router and other indicators determine the coverage range of the wireless network, the connection success rate and other indicators. When the wireless signal strength of the router is low, the connection success rate of the wireless network will decrease.
[0004] With regard to the problem of low success rate of wireless network connection in related technologies, no effective solution has been proposed yet.
[0005] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0006] The embodiments of the present application provide a method and device for sending an instruction, a storage medium, and an electronic device to at least solve the problem of low success rate of wireless network connection.
[0007] According to one aspect of an embodiment of the present application, a method for sending an instruction is provided, including: acquiring router information sent by a target device to obtain first router information, wherein the first router information includes information of N routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1; when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, sending a first instruction to the target device, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on an enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
[0008] In an exemplary embodiment, sending a first instruction to the target device includes: determining a transmission power corresponding to the first preset threshold to obtain a first transmission power; sending a first instruction to the target device, wherein the first instruction is also used to instruct the target device to increase the transmission power of sending wireless signals to the first transmission power.
[0009] In an exemplary embodiment, the method further includes: when the signal strength of the WIFI signal of the target router is less than a second preset threshold, sending a second instruction to the target router, wherein the second instruction is used to instruct the target router to turn on the enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0010] In an exemplary embodiment, after acquiring the router information sent by the target device, the method further includes: determining second router information, wherein the second router information includes information of M routers searched by the target device last time, wherein M is an integer greater than or equal to 1; when the target device is to be instructed to connect to a target router among the N routers and the M routers do not include the target router, sending a second instruction to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0011] In an exemplary embodiment, after acquiring the router information sent by the target device, the method further includes: when the target device is to be instructed to connect to a designated router and the N routers do not include the designated router, sending a second instruction to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router increases; acquiring the router information sent by the target device again to obtain third router information, wherein the third router information contains information of Z routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the Z routers, where Z is an integer greater than or equal to 1; when the Z routers include the designated router, sending a third instruction to the target device, wherein the third instruction carries an identifier of the designated router and an access password of the designated router; the third instruction is used to instruct the target device to connect to the designated router.
[0012] In an exemplary embodiment, when the Z routers include the designated router, the method further includes: when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, determining the transmission power corresponding to the second preset threshold to obtain a second transmission power; and sending a fourth instruction to the designated router, wherein the fourth instruction is used to instruct the target router to increase the transmission power of sending the wireless signal to the second transmission power.
[0013] In an exemplary embodiment, sending a third instruction to the target device includes: when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, sending the third instruction to the target device, wherein the third instruction is also used to instruct the target device to turn on the enhanced mode.
[0014] According to another aspect of an embodiment of the present application, an instruction sending device is also provided, including: an acquisition module, used to acquire first data in TLV format sent by a first business module through a first communication module, wherein the first communication module and the first business module are modules written using non-Java code; a first sending module, used to send the first instruction in TLV format to a second communication module through a Java local interface JNI, wherein the second communication module is a module written using Java code.
[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned instruction sending method when running.
[0016] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the instruction sending method through the computer program.
[0017] The present application obtains the strength of wireless network signals of multiple routers by acquiring the router information sent by the target device, and thus sends a first instruction to the target device when the WIFI signal of the target router to be connected is weak, thereby instructing the target device to turn on the enhanced mode, increasing the transmission power of the wireless signal, and improving the success rate of connecting to the router, thereby solving the problem of low success rate of wireless network connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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 present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 is a schematic diagram of a hardware environment of a method for sending instructions according to an embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for sending instructions according to an embodiment of the present application;
[0022] Figure 3 is a timing diagram of an optional wireless network connection according to an embodiment of the present application;
[0023] Figure 4 is a structural block diagram of an optional instruction sending device according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of another optional instruction sending device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of an embodiment of the present application, a method for sending a command is provided. The method for sending a command is widely used in smart home, smart home, smart home device ecology, smart home ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for sending a command can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0028] The above network may include but is not limited to: wired network, wireless network. The above wired network may include but is not limited to: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0029] In order to solve the above problem, a method for sending an instruction is provided in this embodiment, which may be applied to the terminal device 102, Figure 2 : is a flow chart of a method for sending instructions according to an embodiment of the present application, the flow includes the following steps S202-S204:
[0030] Step S202: Obtaining router information sent by the target device to obtain first router information, wherein the first router information includes information of N routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1;
[0031] Optionally, the target devices include, but are not limited to: smart devices applied in the field of smart home and Internet of Things (IoT), smart furniture (such as speakers, TVs, door locks), and smart wearable devices (watches, glasses).
[0032] Optionally, refer to Figure 3 When the target device enters the network configuration mode and is ready to connect to the wireless network, the Bluetooth broadcast is turned on. At the same time, the terminal device scans the target device, establishes a connection with the target device via Bluetooth, and sends a search command to the target device. The search command is used to instruct the target device to search for WIFI signals in the surrounding environment.
[0033] Optionally, the target device will search for WIFI signals in the surrounding environment, obtain a series of router information (including but not limited to SSID, Media Access Control (MAC) address, WIFI signal strength, etc.), and send this information to the terminal device for processing. This step helps the terminal device understand the current network environment of the smart device and provide basic data for subsequent network connection decisions.
[0034] Step S204: When the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, a first instruction is sent to the target device, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on the enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
[0035] Optionally, in step S204, the terminal device analyzes the router information obtained from the smart device. When the terminal device identifies that the signal strength of a target router (ie, the router to which the smart device is expected to connect) is lower than a preset threshold, the terminal device sends a first instruction to the smart device.
[0036] Optionally, the identifier of the target router carried in the first instruction is the SSID of the target router, and the access password PWD of the target router carried in the first instruction may be preset.
[0037] Optionally, the implementation process of enabling enhanced mode on the target device is as follows:
[0038] 1. Software control layer: There is a set of software control logic in the module of the target device, which is used to receive instructions from the terminal device. This logic is usually implemented in the firmware of the module. The firmware will contain a module for receiving and parsing instructions. When the firmware receives the instruction to turn on the enhanced mode, it can understand and execute the corresponding operation.
[0039] 2. Hardware adjustment: The hardware design of the module of the target device needs to have the ability to dynamically adjust the transmission power. This usually involves the power amplifier and RF circuit inside the module. In enhanced mode, the gain of the power amplifier will increase, making the wireless signal transmitted by the module stronger. This adjustment can be achieved through a variable gain amplifier in the hardware circuit or by controlling the gain of the power amplifier through software.
[0040] 3. Connection attempt and optimization: After increasing the transmission power, the target device will try to connect to the target router. If the first attempt fails, the module may make multiple attempts based on the algorithm settings, and the transmission power may be adjusted based on feedback between each attempt to find the optimal connection parameters.
[0041] It should be noted that the first instruction also instructs the target device to turn on enhanced mode, which is a mode that can increase the device's transmission power, helping to improve the connection success rate when the signal is weak. In enhanced mode, the power of the wireless signal sent by the target device is increased, allowing the signal to better penetrate obstacles and cover a wider range, thereby improving the connection quality with the target router.
[0042] It should be noted that by actively adjusting the transmission power of smart devices, the connection success rate in complex network environments can be significantly improved, ensuring that the device can stably access the target network, implementing a dynamic network management strategy, and being able to adjust device behavior based on real-time signal strength, reducing connection failures caused by signal problems, thereby reducing the failure rate of equipment and improving the overall stability of the system.
[0043] In the above steps, the strength of the wireless network signals of multiple routers is obtained by acquiring the router information sent by the target device, so that when the WIFI signal of the target router to be connected is weak, the first instruction is sent to the target device, thereby instructing the target device to turn on the enhanced mode, increasing the transmission power of the wireless signal, and improving the success rate of connecting to the router, thereby solving the problem of low success rate of wireless network connection.
[0044] In an exemplary embodiment, sending the first instruction to the target device may be implemented by the following steps S11-S12:
[0045] Step S11: determining a transmit power corresponding to the first preset threshold to obtain a first transmit power;
[0046] It should be noted that when the signal strength of the router searched by the device is lower than the preset threshold (the first preset threshold), this usually means that the connection between the device and the router may not be stable enough, which may result in a reduced data transmission rate or disconnection. To solve this problem, the terminal device or server needs to calculate an appropriate transmission power that is higher than the current transmission power of the device, but not too high to cause interference or energy consumption problems. This calculation is based on the estimated distance between the device and the router, signal attenuation, and possible environmental factors (such as obstacles, interference from other wireless signals, etc.).
[0047] Optionally, the first transmission power is a transmission power corresponding to when the target device is connected to a target router that reaches a first preset threshold.
[0048] Optionally, the transmission power corresponding to the first preset threshold is determined according to a target configuration file, wherein the target configuration file records the transmission power to which the target device needs to be enhanced when the WIFI signal of the target router is at different preset thresholds.
[0049] Step S12: Send a first instruction to the target device, wherein the first instruction is further used to instruct the target device to increase the transmission power of the wireless signal to the first transmission power.
[0050] Optionally, after determining the first transmission power, the terminal device will send a first instruction to the target device via wireless communication (such as Bluetooth). This instruction contains two key information: the SSID (service set identifier, i.e., network name) and access password (PWD) of the target router, and a command instructing the device to increase the transmission power of its wireless signal to the first transmission power. After receiving the instruction, the target device will adjust its wireless transmission circuit to meet the new power requirement and try to connect to the target router.
[0051] It should be noted that by increasing the transmission power, the device can overcome signal attenuation, especially in a weak signal environment, which significantly improves the success rate of the device connecting to or reconnecting to the WIFI network for the first time. In addition, the increased transmission power helps reduce the loss and retransmission of data packets, thereby improving the stability of network communication and the efficiency of data transmission.
[0052] It should be noted that, through the above steps, the method in the embodiment of the present application effectively solves the problem of smart devices connecting to the Wi-Fi network under poor signal conditions, and provides an automatic, efficient and intelligent network configuration solution, which is of great significance for improving the user experience and system performance of smart home and Internet of Things technologies.
[0053] In an exemplary embodiment, the method further includes the following steps: when the signal strength of the WIFI signal of the target router is less than a second preset threshold, sending a second instruction to the target router, wherein the second instruction is used to instruct the target router to turn on the enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0054] Optionally, when it is detected that the WIFI signal strength of the target router is lower than a set second preset threshold, the terminal device will take active measures to send a second instruction to the target router, and the second instruction includes a command to turn on the enhanced mode, that is, requiring the router to adjust its transmission power to enhance the coverage and strength of the wireless signal.
[0055] It should be noted that by turning on the enhanced mode, the target router can increase the transmission power of its wireless signal, thereby improving the signal strength. The increase in signal strength helps to optimize the connection quality between smart devices and routers, reduce data transmission delays and errors, and improve the stability and efficiency of wireless networks. This is extremely effective in solving signal attenuation problems, especially in areas at the edge of signal coverage or affected by environmental factors.
[0056] It should be noted that in addition to enabling the enhanced mode on the device side, this embodiment also introduces an enhanced mode on the router side, which achieves signal optimization on both ends and further improves the connection success rate and network stability.
[0057] It should be noted that by sending a second instruction to the target router to instruct it to turn on the enhanced mode and adjust the transmission power, this embodiment effectively solves the connection problem caused by insufficient signal strength, improves the communication quality and stability between the device and the router, and maintains the intelligence and user-friendliness of the system, which is of great significance for building an efficient and stable smart home or Internet of Things environment. This mechanism ensures that the network connection can maintain the optimal state under various conditions by dynamically adjusting the performance parameters of the network device, thereby promoting the healthy development of smart life and smart device ecology.
[0058] In an exemplary embodiment, after acquiring the router information sent by the target device, the method further includes the following steps S21-S22:
[0059] Step S21: determining second router information, wherein the second router information includes information of M routers searched by the target device last time, wherein M is an integer greater than or equal to 1;
[0060] Optionally, the terminal device will review and determine the router information (second router information) previously searched by the target device, and this information set includes data of M routers (such as SSID, MAC address, signal strength, etc.). By collecting historical search data, the terminal device can compare the currently searched router information and analyze changes in the network environment of the target device.
[0061] Step S22: When the target device is to be instructed to connect to a target router among the N routers and the M routers do not include the target router, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0062] Optionally, when the terminal device is ready to instruct the target device to connect to a router (target router) not included in the previous search record, a second instruction is sent to the target router, requesting the router to turn on the enhanced mode, that is, to increase the transmission power of its wireless signal to improve signal coverage and strength.
[0063] It should be noted that when the target device tries to connect to a router that has not been searched before (due to the long distance or unstable router hardware), if the signal strength is not enough to ensure a stable connection, the enhanced mode can significantly enhance the signal and improve the reliability of the connection.
[0064] It should be noted that after obtaining the router information sent by the target device, through the above steps S21-S22, the system can not only evaluate and optimize the signal strength of the newly emerged router, but also make intelligent decisions based on the historical search information of the device, ensuring that in a complex and changing network environment, the smart device can quickly and stably connect to the best network node. This mechanism not only improves the efficiency and success rate of the connection, but also optimizes the overall network performance, and has important technical value for building efficient, stable and intelligent smart home and Internet of Things systems.
[0065] In an exemplary embodiment, after acquiring the router information sent by the target device, the method further includes the following steps S31-S33:
[0066] Step S31: When the target device is to be instructed to connect to a designated router and the N routers do not include the designated router, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased;
[0067] It should be noted that in step S31, the terminal device instructs the target device to connect to a specific router (designated router), but the designated router is not included in the N routers currently searched. In order to ensure that the target device can successfully search and connect to the designated router, the system will send a second instruction to the designated router, instructing it to enter the enhanced mode, that is, to increase the transmission power of the wireless signal. Enabling the enhanced mode helps the target device to detect the signal of the designated router in subsequent searches.
[0068] Step S32: acquiring the router information sent by the target device again to obtain third router information, wherein the third router information includes information of Z routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the Z routers, where Z is an integer greater than or equal to 1;
[0069] Optionally, after instructing the designated router to enter the enhanced mode, the system needs to obtain the router information searched by the target device again to confirm whether the designated router has been searched. The router information obtained this time is defined as the third router information, which includes the information of Z routers.
[0070] Step S33: When the Z routers include the designated router, a third instruction is sent to the target device, wherein the third instruction carries an identifier of the designated router and an access password of the designated router; the third instruction is used to instruct the target device to connect to the designated router.
[0071] Optionally, once the search result (third router information) of the target device includes the designated router, the terminal device will send a third instruction to the target device, instructing it to connect to the designated router using the designated SSID and access password. The third instruction may also include an instruction to turn on the enhanced mode to ensure that when the target device is connected to the designated router, its own transmission power is also adjusted to the optimal state, thereby improving the stability of the connection and the efficiency of data transmission.
[0072] It should be noted that by sending enhanced mode instructions to the designated router, the problem that the target device cannot detect the designated router due to insufficient signal coverage can be effectively solved, ensuring the success rate of network configuration. In other words, the application can dynamically adjust the network configuration strategy according to the changes in the search results of the target device, which improves the flexibility and adaptability of the network and ensures the best connection effect.
[0073] It should be noted that, through the above steps, this embodiment provides an intelligent network configuration method that can automatically identify and solve connection problems caused by signal coverage problems, ensuring that smart devices can quickly, accurately and stably connect to the designated router. This strategy not only optimizes network performance and connection experience, but also greatly reduces the difficulty of operation for users in the device network configuration process, and has significant technical effects on building an efficient and intelligent network connection management mechanism in smart home and Internet of Things environments.
[0074] In an exemplary embodiment, when the Z routers include the designated router, the method further includes the following steps S41-S42:
[0075] Step S41: when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, determining a transmission power corresponding to the second preset threshold to obtain a second transmission power;
[0076] It should be noted that after the terminal device reacquires the router information (i.e., the third router information) sent by the target device, it is found that the designated router is included in the Z routers. However, if the WIFI signal strength of the designated router is still lower than the second preset threshold value set previously, this indicates that even if the target device can detect the designated router, the signal strength may not be sufficient to maintain a stable and efficient data transmission. In order to improve this situation, the terminal device needs to calculate an appropriate transmission power (second transmission power) that is higher than the current transmission power but lower than a level that may cause signal interference or consume too much energy.
[0077] Step S42: Send a fourth instruction to the designated router, wherein the fourth instruction is used to instruct the target router to increase the transmission power of the wireless signal to the second transmission power.
[0078] Optionally, after determining the second transmission power, the terminal device will send a fourth instruction to the designated router, instructing it to increase the transmission power of the wireless signal to the new power level. The purpose of increasing the transmission power is to improve the signal coverage and strength, ensuring that the target device can establish a stable and high-speed connection with the designated router.
[0079] It should be noted that by dynamically calculating and adjusting the transmission power, the terminal device can effectively deal with the situation of insufficient signal strength, improve the communication quality between the target device and the designated router, and ensure the stability and high speed of data transmission. The setting of the second preset threshold allows the terminal device to adopt different optimization strategies under different signal strength levels, automatically adjust the router's transmission power according to the real-time signal strength and network environment changes, and realize fine-grained control of network optimization, which enhances the adaptability and intelligence of the network, improves the pertinence and effectiveness of the optimization effect, and is especially important for device connections in complex network environments.
[0080] It should be noted that through the above steps S41-S42, not only can the signal strength be improved when the target device has detected the designated router, but also the stability of device connection and data transmission efficiency can be improved without sacrificing energy efficiency and network stability. This dynamic power adjustment and optimization mechanism significantly enhances the network connection management capability of smart homes or IoT systems, and has important technical value for building an efficient, stable and intelligent network environment.
[0081] In an exemplary embodiment, sending the third instruction to the target device can be achieved by the following steps: when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, sending the third instruction to the target device, wherein the third instruction is also used to instruct the target device to turn on the enhanced mode.
[0082] Optionally, when the terminal device detects that the WIFI signal strength of the designated router is less than the second preset threshold, this indicates that although the target device can detect the signal of the designated router, the signal quality is not sufficient to ensure a stable and efficient network connection. To solve this problem, the terminal device sends a third instruction to the target device to instruct the target device to turn on the enhanced mode.
[0083] Optionally, when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, both the designated router and the target device will turn on the enhanced mode.
[0084] It should be noted that the activation of enhanced mode means that the target device will adjust the transmission power of its wireless signal to adapt to the weak signal environment. By increasing the transmission power, the target device can overcome signal attenuation, increase the coverage and penetration of the signal, and thus improve the possibility of connecting to the designated router and the quality of the connection.
[0085] It should be noted that this embodiment effectively solves the connection problem caused by insufficient signal strength by instructing the target device to turn on the enhanced mode, and improves the connection quality and stability of the target device in a complex network environment. This automated and intelligent network configuration and optimization solution is of great value in building an efficient, stable and secure smart home and Internet of Things system, and can significantly improve the user's network experience and the ability of devices to work together.
[0086] In an exemplary embodiment, the method further comprises the following steps: when the Z routers do not include the designated router, recording the search failure information of the designated router and the location information of the target device; within a preset time, if the target device is in the network configuration mode again, instructing the target device to preferentially search for the designated router according to the location information of the target device, wherein when the target device is in the network configuration mode, instructing the target device to connect to the designated router;
[0087] It should be noted that by recording the search failure information of the designated router and the location of the device, the terminal device can prioritize the search for the designated router based on the location information when the target device is in the network configuration mode in the future. If the signal strength meets the conditions, the terminal device will instruct the target device to connect directly to the designated router without entering the enhanced mode, balancing the connection efficiency and energy consumption.
[0088] In an exemplary embodiment, the method further includes: determining a first preset threshold and a second preset threshold by the following steps: dynamically adjusting the first preset threshold and the second preset threshold according to the type of the target device, the distance between the target device and the target router, and the environmental factors around the target device, wherein the first preset threshold is used to determine whether the target device needs to turn on the enhanced mode, and the second preset threshold is used to determine whether the target router needs to turn on the enhanced mode; when the distance between the target device and the target router exceeds the preset distance, the first preset threshold and the second preset threshold are both reduced.
[0089] It should be noted that the terminal device can intelligently adjust the threshold to adapt to different connection requirements based on the device type, distance from the router, and surrounding environmental factors. For long-distance smart home devices, the reduction of the threshold helps ensure that the device can successfully connect to the router even in an environment with severe signal attenuation, reflecting the system's adaptability and intelligence to different environments and device types.
[0090] In an exemplary embodiment, the method further includes: when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, sending a fifth instruction to the target device, wherein the fifth instruction carries an identifier of the target router and an access password of the target router; the fifth instruction is used to instruct the target device to turn on a reception enhancement mode and connect to the target router; when the target device turns on the reception enhancement mode, the receiving power of the wireless signal received by the target device increases.
[0091] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:
[0092] 1: The device (equivalent to the target device mentioned above) enters the network configuration mode and turns on Bluetooth broadcasting;
[0093] 2: The mobile phone (equivalent to the above-mentioned terminal device) receives the Bluetooth Low Energy Advertising (BLE) broadcast from the device and scans the device to be connected to the network;
[0094] 3: The mobile phone establishes a Bluetooth connection with the device and sends a command to the device to allow the device to obtain surrounding WIFI information;
[0095] 4: The device obtains the surrounding WIFI information;
[0096] 5: The device returns the WIFI information to the mobile phone via Bluetooth;
[0097] 6: After the mobile phone obtains the surrounding WIFI information of the device, it compares the information of the router to which the device is to be configured to determine the strength of the WIFI signal of the router;
[0098] 7: If the target router's WIFI signal is medium or weak, when sending the router's SSID and PWD to the device, the device is also informed that it needs to turn on the enhanced mode to increase the transmission power;
[0099] 8: After receiving the command, the device turns on the enhanced mode, increases the transmission power, and connects to the target router.
[0100] It should be noted that this application also has the following advantages:
[0101] 1. Dynamically obtain the WIFI list information around the smart device;
[0102] 2. If the WIFI signal of the target router is weak, actively enable the device to turn on the enhanced mode to increase the transmission power, thereby increasing the success rate of connecting to the router.
[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0104] In the present embodiment, a command sending device is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the equipment described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0105] Figure 4 is a structural block diagram of an instruction sending device according to an embodiment of the present application, the device comprising:
[0106] The acquisition module 402 is used to acquire the router information sent by the target device to obtain the first router information, wherein the first router information includes the information of N routers searched by the target device and the signal strength of the wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1;
[0107] The first sending module 404 is used to send a first instruction to the target device when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on the enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
[0108] The above-mentioned device obtains the strength of the wireless network signals of multiple routers by acquiring the router information sent by the target device, and thus sends a first instruction to the target device when the WIFI signal of the target router to be connected is weak, thereby instructing the target device to turn on the enhanced mode, increasing the transmission power of the wireless signal, and improving the success rate of connecting to the router, thereby solving the problem of low success rate of wireless network connection.
[0109] In an exemplary embodiment, the first sending module 404 is also used to determine the transmission power corresponding to the first preset threshold to obtain a first transmission power; and send a first instruction to the target device, wherein the first instruction is also used to instruct the target device to increase the transmission power of the wireless signal to the first transmission power.
[0110] In an exemplary embodiment, Figure 5 As shown, the above-mentioned device also includes: a second sending module 502, which is used to send a second instruction to the target router when the signal strength of the WIFI signal of the target router is less than a second preset threshold, wherein the second instruction is used to instruct the target router to turn on the enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0111] In an exemplary embodiment, the second sending module 502 is further used to determine second router information, wherein the second router information includes information of M routers searched by the target device last time, wherein M is an integer greater than or equal to 1; when the target device is to be instructed to connect to a target router among the N routers and the M routers do not include the target router, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on the enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
[0112] In an exemplary embodiment, the second sending module 502 is further used to send a second instruction to the target router when the target device is to be instructed to connect to a designated router and the N routers do not include the designated router, wherein the second instruction is used to instruct the target router to turn on the enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router increases; the acquisition module 402 is further used to acquire the router information sent by the target device again to obtain the third router information, wherein the third router information contains the information of the Z routers searched by the target device and the signal strength of the wireless fidelity WIFI signals of the Z routers, where Z is an integer greater than or equal to 1; Figure 5 As shown, the above-mentioned device also includes: a third sending module 504, which is used to send a third instruction to the target device when the Z routers include the designated router, wherein the third instruction carries the identifier of the designated router and the access password of the designated router; the third instruction is used to instruct the target device to connect to the designated router.
[0113] In an exemplary embodiment, Figure 5 As shown, the above-mentioned device also includes: a fourth sending module 506, which is used to determine the transmission power corresponding to the second preset threshold value when the signal strength of the WIFI signal of the designated router is less than the second preset threshold value, and obtain the second transmission power; send a fourth instruction to the designated router, wherein the fourth instruction is used to instruct the target router to increase the transmission power of the wireless signal to the second transmission power.
[0114] In an exemplary embodiment, the third sending module 504 is further used to send a third instruction to the target device when the signal strength of the WIFI signal of the designated router is less than a second preset threshold, wherein the third instruction is also used to instruct the target device to turn on the enhanced mode.
[0115] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0116] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0117] S1, obtaining router information sent by the target device to obtain first router information, wherein the first router information includes information of N routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1;
[0118] S2, when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, send a first instruction to the target device, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on an enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
[0119] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0120] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0121] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0122] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0123] S1, obtaining router information sent by the target device to obtain first router information, wherein the first router information includes information of N routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1;
[0124] S2, when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, send a first instruction to the target device, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on an enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
[0125] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0126] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0127] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0128] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0129] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0130] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0131] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for sending an instruction, characterized in that: include: Acquire the router information sent by the target device to obtain first router information, wherein the first router information includes information of N routers searched by the target device and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1; When the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, a first instruction is sent to the target device, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on an enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
2. The method according to claim 1, characterized in that Sending a first instruction to the target device includes: Determine a transmit power corresponding to the first preset threshold to obtain a first transmit power; A first instruction is sent to the target device, wherein the first instruction is further used to instruct the target device to increase the transmission power of the wireless signal sent to the first transmission power.
3. The method according to claim 1, characterized in that The method further comprises: When the signal strength of the WIFI signal of the target router is less than a second preset threshold, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on the enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
4. The method according to claim 1, characterized in that: After acquiring the router information sent by the target device, the method further includes: Determine second router information, wherein the second router information includes information of M routers searched by the target device last time, wherein M is an integer greater than or equal to 1; When the target device is to be instructed to connect to a target router among the N routers and the M routers do not include the target router, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode. When the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased.
5. The method according to claim 1, characterized in that After acquiring the router information sent by the target device, the method further includes: When the target device is to be instructed to connect to a designated router and the N routers do not include the designated router, a second instruction is sent to the target router, wherein the second instruction is used to instruct the target router to turn on an enhanced mode, and when the target router turns on the enhanced mode, the transmission power of the wireless signal sent by the target router is increased; The router information sent by the target device is acquired again to obtain the third router information, wherein the third router information contains the information of the Z routers searched by the target device and the signal strength of the wireless fidelity WIFI signals of the Z routers, and Z is an integer greater than or equal to 1; when the Z routers include the designated router, a third instruction is sent to the target device, wherein the third instruction carries the identifier of the designated router and the access password of the designated router; the third instruction is used to instruct the target device to connect to the designated router.
6. The method according to claim 5, characterized in that In the case where the Z routers include the designated router, the method further includes: When the signal strength of the WIFI signal of the designated router is less than a second preset threshold, determining a transmission power corresponding to the second preset threshold to obtain a second transmission power; A fourth instruction is sent to the designated router, wherein the fourth instruction is used to instruct the target router to increase the transmission power of the wireless signal to the second transmission power.
7. The method according to claim 5, characterized in that Sending a third instruction to the target device includes: When the signal strength of the WIFI signal of the designated router is less than a second preset threshold, a third instruction is sent to the target device, wherein the third instruction is further used to instruct the target device to turn on the enhanced mode.
8. A command sending device, characterized in that: include: an acquisition module, configured to acquire router information sent by a target device, and obtain first router information, wherein the first router information includes information of N routers searched by the target device, and signal strengths of wireless fidelity WIFI signals of the N routers, where N is an integer greater than or equal to 1; The first sending module is used to send a first instruction to the target device when the target device is to be instructed to connect to a target router among the N routers and the signal strength of the WIFI signal of the target router is less than a first preset threshold, wherein the first instruction carries an identifier of the target router and an access password of the target router; the first instruction is used to instruct the target device to turn on an enhanced mode and connect to the target router; when the target device turns on the enhanced mode, the transmission power of the wireless signal sent by the target device is increased.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.