Antenna selection method and device

By calculating the average signal strength and variance of multiple antennas, determining the antenna with good signal strength for communication, the problem of difficult to determine the signal quality of multiple antennas in IoT devices is solved, and the stability and user experience of communication are improved.

CN112290983BActive Publication Date: 2024-12-10QUECLINK WIRELESS SOLUTIONS(SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011191968.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-12-10
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

In IoT devices, it is difficult to determine which antenna has the best signal quality when working at the same time, resulting in confusion in signal transmission and reception, increasing power consumption, and communication interruption may occur due to antenna damage or environmental factors, affecting the user experience.

Method used

By obtaining the signal strength of multiple antennas, calculating the average signal strength of each antenna, and determining the antenna with good signal strength as the target antenna based on the difference and variance, so as to communicate and avoid poor signal quality and communication interruption caused by blind selection. .

Benefits of technology

It achieves timely and accurate acquisition of external information, improves user experience, avoids communication interruptions, and ensures the stability of signal quality and equipment reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112290983B_ABST
    Figure CN112290983B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an antenna selection method and device, the method comprising: the processor obtains at least one signal strength of each antenna in N antennas through a wireless communication module; according to at least one signal strength of each antenna, the average signal strength of each antenna is calculated; according to the average signal strength of each antenna in N antennas, the antenna with better signal strength is determined from N antennas as the target antenna, so as to communicate with the network device through the target antenna. In this way, external information can be obtained in a timely and accurate manner, avoiding the problem of being unable to obtain external information in a timely and accurate manner due to poor quality of the selected antenna receiving and transmitting signals due to uncertainty of the quality of the antenna receiving and transmitting signals when blindly selecting an antenna, and avoiding the situation of communication interruption during the communication process, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of wireless communication technology, and in particular, to an antenna selection method and device. Background Art

[0002] With the development of Internet of Things technology, the functions of networked devices in the Internet of Things are becoming more and more abundant, and more and more services are provided to users, such as calls and Internet access. These functions need to be realized by antennas installed on networked devices. Therefore, the performance requirements for antennas are getting higher and higher.

[0003] At present, in order to ensure the communication quality and signal continuity, multiple antennas can be set on the networking device. For example, for a vehicle, the internal antenna is installed inside the vehicle, which will weaken the antenna signal because it is wrapped by metal materials. Therefore, an external antenna is set on the vehicle to communicate through the external antenna. However, since the external antenna is exposed to the outside, it is easy to be damaged, resulting in the weakening of the antenna signal. For the vehicle, it is impossible to determine which antenna to choose for communication to obtain good communication quality. Summary of the invention

[0004] The embodiments of the present application provide an antenna selection method and device to determine an antenna with better signal strength from N antennas for communication, obtain external information in a timely and accurate manner, and improve user experience.

[0005] In a first aspect, an embodiment of the present application provides an antenna selection method, including:

[0006] Obtain at least one first signal strength of each of N antennas, where N is a positive integer greater than or equal to 2;

[0007] Calculating a first average signal strength of each antenna according to at least one first signal strength of each antenna;

[0008] A target antenna is determined from the N antennas according to a first average signal strength of each antenna in the N antennas, so as to communicate with a network device through the target antenna.

[0009] Optionally, determining the target antenna from the N antennas according to the first average signal strengths of the N antennas includes:

[0010] If the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, the antenna with the largest first average signal strength among the N antennas is determined as the target antenna.

[0011] Optionally, if the difference between the first average signal strengths of two antennas among the N antennas is less than a first preset value; or the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to the first preset value, and the first average signal strength of each antenna is greater than or equal to a second preset value, and the number of first signal strengths collected by each antenna is greater than or equal to a preset number, the method further includes:

[0012] Obtain at least one second signal strength of each of the N antennas;

[0013] Calculating a second average signal strength of each antenna according to at least one second signal strength of each antenna;

[0014] A target antenna is determined from the N antennas according to the second average signal strength of each antenna in the N antennas.

[0015] Optionally, determining the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas includes:

[0016] If the difference between the second average signal strengths of two antennas among the N antennas is greater than or equal to a third preset value, determining the antenna with the largest second average signal strength among the N antennas as the target antenna;

[0017] Otherwise, calculating a signal strength variance of each of the N antennas according to the second average signal strength of each of the N antennas;

[0018] A target antenna is determined from the N antennas according to a signal strength variance of each antenna in the N antennas.

[0019] Optionally, determining the target antenna from the N antennas according to the signal strength variance of each antenna in the N antennas includes:

[0020] An antenna with the smallest signal strength variance is determined from the N antennas as a target antenna.

[0021] Optionally, obtaining at least one first signal strength of each antenna in the N antennas includes:

[0022] According to the acquisition time of at least one first signal strength of each antenna in the N antennas, at least one first signal strength of each antenna is continuously acquired from back to front.

[0023] Optionally, the method further includes:

[0024] If the difference between two consecutive first signal strengths is greater than or equal to a fourth preset value, then the acquisition of the first signal strength of the antenna is stopped.

[0025] In a second aspect, an embodiment of the present application provides an antenna selection device, including:

[0026] An acquisition module, used to acquire at least one first signal strength of each of N antennas, where N is a positive integer greater than or equal to 2;

[0027] A calculation module, configured to calculate a first average signal strength of each antenna according to at least one first signal strength of each antenna;

[0028] The determination module is used to determine a target antenna from the N antennas according to a first average signal strength of each antenna in the N antennas, so as to communicate with the network device through the target antenna.

[0029] Optionally, the determination module determines the target antenna from the N antennas according to the first average signal strengths of the N antennas, specifically for:

[0030] If the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, the antenna with the largest first average signal strength among the N antennas is determined as the target antenna.

[0031] Optionally, when the determining module determines that the difference between the first average signal strengths of two antennas among the N antennas is less than a first preset value; or, the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to the first preset value, and the first average signal strength of each antenna is greater than or equal to a second preset value, and the number of first signal strengths collected by each antenna is greater than or equal to a preset number, the acquiring module is further used to:

[0032] Obtain at least one second signal strength of each of the N antennas;

[0033] The calculation module is further used to calculate the second average signal strength of each antenna according to at least one second signal strength of each antenna;

[0034] The determination module is further used to determine the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas.

[0035] Optionally, when the determination module determines the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas, it is specifically used to:

[0036] If the difference between the second average signal strengths of two antennas among the N antennas is greater than or equal to a third preset value, determining the antenna with the largest second average signal strength among the N antennas as the target antenna;

[0037] Otherwise, the calculation module is further used to: calculate the signal strength variance of each of the N antennas according to the second average signal strength of each of the N antennas;

[0038] The determination module is further used to: determine the target antenna from the N antennas according to the signal strength variance of each antenna in the N antennas.

[0039] Optionally, when the determination module determines the target antenna from the N antennas according to the signal strength variance of each antenna in the N antennas, it is specifically used to:

[0040] The antenna with the smallest signal strength variance is determined from the N antennas as the target antenna.

[0041] Optionally, when the acquisition module acquires at least one first signal strength of each of the N antennas, it is specifically used to:

[0042] According to the acquisition time of at least one first signal strength of each antenna in the N antennas, at least one first signal strength of each antenna is continuously acquired from back to front.

[0043] Optionally, the Get module is also used to:

[0044] If the difference between two consecutive first signal strengths is greater than or equal to a fourth preset value, then the acquisition of the first signal strength of the antenna is stopped.

[0045] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: at least one processor and a memory;

[0046] The memory stores computer-executable instructions; and the at least one processor executes the computer-executable instructions stored in the memory to perform the method described in any one of the first aspects of the embodiments of the present application.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program instructions are stored. When the program instructions are executed by a processor, the method described in any one of the first aspects of the embodiments of the invention is implemented.

[0048] In a fifth aspect, an embodiment of the present application provides a program product, which includes a computer program, and the computer program is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device implements the method described in any one of the first aspects of the embodiment of the invention of this application.

[0049] The embodiment of the present application provides an antenna selection method and device, which obtains at least one signal strength of each of N antennas through a wireless communication module; calculates the average signal strength of each antenna according to at least one signal strength of each antenna; and determines the antenna with better signal strength from the N antennas as the target antenna according to the average signal strength of each of the N antennas, so as to communicate with the network device through the target antenna. In this way, external information can be obtained in a timely and accurate manner, avoiding the problem of being unable to obtain external information in a timely and accurate manner due to poor quality of the selected antenna's received and transmitted signals due to uncertainty about the quality of the antenna's received and transmitted signals when blindly selecting an antenna. It can also avoid communication interruptions during the communication process, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0051] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0052] Figure 2 A schematic diagram of the antenna hardware structure provided in one embodiment of the present application;

