Antenna optimal orientation calculation method and device, terminal equipment and storage medium
By collecting signal strength within the antenna's motion angle range and performing polynomial fitting to calculate the maximum value, the problem of excessively long antenna adjustment time is solved, enabling rapid determination of the optimal antenna orientation and improving signal strength and network performance.
Patent Information
- Application Number
- CN202210047460.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-01-17
AI Technical Summary
In existing technologies, adjusting the antenna radiation direction to optimize signal strength is too time-consuming, which affects the user experience.
By acquiring sample angles within the range of antenna motion angles, collecting signal strength and performing polynomial fitting, the maximum value of the polynomial equation is calculated to determine the optimal orientation of the antenna.
Quickly calculate the optimal antenna orientation to improve client signal strength and enhance network performance.
Smart Images

Figure CN114492968B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, terminal device, and storage medium for calculating the optimal orientation of an antenna. Background Technology
[0002] Currently, most home wireless routers use omnidirectional antennas. However, in actual use, antenna radiation is not ideally omnidirectional; it has a dominant and a disadvantageous radiation direction. When the client is in the antenna's dominant radiation direction, the signal strength is higher, resulting in a better experience. Therefore, to improve communication quality, it is necessary to adjust the antenna's radiation direction so that its dominant radiation direction faces the client, thus enhancing the client's experience.
[0003] In existing technologies, a common method is to select the final antenna coverage angle by iterating through the relationship between the antenna radiation angle and wireless parameters. However, after the antenna rotates, it takes some time for the collected signal strength to stabilize, resulting in an excessively long time consumption for the iterative method to select the optimal antenna angle. This leads to poor real-time antenna adjustment and negatively impacts the user experience. Summary of the Invention
[0004] This invention provides a method, apparatus, terminal device, and storage medium for calculating the optimal orientation of an antenna, so as to quickly solve for the optimal orientation of the antenna and thus maximize the signal strength received by the client.
[0005] In a first aspect, to solve the above-mentioned technical problems, the present invention provides a method for calculating the optimal orientation of an antenna, comprising:
[0006] The sample angle is obtained based on the range of antenna motion angles;
[0007] When the antenna moves to the sample angle, the signal strength received by the client is obtained;
[0008] Polynomial fitting is performed based on the sample angle and the signal intensity to obtain a polynomial equation;
[0009] Calculate the maximum value of the curve corresponding to the polynomial equation, and obtain the optimal orientation angle of the antenna based on the angle corresponding to the maximum value.
[0010] Preferably, the step of performing polynomial fitting based on the sample angle and the signal intensity to obtain a polynomial equation includes:
[0011] The highest-order term of the polynomial equation is determined based on the number of sample angles.
[0012] Based on the sample angle and the signal strength, calculate the coefficients of each term of the polynomial equation using the gradient descent method;
[0013] By fitting the coefficients of each term and the highest-order term, a polynomial equation is obtained.
[0014] Preferably, calculating the maximum value of the curve corresponding to the polynomial equation includes:
[0015] The maximum value of the curve corresponding to the polynomial equation is calculated based on the extreme point determination method.
[0016] Preferably, the step of calculating each coefficient of the polynomial equation based on the sample angle and the signal intensity using the gradient descent method includes:
[0017] Based on the sample angle and the signal intensity, an initial equation for each coefficient is constructed based on minimizing the mean square error;
[0018] Based on the initial equation, construct the first loss function;
[0019] By adding L2 norm regularization to the first loss function, a second loss function including angle parameters is obtained.
[0020] By introducing calculation parameters into the second loss function, a third loss function is obtained;
[0021] According to the gradient descent method, each angle parameter in the third loss function is updated to obtain the coefficient of each term in the polynomial equation.
[0022] Preferably, obtaining the sample angle based on the antenna motion angle range includes:
[0023] Based on the range of antenna motion angles, n sample angles are uniformly extracted; where n is a positive integer.
[0024] Preferably, the method further includes:
[0025] Timing begins when the antenna moves to the angle specified in the sample.
[0026] After a preset stabilization time, the signal strength received by the client is obtained.
[0027] In a second aspect, the present invention provides an antenna optimal orientation calculation device, comprising:
[0028] Angle acquisition module, used to acquire sample angles based on the range of antenna motion angles;
[0029] The signal acquisition module is used to acquire the signal strength received by the client when the antenna moves to the sample angle;
[0030] The polynomial fitting module is used to perform polynomial fitting based on the sample angle and the signal intensity to obtain a polynomial equation.
[0031] The maximum value calculation module is used to calculate the maximum value of the curve corresponding to the polynomial equation, and obtain the optimal orientation angle of the antenna based on the angle corresponding to the maximum value.
[0032] Preferably, the polynomial fitting module includes:
[0033] The highest-order term determination unit is used to determine the highest-order term of the polynomial equation based on the number of sample angles.
[0034] A coefficient calculation unit is used to calculate the coefficients of each term of the polynomial equation based on the sample angle and the signal intensity using the gradient descent method.
[0035] A fitting unit is used to fit a polynomial equation based on each coefficient and the highest-order term.
[0036] Thirdly, the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the antenna optimal orientation calculation method described in any one of the above.
[0037] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the antenna optimal orientation calculation method described in any one of the above.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] This invention performs polynomial fitting between the sample angle of the antenna and the signal strength received by the client, and calculates the maximum value of the curve corresponding to the polynomial equation using mathematical methods. The optimal antenna orientation is then obtained based on the sample angle corresponding to the maximum value. In this invention, fewer antenna locations can be selected for signal strength sampling, and the optimal antenna orientation angle can be quickly calculated based on the collected data, thereby maximizing the signal strength received by the client and achieving better average network performance. Attached Figure Description
[0040] Figure 1 This is a schematic flowchart of the antenna optimal orientation calculation method provided in the first embodiment of the present invention;
[0041] Figure 2 This is a schematic diagram of the antenna field pattern;
[0042] Figure 3 This is a schematic diagram of the antenna optimal orientation calculation device provided in the second embodiment of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] Reference Figure 1 The first embodiment of the present invention provides a method for calculating the optimal orientation of an antenna, including the following steps S11-S14:
[0045] S11, Obtain the sample angle based on the antenna motion angle range;
[0046] S12, when the antenna moves to the sample angle, the signal strength received by the client is obtained;
[0047] S13, perform polynomial fitting based on the sample angle and the signal intensity to obtain a polynomial equation;
[0048] S14, calculate the maximum value of the curve corresponding to the polynomial equation, and obtain the optimal orientation angle of the antenna based on the sample angle corresponding to the maximum value.
[0049] It should be noted that, regardless of whether it is an omnidirectional antenna or a directional antenna, their antenna field pattern is a convex body, such as... Figure 2 As shown, when the antenna rotates 180° in any plane, the signal strength received by the client will inevitably undergo a process of weakening, strengthening, and then weakening again. This invention models the change curve of the signal strength received by the client during this process using a high-order polynomial. By collecting signal strength data from a small number of locations, performing polynomial fitting, and using mathematical methods to calculate the maximum value of the curve corresponding to the polynomial equation, i.e., the signal strength curve, the maximum value can be obtained by controlling the angle at which the antenna rotates to the maximum value. Furthermore, the antenna in this invention can be a router antenna or the antenna of other signal transmitting devices; this invention does not limit this.
[0050] In step S11, sample angles need to be obtained based on the antenna motion angle range. The antenna motion angle range is related to the specific structure of the device. For example, assuming the router's antenna can rotate a maximum of 180° in a plane, the antenna motion angle range is 0-180°. In this embodiment, n sample angles are uniformly sampled based on the antenna motion angle range; where n is a positive integer. By uniformly sampling a small number of angles, both fast calculation and increased calculation accuracy can be ensured.
[0051] In step S12, the antenna is first moved to the position corresponding to each sample angle extracted in step S11. When the antenna reaches the sample angle, timing begins, and after a preset stabilization time, the signal strength received by the client is acquired. The stabilization time is set by the user based on the performance of the device containing the antenna; this invention does not limit this setting. For example, the data acquisition format can be <φ i rssi1>,<φ i ,rssi2>,…<φ i rssi k >, where rssi k The signal strength is represented by k, which is the number of data points collected at each sample angle.
[0052] In step S13, a polynomial fitting is performed based on the sample angle and the signal intensity to obtain a polynomial equation, specifically including:
[0053] The highest-order term of the polynomial equation is determined based on the number of sample angles.
[0054] Based on the sample angle and the signal strength, calculate the coefficients of each term of the polynomial equation using the gradient descent method;
[0055] By fitting the coefficients of each term and the highest-order term, a polynomial equation is obtained.
[0056] In step S14, the maximum value of the curve corresponding to the polynomial equation needs to be calculated, and the optimal antenna orientation angle is obtained based on the angle corresponding to the maximum value. Specifically, the maximum value of the curve corresponding to the polynomial equation can be calculated using an extreme point determination method. An extreme point is a point on the curve corresponding to the polynomial equation where the first derivative is equal to 0 and the second derivative is not equal to 0. The maximum value is the point with the largest corresponding polynomial equation value among all extreme points. After obtaining the maximum value, the antenna is controlled to rotate to the angle corresponding to the maximum value, maximizing the signal strength received by the client.
[0057] To facilitate understanding of the present invention, some preferred embodiments of the present invention will be described in further detail below.
[0058] In one implementation, calculating each coefficient of the polynomial equation based on the sample angle and the signal strength using gradient descent includes:
[0059] Based on the sample angle and the signal intensity, an initial equation for each coefficient is constructed based on minimizing the mean square error;
[0060] Based on the initial equation, construct the first loss function;
[0061] By adding L2 norm regularization to the first loss function, a second loss function including angle parameters is obtained.
[0062] By introducing calculation parameters into the second loss function, a third loss function is obtained;
[0063] According to the gradient descent method, each angle parameter in the third loss function is updated to obtain the coefficient of each term in the polynomial equation.
[0064] For example, let the angles of the n samples be φ1, φ2, ..., φ n Then the highest-order term of the polynomial equation is n-1, and the polynomial equation concerning signal strength is:
[0065]
[0066] Where, θ i Let φ represent each coefficient, and let i ∈ [0, n-1].
[0067] Furthermore, let x be... i =φ i Then the polynomial is transformed into
[0068] Let the given dataset D = {(x (1) y 1 ), (x (2) y 2 ), ..., (x (m) y m )},in, y i =(rssi1, rssi2,…, rssi k ), where m is the number of samples and n-1 is the number of features in the samples.
[0069] Assume a linear relationship is satisfied:
[0070]
[0071] To minimize the root mean square error, the initial equation for each coefficient is obtained as follows:
[0072]
[0073] From equation (2), the first loss function can be obtained:
[0074]
[0075] Adding L2 norm regularization results in a second loss function:
[0076]
[0077] Where, the L2 norm regularization parameter λ > 0, θ j Here, represents the angle parameter. It's important to note that the L2 norm, also known as "Ridge Regression" or "weight decay," is used to improve overfitting. Overfitting occurs when the model's training error is small, but its testing error is large; in other words, the model is complex enough to fit all training data, but performs poorly when predicting new data. Specifically, the L2 norm is the square root of the sum of the squares of the elements in a vector.
[0078] Furthermore, for ease of subsequent calculations, a third loss function is obtained by introducing calculation parameters into equation (4):
[0079]
[0080] Using the gradient descent method, the parameter θ in equation (5) is... j By updating each term sequentially, the coefficients of each term in the polynomial equation are obtained, i.e.:
[0081]
[0082] Among them, the updated θ′ j That is, the coefficient θ of each term in the polynomial equation. i α represents the learning rate or step size, which controls the distance taken in each step; k is the number of signal strength data points collected at the corresponding sample angle.
[0083] right The calculation is as follows:
[0084]
[0085] In this embodiment, the sample angle of the antenna and the signal strength received by the client are subjected to polynomial fitting, and the maximum value of the curve corresponding to the polynomial equation is calculated using mathematical methods. The optimal antenna orientation is then obtained based on the sample angle corresponding to the maximum value. In this invention, fewer antenna locations can be selected for signal strength collection, and the optimal antenna orientation angle can be quickly solved based on the collected data, thereby maximizing the signal strength received by the client and achieving better average network performance.
[0086] Reference Figure 3 The second embodiment of the present invention provides an antenna optimal orientation calculation device, comprising:
[0087] Angle acquisition module, used to acquire sample angles based on the range of antenna motion angles;
[0088] The signal acquisition module is used to acquire the signal strength received by the client when the antenna moves to the sample angle;
[0089] The polynomial fitting module is used to perform polynomial fitting based on the sample angle and the signal intensity to obtain a polynomial equation.
[0090] The maximum value calculation module is used to calculate the maximum value of the curve corresponding to the polynomial equation, and obtain the optimal orientation angle of the antenna based on the angle corresponding to the maximum value.
[0091] Preferably, the polynomial fitting module includes:
[0092] The highest-order term determination unit is used to determine the highest-order term of the polynomial equation based on the number of sample angles.
[0093] A coefficient calculation unit is used to calculate the coefficients of each term of the polynomial equation based on the sample angle and the signal intensity using the gradient descent method.
[0094] A fitting unit is used to fit a polynomial equation based on each coefficient and the highest-order term.
[0095] Preferably, the maximum value calculation module includes:
[0096] The maximum value calculation unit is used to calculate the maximum value of the curve corresponding to the polynomial equation according to the extreme point judgment method.
[0097] Preferably, the coefficient calculation unit is further used for:
[0098] Based on the sample angle and the signal intensity, an initial equation for each coefficient is constructed based on minimizing the mean square error;
[0099] Based on the initial equation, construct the first loss function;
[0100] By adding L2 norm regularization to the first loss function, a second loss function including angle parameters is obtained.
[0101] By introducing calculation parameters into the second loss function, a third loss function is obtained;
[0102] According to the gradient descent method, each angle parameter in the third loss function is updated to obtain the coefficient of each term in the polynomial equation.
[0103] Preferably, the angle acquisition module includes:
[0104] Angle acquisition unit is used to uniformly extract n sample angles based on the antenna motion angle range; where n is a positive integer.
[0105] Preferably, the signal acquisition module includes:
[0106] A timing unit is used to start timing when the antenna moves to the sample angle;
[0107] The signal acquisition unit is used to acquire the signal strength received by the client after a preset stabilization time.
[0108] It should be noted that the antenna optimal orientation calculation device provided in this embodiment of the invention is used to execute all the process steps of the antenna optimal orientation calculation method in the above embodiment. The working principle and beneficial effect of the two are one-to-one, so they will not be described again.
[0109] This invention also provides a terminal device. The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an antenna optimal orientation calculation program. When the processor executes the computer program, it implements the steps in the various antenna optimal orientation calculation method embodiments described above, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as the angle acquisition module.
[0110] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0111] The terminal device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of terminal devices and do not constitute a limitation on the terminal device. It may include more or fewer components than described above, or a combination of certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.
[0112] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0113] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0114] Wherein, if the modules / units integrated in the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0115] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0116] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for calculating an optimal orientation of an antenna, characterized by, The method comprises the following steps: acquiring sample angles according to an antenna movement angle range; acquiring signal strength received by a client when the antenna moves to the sample angles; performing polynomial fitting according to the sample angles and the signal strength to obtain a polynomial equation; calculating a maximum value of a curve corresponding to the polynomial equation, and obtaining an optimal antenna orientation angle according to an angle corresponding to the maximum value; the polynomial fitting according to the sample angles and the signal strength to obtain the polynomial equation comprises the following steps: determining a highest order term of the polynomial equation according to a number of the sample angles; calculating each coefficient of the polynomial equation based on a gradient descent method according to the sample angles and the signal strength; performing fitting according to the each coefficient and the highest order term to obtain the polynomial equation; the calculation of each coefficient of the polynomial equation based on the gradient descent method according to the sample angles and the signal strength comprises the following steps: constructing an initial equation about the each coefficient based on mean square error minimization according to the sample angles and the signal strength; constructing a first loss function according to the initial equation; adding in the first loss function a norm regularization, resulting in a second loss function comprising the angle parameter; introducing a calculation parameter to the second loss function to obtain a third loss function; updating each angle parameter in the third loss function according to the gradient descent method to obtain the each coefficient in the polynomial equation.
2. The antenna optimal orientation calculation method of claim 1, wherein, the calculation of the maximum value of the curve corresponding to the polynomial equation comprises the following step: calculating the maximum value of the curve corresponding to the polynomial equation according to an extreme point judgment method.
3. The antenna optimal orientation calculation method of claim 1, wherein, the acquisition of the sample angles according to the antenna movement angle range comprises the following step: uniformly extracting n sample angles according to the antenna movement angle range; wherein n is a positive integer.
4. The antenna optimal orientation calculation method of claim 1, wherein, The method further comprises the following steps: starting timing when the antenna moves to the sample angles; acquiring the signal strength received by the client after a preset stable time.
5. An antenna optimal orientation calculation apparatus, characterized by, The device comprises: an angle acquisition module, configured to acquire sample angles according to an antenna movement angle range; a signal acquisition module, configured to acquire signal strength received by a client when the antenna moves to the sample angles; a polynomial fitting module, configured to perform polynomial fitting according to the sample angles and the signal strength to obtain a polynomial equation; a maximum value calculation module, configured to calculate a maximum value of a curve corresponding to the polynomial equation, and obtain an optimal antenna orientation angle according to an angle corresponding to the maximum value; the polynomial fitting module comprises: a highest order term determination unit, configured to determine a highest order term of the polynomial equation according to a number of the sample angles; a coefficient calculation unit, configured to calculate each coefficient of the polynomial equation based on a gradient descent method according to the sample angles and the signal strength; a fitting unit, configured to perform fitting according to the each coefficient and the highest order term to obtain the polynomial equation; the coefficient calculation unit is further configured to: construct an initial equation about the each coefficient based on mean square error minimization according to the sample angles and the signal strength; construct a first loss function according to the initial equation; adding in the first loss function a norm regularization, resulting in a second loss function comprising the angle parameter; introduce a calculation parameter to the second loss function to obtain a third loss function; According to a gradient descent method, each angle parameter in the third loss function is updated to obtain each term coefficient in the polynomial equation.
6. A terminal device, characterized by comprising: The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the antenna optimal orientation calculation method according to any one of claims 1 to 4 when the computer program runs.
7. A computer readable storage medium characterized by, The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the antenna optimal orientation calculation method according to any one of claims 1 to 4 when the computer program runs.
Citation Information
Patent Citations
Network data transmission method and user terminal
CN108390734A
Photovoltaic cell panel solder strip offset detection method and device based on artificial intelligence
CN112270724A
Method for assisting with installation of customer premise equipment, and electronic device
WO2021180228A1