Wireless communication method, electronic device and computer storage medium

By setting and switching wireless communication links on temporary channels between mobile devices and base stations, the problem of lengthy and unstable wireless communication link settings is solved, communication efficiency and stability are improved, and communication contact is multiplexed The point realizes the dual functions of communication and charging, reducing equipment costs.

CN116017390BActive Publication Date: 2024-12-20ECOFLOW INC
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202211389348.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2024-12-20
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

The setup process of the wireless communication link between the mobile device and the base station is relatively lengthy and unstable, resulting in inefficient communication.

Method used

By performing wireless communication on the temporary channel established by the connected contact point, negotiate to switch to the second channel corresponding to the preset country code, stable communication is achieved, and re-enter the pairing process when the channel configuration fails to improve stability.

Benefits of technology

The wireless communication link setting process is accelerated, the communication stability is improved, and the communication and charging functions are realized by multiplexing the contact points, reducing equipment costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116017390B_ABST
    Figure CN116017390B_ABST
Patent Text Reader

Abstract

The present invention relates to a wireless communication method, an electronic device and a computer storage medium. After a mobile device is connected to a target device through a connection contact, pairing is performed, and both a receiving channel and a sending channel are set to a first channel, and wireless pairing with the target device is completed. After determining the second channel according to a country code, a channel configuration request is sent to the target device, and after receiving a first confirmation signal returned by the target device, the receiving channel is configured as the second channel, and a channel configuration notification is sent to the target device. After confirming that the channel configuration of the target device is successful, the sending channel itself is configured as the second channel, and subsequently communicates with the target device on the second channel. The above method negotiates with a base station on a temporary first channel through wireless communication to switch to the second channel corresponding to the country code for stable communication. Compared with link setting through a connection contact, the setting process of the wireless communication link can be accelerated and the stability of communication can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a wireless communication method, an electronic device, and a computer storage medium. Background Art

[0002] In the field of self-mobile equipment, charging piles are often also used as base stations. In related technologies, base stations need to send positioning information to self-mobile equipment, such as outdoor lawn mowers, so that the self-mobile equipment can find the base station for charging or operate based on the positioning information. The base station often uses wireless communication to send positioning information to the self-mobile equipment, such as long-range radio communication (LoRa). Before the wireless communication link is established, wireless pairing and link establishment are usually performed through connection contacts, which makes the link setting of the wireless communication link lengthy and unstable. Summary of the invention

[0003] In view of this, the present application provides a wireless communication method, an electronic device and a computer storage medium, which can solve the problem that the link setting of the wireless communication link is relatively lengthy and unstable.

[0004] In a first aspect, an embodiment of the present application provides a wireless communication method, which is applied in a self-mobile device, and the wireless communication method includes: after connecting with a target device through a connection contact, receiving a pairing request sent by the target device through the connection contact, wherein the pairing request carries information of a first channel; configuring a sending channel of the self-mobile device and a receiving channel of the self-mobile device as the first channel, and performing wireless communication with the target device on the first channel to complete wireless pairing; sending a channel configuration request to the target device through the sending channel of the self-mobile device, wherein the channel configuration request carries information of a second channel, and the second channel is determined according to a preset country code; when a first confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, configuring the receiving channel of the self-mobile device to the second channel; if the receiving channel of the self-mobile device is successfully configured, sending a channel configuration notification to the target device through the sending channel of the self-mobile device; if a configuration success confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, configuring the sending channel of the self-mobile device to the second channel, and performing wireless communication with the target device through the receiving channel and the sending channel of the self-mobile device.

[0005] After the above method successfully pairs the devices through the connection contacts, it negotiates with the target device on a temporary first channel through wireless communication to switch to the second channel corresponding to the country code for stable communication. Compared with pairing and link setting through the connection contacts, directly setting the link on the first channel of wireless communication can speed up the setting process of the wireless communication link and improve the stability of communication.

[0006] In one embodiment of the present application, after sending a channel configuration notification to the target device through the sending channel of the self-mobile device, the method further includes: if the configuration success confirmation signal is not received through the receiving channel of the self-mobile device within a first preset time period, returning to the step of receiving a pairing request sent by the target device through the connection contact.

[0007] In the above method, when the self-mobile device does not receive the configuration success confirmation signal within the first preset time, it indicates that the channel configuration of the target device has failed. At this time, the self-mobile device re-enters the pairing process, which can avoid the self-mobile device and the target device from losing communication opportunities after the channel switching fails, and further improve the stability of communication.

[0008] In one embodiment of the present application, before sending the channel configuration request to the target device through the sending channel of the mobile device, the method further includes: generating a random number; and determining a channel corresponding to the random number from all channels corresponding to the preset country code as the second channel.

[0009] In one embodiment of the present application, when the first confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, after configuring the receiving channel of the self-mobile device to the second channel, the method further includes: if the configuration of the receiving channel of the self-mobile device fails, returning to the step of receiving the pairing request sent by the target device through the connection contact.

[0010] In the above method, when the channel configuration of the mobile device fails, the method returns to the step of receiving the pairing request sent by the target device through the connection contact, thereby re-performing the wireless communication link setting process with the target device to improve the stability of communication with the target device.