[0053] Figure 3 A schematic diagram of antenna signal changes provided in an embodiment of the present application;

[0054] Figure 4 A flowchart of an antenna selection method provided in an embodiment of the present application;

[0055] Figure 5 A flow chart of a signal strength acquisition method provided in one embodiment of the present application;

[0056] Figure 6 A flowchart of an antenna selection method provided by another embodiment of the present application;

[0057] Figure 7 A schematic diagram of the structure of an antenna selection device provided in one embodiment of the present application;

[0058] Figure 8 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0059] Fig. 9 A schematic diagram of the structure of a networking device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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 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 are within the scope of protection of this application.

[0061] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0062] With the development of Internet of Things technology, users have higher and higher requirements for the communication quality of Internet of Things devices. Therefore, in order to ensure the communication quality and signal continuity, multiple antennas are usually installed on the Internet of Things devices to avoid the problem of being unable to communicate due to antenna damage and other situations when there is only one antenna on the Internet of Things device, but there is no replaceable spare antenna. However, when multiple antennas are installed on the Internet of Things device, if multiple antennas work at the same time, power consumption will increase and signal transmission and reception confusion will easily occur. Therefore, it is necessary to select one of the antennas to work. When selecting one of the antennas to work, the antenna with the best signal transmission and reception is usually selected. However, when the Internet of Things device selects an antenna, it is not sure which antenna has the best signal transmission and reception.

