An antenna selection method
Patent Information
- Application Number
- CN202310437775.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2043-04-21
AI Technical Summary
The existing antenna switching algorithms lead to frequent antenna switching, which increases the workload of communication equipment and unstable data transmission, especially the signal changes caused by human interference cannot be effectively identified and avoided.
By continuously sampling the signal quality index value of the current working antenna, the average value and difference threshold judgment are calculated using the data sequence of the first-in-first-out mode, combined with timing monitoring and fluctuation indicators, the optimal antenna is selected to avoid frequent switching.
Improve data transmission throughput, reduce unnecessary antenna switching, ensure the stability and efficiency of data transmission, and reduce computing and storage requirements.
Smart Images

Figure CN116470944B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technologies, and in particular, to a method for selecting a working antenna for a communication device with multiple antennas and a communication device. Background Art
[0002] An antenna is one of the important components of a wireless infrastructure and is used to receive or transmit signals. On the one hand, the antenna converts the voltage of a transmitter into a radio signal, and on the other hand, the antenna picks up the radio signal from the air and converts it into a voltage for recovery in a receiver.
[0003] Traditional communication devices usually adopt the traditional technology of a single transmit antenna and a single receive antenna. However, the antenna performance greatly affects the wireless capabilities of users using electronic communication devices. For example, if the performance of the antenna cannot meet the communication requirements, it may lead to call failures or a decrease in data transmission rate, etc. In order to maximize the performance and communication capacity of a wireless communication system and make the antenna performance meet the design standards, it has gradually evolved to adopt a multi-antenna system with multiple transmit antennas and multiple receive antennas. Therefore, a communication device often has multiple antennas configured to ensure communication quality by switching the antennas when needed.
[0004] Currently, existing antenna switching algorithms include periodically comparing the signal strengths of multiple antennas to find the current optimal signal strength and switching the antenna in real time to transmit and receive data packets. However, this solution will cause the antenna to switch too frequently. On the one hand, it increases the workload of the communication device, and on the other hand, it also leads to unstable communication quality. Specifically, the existing technical solutions have the following defects: (1) It is necessary to frequently monitor the signal strength of each antenna separately and decide whether to switch the antenna based on the signal strength of each antenna or the difference between them; (2) Since the working antenna cannot be stably on one antenna for a long time, after each antenna switch, the data transmission needs to be renegotiated to find the currently adapted transmission speed. Therefore, this will result in a relatively low data throughput. (3) The change in the antenna signal strength is affected by various factors. In addition to environmental changes, it may also be affected by human interference. In some actual application scenarios, if the change in the current antenna signal strength is only caused by human factors, for example, a person just stands at a specific position and interferes with the transceiver performance of the antenna, but after the person leaves, this interference will quickly return to normal. In this case, there is no need to switch the antenna.
[0005] Therefore, it is desirable to provide an improved way of antenna selection that can avoid frequent antenna switching caused by human-induced interference and improve data transmission throughput.
[0006] It should be understood that the above-listed technical problems are only examples and not limitations of the present invention. The present invention is not limited to the technical solutions that can solve all the above technical problems simultaneously. The technical solutions of the present invention can be implemented to solve one or more of the above or other technical problems. Summary of the Invention
[0007] To solve the above and other problems, the present application provides a method for selecting a working antenna for a communication device having multiple antennas.
[0008] Specifically, the method includes continuously sampling the signal quality index value of the current working antenna to obtain sampling values, and performing the following steps: Step (A), in response to obtaining the latest sampling value, adding the latest sampling value to the tail of a first data sequence in a first-in, first-out mode to update the first data sequence, where the first data sequence includes consecutive M sampling values; Step (B), calculating the average value of the M sampling values in the current first data sequence and adding it to the tail of a second data sequence in a first-in, first-out mode to update the second data sequence, where the second data sequence includes N average values; Step (C), determining whether a first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; Step (D), in response to the first difference exceeding the preset first threshold, starting a timing monitoring with a duration of T, and within the duration, repeating steps (A) and (B) to update the first data sequence and the second data sequence; and determining whether a second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold; Step (E), in response to the second difference exceeding the preset second threshold, triggering the communication device to reselect another antenna as the working antenna.
[0009] Preferably, in step (E), in response to the second difference exceeding the preset second threshold, obtaining the first data sequence at the end of the timing monitoring, calculating a fluctuation index of the M sampling values in the first data sequence, and determining whether a third difference between the second difference and a k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and in response to the third difference exceeding the preset third threshold, triggering the communication device to reselect another antenna as the working antenna. Further preferably, the fluctuation index includes the difference between the first and last sampling values in the first data sequence, or any one or a combination of variance, standard deviation, range, and coefficient of variation of all the sampling values in the first data sequence.
[0010] Further preferably, reselecting the working antenna includes: measuring the signal quality index values of multiple antennas and selecting the antenna with the best signal quality index value as the working antenna of the communication device.
[0011] Further preferably, after reselecting the working antenna of the communication device, the first data sequence and the second data sequence are cleared.
[0012] Further preferably, the signal quality index value includes any one or a combination of received signal strength indication (RSSI), packet loss rate, signal-to-noise ratio (SNR), bit error rate (BER), rate, and transmission power.
[0013] Preferably, in step (A), the following operations are further performed: determining whether the first data sequence is full, and in response to the first data sequence being full, removing the sampled value at the head of the first data sequence from the first data sequence, and adding the latest sampled value to the tail of the first data sequence to update the first data sequence.
[0014] Preferably, in step (B), the following operations are further performed: determining whether the second data sequence is full, and in response to the second data sequence being full, removing the average value at the head of the second data sequence from the second data sequence, and adding the average value of M sampled values in the current first data sequence to the tail of the second data sequence.
[0015] Further preferably, in response to the signal quality index value being the received signal strength indication, a filter is applied to the sampled value to remove noise before step (A).
[0016] Further preferably, the filter includes any one of a Kalman filter or other filters.
[0017] On the other hand, the present application also provides a communication device, including a storage module, an operation module, a timing monitoring module, and an antenna selection module that are coupled to each other; wherein, the storage module is used to store a first data sequence in a first-in first-out mode and a second data sequence in a first-in first-out mode; the operation module is configured to perform the following operations: continuously sample the signal quality index value of the current working antenna to obtain a sampling value; in response to obtaining the latest sampling value, add the latest sampling value to the end of the queue of the first data sequence to update the first data sequence, where the first data sequence includes continuous M sampling values; calculate the average value of the M sampling values in the current first data sequence and add it to the end of the queue of the second data sequence to update the second data sequence, where the second data sequence includes N average values; determine whether a first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; the operation module is further configured to, in response to the first difference exceeding the preset first threshold, trigger the operation of the timing monitoring module; the timing monitoring module is configured to perform the following operations: start a timing monitoring with a duration of T, and during the duration, continue to perform continuous sampling and update the first data sequence and the second data sequence accordingly; and determine whether a second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold; the timing monitoring module is further configured to, in response to the second difference exceeding the preset second threshold, trigger the operation of the antenna selection module; the antenna selection module is configured to: reselect another antenna as the working antenna.
[0018] Preferably, the timing monitoring module is further configured to: in response to the second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitoring, calculate the fluctuation index of the M sampling values in the first data sequence, and determine whether a third difference between the second difference and k times the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and, in response to the third difference exceeding the preset third threshold, trigger the operation of the antenna selection module.
[0019] In yet another aspect, the present application also provides a communication device, which includes: a radio circuit including at least two antennas and a transceiver coupled to the at least two antennas; and a control circuit configured to control the radio circuit to select a working antenna from the at least two antennas, where the control circuit is configured to perform the steps of the method according to various embodiments of the present application.
[0020] In still another aspect, the present application also provides a computer-readable storage medium storing instructions, which are configured to perform any of the above methods when executed by a processor.
[0021] The method of the present application monitors the signal of the current working antenna through sampling, and judges it with the historical data of the antenna, so as to realize predicting the change of the environment without switching the working antenna, and reselecting the working antenna when necessary. The method provided by the present application improves the data throughput of a communication device with multiple antennas, and avoids unnecessary frequent antenna switching on the premise of ensuring stable data transmission. In particular, the method of the present application only uses a small amount of storage space during the judgment process, and the calculation is simple. The method of the present application can filter out the interference of human beings on the antenna signal, so as to further ensure the stable data transmission. Brief Description of the Drawings
[0022] In the following, the present application will be further explained with reference to the accompanying drawings based on embodiments.
[0023] Figure 1 Schematically showing a communication system to which the method provided by the embodiment of the present application is applicable;
[0024] Figure 2 Schematically showing a flowchart of a specific implementation manner of the method according to the present application;
[0025] Figure 3 Schematically showing a schematic diagram of an example of a first data sequence and a second data sequence of the method according to the present application;
[0026] Figure 4 Schematically showing a flowchart of another specific implementation manner of the method according to the present application;
[0027] Figure 5 Schematically showing a schematic structural diagram of a communication device 500 provided by the embodiment of the present application;
[0028] Figure 6A and Figure 6B Schematically showing a schematic flowchart and another example flowchart of the state machine of the communication device according to the embodiment of the present application respectively;
[0029] Figure 7 Schematically showing a schematic structural diagram of a communication device 700 provided by the embodiment of the present application;
[0030] Figure 8 Schematically showing a specific example according to the embodiment of the present application. Detailed Description of the Embodiments
[0031] The method and device of the present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the embodiments shown in the drawings and described below are merely illustrative and do not limit the present application.
[0032] To facilitate the understanding of the embodiments of the present application, the following takesFigure 1 Taking the shown communication system as an example, the communication system to which the method provided by the embodiments of the present application is applicable will be described in detail. As Figure 1 shown, the communication system 100 may include at least one terminal communication device, such as Figure 1 the terminal communication device 102 shown in Figure 1 , which may also be a chip configured in the terminal communication device; and at least one network device, such as
[0033] the network device 102 shown as a base station in
[0034] , which may also be a chip configured in the network device. In some other examples, the network device 102 may be a router device.
[0035] In view of this, the present application provides a method for selecting a working antenna for a communication device with multiple antennas. According to the method of the present application, an improved way of antenna selection is provided to avoid frequent antenna switching caused by human interference and improve data transmission throughput. This will be described below in combination with multiple embodiments and specific examples.
[0036] Example 1
[0037] Figure 2 The flowchart of a specific implementation manner of the method according to the present application is shown. According to the method of this embodiment, the signal quality index value of the current working antenna is continuously sampled to obtain sampling values. By way of example and not limitation, the signal quality index value may include any one or a combination of received signal strength indication (RSSI), packet loss rate, signal-to-noise ratio (SNR), bit error rate (BER), rate, transmit power. Among them, continuous sampling can adopt a fixed-period or non-fixed-period sampling method. By way of example, a fixed-period sampling method can be adopted, for example, obtaining the signal quality index value of the current working antenna every 100 milliseconds, such as the signal strength of the current working antenna. It should be noted that in the communication field, the received signal strength indication (RSSI) is an indication of the signal strength received by the receiving-end antenna after the wireless signal gradually attenuates during propagation. RSSI is a relative value, usually in dBm, representing the ratio between the received signal strength and the reference power of 1 milliwatt (mW), and the larger the RSSI value, the stronger the received signal. The received signal strength indication is affected by various factors, such as transmission distance, obstacles, weather, etc.
[0038] In the case of continuous sampling, the following steps 202 to 210 are sequentially executed to select an antenna. In another embodiment, considering that there may be noise points in the sampled data, optionally, before executing steps 202 to 210, a filter is used for preprocessing to filter out the noise points. Preferably, filtering is performed each time a new sampling value is obtained. Optionally, the filter can be any one of a Kalman filter, a mean filter, an IIR filter, a jitter filter or other filters. Optionally, when the sampling value is the packet loss rate of the current working antenna, no filter is required for preprocessing.
[0039] In step 202, in response to obtaining the latest sampling value, the latest sampling value is added to the tail of the first data sequence in a first-in-first-out mode to update the first data sequence, where the first data sequence includes continuous M sampling values.
[0040] Preferably, step 202 further includes determining whether the first data sequence is full, and in response to the first data sequence being full, removing the sampling value located at the head of the first data sequence from the first data sequence, and adding the latest sampling value to the tail of the first data sequence to update the first data sequence.
[0041] In step 204, calculate the average value of M sampling values in the current first data sequence and add it to the end of the second data sequence adopting the first-in-first-out mode to update the second data sequence, where the second data sequence includes N average values.
[0042] Preferably, step 204 further includes determining whether the second data sequence is full, and in response to the second data sequence being full, removing the average value at the head of the second data sequence from the second data sequence, and adding the average value of M sampling values in the current first data sequence to the end of the second data sequence.
[0043] In step 206, determine whether a first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold;
[0044] In step 208, in response to the first difference exceeding the preset first threshold, start a timing monitoring with a duration of T, and within the duration, repeatedly execute step 202 and step 204 to update the first data sequence and the second data sequence; and determine whether a second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold. It should be noted that the setting of the duration T can be adjusted according to experience. Preferably, considering that if the signal fluctuation is caused by human interference, such as a person passing by the communication device, the duration of such fluctuations usually does not exceed the second level. Therefore, for example, T can be set to 6 seconds.
[0045] In step 210, in response to the second difference exceeding the preset second threshold, trigger the communication device to reselect another antenna as the working antenna.
[0046] Preferably, reselecting the working antenna includes: measuring the signal quality index values of multiple antennas, and selecting the antenna with the best signal quality index value as the working antenna of the communication device.
[0047] Preferably, after reselecting the working antenna of the communication device, clear the first data sequence and the second data sequence.
[0048] As an example but not a limitation, for different application scenarios, M and N can be set to different values. For example, in an office scenario, since people often walk around and cause interference, the values of M and N can be set to be larger, while in some scenarios where the environment does not change much, such as factories, the values of M and N can be set to be smaller. In addition, in addition to considering the application scenario, the memory size of the communication device can also be considered when setting the values of M and N. Since communication devices are usually embedded devices with limited memory space, the values of M and N should not be set too large. Optionally, M can be set to 15 in a complex environment, while M can be any value between 5 and 10 in a relatively simple environment.
[0049] As an example, Figure 3 It shows that according to the above Figure 2 Schematic diagram of an example of the first data sequence and the second data sequence of the steps of the method in . The latest sampled value of the signal quality index value of the current working antenna is recorded as x. In step 202, it is determined whether the first data sequence L1 is full; if so, according to step 202, the latest sampled value is added to the end of the first data sequence L1, and the data at the head of the sequence is removed from the sequence; if the first data sequence is not full, the latest sampled value is directly added to the end of the first data sequence. Figure 3 For example, the first data sequence L1 includes M sampling values a n1 、a n2 ,...a nM , that is, the first data sequence is full. In response to obtaining the latest sample value x, the first data sequence L′1 is updated to a according to step 202 in the method. n2 、a n3 ,...a n(M+1) , where the original team leader data a n1 is removed from the first data sequence, and the latest sample value x is added to the tail of the first data sequence, i.e., a n(M+1) = x. In step 204, the average value of the M sample values in the first data sequence is calculated. Figure 3 For example, the second data sequence L2 before updating is full and includes N average values avg1, avg2, ... avg N , where avg N is the M sample values a in the first data sequence before updating n1 、a n2 ,...a nM After updating according to step 204, the updated second data sequence L′2 includes avg2, avg3, ... avg N+1 , where avg N+1corresponding to the M sampled values a in the updated first data sequence n2 、a n3 、...a n(M+1) of the average value. In step 206, it is determined whether the Nth average value in the current second data sequence, that is, avg N+1 , and the first average value in the second data sequence before the update, that is, avg1, the first difference between the two, and it is determined whether the first difference exceeds a preset first threshold, and the first difference can be marked as Diff1. If the first difference exceeds the preset first threshold, it indicates that the operating state of the antenna may have changed. Therefore, start a timing monitor with a duration of T. During this duration, continuously obtain the latest sampled values, and repeatedly execute steps 202 and 204 as described above to continuously update the first data sequence and the second data sequence until the timing monitor ends. As an example, at the moment T0 when the timing monitor is turned on, the first data sequence is which includes M sampled values, for example, denoted as a nx0 、a n(x0+1) 、...a n(x0+M-1) , and the second data sequence is which includes N average values. The second data sequence includes N average values, avg y0 、avg y0+1 、...avg y0+N-1 . At the moment T1 when the timing monitor ends, the updated first data sequence obtained is which includes M sampled values, for example, denoted as a nx1 、a n(x1+1) 、...a n(x1+M-1) , and the updated second data sequence obtained is which includes N average values, avg y1 、avg y1+1 、...avg y1+N-1 , and among them, avg y1+N-1 is equal to the average value of the M sampled values in the updated first data sequence . In step 208, it also includes determining whether the Nth average value in the second data sequence at the end of the timing monitor, for example, avg y1+N-1 in the example, and the first average value in the second data sequence when the timing monitor is turned on, for example, avg y0 in the example, the second difference between the two exceeds a preset second threshold, and the second difference can be marked as Diff2. In response to the second difference exceeding the preset second threshold, the communication device is triggered to reselect another antenna as the working antenna.
[0050] Specific Example of Example 1
[0051] In a specific example of the method according to Embodiment 1 above, a fixed-period sampling method is adopted, and a sampling value of the signal quality index value of the current working antenna is obtained every 100 milliseconds. The first data sequence includes 10 sampling values, that is, M equals 10; the second data sequence includes 25 average values, that is, N equals 25. The preset first threshold is set to 2.4 dB, and the preset second threshold is set to 3.5 dB.
[0052] For example, in one example, the timing monitoring period is set to 6 seconds. In step 208, the second difference is obtained as 4 dB, which exceeds the preset second threshold of 3.5 dB. Therefore, the communication device is triggered to reselect another antenna as the working antenna.
[0053] Example 2
[0054] According to Embodiment 1 above, in order to further effectively avoid unnecessary antenna switching caused by human interference, the present application provides another method for antenna selection. As Figure 4 shown, it is a flowchart showing another specific implementation manner of the method according to the present application.
[0055] According to the method of this embodiment, the signal quality index value of the current working antenna is continuously sampled to obtain sampling values, and the following steps 402 to step 410 are sequentially executed to select an antenna.
[0056] In step 402, in response to obtaining the latest sampling value, the latest sampling value is added to the tail of the first data sequence adopting the first-in-first-out mode to update the first data sequence, where the first data sequence includes continuous M sampling values.
[0057] Preferably, step 402 further includes judging whether the first data sequence is full, and in response to the first data sequence being full, removing the sampling value at the head of the first data sequence from the first data sequence, and adding the latest sampling value to the tail of the first data sequence to update the first data sequence.
[0058] In step 404, the average value of the M sampling values in the current first data sequence is calculated and added to the tail of the second data sequence adopting the first-in-first-out mode to update the second data sequence, where the second data sequence includes N average values.
[0059] Preferably, step 404 further includes judging whether the second data sequence is full, and in response to the second data sequence being full, removing the average value at the head of the second data sequence from the second data sequence, and adding the average value of the M sampling values in the current first data sequence to the tail of the second data sequence.
[0060] In step 406, it is determined whether a first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold;
[0061] In step 408, in response to the first difference exceeding the preset first threshold, a timing monitor with a duration of T is started, and within the duration, steps 402 and 404 are repeatedly executed to update the first data sequence and the second data sequence; and it is determined whether a second difference between the Nth average value in the second data sequence at the end of the timing monitor and the first average value in the second data sequence at the start of the timing monitor exceeds a preset second threshold;
[0062] In step 410, in response to the second difference exceeding the preset second threshold, the first data sequence at the end of the timing monitor is obtained, a fluctuation index of M sampling values in the first data sequence is calculated, and it is determined whether a third difference between the second difference and a k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and in response to the third difference exceeding the preset third threshold, the communication device is triggered to reselect another antenna as the working antenna. Among them, by way of example and not limitation, the fluctuation index includes the difference between the first and last sampling values in the first data sequence, or any one or a combination of the variance, standard deviation, range, coefficient of variation of all sampling values in the first data sequence. Preferably, in order to minimize the additional resources required for data transmission, the variance is used as the fluctuation index. By way of example, where k is an empirical coefficient, it can be determined according to the historical values of the second difference and the fluctuation index. In one example, k can take a value of 0.05 or 0.1 or other values.
[0063] By way of example, further steps of the method according to Embodiment 2 are given. As described above, by way of example, at time T0 when the timing monitor is started, the first data sequence is which includes M sampling values, for example denoted as a nx0 、a n(x0+1) 、...a n(x0+M-1) , and the second data sequence is which includes N average values. The second data sequence includes N average values, avg y0 、avg y0+1 、...avg y0+N-1 , where y0 + N - 1 = x0. At time T1 when the timing monitor ends, the updated first data sequence obtained is which includes M sampling values, for example denoted as a nx1 、a n(x1+1) 、...a n(x1+M-1) , and the updated second data sequence obtained is which includes N average values, avg y1 、avgy1+1 ,... avg y1+N-1 , and wherein avg y1+N-1 is equal to the average value of M sampling values in the updated first data sequence , that is, where y1 + N - 1 = x1. In step 408, it also includes judging the Nth average value in the second data sequence at the end of the timing monitoring, such as avg in the example y1+N-1 , and the first average value in the second data sequence when the timing monitoring is turned on, such as avg in the example y0 , and whether the second difference between the two exceeds a preset second threshold, and this second difference is marked as Dif2. In response to this second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitoring, that is it includes M sampling values, for example denoted as a nx1 , a n(x1+1) ,... a n(x1+M-1) , and calculate the fluctuation index of the M sampling values in this sequence, such as variance. Taking the fluctuation index as variance as an example, denote the fluctuation index of the M sampling values as In step 410, it further includes judging whether the third difference between the second difference Diff2 and the k - fold value of the fluctuation index exceeds a preset third threshold, where the third difference is marked as Diff3.
[0064] Specific Example of Example 2
[0065] In a specific example of the method according to Embodiment 2 above, a fixed - period sampling method is adopted, and the sampling value of the signal quality index of the current working antenna is obtained every 100 milliseconds. The first data sequence includes 10 sampling values, that is, M is equal to 10; the second data sequence includes 25 average values, that is, N is equal to 25. The preset first threshold is set to 2.4 dB, the preset second threshold is set to 3.5 dB, and the preset third threshold is set to 3.5 dB. In addition, the empirical coefficient k is set to 0.1.
[0066] For example, in an example, the timing monitoring period is set to 6 seconds. In step 408, the second difference Diff2 obtained is 4 dB, which exceeds the preset second threshold. Therefore, continue to obtain the fluctuation index here is the variance of the 10 sampling values in the first data sequence at the end of the timing monitoring, and its value is 15 dB. Therefore, in step 410, judge that the third difference between the second difference and the k - fold value of the fluctuation index is Therefore, it does not exceed the preset third threshold. Thus, in this example, the communication device is not triggered to re - select another antenna as the working antenna.
[0067] In this example, assume a scenario where a staff member comes to the workbench to operate the device, which may cause interference to the communication device. Although it is unlikely that the staff member will leave within 6 seconds, this kind of human interference is not long-lasting. Therefore, it is not necessarily required to switch the antenna in this scenario. Although the presence of the staff member will cause the second difference in the average value at the start and end of the timing monitoring to increase, which indicates that the environment may have changed. However, since the staff member generally makes at least slight movements when operating the machine. For example, the swaying of their body will cause fluctuations in the sampling values of the working antenna. Therefore, the fluctuations in the sampling values in the first data sequence are relatively large. Thus, according to the embodiments of the present application, according to the above step 410, by determining whether the third difference between the second difference and k times the fluctuation index exceeds a preset third threshold, unnecessary antenna switching caused by human interference can be effectively excluded, avoiding frequent antenna switching.
[0068] It should be noted that the methods of the various embodiments of the present application require extremely little storage space and small computational amounts during the execution process, and only require lightweight storage space and processing capabilities to implement the methods of the present application.
[0069] Example 3
[0070] Figure 5 It is a schematic structural diagram of a communication device 500 with at least two antennas provided by an embodiment of the present application. The terminal device 500 can be applied to a system as shown in Figure 1 to execute the methods in the above method embodiments.
[0071] As shown in the figure, the communication device includes a radio circuit including at least two antennas 502 and a transceiver 504 coupled to the two antennas, and a control circuit 506 that can communicate with the radio circuit. The control circuit 506 is configured to control the radio circuit to select a working antenna from the at least two antennas 502. The data or control signaling output by the transceiver can be sent out through the antenna, or data or control signaling can be received through the antenna. Optionally, the communication device may further include a memory 508. Among them, the control circuit 506, the transceiver 504, and the memory 508 can communicate with each other through an internal connection path to transmit control and / or data signals.
[0072] Among them, the control circuit 506 is configured to: (1) continuously sample the signal quality index value of the current working antenna to obtain a sampling value; (2) in response to obtaining the latest sampling value, add the latest sampling value to the tail of the first data sequence in the first-in-first-out mode to update the first data sequence, where the first data sequence includes M consecutive sampling values; (3) calculate the average value of the M sampling values in the current first data sequence and add it to the tail of the second data sequence in the first-in-first-out mode to update the second data sequence, where the second data sequence includes N average values; (4) determine whether the first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; (5) in response to the first difference exceeding the preset first threshold, start a timing monitor with a duration of T, and during the duration, continue to perform continuous sampling, and accordingly update the first data sequence and the second data sequence; and determine whether the second difference between the Nth average value in the second data sequence at the end of the timing monitor and the first average value in the second data sequence at the start of the timing monitor exceeds a preset second threshold; (6) in response to the second difference exceeding the preset second threshold, trigger the control circuit to reselect another antenna as the working antenna.
[0073] Optionally, the above (6) can be implemented as: in response to the second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitor, calculate the fluctuation index of the M sampling values in the first data sequence, and determine whether the third difference between the second difference and the k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and in response to the third difference exceeding the preset third threshold, trigger the control circuit to reselect another antenna as the working antenna.
[0074] It should be understood that Figure 5 the terminal device 500 shown can also implement Figures 2 to 4 the corresponding processes in any of the method embodiments in
[0075] Example 4
[0076] In another embodiment, a communication device for implementing the method embodiment of the present application may be configured with a state machine having multiple states. As Figure 6A shown, a schematic flowchart of the state machine of the communication device according to an embodiment of the present application is shown.
[0077] In this embodiment, the communication device may include at least three states, an antenna selection state, an operation sampling state, and a timing monitoring state. The following specifically describes the specific working process of the communication device:
[0078] (1) After the communication device is powered on, it boots up (602) and enters the antenna selection state (604). As an example, when in the antenna selection state, the communication device measures the signal quality index values of multiple antennas it is configured with and selects the antenna with the best signal quality index value as the working antenna of the communication device. For example, the antenna with the highest received signal strength indication (RSSI) or signal-to-noise ratio (SNR) is selected as the working antenna. As an example, the signal quality index value can also use any one of the packet loss rate, bit error rate (BER), rate, transmit power, or a combination of any of the above.
[0079] (2) After the communication device determines the working antenna, it enters the running sampling state (606). As an example, when in the running sampling state, the communication device continuously samples the signal quality index value of the current working antenna to obtain sampling values. For example, sampling is performed in a fixed period manner. For example, the signal quality index value of the current working antenna is obtained every 100 milliseconds. Optionally, a filter can also be applied to filter the sampling values to remove noise points.
[0080] (3) After the communication device obtains each latest sampling value, it updates the first data sequence and the second data sequence and triggers the execution of the first judgment (608). Among them, the latest sampling value is added to the end of the first data sequence using the first-in-first-out mode to update the first data sequence, where the first data sequence includes M consecutive sampling values. Among them, the average value of the M sampling values in the current first data sequence is calculated and added to the end of the second data sequence using the first-in-first-out mode to update the second data sequence, where the second data sequence includes N average values. The first judgment executed is used to determine whether the first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before the update exceeds a preset first threshold.
[0081] (4) If the first difference does not exceed the preset first threshold, the communication device continues to return to the running sampling state (606). Otherwise, when the first difference exceeds the preset first threshold, the communication device enters the timing monitoring state (610), and the duration of this timing monitoring state is a preset time T. When the device is in the timing monitoring state, the communication device still continuously samples the signal quality index value of the current working antenna to obtain sampling values, and in response to each acquisition of the latest sampling value, updates the first data sequence and the second data sequence. Among them, the latest sampling value is added to the end of the first data sequence using the first-in-first-out mode to update the first data sequence. Among them, the average value of the M sampling values in the current first data sequence is calculated and added to the end of the second data sequence using the first-in-first-out mode to update the second data sequence.
[0082] (5) At the end of the timing detection state, trigger the execution of the second judgment (612). Among them, the second judgment is used to determine whether the second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold.
[0083] (6) If the second difference does not exceed the preset second threshold, the communication device continues to return to the running sampling state (606). Otherwise, when the second difference exceeds the preset second threshold, the communication device enters the antenna selection state (604) to reselect another antenna as the working antenna.
[0084] As Figure 6B shown, another schematic flowchart of the state machine of the communication device according to an embodiment of the present application is shown. Among them, after the above-mentioned execution of the second judgment (612), the above-mentioned (6) can be implemented as: If the second difference does not exceed the preset second threshold, the communication device continues to return to the running sampling state (606). Otherwise, when the second difference exceeds the preset second threshold, trigger the execution of the third judgment (614). Among them, the third judgment is used to obtain the first data sequence at the end of the timing monitoring, calculate the fluctuation index of M sampling values in the first data sequence, and determine whether the third difference between the second difference and the k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient. If the third difference does not exceed the preset third threshold, the communication device continues to return to the running sampling state (606). Otherwise, when the third difference exceeds the preset third threshold, the communication device enters the antenna selection state (604) to reselect another antenna as the working antenna.
[0085] Example 5
[0086] Figure 7 is a schematic structural diagram of a communication device 700 provided by an embodiment of the present application. The communication device 700 has at least two antennas. As Figure 7 shown, the communication device 700 includes a storage module, an operation module, a timing monitoring module, and an antenna selection module that are mutually coupled; data communication can be carried out between the modules through a communication bus.
[0087] Among them, the storage module is used to store the first data sequence in the first-in first-out mode and the second data sequence in the first-in first-out mode.
[0088] Among them, the operation module is configured to perform the following operations: (1) Continuously sample the signal quality index value of the current working antenna to obtain a sampling value; in response to obtaining the latest sampling value, add the latest sampling value to the end of the first data sequence to update the first data sequence, where the first data sequence includes M consecutive sampling values; (2) Calculate the average value of the M sampling values in the current first data sequence and add it to the end of the second data sequence to update the second data sequence, where the second data sequence includes N average values; (3) Determine whether the first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before the update exceeds a preset first threshold. Further, the operation module is also configured to trigger the operation of the timing monitoring module in response to the first difference exceeding the preset first threshold. Optionally, the operation module can also be configured to, in response to obtaining the latest sampling value, apply a filter to the sampling value to filter out noise points.
[0089] Among them, the timing monitoring module is configured to perform the following operations: (1) Start timing monitoring with a duration of T, and during the duration, continue to perform continuous sampling and update the first data sequence and the second data sequence accordingly; and (2) Determine whether the second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold. The timing monitoring module is also configured to trigger the operation of the antenna selection module in response to the second difference exceeding the preset second threshold.
[0090] In another embodiment, the timing monitoring module is further configured to perform the following operations: in response to the second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitoring, calculate the fluctuation index of the M sampling values in the first data sequence, and determine whether the third difference between the second difference and the k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and, in response to the third difference exceeding the preset third threshold, trigger the operation of the antenna selection module.
[0091] Among them, the antenna selection module is configured to: reselect another antenna as the working antenna. Optionally, the antenna selection module is configured to: measure the signal quality index values of the at least two antennas and select the antenna with the best signal quality index value as the working antenna of the communication device. Among them, the signal quality index value includes any one or a combination of received signal strength indication (RSSI), packet loss rate, signal-to-noise ratio (SNR), bit error rate (BER), rate, and transmit power.
[0092] Example
[0093] Reference Figure 8, the following specifically introduces an example according to an embodiment of the present application.
[0094] After the communication device is initialized, it obtains the signal quality index values of each antenna, such as the RSSI value of each antenna, to determine the antenna with the best current signal quality index value and use it as the current working antenna.
[0095] During the operation of the communication device, a sampling method with a fixed period of 100 milliseconds is adopted to obtain the sampling value of the signal quality index value of the current working antenna, and the latest sampling value is added to the end of the first data sequence in the first-in first-out mode. Figure 8 Among them, the first data sequence can be extracted and saved in the manner of the first sliding window, that is, the size of the first sliding window is set to the number M of default sampling values in the first data sequence. Figure 8 In the example of , the first data sequence includes 10 sampling values. Therefore, the size of the first sliding window is also set to 10. Every time a new sampling value is obtained, the first sliding window moves one bit to the right to extract and save the sampling values of the current first data sequence in the first-in first-out mode. It should be noted that in different application scenarios, the value of M can be set to different values. For example, in an office scenario, people often move around and cause interference, so the value of M can be set larger, while in some scenarios with little environmental change, such as a factory, the value of M can be adjusted smaller.
[0096] Furthermore, calculate the average value of all sampling values in the first data sequence in the current first sliding window and save the average value to the second data sequence. The second data sequence contains N average values. As an example, the second data sequence can be extracted and saved in the manner of the second sliding window. Figure 8 As shown in , the second data sequence includes 25 average values. Therefore, the size of the second sliding window is also set to 25. Every time the first data sequence is updated, a new average value is calculated. Therefore, the second sliding window moves one bit to the right to extract and save the current latest average value in the first-in first-out mode.
[0097] According to the method of the embodiment of the present application, every time the second data sequence is updated, it triggers a judgment on whether the first difference between the last average value (i.e., the Nth average value) in the current second data sequence and the first average value in the second data sequence before the update exceeds a preset first threshold. If it exceeds, start timing monitoring.
[0098] Take Figure 8 as an example. At time T0, determine the last average value in the current second data sequence, that is, avg 26, the first difference between the first average value in the second data sequence before update, i.e., avg1, and determine whether this first difference exceeds a preset first threshold. In Figure 8 's example, at time T0, this first difference exceeds the preset first threshold. The first difference exceeding the preset first threshold indicates that the current sampled value fluctuates, but it may be caused by transient interference or environmental changes. If it is the former, since transient interference may be eliminated in a very short time, it may not necessarily be necessary to switch the antenna. Therefore, in order to further confirm the cause of this change, the timing monitoring function is enabled at time T0, and the duration of this timing monitoring is T. For example, in one example, T is set to 6 seconds. When the timing monitoring starts, the corresponding first data sequence is a n26 to a n35 , and the updated second data sequence is avg2 to avg 26 . During the timing monitoring stage, continuous sampling continues and the first data sequence and the second data sequence are continuously updated in the same way as above.
[0099] Until the end of the timing monitoring, the updated first data sequence is a n86 to a n95 , and the updated second data sequence is avg 62 to avg 86 . Determine whether the second difference between the Nth average value in the second data sequence at the end of the timing monitoring (in this example, avg 86 ) and the first average value in the second data sequence when the timing monitoring is started (in this example, avg2) exceeds a preset second threshold. If it does not exceed the preset second threshold, it means that the signal change causing the first difference is transient and it may be an interference signal. For example, the interference signal is eliminated during the duration of the timing monitoring, the antenna returns to the normal state, and the environment where the antenna is located has not changed. Therefore, there is no need to trigger the re-selection of the working antenna. Taking an actual scenario as an example, for example, when a person quickly passes by the communication device, it will cause the first difference to become larger in the instant of passing by, but after the timing monitoring, the second difference does not exceed the preset second threshold. Therefore, it is determined as short-term interference and there is no need to switch the working antenna. If, at the end of the timing monitoring, the second difference still exceeds the preset second threshold, it means that the interference source still exists, and at this time, the re-selection of the working antenna can be triggered.
[0100] In another example, even if the second difference still exceeds the preset second threshold at the end of the timing monitoring, it is still necessary to further determine whether the interference source is caused by human interference. Then, the first data sequence at the end of the timing monitoring can be further obtained, the fluctuation index of M sampled values in the first data sequence can be calculated, and it can be determined whether the third difference between the second difference and k times the fluctuation index exceeds a preset third threshold. In Figure 8Taking the example of n86 to a n95 , the variance of M sampling values in the first data sequence is judged. And it is determined whether the third difference between the second difference and k times the variance exceeds a preset third threshold. In another example, the fluctuation index can be the difference between the sampling values at the head and the tail of the first data sequence. In Figure 8 the example of n95 and a n86 . Using the difference between the first and last sampling values in the first data sequence instead of the variance as the fluctuation index can reduce the complexity of the algorithm and the memory space occupation.
[0101] If the third difference does not exceed the preset third threshold, there is no need to reselect the working antenna. A corresponding scenario could be that a worker comes to the operating table to operate and does not leave within 6 seconds, interfering with the antenna signal of the communication device and not leaving within 6 seconds. However, since the worker cannot remain completely still when operating the machine, the movement of their body may cause fluctuations in the signal strength value. Therefore, this situation still belongs to interference signals rather than environmental changes, so there is no need to switch the antenna. Thus, through the judgment of the third difference, it is possible to identify long-term antenna changes caused by human interference, but in this case, there is no need to switch the antenna.
[0102] Conversely, if the third difference exceeds the preset third threshold, it indicates that there is a relatively stable error in the signals before and after the timing monitoring, and the variance of the sampling values in the first data sequence is small. Therefore, it can be judged that the environment has changed, such as the position of the router has changed or the position of the communication device has changed. Therefore, it is necessary to reselect the working antenna. After reselecting the working antenna, since the historical data of the previous working antenna is no longer of reference significance, the first data sequence and the second data sequence are cleared.
[0103] In addition, the present application also discloses a computer-readable storage medium storing instructions, which are configured to execute each method according to the method embodiments disclosed in the present application when executed by a processor.
[0104] In summary, the technical solutions of the embodiments of the present application can be applied to various communication systems, such as Wi-Fi communication systems, Bluetooth communication systems, 5G communication systems, NR communication systems, etc., and can also be applied to future networks, such as 6G systems and even future systems.
[0105] The method according to the above various embodiments of the present application can shield human interference factors and avoid deterioration of communication quality caused by frequent antenna switching. In addition, this method is a lightweight method, which requires small data storage and calculation amounts, and does not need to regularly scan the signal quality of each antenna. Only by sampling and monitoring the current working condition of the antenna can the search for the optimal antenna for data transmission be triggered when needed. Therefore, it is ensured that the throughput of data transmission can be maintained at a relatively stable value for a long time. According to the technical solution of the present application, without increasing any hardware costs, the existing technical difficulties can be solved by software algorithms.
[0106] Although various embodiments of aspects of the present application have been described for the purposes of this disclosure, the teachings of the disclosure should not be construed as being limited to these embodiments. Features disclosed in one specific embodiment are not limited to that embodiment, but may be combined with features disclosed in different embodiments. For example, one or more features and / or operations of the method according to the present application described in one embodiment may also be applied alone, in combination, or as a whole in another embodiment. Those skilled in the art should understand that there are also more possible alternative embodiments and variations, and various changes and modifications can be made to the above system without departing from the scope defined by the claims of the present application.
Claims
1. An antenna selection method, which is used to select a working antenna for a communication device with multiple antennas, characterized in that, Including: Continuously sampling the signal quality index value of the current working antenna to obtain sampling values, and performing the following steps: Step (A): In response to obtaining the latest sampling value, adding the latest sampling value to the end of the first data sequence in a first-in-first-out mode to update the first data sequence, where the first data sequence includes consecutive M sampling values; Step (B): Calculating the average value of the M sampling values in the current first data sequence and adding it to the end of the second data sequence in a first-in-first-out mode to update the second data sequence, where the second data sequence includes N average values; Step (C): Judging whether the first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; Step (D): In response to the first difference exceeding the preset first threshold, starting a timing monitoring with a duration of T, and within the duration, repeatedly performing Step (A) and Step (B) to update the first data sequence and the second data sequence; and judging whether the second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold; Step (E): In response to the second difference exceeding the preset second threshold, triggering the re-selection of another antenna as the working antenna.
2. The antenna selection method according to claim 1, wherein: Step (E) includes: In response to the second difference exceeding the preset second threshold, obtaining the first data sequence at the end of the timing monitoring, calculating the fluctuation index of the M sampling values in the first data sequence, and judging whether the third difference between the second difference and the k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and in response to the third difference exceeding the preset third threshold, triggering the re-selection of another antenna as the working antenna.
3. The antenna selection method according to claim 2, wherein: The fluctuation index includes the difference between the first and last sampling values in the first data sequence, or any one or a combination of variance, standard deviation, range, and coefficient of variation of all sampling values in the first data sequence.
4. The antenna selection method according to claim 1, wherein: Step (A) further includes: Judging whether the first data sequence is full, and in response to the first data sequence being full, removing the sampling value at the head of the first data sequence from the first data sequence, and adding the latest sampling value to the end of the first data sequence to update the first data sequence.
5. The antenna selection method according to claim 1, wherein: Step (B) further includes: determining whether the second data sequence is full, and in response to the second data sequence being full, removing the average value at the head of the queue of the second data sequence, and adding the average value of the M sampled values in the current first data sequence to the tail of the queue of the second data sequence.
6. The antenna selection method according to claim 1 or 2, wherein said reselecting the operating antenna includes: measuring signal quality index values of the plurality of antennas, and selecting the antenna having the best signal quality index value as the operating antenna of the communication device.
7. The antenna selection method according to claim 6, wherein after reselecting the operating antenna of the communication device, clear the first data sequence and the second data sequence.
8. The antenna selection method according to claim 6, wherein said signal quality index value includes any one or a combination of received signal strength indication RSSI, packet loss rate, signal-to-noise ratio SNR, bit error rate BER, rate, transmit power.
9. The antenna selection method according to claim 8, wherein in response to the signal quality index value being the received signal strength indication, apply a filter to the first data sequence to remove noise points.
10. The antenna selection method according to claim 9, wherein said filter includes any one of a Kalman filter or other filters.
11. A communication device, characterized in that, comprises: a radio circuit including at least two antennas and a transceiver coupled to the at least two antennas; and a control circuit configured to control the radio circuit to select an operating antenna from the at least two antennas, wherein the control circuit is configured to: continuously sample the signal quality index value of the current operating antenna to obtain sampled values; in response to obtaining the latest sampled value, add the latest sampled value to the tail of the queue of the first data sequence in a first-in first-out mode to update the first data sequence, wherein the first data sequence includes continuous M sampled values; calculate the average value of the M sampled values in the current first data sequence and add it to the tail of the queue of the second data sequence in a first-in first-out mode to update the second data sequence, wherein the second data sequence includes N average values; determine whether a first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; in response to the first difference exceeding the preset first threshold, start a timing monitoring with a duration of T, and during the duration, continue to perform continuous sampling, and update the first data sequence and the second data sequence accordingly; and determine whether a second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold; in response to the second difference exceeding the preset second threshold, trigger the control circuit to reselect another antenna as the operating antenna.
12. The communication device according to claim 11, wherein The control circuit is further configured to: In response to the second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitoring, calculate the fluctuation index of M sampling values in the first data sequence, and determine whether the third difference between the second difference and k times the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and, In response to the third difference exceeding the preset third threshold, trigger the control circuit to reselect another antenna as the working antenna.
13. The communication device according to claim 11 or 12, wherein, The reselecting the working antenna includes: measuring the signal quality index values of the at least two antennas, and selecting the antenna with the best signal quality index value as the working antenna of the communication device.
14. The communication device according to claim 13, wherein, The signal quality index value includes any one or a combination of received signal strength indication (RSSI), packet loss rate, signal-to-noise ratio (SNR), bit error rate (BER), rate, and transmit power.
15. A communication device, wherein, It includes a storage module, an operation module, a timing monitoring module, and an antenna selection module that are coupled to each other; The storage module is used to store the first data sequence in a first-in-first-out mode and the second data sequence in a first-in-first-out mode; The operation module is configured to perform the following operations: Continuously sample the signal quality index value of the current working antenna to obtain sampling values; in response to obtaining the latest sampling value, add the latest sampling value to the end of the queue of the first data sequence to update the first data sequence, where the first data sequence includes continuous M sampling values; Calculate the average value of M sampling values in the current first data sequence and add it to the end of the queue of the second data sequence to update the second data sequence, where the second data sequence includes N average values; Determine whether the first difference between the Nth average value in the current second data sequence and the first average value in the second data sequence before update exceeds a preset first threshold; The operation module is further configured to, in response to the first difference exceeding the preset first threshold, trigger the operation of the timing monitoring module; The timing monitoring module is configured to perform the following operations: Start a timing monitoring with a duration of T, and during the duration, continue to perform continuous sampling, and update the first data sequence and the second data sequence accordingly; and Determine whether the second difference between the Nth average value in the second data sequence at the end of the timing monitoring and the first average value in the second data sequence at the start of the timing monitoring exceeds a preset second threshold; The timing monitoring module is further configured to, in response to the second difference exceeding the preset second threshold, trigger the operation of the antenna selection module; The antenna selection module is configured to: reselect another antenna as the working antenna.
16. The communication device according to claim 15, wherein, The timing monitoring module is further configured to perform the following operations: in response to the second difference exceeding the preset second threshold, obtain the first data sequence at the end of the timing monitoring, calculate the fluctuation index of M sampling values in the first data sequence, and determine whether a third difference between the second difference and a k-fold value of the fluctuation index exceeds a preset third threshold, where k is an empirical coefficient; and in response to the third difference exceeding the preset third threshold, trigger the operation of the antenna selection module.
17. A computer-readable storage medium storing instructions, characterized in that the instructions, when executed by a processor, are configured to perform the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Antenna switching method, antenna switching device, storage medium and electronic device
CN110278010A
System and method for interference cancellation in a location calculation, for use in a wireless location system
US20030016174A1