[0011] In one embodiment of the present application, after wireless communication with the target device is performed through the receiving channel and the sending channel of the self-mobile device, the method further includes: upon receiving a firmware upgrade request from the target device, detecting the docking status between the self-mobile device and the target device and whether there is a firmware upgrade package to be transmitted; if the docking status satisfies a preset condition and there is the firmware upgrade package to be transmitted, sending a firmware receive request to the target device through the sending channel of the self-mobile device, the firmware receive request being used to instruct the target device to reduce a spreading factor from an initial value to a preset value; modulating the firmware upgrade package to be transmitted based on the reduced spreading factor, and sending the modulated firmware upgrade package to be transmitted to the target device through the sending channel of the self-mobile device.

[0012] In the above method, when the docking status between the mobile device and the target device meets the preset conditions and there is the firmware upgrade package to be transmitted, the firmware upgrade package to be transmitted is modulated after the spreading factor is reduced, and the modulated firmware upgrade package to be transmitted is sent to the target device through the second channel, which can improve the transmission speed of the firmware upgrade package.

[0013] In one embodiment of the present application, after sending the modulated firmware upgrade package to be transmitted to the target device based on the transmission channel of the self-mobile device, the method further includes: after completing the sending of the firmware upgrade package to be transmitted, restoring the spreading factor to the initial value.

[0014] In one embodiment of the present application, after wirelessly communicating with the target device through the receiving channel and the sending channel of the self-mobile device, the method further includes: receiving electric energy output by the target device through the connection contact.

[0015] In the above method, the connection contacts can not only realize the negotiation between the mobile device and the target device on a temporary first channel to set up a wireless link, but also the mobile device can receive the electric energy output by the target device through the connection contacts. The connection contacts are multiplexed to realize communication and charging functions at the same time, which can reduce contact settings and reduce equipment costs.

[0016] In a second aspect, the present application provides a wireless communication method, which is applied in a target device, and the method includes: after connecting with a self-mobile device through a connection contact, sending a pairing request to the self-mobile device through the connection contact, wherein the pairing request carries a first channel; configuring the sending channel of the target device and the receiving channel of the target device as the first channel, and performing wireless communication with the mobile device on the first channel to complete wireless pairing; when a channel configuration request sent by the self-mobile device is received through the receiving channel of the target device, sending a first confirmation signal to the self-mobile device through the sending channel of the target device, wherein the channel configuration request carries information of a second channel; when a channel configuration notification sent by the self-mobile device is received through the receiving channel of the target device, configuring the sending channel of the target device and the receiving channel of the target device as the second channel in response to the channel configuration notification; if the channel configuration is successful, sending a configuration success confirmation signal to the self-mobile device through the sending channel of the target device.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing program instructions; and a processor for reading and executing the program instructions stored in the memory, so that when the program instructions are executed by the processor, the electronic device performs the above-mentioned wireless communication method.

[0018] In a fourth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, the electronic device executes the above-mentioned wireless communication method.

[0019] In addition, the technical effects brought about by the second to fourth aspects can be found in the description related to the methods of each design of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] 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, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0021] Figure 1 An application scenario diagram of a wireless communication method provided in one embodiment of the present application.

[0022] Figure 2 A flowchart of a wireless communication method provided by an embodiment of the present application.

[0023] Figure 3A flowchart of a wireless communication method provided by another embodiment of the present application.

[0024] Figure 4 A flowchart of the interaction between a mobile device and a target device using a wireless communication method provided in one embodiment of the present application.

[0025] Figure 5 A module diagram of a self-equipped device and a target device provided in one embodiment of the present application.

[0026] Figure 6 1 is a flow chart of wireless communication between a mobile device and a target device via a second channel in one embodiment of the present application.

[0027] Figure 7 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.

[0028] The following specific embodiments will further illustrate the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0029] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The embodiments described are only a part of the embodiments of the present application, rather than 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 are within the scope of protection of the present application.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0032] refer to Figure 1 As shown, it is an application scenario diagram of the wireless communication method provided in the embodiment of the present application. The wireless communication method can be applied in an interactive system consisting of a self-mobile device 10 and a target device 20. The self-mobile device 10 communicates with the target device through a connection contact and a wireless link. It can be understood that in the present application, the wireless link can be a wireless link such as lora, WiFi, Bluetooth, etc., and the present application does not limit this. The following is an explanation of this using lora as an example.