[0063] For example, for Figure 1 The vehicle shown has an internal antenna ( Figure 1 (not shown) and an external antenna. Figure 2 As shown, when the internal antenna or the external antenna is selected, the antenna interface is connected to the internal antenna or the external antenna, so that the internal antenna or the external antenna interacts with the wireless communication module to communicate with the outside world.

[0064] However, the vehicle's internal antenna is installed inside the vehicle, and the antenna signal will be weakened because it is wrapped in metal materials, and the external antenna is exposed to the outside and is also easily damaged, resulting in antenna signal weakening. Even if the vehicle's internal antenna and external antenna can both work, it is impossible to determine whether the internal antenna's receiving and transmitting signal is better than the external antenna, or the external antenna's receiving and transmitting signal is better than the internal antenna in the current environment of the vehicle.

[0065] Therefore, in order to solve the problems existing in the prior art, the present application proposes: Figure 3 As shown, the antenna is connected to the wireless communication module at the rising edge of the broken line 1, and the antenna is disconnected from the wireless communication module at the falling edge. The broken line 2 represents the signal of the antenna recognized by the wireless communication module.

[0066] In a networked device, when an antenna is connected to a wireless communication module, the wireless communication module cannot immediately recognize the signal of the antenna. After a time period of T1, the wireless communication module recognizes the signal of the antenna, and after a time period of T2, the wireless communication module recognizes the stable signal of the antenna. Correspondingly, when the antenna is disconnected from the wireless communication module, the wireless communication module cannot immediately recognize that the antenna is disconnected. After a time period of T3, the wireless communication module recognizes that the antenna is disconnected. Each time the antenna is connected or disconnected from the wireless communication module, the time periods T1, T2, and T3 are not fixed.

[0067] Therefore, when the antenna signal is stable, at least one signal strength of each of the multiple antennas is collected, the signal strength of each of the multiple antennas is processed, and the processed signal strength of each of the multiple antennas is compared to determine the antenna with better transceiver signal. This avoids the problem of blindly selecting an antenna, which may cause the selection of a damaged antenna or an antenna with poor transceiver signal quality due to uncertainty about the quality of the antenna's transceiver signal, thereby causing the inability to obtain external information in a timely and accurate manner due to the poor quality of the antenna's transceiver signal, and a poor user experience.

[0068] Figure 4 A flowchart of an antenna selection method provided in an embodiment of the present application. The method shown in the embodiment of the present application is applied to networked devices, such as mobile phones, vehicles, routers, communication modules, etc., and the embodiment of the present application is not limited to this. The execution subject of the embodiment of the present application is a networked device, specifically, a processor or chip in the networked device for controlling and processing antenna-related data, and the embodiment of the present application is not limited to this. Figure 4 As shown, the method shown in the embodiment of the present application includes:

[0069] S401. Obtain at least one first signal strength of each of N antennas.

[0070] Wherein, N is a positive integer greater than or equal to 2.

[0071] In this embodiment, a built-in antenna and an external antenna in a vehicle are taken as examples for description.

[0072] After the vehicle is started, when the wireless signal module detects that the signal strength CSQ is not 0, the vehicle's built-in antenna is connected to the wireless communication module. When the signal strength of the built-in antenna is stable, the wireless communication module collects at least one first signal strength of the built-in antenna and sends at least one first signal strength of the built-in antenna to the processor.

[0073] Then the internal antenna is switched to the external antenna, and when the signal strength of the external antenna is stable, the wireless communication module collects at least one first signal strength of the external antenna and sends the at least one first signal strength of the external antenna to the processor. Figure 5 The flow chart for collecting signal strength for the wireless communication module is as follows: Figure 5 As shown:

[0074] S501: Determine whether the signal strength of the antenna enters a stable state.

[0075] In this embodiment, for the built-in antenna, such as Figure 3 As shown, when the duration of connection between the built-in antenna and the wireless communication module reaches t1, or when the fluctuation of the signal strength is detected twice in a row within the first preset range, it is determined that the signal strength of the built-in antenna enters a stable state.

[0076] Wherein, t1 is greater than or equal to the duration of the wireless communication module recognizing the stable signal strength of the built-in antenna. For example, t1 is greater than or equal to Figure 3 In practice, t1 is, for example, 50 seconds.

[0077] The first preset range is, for example, a range between 0 and a fourth preset value, wherein the fourth preset value is, for example, 8 dB.

[0078] In addition, since the internal antenna is located inside the vehicle and the external antenna is located outside the vehicle, when the connection between the external antenna and the wireless communication module is switched to the connection between the internal antenna and the wireless communication module, if the signal strength no longer decreases within t2, it is determined that the signal strength of the internal antenna has entered a stable state. In practice, t2 is, for example, 20 seconds.

[0079] For external antennas, such as Figure 3 As shown, when the duration of connection between the external antenna and the wireless communication module reaches t3, or when the fluctuation of the signal strength is detected twice in succession within the second preset range, it is determined that the signal strength of the external antenna enters a stable state.

[0080] Wherein, t3 is greater than or equal to the duration of the wireless communication module recognizing the stable signal strength of the external antenna. For example, t3 is greater than or equal to Figure 3 In practice, t3 is, for example, 50 seconds.

[0081] The second preset range is, for example, a range between 0 and a fourth preset value, wherein the fourth preset value is, for example, 8 dB.

[0082] In addition, since the internal antenna is located inside the vehicle and the external antenna is located outside the vehicle, when the connection between the internal antenna and the wireless communication module is switched to the connection between the external antenna and the wireless communication module, if the signal strength no longer increases within t4, it is determined that the signal strength of the external antenna has entered a stable state. In practice, t4 is, for example, 20 seconds.

[0083] When a large signal strength fluctuation occurs during the process of collecting the signal strength of the built-in antenna or the signal strength of the external antenna, for example, when the vehicle enters a tunnel, if the signal strength still does not reach a stable state within t5, signal strength collection also begins.

[0084] It should be noted that the specific values ​​of t1, t2, t3, t4, t5, the first preset range, the second preset range and the fourth preset value are only given as a specific embodiment and can be set according to actual needs in practical applications.

[0085] S502: Continuously acquire at least one signal strength of each of the N antennas from back to front according to the acquisition time of at least one signal strength of the antenna.

[0086] In this embodiment, a built-in antenna is taken as an example for description.

[0087] When the built-in antenna is connected to the wireless communication module, according to the change law of the signal strength, as the access time increases, the signal strength becomes more and more stable. Therefore, when collecting the signal strength of the built-in antenna, according to the time when the signal strength is received, the signal strength is collected from the later time forward. For example, when collecting the signal strength in the time period 10:00:00-10:01:00, the signal strength is collected from the signal strength at 10:01:00 to 10:00:00 every preset time length to obtain the signal strength of at least one built-in antenna.

[0088] S503: If the difference between two consecutive signal strengths is greater than or equal to a fourth preset value, stop acquiring the signal strength of the built-in antenna.

[0089] In this embodiment, a built-in antenna is taken as an example for description.

[0090] When collecting from the back to the front according to the time of receiving signal strength, if the difference between two consecutively collected signal strengths is greater than or equal to the fourth preset value, the collection is stopped, the collected signal strength of the built-in antenna is saved, and the signal strength with the previous receiving time is no longer collected. The specific value of the fourth preset value can be determined according to actual conditions, for example, the fourth preset value is 8dB.

[0091] It should be noted that when collecting the signal strength of each antenna, due to the influence of factors such as the external environment on the antenna signal, the number of signal strengths collected for different antennas among multiple antennas may be different. For example, the number of signal strengths collected by the built-in antenna is 10, and the number of signal strengths collected by the external antenna is 7.

[0092] S402: Calculate an average signal strength of each antenna according to at least one first signal strength of each antenna.

[0093] In this embodiment, for each antenna among N antennas, for example, a built-in antenna in a vehicle, after obtaining at least one first signal strength of the built-in antenna, an average signal strength of the built-in antenna is calculated according to the at least one first signal strength of the built-in antenna.

[0094] The average signal strength is, for example, the average value of at least one first signal strength. For example, the signal strength of the built-in antenna is C 1 , C 2 , C 3 , then the average signal strength is Alternatively, the average signal strength is, for example, a weighted average of at least one first signal strength. For example, according to the acquisition time of the signal strength, the closer the time is to the current time, the greater the weight of the signal strength. The signal strength of the built-in antenna is C 1 , weight is S 1 , the signal strength is C 2 , weight is S 2 , the signal strength is C 3 , weight is S 3 , then the average signal strength is C = S 1 ×C 1 +S 2 ×C 2 +S 3 ×C 3 .

[0095] For other antennas, the calculation is performed in the above manner, and the method for calculating the average signal strength among the N antennas is consistent.

[0096] S403: Determine a target antenna from the N antennas according to the average signal strength of each antenna in the N antennas, so as to communicate with the network device through the target antenna.

[0097] In this embodiment, after obtaining the average signal strength of each of the N antennas, the average signal strength of each of the N antennas is compared to determine the target antenna for communication between the network device and the network device, and the antenna in the network device is switched to the target antenna.

[0098] Exemplarily, if the difference between the average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, the antenna with the largest average signal strength among the N antennas is determined as the target antenna, wherein the first preset value is, for example, 7 dB.

[0099] The average signal strength of each antenna in the N antennas is compared in pairs to obtain the difference between the average signal strengths of any two antennas. If the difference between the average signal strengths of any two antennas is greater than a first preset value, it can be determined that there is a damaged antenna in the N antennas. At this time, the antenna with the largest average signal strength among the N antennas is used as the target antenna and the antenna is used for communication. The first preset value can be set according to actual needs, and this application does not limit this.

[0100] In this embodiment, at least one first signal strength of each of the N antennas is obtained through the wireless communication module; the average signal strength of each antenna is calculated based on the at least one first signal strength of each antenna; and the antenna with better signal strength is determined as the target antenna from the N antennas based on the average signal strength of each of the N antennas, so as to communicate with the network device through the target antenna. In this way, external information can be obtained in a timely and accurate manner, avoiding the problem of being unable to obtain external information in a timely and accurate manner due to poor quality of the signal received and sent by the selected antenna due to uncertainty about the quality of the signal received and sent by the antenna when blindly selecting the antenna. It can also avoid communication interruption during the communication process, thereby improving the user experience.

[0101] exist Figure 4 The embodiment shown is to perform one round of traversal to determine the target antenna. The communication antenna determined in this way is accidental. Therefore, in order to increase the probability that the determined antenna is the antenna with better signal transmission and reception among the N antennas, two rounds of traversal are usually required, such as Figure 6 As shown, the method includes:

[0102] S601: Obtain at least one first signal strength of each of N antennas.

[0103] In this embodiment, the specific implementation of S601 may refer to S401 and will not be described in detail here.

[0104] It should be noted that when acquiring the signal strength of each antenna in the first round, it is necessary to acquire it when the signal strength of the antenna is stable. When switching antennas, if you switch to one of the antennas, when the preset time is reached, for example, after switching, when the time the antenna is connected to the wireless communication module reaches t1, the wireless communication module still does not detect the signal strength of the antenna, which means that the antenna is damaged, or that the antenna currently does not have the ability to send and receive signals, so it is switched to another antenna. Thereafter, in order to save antenna selection time, the signal strength of the antenna is no longer collected during this round of collecting antenna signal strength.

[0105] S602: Calculate a first average signal strength of each antenna according to at least one first signal strength of each antenna.

[0106] In this embodiment, the specific implementation of S602 may refer to S402 and will not be described in detail here.

[0107] S603, determine whether the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, if so, execute S604 or S611; if so, execute S605.

[0108] In this embodiment, the specific implementation of S603 can refer to S403, which will not be repeated here. That is, if the difference between the first average signal strengths of any two antennas is greater than or equal to the first preset value, it can be determined that there is a damaged antenna among the N antennas, and then S611 is executed to select the antenna with better first average signal strength as the communication antenna.

[0109] However, in actual applications, there may be a situation where the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to the first preset value, but each antenna can send and receive signals, but the ability to send and receive signals among the N antennas varies greatly.

[0110] Furthermore, since the ability of an antenna to send and receive signals may fluctuate due to external interference, such as weather influence, the first antenna having the largest average signal strength does not mean that the antenna has the best ability to send and receive signals among the N antennas.

[0111] Therefore, if the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to the first preset value, the antenna with the largest first average signal strength is selected as the communication antenna, and the selected antenna may not be the antenna with the best signal receiving and sending capability among the N antennas. Therefore, in order to more accurately select the antenna with the best signal receiving and sending capability among the N antennas, S604 may be executed.

[0112] If the difference between the first average signal strengths of two antennas among the N antennas is less than the first preset value, it means that at least two antennas among the N antennas are antennas that can send and receive signals. At this time, a second round of obtaining the signal strength of each antenna among the N antennas is required to execute S605.

[0113] Among them, the first preset value can be set according to actual needs. For example, in this embodiment, the first preset value is 7dB, and this application does not impose any limitation on this.

[0114] S604: Determine whether the first average signal strength of each antenna is greater than or equal to a second preset value, and whether the number of first signal strengths collected by each antenna is greater than or equal to a preset number. If so, execute S605; if not, execute S611.

[0115] In this embodiment, it is determined whether the first average signal strength of each antenna is greater than or equal to a second preset value. If the number of collected first signal strengths of the antennas is too small, the accuracy of the result will be affected. Therefore, it is also necessary to determine whether the number of collected first signal strengths of each antenna is greater than or equal to a preset number.

[0116] Among them, the second preset value is, for example, 13dB, and the preset number is, for example, 2. In practical applications, it can be set according to actual needs, and this application does not impose any restrictions on this.

[0117] When the first average signal strength of each antenna is greater than or equal to the second preset value, and the number of collected first signal strengths of each antenna is greater than or equal to the preset number, it means that each of the current N antennas can send and receive signals and the antennas send and receive signals stably. At this time, it is necessary to collect the second round of antenna signal strengths, that is, execute S605; otherwise, execute S611.

[0118] S605: Obtain at least one second signal strength of each of the N antennas.

[0119] In this embodiment, the specific implementation of S605 may refer to S401 and will not be described in detail here.

[0120] It should be noted that, in order to save time in selecting antennas during the second round of collecting antenna signal strengths, the antenna signal strengths may be collected after the antennas are switched, and there is no need to collect the signals when the signal strengths are stable.

[0121] S606: Calculate a second average signal strength of each antenna according to at least one second signal strength of each antenna.

[0122] In this embodiment, the specific implementation of S606 may refer to S402 and will not be described in detail here.

[0123] S607, determine whether the difference between the second average signal strengths of any two antennas among the N antennas is greater than or equal to a third preset value, if so, execute S608; if not, execute S609.

[0124] In this embodiment, the second average signal strengths of any two antennas among the N antennas are compared pairwise to obtain the difference between the second average signal strengths of any two antennas. If the difference between the second average signal strengths of any two antennas is greater than the third preset value, S608 is executed; otherwise, S609 is executed.

[0125] Among them, the third preset value is, for example, 2dB. In practical application, it can be set according to actual needs, and this application does not impose any limitation on this.

[0126] S608: Determine the antenna with the largest second average signal strength among the N antennas as the target antenna.

[0127] In this embodiment, the antenna with the largest second average signal strength among the N antennas is determined as the target antenna, and the antenna is used for communication.

[0128] S609: Calculate the signal strength variance of each of the N antennas.

[0129] In this embodiment, if the difference between the second average signal strengths of any two antennas among the N antennas is less than the third preset value, it means that there is no significant difference between the capabilities of the N antennas to send and receive signals. At this time, the signal strength variance of each antenna is calculated based on the second average signal strength of each antenna, and the antenna with better stability is selected as the communication antenna.

[0130] S610: Determine a target antenna from the N antennas according to a signal strength variance of each of the N antennas.

[0131] In this embodiment, the variance can reflect the fluctuation of signal strength. The smaller the variance, the more stable the antenna's ability to send and receive signals. Therefore, the antenna with the smallest signal strength variance is determined as the target antenna to avoid signal fluctuations when the antenna sends and receives signals, thereby affecting communication quality.

[0132] S611. Determine an antenna with the largest first average signal strength among N antennas as a target antenna, so as to communicate with a network device through the target antenna.

[0133] In this embodiment, the antenna with the largest second average signal strength among the N antennas is determined as the target antenna, and the antenna is used for communication.

[0134] In this embodiment, in the first round of traversal, at least one first signal strength of each antenna in the N antennas is obtained, and the first average signal strength of each antenna is calculated according to the at least one first signal strength of each antenna. When the difference between the first average signal strengths of two antennas in the N antennas is less than the first preset value, and / or the first average signal strength of each antenna is greater than or equal to the second preset value, and the number of second signal strengths of each antenna is greater than or equal to the preset number, a second round of traversal is performed, that is, at least one second signal strength of each antenna in the N antennas is obtained, and the second average signal strength of each antenna is calculated according to the at least one second signal strength of each antenna. If the difference between the second average signal strengths of any two antennas in the N antennas is greater than or equal to the third preset value, the antenna with the largest second average signal strength among the N antennas is determined as the target antenna; otherwise, the signal strength variance of each antenna in the N antennas is calculated, and the target antenna is determined from the N antennas according to the signal strength variance of each antenna in the N antennas. Through two rounds of traversal, the probability that the antenna finally determined for communication is the best antenna among N antennas is increased, the communication quality is improved, thereby avoiding communication interruption during the communication process and improving the user experience.

[0135] Figure 7 A schematic diagram of the structure of an antenna selection device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device of this embodiment includes: an acquisition module 71, a calculation module 72 and a determination module 73. Among them,

[0136] An acquisition module 71 is used to acquire at least one first signal strength of each of N antennas, where N is a positive integer greater than or equal to 2;

[0137] A calculation module 72, configured to calculate a first average signal strength of each antenna according to at least one first signal strength of each antenna;

[0138] The determination module 73 is configured to determine a target antenna from the N antennas according to the first average signal strength of each antenna in the N antennas, so as to communicate with the network device through the target antenna.

[0139] Optionally, the determination module 73 determines the target antenna from the N antennas according to the first average signal strengths of the N antennas, specifically for:

[0140] If the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, the antenna with the largest first average signal strength among the N antennas is determined as the target antenna.

[0141] Optionally, when the determination module determines that the difference between the first average signal strengths of two antennas among the N antennas is less than a first preset value; or, when the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to the first preset value, and the first average signal strength of each antenna is greater than or equal to a second preset value, and the number of first signal strengths collected by each antenna is greater than or equal to a preset number, the acquisition module 71 is further used to:

[0142] Obtain at least one second signal strength of each of the N antennas;

[0143] The calculation module 72 is further configured to calculate a second average signal strength of each antenna according to at least one second signal strength of each antenna;

[0144] The determination module 73 is further configured to determine a target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas.

[0145] Optionally, when the determination module 73 determines the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas, it is specifically used to:

[0146] If the difference between the second average signal strengths of two antennas among the N antennas is greater than or equal to a third preset value, determining the antenna with the largest second average signal strength among the N antennas as the target antenna;

[0147] Otherwise, the calculation module 72 is further used to: calculate the signal strength variance of each of the N antennas according to the second average signal strength of each of the N antennas;

[0148] The determination module 73 is further configured to determine a target antenna from the N antennas according to a signal strength variance of each of the N antennas.

[0149] Optionally, when the determination module 73 determines the target antenna from the N antennas according to the signal strength variance of each antenna in the N antennas, it is specifically used to:

[0150] The antenna with the smallest signal strength variance is determined from the N antennas as the target antenna.

[0151] Optionally, when the acquisition module 71 acquires at least one first signal strength of each of the N antennas, it is specifically used to:

[0152] According to the acquisition time of at least one first signal strength of each antenna in the N antennas, at least one first signal strength of each antenna is continuously acquired from back to front.

[0153] Optionally, the acquisition module 71 is further used for:

[0154] If the difference between two consecutive first signal strengths is greater than or equal to a fourth preset value, then the acquisition of the first signal strength of the antenna is stopped.

[0155] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0156] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the electronic device of this embodiment may include: at least one processor 81 and a memory 82. Figure 8 The electronic device shown is an example of a processor, wherein