[0033] It can be understood that the self-moving device 10 can be a device that includes a self-moving assistance function. Among them, the self-moving assistance function can be implemented by a vehicle-mounted terminal, and the corresponding self-moving device can be a vehicle with the vehicle-mounted terminal. The self-moving device can also be a semi-autonomous device or a fully autonomous device. Exemplarily, the self-moving device can be a lawn mower, a sweeper, a robot with a navigation function, etc. The target device 20 can be used as a base station for positioning the self-moving device when it moves. In some embodiments, the target device 20 can also be used as a charging station for the self-moving device 10. It should be noted that Figure 1 The self-mobile device 10 is taken as an example of a lawn mower, and the target device 20 is taken as an example of a charging station for the self-mobile device. The above examples are only exemplary and are not limited to these in actual applications. Figure 1 As shown, for example, when the lawn mower is performing a task, it uses the charging pile as a base station to locate itself in order to perform the mowing task, or when charging is needed, it returns to the charging pile for charging. The lawn mower and the charging pile communicate via wireless communication, such as a lora wireless link. Before establishing the lora wireless link, when the lawn mower arrives at the charging pile, the connection contacts on the lawn mower ( Figure 1 The LORA wireless link is paired and configured through the connection contacts. After the LORA wireless link is configured, the lawn mower and the charging pile can communicate through the LORA wireless link.

[0034] refer to Figure 2 As shown in FIG. 1 , it is a flow chart of a wireless communication method provided by an embodiment of the present application. The wireless communication method can be applied to Figure 1 As shown in the self-mobile device 10. Figure 2 As shown, the wireless communication method specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. Figure 2 As shown, the wireless communication method in the embodiment of the present application includes steps S201-S207.

[0035] Step S201, after connecting with a target device through a connection contact, receiving a pairing request sent by the target device through the connection contact.

[0036] refer to Figure 5In one embodiment of the present application, the target device 20 includes a first connection contact 21, a first lora module 22, a first processor 23 and a first memory 24. The self-mobile device 10 includes a second connection contact 11, a second lora module 12, a second processor 13 and a second memory 14. When the self-mobile device 10 moves to the location of the target device 20, and the second connection contact 11 of the self-mobile device 10 is connected to the first connection contact 21 of the target device 20, the self-mobile device 10 and the target device 20 can establish a wired communication link through the first connection contact 21 and the second connection contact 11. Then, the target device 20 can obtain the information of the first channel and the first pairing address of the target device 20, and send a pairing request to the self-mobile device 10 through the above-mentioned wired communication link, wherein the pairing request carries the information of the first channel and the first pairing address.

[0037] In one embodiment of the present application, the first channel can be any channel in the lora channel, which can be referred to as ch1. The first pairing address can be the media access control (MAC) address of the first lora module 22 in the target device 20 or other addresses that can identify the identity of the target device 20. In some embodiments, the first connection contact 21 can be a power supply contact for the target device 20 to power the self-mobile device 10. When the second connection contact 11 of the self-mobile device 10 is connected to the first connection contact 21 of the target device 20, the target device 20 detects that the power supply link between the self-mobile device 10 is connected, and reads the information and MAC address of ch1 of the first lora module 22, and initiates a pairing request to the self-mobile device 10 to request to establish a pairing connection of the lora wireless link with the self-mobile device 10, wherein the pairing request includes the information of ch1 and the MAC address of the first lora module 22.

[0038] It can be understood that ch1 can be determined by the target device 20 from the available LORA channels according to the MAC address of the first LORA module 22. For example, the target device 20 can generate a random number n according to the last two digits of the MAC address of the first LORA module 22, and select the nth channel as ch1 from 500 LORA channels.

[0039] Step S202: configure the sending channel of the mobile device and the receiving channel of the mobile device as a first channel, and perform wireless communication with the target device on the first channel to complete wireless pairing.

[0040] In one embodiment of the present application, after receiving a pairing request through a connection contact, the self-mobile device 10 configures its own sending channel and receiving channel as a first channel, communicates with a target device 20 having a first pairing address through the first channel, responds to the pairing request, and completes the wireless pairing. In this way, the self-mobile device 10 and the target device 20 establish a wireless communication connection based on the first channel.

[0041] Step S203: Send a channel configuration request to the target device through the sending channel of the mobile device. The channel configuration request carries information of the second channel, and the second channel is determined according to a preset country code.

[0042] In one embodiment of the present application, the second channel is any channel of the available Lora channels in the area corresponding to the current country code, that is, CH2. For example, the Lora channel has a total bandwidth of 100 MHz in the 840 MHz frequency band. In the total bandwidth of 100 MHz, a total of 500 Lora channels can be divided in accordance with the method of dividing each 0.2 MHz into one Lora channel. Different regions may correspond to different country codes, and different country codes correspond to different allowed Lora channels, and each country code may correspond to one or more Lora channels. In order to distinguish the 500 Lora channels, the country code can be numbered with a multi-bit binary number to form a binary number, and each country code formed by the binary number corresponds to one or more Lora channels. The above-mentioned preset country code can be the country code corresponding to the area where the mobile device is currently located.

[0043] It can be understood that the channel configuration request carries information about the second channel. The wireless communication link established between the mobile device 10 and the target device 20 through the first channel is only a temporary communication link. Since the first channel is determined by the target device and has nothing to do with the country code, it cannot be guaranteed that the first channel is a channel allowed for use in the current area, and it is necessary to switch to the second channel determined according to the country code. At this time, the sending channel of the mobile device 10 is the first channel. Therefore, the mobile device 10 sends a channel configuration request to the target device 20 through the first channel, so as to negotiate with the target device 20 through the temporary first channel to switch the communication channel to the second channel corresponding to the preset country code, and to communicate stably with the target device 20 through the second channel.

[0044] Step S204: when a first confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, the receiving channel of the self-mobile device is configured as a second channel.

[0045] In one embodiment of the present application, the target device 20 obtains information about the second channel from the channel configuration request and returns a first confirmation signal to the self-mobile device 10, where the first confirmation signal is used to indicate that the target device 20 agrees to perform channel switching on the self-mobile device 10, or the first confirmation signal can also be used to indicate that the target device 20 has received the above-mentioned channel configuration request.

[0046] Step S205: If the receiving channel of the mobile device is configured successfully, a channel configuration notification is sent to the target device via the sending channel of the mobile device.

[0047] In one embodiment of the present application, the channel configuration notification is used to indicate to the target device 20 that the mobile device 10 has successfully switched the receiving channel from the first channel to the second channel and to indicate the target device 20 to perform channel switching, that is, to indicate to the target device 20 that the mobile device 10 has successfully configured the receiving channel as the second channel and to indicate the target device 20 to configure both the sending channel and the receiving channel as the second channel. Since the target device 20 has not yet performed channel switching, and the mobile device 10 has not yet switched the sending channel to the second channel, at this time, the sending channel of the mobile device 10 is still the first channel, and therefore, the channel configuration notification will be sent through the first channel.

[0048] Step S206: If a configuration success confirmation signal returned by the target device is received through the receiving channel of the mobile device, the sending channel of the mobile device is configured as the second channel, and wireless communication is performed with the target device through the receiving channel and the sending channel of the mobile device.

[0049] When the self-mobile device 10 receives the configuration success confirmation signal returned by the target device on the second channel, it indicates that the target device 20 has completed the channel switching from the first channel to the second channel, and both the sending channel and the receiving channel of the target device 20 are switched from the first channel to the second channel. At this time, the self-mobile device 10 can configure its own sending channel as the second channel, and subsequently, the self-mobile device 10 and the target device 20 can communicate stably through the second channel, such as sending and receiving data.

[0050] In the above embodiment, after the mobile device and the target device are successfully paired through the connection contact, they negotiate with the target device on a temporary first channel through wireless communication to switch to the second channel corresponding to the country code for stable communication. Compared with pairing and link setting through the connection contact, directly setting the link on the first channel of wireless communication can speed up the setting process of the wireless communication link and improve the stability of communication.

[0051] refer to Figure 3 As shown in FIG. 1 , it is a flow chart of a wireless communication method provided by another embodiment of the present application. The wireless communication method can be applied to Figure 1In the target device 20 shown. Figure 2 As shown, the wireless communication method specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. Figure 3 As shown, the wireless communication method in the embodiment of the present application includes steps S301-S305.

[0052] Step S301, after connecting with the own mobile device through the connection contact, sending a pairing request to the own mobile device through the connection contact.

[0053] refer to Figure 5 In one embodiment of the present application, the target device 20 includes a first connection contact 21, a first lora module 22, a first processor 23 and a first memory 24. The self-mobile device 10 includes a second connection contact 11, a second lora module 12, a second processor 13 and a second memory 14. When the self-mobile device 10 moves to the location of the target device 20, and the second connection contact 11 of the self-mobile device 10 is connected to the first connection contact 21 of the target device 20, the self-mobile device 10 and the target device 20 can establish a wired communication link through the first connection contact 21 and the second connection contact 11. Then, the target device 20 can obtain the information of the first channel and the first pairing address of the target device 20, and send a pairing request to the self-mobile device 10 through the above-mentioned wired communication link, and the pairing request carries the information of the first channel and the first pairing address.

[0054] Step S302: configure the sending channel of the target device and the receiving channel of the target device as a first channel, and perform wireless communication with the mobile device on the first channel to complete wireless pairing.

[0055] In one embodiment of the present application, after sending a pairing request through the connection contact, the target device 20 configures its own sending channel and receiving channel as the first channel, communicates with the self-mobile device 10 through the first channel, receives a response message based on the pairing request from the self-mobile device 10, and completes the wireless pairing. In this way, the self-mobile device 10 and the target device 20 establish a wireless communication connection based on the first channel.

[0056] Step S303: When the channel configuration request sent by the self-mobile device is received through the receiving channel of the target device, a first confirmation signal is sent to the self-mobile device through the sending channel of the target device.

[0057] In an embodiment of the present application, the target device 20 obtains the information of the second channel from the channel configuration request, and returns a first confirmation signal to the mobile device 10 .

[0058] Step S304: when a channel configuration notification sent from the mobile device is received through the receiving channel of the target device, the sending channel of the target device and the receiving channel of the target device are configured as a second channel in response to the channel configuration notification.

[0059] It can be understood that when the target device 20 receives the channel configuration notification, it means that the self-mobile device 10 has at least successfully switched the receiving channel. At this time, the target device 20 can configure its own sending channel and receiving channel, and switch the sending channel and the receiving channel to the second channel at the same time. When the target device 20 subsequently sends data through the second channel, the self-mobile device 10 can receive the data sent by the target device 20 on the second channel.

[0060] Step S305: If the channel configuration is successful, a configuration success confirmation signal is sent to the mobile device via the sending channel of the target device.

[0061] In one embodiment of the present application, if the sending channel and the receiving channel of the target device 20 are configured successfully, that is, successfully switched from the first channel to the second channel, the target device 20 can send a configuration success confirmation signal to the self-mobile device 10 through the second channel, wherein the configuration success confirmation signal is used to indicate to the self-mobile device 10 that the target device 20 has switched the sending channel and the receiving channel to the second channel.

[0062] In the above wireless communication method, after the self-mobile device 10 and the target device 20 are successfully paired through the connection contacts, the self-mobile device 10 negotiates with the target device 20 on a temporary first channel through wireless communication to switch to the second channel corresponding to the country code for stable communication. Compared with wireless pairing and link setting through the connection contacts, directly setting the link on the first channel of wireless communication can speed up the setting process of the wireless communication link and improve the stability of communication.

[0063] The following Figure 4 As an example, the interaction flow chart between the mobile device 10 and the target device 20 using the wireless communication method is described. Figure 4 As shown, the wireless communication method in the embodiment of the present application includes steps S401-S411.

[0064] Step S401 : the target device 20 sends a pairing request to the mobile device 10 via the connection contact.

[0065] refer to Figure 5In one embodiment of the present application, the target device 20 includes a first connection contact 21, a first lora module 22, a first processor 23 and a first memory 24. The self-mobile device 10 includes a second connection contact 11, a second lora module 12, a second processor 13 and a second memory 14. When the self-mobile device 10 moves to the location of the target device 20, and the second connection contact 11 of the self-mobile device 10 is connected to the first connection contact 21 of the target device 20, the self-mobile device 10 and the target device 20 can establish a wired communication link through the first connection contact 21 and the second connection contact 11. Then, the target device 20 can obtain the information of the first channel and the first pairing address of the target device 20, and send a pairing request to the self-mobile device 10 through the above-mentioned wired communication link, and the pairing request carries the information of the first channel and the first pairing address.

[0066] Step S402 : The mobile device 10 receives a pairing request sent by the target device 20 via a connection contact.

[0067] As mentioned above, before the self-mobile device 10 and the target device 20 communicate through the lora wireless link, they communicate through the connection contacts 11 and 21. For example, the self-mobile device 10 receives the pairing request sent by the target device 20 through the first connection contact 11 and the second connection contact 21, and obtains the information of the first channel carried in the pairing request and the first pairing address of the target device 20.

[0068] Step S403 , the mobile device 10 configures the sending channel of the mobile device and the receiving channel of the mobile device as a first channel, and performs wireless communication with the target device on the first channel to complete wireless pairing.

[0069] In one embodiment of the present application, after receiving the pairing request through the connection contact, the self-mobile device 10 configures its own sending channel and receiving channel to the first channel. Subsequently, the self-mobile device 10 communicates with the target device 2 having the first pairing address through the first channel, so that the self-mobile device 10 and the target device 20 establish a wireless communication connection based on the first channel.

[0070] Step S404: configure the sending channel of the target device and the receiving channel of the target device as a first channel, and perform wireless communication with the mobile device on the first channel to complete wireless pairing.

[0071] In one embodiment of the present application, after sending a pairing request through the connection contact, the target device 20 configures its own sending channel and receiving channel as the first channel, communicates with the self-mobile device 10 through the first channel, receives a response message based on the pairing request from the self-mobile device 10, and completes the wireless pairing. In this way, the self-mobile device 10 and the target device 20 establish a wireless communication connection based on the first channel.

[0072] Step S405 : the mobile device 10 sends a channel configuration request to the target device 20 via the sending channel of the mobile device.

[0073] It can be understood that the channel configuration request carries information about the second channel. The wireless communication link established between the mobile device 10 and the target device 20 through the first channel is only a temporary communication link. Since the first channel is determined by the target device and has nothing to do with the country code, it cannot be guaranteed that the first channel is a channel allowed for use in the current area, and it is necessary to switch to the second channel determined according to the country code. The mobile device 10 sends a channel configuration request to the target device 20 through the first channel to negotiate with the target device 20 through the temporary first channel to switch the communication channel to the second channel corresponding to the preset country code, and to communicate stably with the target device 20 through the second channel.

[0074] Step S406: When the target device 20 receives the channel configuration request sent by the self-mobile device through the receiving channel of the target device, the target device 20 sends a first confirmation signal to the self-mobile device through the sending channel of the target device.

[0075] In an embodiment of the present application, the target device 20 obtains the information of the second channel from the channel configuration request, and returns a first confirmation signal to the mobile device 10 .

[0076] Step S407: when the mobile device 10 receives the first confirmation signal returned by the target device through the receiving channel of the mobile device, the receiving channel of the mobile device is configured as the second channel.

[0077] In one embodiment of the present application, the self-mobile device 10 receives the first confirmation signal returned by the target device 20, indicating that the target device 20 has successfully acquired the information of the second channel, but is still waiting for channel switching. At this time, the target device 20 is still sending and receiving data on the first channel. Therefore, the self-mobile device can start channel switching, first switching the receiving channel from the first channel to the second channel, so that as long as the subsequent target device 20 switches the channel successfully, the self-mobile device can receive the data sent by the target device 20 on the second channel.

[0078] Step S408: If the received channel configuration is successful, the mobile device 10 sends a channel configuration notification to the target device via the sending channel of the mobile device.

[0079] In one embodiment of the present application, the channel configuration notification is used to indicate to the target device 20 that the mobile device 10 has successfully switched the receiving channel from the first channel to the second channel and to indicate the target device 20 to perform channel switching, that is, to indicate to the target device 20 that the mobile device 10 has successfully configured the receiving channel as the second channel and to indicate the target device 20 to configure both the sending channel and the receiving channel as the second channel. Since the target device 20 has not yet performed channel switching, and the mobile device 10 has not yet switched the sending channel to the second channel, at this time, the sending channel of the mobile device 10 is still the first channel, and therefore, the channel configuration notification will be sent through the first channel.

[0080] Step S409 , when the target device 20 receives the channel configuration notification sent from the mobile device 10 through the receiving channel of the target device 20 , the target device 20 configures the sending channel of the target device 20 and the receiving channel of the target device 20 as the second channel in response to the channel configuration notification.

[0081] It can be understood that when the target device 20 receives the channel configuration notification, it means that the self-mobile device 10 has at least successfully switched the receiving channel. At this time, the target device 20 can configure its own sending channel and receiving channel, and switch the sending channel and the receiving channel to the second channel at the same time. When the target device 20 subsequently sends data through the second channel, the self-mobile device 10 can receive the data sent by the target device 20 on the second channel.

[0082] Step S410 , if the channel configuration is successful, the target device 20 sends a configuration success confirmation signal to the mobile device 10 via the sending channel of the target device 20 .

[0083] In one embodiment of the present application, if the sending channel and the receiving channel of the target device 20 are successfully switched from the first channel to the second channel, the target device 20 can send a configuration success confirmation signal to the self-mobile device 10 through the second channel, wherein the configuration success confirmation signal is used to indicate that the self-mobile device 10 has switched the sending channel and the receiving channel to the second channel.

[0084] Step S411, if the mobile device 10 receives a configuration success confirmation signal returned by the target device 20 through the receiving channel, the sending channel of the mobile device 10 is configured as the second channel, and wireless communication is performed with the target device 20 through the receiving channel and the sending channel of the mobile device 10.

[0085] When the self-mobile device 10 receives the configuration success confirmation signal returned by the target device on the second channel, it indicates that the target device 20 has completed the channel switching from the first channel to the second channel, and both the sending channel and the receiving channel of the target device 20 are switched from the first channel to the second channel. At this time, the self-mobile device 10 can switch its own sending channel from the first channel to the second channel, and subsequently, the self-mobile device 10 and the target device 20 can communicate stably through the second channel, such as sending and receiving data.

[0086] In the above embodiment, after the mobile device and the target device are successfully paired through the connection contact, they negotiate with the target device on a temporary first channel through wireless communication to switch to the second channel corresponding to the country code for stable communication. Compared with pairing and link setting through the connection contact, directly setting the link on the first channel of wireless communication can speed up the setting process of the wireless communication link and improve the stability of communication.

[0087] In one embodiment of the present application, before sending a channel configuration request to the target device through the sending channel of the self-mobile device, the self-mobile device also needs to determine a second channel, and the process of determining the second channel includes: generating a random number; determining a channel corresponding to the random number from all channels corresponding to a preset country code as the second channel.

[0088] Specifically, the MAC address of the mobile device 10 can be used as the second pairing address, a random number can be generated according to the last two digits of the second pairing address, the binary number corresponding to the random number can be determined, and the corresponding lora channel can be determined as the second channel according to the binary number.

[0089] In some embodiments of the present application, after step S204, if the channel configuration of the self-mobile device 10 fails, the process returns to step S201. The self-mobile device 10 and the target device 20 will be re-paired and continue the negotiation.

[0090] It can be understood that if the self-mobile device 10 cannot switch from the first channel to the second channel, it may be due to channel reasons or other reasons. Therefore, the self-mobile device 10 can try to re-pair with the target device 20 to renegotiate and set up the wireless link to avoid continuous attempts on the second channel, which consumes a long wireless link configuration time.

[0091] In some embodiments of the present application, after step S206, the mobile device further receives the power output by the target device through the connection contact.

[0092] It can be understood that after the wireless link is set up, the connection contacts of the self-mobile device 10 and the target device 20 are still connected, that is, the first connection contact 11 and the second connection contact 21 are still in a connected state. Since the wireless link has been set up, there is no need to pair through the connection contacts. The self-mobile device 10 and the target device 20 can use the connection contacts as charging contacts. At this time, the self-mobile device 10 can receive the power output by the target device 20 through the connection contacts. In this way, the charging contacts are reused as communication contacts to reduce the cost of the device.

[0093] refer to Figure 6 , which is a schematic diagram of a process of wirelessly communicating between a mobile device 10 and a target device 20 via a second channel in one embodiment of the present application. The method comprises the following steps S601 to S603.

[0094] Step S601, upon receiving a firmware upgrade request from a target device, detecting the docking status between the mobile device and the target device and whether there is a firmware upgrade package to be transmitted.

[0095] In one embodiment of the present application, a firmware upgrade package refers to a software program for upgrading application software or system software. The self-mobile device 10 can obtain the firmware upgrade package from a server, mobile phone or other device connected to it. The docking state refers to the transmission distance or communication state between the self-mobile device 10 and the target device 20, for example, whether the transmission distance exceeds the lora wireless transmission distance, or whether the lora wireless link is disconnected. Exemplarily, the docking state can be measured by the distance between the self-mobile device 10 and the target device 20.

[0096] The target device 20 may periodically send a firmware upgrade request to the self-mobile device 10 , or may send a firmware upgrade request to the self-mobile device 10 in response to a user operation.

[0097] Step S602: If the docking status meets the preset conditions and there is a firmware upgrade package to be transmitted, a firmware reception request is sent to the target device through the transmission channel of the mobile device. The firmware reception request is used to instruct the target device to reduce the spreading factor from the initial value to the preset value.

[0098] In one embodiment of the present application, the preset condition is: the distance between the self-mobile device 10 and the target device 20 is less than the preset distance, and the preset distance can be determined according to the lora transmission distance. It can be understood that the preset distance can be a distance threshold of a distance, or it can be a distance range. If it is determined that the docking state satisfies that the distance between the self-mobile device 10 and the target device 20 is within the preset distance range, and there is a firmware upgrade package to be transmitted in the self-mobile device 10, then the self-mobile device 10 sends a firmware reception request to the target device 20 to instruct the target device 20 to reduce the spreading factor from the initial value to the preset value. In this embodiment, the spreading factor represents the ratio of the chip rate after spreading to the signal rate before spreading, which directly reflects the spreading gain. For a certain standard signal, the chip rate is constant, the larger the spreading factor, the lower the corresponding transmission rate, the longer the transmission distance, the smaller the spreading factor, the higher the corresponding transmission rate, and the closer the transmission distance. For example, when the value of the spreading factor is SF7, the transmission rate corresponding to SF7 is 1.8KB / S. When the spreading factor value is SF5, the transmission rate corresponding to SF5 is 3.5KB / S, but the transmission distance of SF5 is less than the transmission distance corresponding to SF7. The target device 20 can reduce the spreading factor from the initial value to the preset value according to the received firmware reception request, and the subsequent transmission rate of data transmission through the lora wireless link will be correspondingly increased.

[0099] Step S603: modulate the firmware upgrade package to be transmitted based on the reduced spreading factor, and send the modulated firmware upgrade package to be transmitted to the target device through the transmission channel of the mobile device.

[0100] In one embodiment of the present application, it can be understood that after the self-mobile device 10 issues a firmware reception request, it also synchronously reduces its own spreading factor from the initial value to the preset value. Exemplarily, considering that the self-mobile device 10 and the target device 20 are usually in a long-distance data transmission scenario, the initial value of the spreading factor is set to SF7. Since the upgrade of the firmware upgrade package of the target device 20 is performed when the docking state of the self-mobile device 10 and the target device 20 meets the preset conditions, at this time, the distance communication between the self-mobile device 10 and the target device 20 is very close. Exemplarily, in some embodiments, when performing a firmware upgrade, the connection contacts of the self-mobile device 10 and the target device 20 are in a connected state. At this time, the target device 20 charges the self-mobile device, and the self-mobile device 10 receives the power output by the target device 20 through the first connection contact 21 and the second connection contact 11. At this time, the mobile device 10 can set the spreading factor to SF5 (for example, the transmission speed is 3.5KB / S), and modulate the firmware upgrade package to be transmitted based on the reduced spreading factor SF5, and send the modulated firmware upgrade package to be transmitted to the target device 20 through the second channel, thereby improving the transmission speed of the firmware upgrade package.

[0101] In one embodiment of the present application, after the firmware upgrade package to be transmitted is sent, the mobile device 10 restores the spreading factor to the initial value.

[0102] Specifically, after determining that the firmware upgrade package to be transmitted has been sent, the self-mobile device 10 restores the spreading factor to the initial value and sends a spreading factor recovery notification to the target device 20. The spreading factor recovery notification is used to instruct the target device 20 to increase the spreading factor from the preset value to the initial value. The target device 20 restores the spreading factor from the preset value to the initial value according to the received spreading factor recovery notification.

[0103] In some embodiments, after step 205, if the target device 20 fails to configure the channel, and the target device 20 does not send a configuration success confirmation signal to the self-mobile device 10, then at this time, the above-mentioned wireless communication method also includes: if the configuration success confirmation signal is not received through the receiving channel of the self-mobile device within a first preset time period, returning to execute the step of receiving the pairing request sent by the target device through the connection contact.

[0104] In some embodiments, the first preset duration can be set according to actual needs. For example, the first preset duration can be set to 1 second, 3 seconds, 5 seconds, etc., and this application is not limited to this. By setting the first preset duration, the target device 20 is allowed to have a certain amount of time to try multiple channel switching attempts when the channel switching fails.

[0105] If no configuration success confirmation signal is received within the first preset time period, the mobile device 10 returns to step S702 to perform the pairing and negotiation process again.

[0106] In addition, in some embodiments, the self-mobile device 10 can reconfigure the receiving channel of the self-mobile device 10 from the second channel to the first channel. In this way, if the target device 20 still has temporary data to send, the self-mobile device 10 and the target device 20 can communicate temporarily through the first channel.

[0107] In the present application, when the mobile device 10 fails to switch channels with the target device 20, the pairing process is re-entered, which can avoid the mobile device 10 and the target device 20 from losing communication opportunities after the channel switching fails, and further improve the stability of communication.

[0108] The present application also provides a computer-readable storage medium that stores a plurality of instructions suitable for being loaded and executed by a processor to implement corresponding steps of the wireless communication method, such as steps S201-S207, steps S301-S305, steps S401-S411, and steps S601-S603.

[0109] Please refer to Figure 7 As shown, it is a schematic diagram of the structure of the electronic device 30 provided in an embodiment of the present application. The electronic device 30 can be a self-mobile device 10 or a target device 20. The electronic device 30 includes at least one processor 32, a memory 31, and a communication unit 33. The memory 31 includes a computer-readable storage medium, which is used to store a plurality of logic instructions, and the communication unit 33 is used to communicate with the target device 20 or the self-mobile device 10, and the processor 22 can run the logic instructions to perform the above-mentioned wireless communication method.

[0110] It can be understood that in some embodiments, the communication unit 33 includes at least a module with communication function such as a lora module, and the present application does not limit this.

[0111] The logic instructions in the above-mentioned computer-readable storage medium can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0112] The computer-readable storage medium may be configured to store software programs, computer-executable programs, such as program instructions corresponding to the wireless communication method in the embodiment of the present application. The processor 32 executes the functional application and image processing by running the software program, instructions or modules stored in the computer-readable storage medium, that is, implementing the wireless communication method in the above embodiment.

[0113] In the embodiment of the present application, the computer-readable storage medium includes a non-volatile computer-readable memory, such as a disk, a memory, etc. It is understood that the computer-readable storage medium may also include other non-volatile computer-readable memories, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one flash memory device and / or other non-volatile solid-state storage devices.

[0114] In the embodiment of the present application, the processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 32 is the control center of the electronic device 30, and may be connected to other devices and / or systems / modules / units using various interfaces and lines to provide Bluetooth connection establishment functions to applications of other devices and / or systems / modules / units.

[0115] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously.

[0116] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A wireless communication method, applied to a mobile device, characterized in that: The method comprises: After connecting with the target device through the connection contact, receiving a pairing request sent by the target device through the connection contact, wherein the pairing request carries information of the first channel; configuring the sending channel of the self-mobile device and the receiving channel of the self-mobile device to be the first channel, and performing wireless communication with the target device on the first channel to complete wireless pairing; Sending a channel configuration request to the target device through the sending channel of the mobile device, wherein the channel configuration request carries information of a second channel, and the second channel is determined according to a preset country code; When a first confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, configuring the receiving channel of the self-mobile device to be the second channel; If the receiving channel of the self-mobile device is configured successfully, a channel configuration notification is sent to the target device through the sending channel of the self-mobile device; If a configuration success confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, the sending channel of the self-mobile device is configured as the second channel, and wireless communication is performed with the target device through the receiving channel and the sending channel of the self-mobile device.