[0157] The memory 82 is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 82 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0158] The processor 81 is used to execute the computer-executable instructions stored in the memory 82 to implement the antenna selection method shown in any of the above embodiments.

[0159] The processor 81 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0160] Optionally, in a specific implementation, if the memory 82 and the processor 81 are implemented independently, the memory 82 and the processor 81 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0161] Optionally, in a specific implementation, if the memory 82 and the processor 81 are integrated on a chip, the memory 82 and the processor 81 can communicate with each other through an internal interface.

[0162] The electronic device described above in this embodiment can be used to execute the technical solutions in the above method embodiments. Its implementation principles and technical effects are similar and will not be repeated here.

[0163] Fig. 9 This is a schematic diagram of the structure of a networking device provided in one embodiment of the present application. The networking device can be applied to the networking devices described in the above embodiments of the present application. For the convenience of explanation, Fig. 9 Only the main components of the networking device are shown. Fig. 9 As shown, the networking device 900 includes a processor, a memory, a control circuit, at least two antennas, and an input-output device. The processor is mainly used to process the communication protocol and communication data, as well as to control the entire terminal, execute the software program, and process the data of the software program. The memory is mainly used to store software programs and data. The radio frequency circuit is mainly used for converting baseband signals and radio frequency signals and processing radio frequency signals. The antenna is mainly used to transmit and receive radio frequency signals in the form of electromagnetic waves. The input-output device, such as a touch screen, a display screen, a keyboard, etc., is mainly used to receive data input by the user and output data to the user.

[0164] When the networked device is turned on, the processor can read the software program in the storage unit, interpret and execute the instructions of the software program, and process the data of the software program. When data needs to be sent wirelessly, the processor performs baseband processing on the data to be sent, and outputs the baseband signal to the RF circuit. The RF circuit performs RF processing on the baseband signal and then sends the RF signal outward in the form of electromagnetic waves through a certain antenna. When data is sent to the device, the RF circuit receives the RF signal through a certain antenna, converts the RF signal into a baseband signal, and outputs the baseband signal to the processor. The processor converts the baseband signal into data and processes the data.

[0165] Those skilled in the art will appreciate that for ease of description, Fig. 9 Only one memory and processor are shown. In an actual terminal, there may be multiple processors and memories. The memory may also be referred to as a storage medium or a storage device, etc., which is not limited in the embodiments of the present application.

[0166] As a possible implementation, the processor may include a baseband processor and a central processing unit. The baseband processor is mainly used to process the communication protocol and communication data, and the central processing unit is mainly used to control the entire device, execute software programs, and process software program data. Fig. 9The processor in integrates the functions of the baseband processor and the central processing unit. Those skilled in the art will understand that the baseband processor and the central processing unit may also be independent processors, which are interconnected through technologies such as buses. Those skilled in the art will understand that a networked device may include multiple baseband processors to adapt to different network formats, and a networked device may include multiple central processing units to enhance its processing capabilities, and the various components of a networked device may be connected through various buses. The baseband processor may also be described as a baseband processing circuit or a baseband processing chip. The central processing unit may also be described as a central processing circuit or a central processing chip. The function of processing the communication protocol and communication data may be built into the processor, or may be stored in a storage unit in the form of a software program, and the processor executes the software program to implement the baseband processing function.