2. The wireless communication method according to claim 1, wherein: After sending the channel configuration notification to the target device through the sending channel of the mobile device, the method further includes: If the configuration success confirmation signal is not received through the receiving channel of the mobile device within the first preset time period, the process returns to the step of receiving a pairing request sent by the target device through the connection contact.

3. The wireless communication method according to claim 1, wherein: Before sending the channel configuration request to the target device through the sending channel of the mobile device, the method further includes: Generate random numbers; A channel corresponding to the random number is determined from all channels corresponding to the preset country code as the second channel.

4. The wireless communication method according to claim 1, wherein: After configuring the receiving channel of the self-mobile device as the second channel when the first confirmation signal returned by the target device is received through the receiving channel of the self-mobile device, the method further includes: If the receiving channel configuration of the self-mobile device fails, the step of returning to the step of receiving the pairing request sent by the target device through the connection contact.

5. The wireless communication method according to claim 1, wherein: After wirelessly communicating with the target device through the receiving channel and the sending channel of the self-mobile device, the method further includes: Upon receiving a firmware upgrade request from the target device, detecting a docking state between the mobile device and the target device and whether there is a firmware upgrade package to be transmitted; If the docking state satisfies a preset condition and there is a firmware upgrade package to be transmitted, sending a firmware receiving request to the target device through a sending channel of the self-mobile device, wherein the firmware receiving request is used to instruct the target device to reduce a spreading factor from an initial value to a preset value; The firmware upgrade package to be transmitted is modulated based on the reduced spreading factor, and the modulated firmware upgrade package to be transmitted is sent to the target device through the sending channel of the mobile device.