[0167] In one example, the antenna with transceiver functions and the control circuit can be regarded as the transceiver module 901 of the networking device 900, and the processor with processing function can be regarded as the processing module 902 of the networking device 900. Fig. 9 As shown, the networking device 900 includes a transceiver module 901 and a processing module 902. The transceiver module may also be referred to as a transceiver, a transceiver, a transceiver device, etc. In a possible implementation, the device used to implement the receiving function in the transceiver module 901 may be regarded as a receiving module, and the device used to implement the sending function in the transceiver module 901 may be regarded as a sending module, that is, the transceiver module 901 includes a receiving module and a sending module. For example, the receiving module may also be referred to as a receiver, a receiver, a receiving circuit, etc., and the sending module may be referred to as a transmitter, a transmitter, or a transmitting circuit, etc.

[0168] The networking device described above in this embodiment can be used to execute the technical solutions executed by the networking device in the above-mentioned method embodiments. The implementation principles and technical effects are similar and will not be repeated here.

[0169] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An antenna selection method, characterized in that: include: Obtain at least one first signal strength of each of N antennas, where N is a positive integer greater than 2; Calculating a first average signal strength of each antenna according to at least one first signal strength of each antenna; Determine a target antenna from the N antennas according to a first average signal strength of each antenna in the N antennas, so as to communicate with a network device through the target antenna; The determining a target antenna from the N antennas according to a first average signal strength of each antenna in the N antennas includes: The difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, and the first average signal strength of each antenna is greater than or equal to a second preset value, and the number of first signal strengths collected by each antenna is greater than or equal to a preset number, and the method further includes: Obtain at least one second signal strength of each of the N antennas; Calculating a second average signal strength of each antenna according to at least one second signal strength of each antenna; If the difference between the second average signal strengths of two antennas among the N antennas is greater than or equal to a third preset value, determining the antenna with the largest second average signal strength among the N antennas as the target antenna; Otherwise, calculating a signal strength variance of each of the N antennas according to the second average signal strength of each of the N antennas; An antenna with the smallest signal strength variance is determined from the N antennas as the target antenna.