6. The wireless communication method according to claim 5, wherein: After sending the modulated firmware upgrade package to be transmitted to the target device through the transmission channel of the mobile device, the method further includes: After the firmware upgrade package to be transmitted is sent, the spreading factor is restored to the initial value.

7. The wireless communication method according to claim 1, wherein: After wirelessly communicating with the target device through the receiving channel and the sending channel of the mobile device, the method further includes: The electric energy output by the target device is received through the connection contact.

8. A wireless communication method, applied in a target device, characterized in that: The method comprises: After being connected to the self-mobile device through the connection contact, sending a pairing request to the self-mobile device through the connection contact, wherein the pairing request carries information of the first channel; configuring a sending channel of the target device and a receiving channel of the target device to be the first channel, and performing wireless communication with the mobile device on the first channel to complete wireless pairing; When receiving the channel configuration request sent by the mobile device through the receiving channel of the target device, sending a first confirmation signal to the mobile device through the sending channel of the target device, wherein the channel configuration request carries information of a second channel, and the second channel is determined according to a preset country code; When receiving the channel configuration notification sent by the mobile device through the receiving channel of the target device, configuring the sending channel of the target device and the receiving channel of the target device as the second channel in response to the channel configuration notification; If the channel configuration is successful, a configuration success confirmation signal is sent to the self-mobile device through the sending channel of the target device.

9. An electronic device, characterized in that: include: A memory for storing program instructions; and A processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device executes the wireless communication method as described in any one of claims 1 to 8.

10. A computer storage medium, characterized in that: The computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, the electronic device executes the wireless communication method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Wireless Internet of Things channel management method and related device

    CN111385043A

  • Wired pairing method and device, robot and wired pairing system

    CN112543234A

  • Method and device for pairing automatic mobile equipment and base station

    CN113766465A

  • Wireless communication connection method and device, electronic equipment and readable storage medium

    CN114828016A

  • Methods and systems for pairing mobile robotic device docking stations with a wireless router and cloud service

    US20190069330A1