2. The method according to claim 1, characterized in that The determining a target antenna from the N antennas according to a first average signal strength of each antenna in the N antennas includes: If the difference between the first average signal strengths of any two antennas among the N antennas is greater than or equal to a first preset value, the antenna with the largest first average signal strength among the N antennas is determined as the target antenna.

3. The method according to any one of claims 1 to 2, characterized in that: The obtaining of at least one first signal strength of each antenna in the N antennas includes: According to the acquisition time of at least one first signal strength of each antenna in the N antennas, at least one first signal strength of each antenna is continuously acquired from back to front.

4. The method according to claim 3, characterized in that The method further comprises: If the difference between two consecutive first signal strengths is greater than or equal to a fourth preset value, then the acquisition of the first signal strength of the antenna is stopped.

5. An antenna selection device, characterized in that: include: An acquisition module, used to acquire at least one first signal strength of each of N antennas, where N is a positive integer greater than 2; A calculation module, configured to calculate a first average signal strength of each antenna according to at least one first signal strength of each antenna; a determination module, configured to determine a target antenna from the N antennas according to a first average signal strength of each antenna in the N antennas, so as to communicate with a network device through the target antenna; The acquisition module is further used to acquire at least one second signal strength of each antenna in the N antennas when the determination module determines that the difference between the first average signal strengths of any two antennas in the N antennas is greater than or equal to a first preset value, and the first average signal strength of each antenna is greater than or equal to a second preset value, and the number of first signal strengths collected by each antenna is greater than or equal to a preset number; The calculation module is further used to calculate the second average signal strength of each antenna according to the at least one second signal strength of each antenna; The determination module is further configured to determine the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas; The determination module is configured to determine the target antenna from the N antennas according to the second average signal strength of each antenna in the N antennas, and is specifically configured to determine the antenna with the largest second average signal strength among the N antennas as the target antenna if the difference between the second average signal strengths of two antennas in the N antennas is greater than or equal to a third preset value; Otherwise, calculating a signal strength variance of each of the N antennas according to the second average signal strength of each of the N antennas; An antenna with the smallest signal strength variance is determined from the N antennas as the target antenna.

6. An electronic device, characterized in that: include: A memory and at least one processor, the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute the antenna selection method according to any one of claims 1 to 4.

7. A readable storage medium, characterized in that: The readable storage medium stores a computer program; when the computer program is executed, the antenna selection method according to any one of claims 1 to 4 is implemented.