Antenna rotation control method and related equipment

By rotating before each antenna rotation and using sensors to compensate for rotation, the problem of antenna angle accumulation error is solved, and the coverage range and quality of wireless network signals are improved.

CN119828770AActive Publication Date: 2025-04-15HONOR DEVICE CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202311288582.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-07
Publication Date
2025-04-15
Estimated Expiration
2043-10-07

AI Technical Summary

Technical Problem

The accumulated angle error generated by the antenna after multiple rotations leads to inaccurate rotation position of the antenna, affecting the transmission and coverage of wireless network signals.

Method used

Before each driving antenna rotates, a rotation is performed. The rotation angle of the antenna is the rotation angle of the previous antenna rotation to avoid the accumulation of angle errors, and the actual rotation angle of the antenna is obtained by the sensor to compensate for the rotation.

Benefits of technology

It effectively reduces the accumulation of angle errors, improves the accuracy of the antenna rotation position, improves the coverage and quality of wireless network signals, and improves the user's Internet experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828770A_ABST
    Figure CN119828770A_ABST
Patent Text Reader

Abstract

The invention provides an antenna rotation control method and related equipment, and relates to the technical field of communication equipment, the antenna rotation control method comprises the following steps: receiving an antenna rotation instruction, the antenna rotation instruction comprising a first rotation angle; acquiring a previous rotation angle of the previous rotation of the antenna; based on the first rotation angle and the previous rotation angle, determining a second rotation angle of the rotation antenna at this time; determining a third rotation angle of rotation of the antenna based on the previous rotation angle; driving the antenna to rotate based on the third rotation angle; and driving the antenna to rotate based on the second rotation angle under the condition that the rotation is finished. According to the method, before the antenna is driven to rotate each time, rotation is carried out, the rotation angle is the last rotation angle of the antenna, accumulation of angle errors can be avoided, the angle errors are kept at the one-time rotation magnitude, and the accuracy of the rotation position of the antenna is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of communication equipment, and in particular, to an antenna rotation control method and related equipment. Background Art

[0002] In order to achieve mutual communication between different networks, routers are widely used in daily life. Since setting the antenna outside the router host has the advantage of strong anti-interference, most routers on the market have external antennas. The router can forward the wireless or wired broadband network signal to nearby wireless network devices (such as laptops, mobile phones, tablets, smart TVs, wireless routers, etc.) through the antenna to achieve wireless signal coverage.

[0003] In order to adjust the antenna angle, in the related art, the router can drive the antenna to rotate by setting a motor. For example, the user can control the rotation of the router antenna through the application (Application, APP) installed on the mobile phone. When the router antenna rotates, it may produce a rotation angle error due to software reasons (for example, there is a difference between the theoretical value and the actual value of the number of pulse width modulation (PulseWidth Modulation, PWM) signals of the driving motor) or hardware reasons (for example, there is a meshing gap between the motor shaft and the gear that drives the antenna to rotate). After multiple rotations, the antenna may produce a large angle accumulation error, which will lead to a large angle difference between the actual rotation angle of the antenna and the expected rotation angle when the antenna is subsequently controlled to rotate. Summary of the invention

[0004] In view of the above, it is necessary to provide an antenna rotation control method and related equipment, which can solve the problem that the angle accumulation error generated after multiple rotations of the antenna leads to inaccurate antenna rotation position, thereby affecting the transmission and coverage range of wireless network signals.

[0005] In a first aspect, the present application provides an antenna rotation control method, which is applied to a network device, wherein the network device includes a rotatable antenna, and the antenna rotation control method includes: receiving an antenna rotation instruction, the antenna rotation instruction including a first rotation angle; obtaining a previous rotation angle of the antenna when it was last rotated; determining a second rotation angle of the antenna for this rotation based on the first rotation angle and the previous rotation angle; determining a third rotation angle of the antenna for rotation based on the previous rotation angle; driving the antenna to rotate based on the third rotation angle; and when the rotation is completed, driving the antenna to rotate based on the second rotation angle.

[0006] By adopting the above technical solution, before each time the antenna is driven to rotate, a rotation is performed, and the rotation angle of the antenna rotation is the rotation angle of the previous antenna rotation, which can avoid the accumulation of angle errors and achieve the goal of keeping the angle error at the level of one rotation, reducing the error caused by inaccurate number of pulse width modulation (PWM) signals or motor gear meshing clearance, and improving the accuracy of the antenna rotation position. This can solve the problem of inaccurate antenna rotation position caused by the accumulated angle error after multiple rotations, affecting the transmission and coverage of wireless network signals, and can improve the coverage and quality of wireless network signals of network devices and improve users' Internet experience.

[0007] In a possible implementation, after driving the antenna to rotate based on the second rotation angle, the method further includes: determining, based on the second rotation angle, a previous rotation angle that the antenna needs to rely on when rotating next time.

[0008] By adopting the above technical solution, the previous rotation angle that the antenna needs to rely on for the next rotation is updated based on the second rotation angle, so that when the antenna is rotated next time, it can be rotated based on the updated rotation angle of the previous rotation, ensuring that the rotation angle of the antenna rotation is always the rotation angle of the previous antenna rotation, which can avoid the accumulation of angle errors and achieve the goal of keeping the angle error at the order of one rotation.

[0009] In a possible implementation, the previous rotation angle of the antenna during the last rotation is It is expressed as: Indicates the previous rotation direction of the antenna. Indicates the previous rotation angle of the antenna, the third rotation angle It is expressed as: and Having opposite directions; first rotation angle It is expressed as: is the pre-rotation direction of the antenna for this rotation, is the pre-rotation angle of the antenna for this rotation, and the second rotation angle Obtained through the following formula:

[0010]

[0011] is the actual rotation angle of the antenna this time, where

[0012] or

[0013] By adopting the above technical solution, the rotation angle has the same angle value as the previous rotation angle of the previous rotation process, and the rotation direction is opposite. After the rotation is completed, the rotation angle of this rotation process is the sum of the previous rotation angle of the previous rotation process and the rotation angle of this planned rotation, thereby avoiding the accumulation of angle errors and keeping the angle error at the level of one rotation.

[0014] In one possible implementation, the network device is further provided with a device to be tested that can rotate synchronously with the antenna, and a sensor for sensing position information of the device to be tested, and driving the antenna to rotate based on the second rotation angle, including: driving the antenna to rotate based on the second rotation angle, and acquiring first sensing data of the sensor; when the antenna stops rotating, determining an actual rotation angle of the antenna based on the first sensing data; determining a compensation rotation angle based on a difference between the actual rotation angle and the second rotation angle; and driving the antenna to rotate based on the compensation rotation angle.

[0015] By adopting the above technical solution, in the process of driving the antenna to rotate, the actual rotation angle of the antenna is obtained by cooperating with the sensor and the magnet, and compensatory rotation is performed according to the difference between the actual rotation angle of the antenna and the theoretical rotation angle, thereby further reducing the angular error in the antenna rotation process and improving the accuracy of the antenna rotation.

[0016] In one possible implementation, driving the antenna to rotate based on a third rotation angle includes: driving the antenna to rotate based on the third rotation angle, and acquiring second sensing data of the sensor; when the antenna finishes rotating, determining an actual rotation angle of the antenna based on the second sensing data; determining a compensation rotation angle based on a difference between the actual rotation angle and the third rotation angle; and driving the antenna to rotate based on the compensation rotation angle.

[0017] By adopting the above technical solution, in the process of driving the antenna to rotate, the actual rotation angle of the antenna is obtained by the sensor, and compensatory rotation is performed according to the difference between the actual rotation angle of the antenna and the theoretical rotation angle, thereby reducing the angle error in the antenna rotation process and improving the accuracy of the antenna rotation.

[0018] In a possible implementation, the antenna rotation control method further includes: when driving the antenna to rotate, determining the rotation angle of the antenna based on the first sensing data at preset time intervals; when it is determined that the rotation angle of the antenna within the preset time is less than a preset angle, stopping driving the antenna to rotate.

[0019] By adopting the above technical solution, when the antenna is driven to rotate, the rotation angle of the antenna is detected every preset time. When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, it is considered that the motor rotation is abnormal, such as the abnormal scenario of motor stalling or obstruction by people / objects, and the driving of the antenna rotation is stopped to avoid damage to the motor components and extend the service life of the motor.

[0020] In a second aspect, the present application provides an antenna rotation control method, which is applied to a network device, wherein the network device includes a rotatable antenna, a device to be tested that can rotate synchronously with the antenna, and a sensor for sensing position information of the device to be tested, and the antenna rotation control method includes: receiving an antenna rotation instruction, the antenna rotation instruction including a first rotation angle; driving the antenna to rotate based on the first rotation angle, and acquiring sensing data from the sensor; when the antenna stops rotating, determining an actual rotation angle of the antenna based on the sensing data; determining a second rotation angle based on a difference between the actual rotation angle and the first rotation angle; and driving the antenna to rotate based on the second rotation angle.

[0021] By adopting the above technical solution, during the rotation of the antenna, the actual rotation angle of the antenna is obtained by a sensor, and compensatory rotation is performed according to the difference between the actual rotation angle of the antenna and the theoretical rotation angle. This can compensate for the angular error in the rotation of the antenna and improve the accuracy of the rotation position of the antenna. This can solve the problem of inaccurate rotation position of the antenna caused by the accumulated angle error after multiple rotations of the antenna, thereby affecting the transmission and coverage of the wireless network signal. This can improve the coverage and quality of the wireless network signal of the network equipment and enhance the user's Internet experience.

[0022] In one possible implementation, the object to be tested is a magnet, the sensor is a magnetometer, and sensing data of the sensor is obtained, including: obtaining three-axis coordinate data of the magnet sensed by the magnetometer in the magnetometer coordinate system; determining the actual rotation angle of the antenna based on the sensing data, including: selecting two-axis coordinate data representing the rotation of the magnet from the three-axis coordinate data, and determining the rotation angle of the magnet based on the two-axis coordinate data; and using the rotation angle of the magnet as the actual rotation angle of the antenna.

[0023] By adopting the above technical solution, the magnet can rotate synchronously with the antenna, and the rotation angle of the magnet can be sensed by the magnetometer, and the rotation angle of the magnet can be used as the actual rotation angle of the antenna to obtain the actual rotation angle of the antenna. Since the magnet rotates on a two-dimensional plane, only the coordinate data of two axes of the three-axis coordinate data detected by the magnetometer change greatly, and the coordinate data of the other axis remains basically unchanged. By selecting two-axis coordinate data representing the rotation of the magnet from the three-axis coordinate data, and converting the rotation angle of the magnet based on the two-axis coordinate data, the complexity of the angle conversion can be reduced.

[0024] In a possible implementation, the rotation angle of the magnet is obtained based on the two-axis coordinate data, including: performing linear fitting processing on the two-axis coordinate data, and obtaining the starting two-axis coordinates and the ending two-axis coordinates of the magnet's rotation in the magnetometer coordinate system based on the linear fitting result; converting the starting two-axis coordinates and the ending two-axis coordinates of the magnet in the magnetometer coordinate system into the starting two-axis coordinates and the ending two-axis coordinates in the target coordinate system, the target coordinate system being a two-dimensional coordinate system constructed based on the plane where the magnet is located; and obtaining the rotation angle of the magnet based on the starting two-axis coordinates and the ending two-axis coordinates of the magnet in the target coordinate system.

[0025] By adopting the above technical solution and performing linear fitting processing on the two-axis coordinate data, it is possible to accurately obtain the two-axis coordinate data of the magnet in the magnetometer coordinate system, and then convert the two-axis coordinate data in the magnetometer coordinate system into coordinates of a two-axis coordinate system constructed with the plane where the magnet is located, so that the rotation angle of the magnet can be quickly converted later.

[0026] In one possible implementation, the antenna rotation control method further includes: when driving the antenna to rotate, determining the rotation angle of the antenna based on sensing data at preset time intervals; when it is determined that the rotation angle of the antenna within the preset time is less than a preset angle, stopping driving the antenna to rotate.

[0027] By adopting the above technical solution, when the antenna is driven to rotate, the rotation angle of the antenna is detected every preset time. When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, it is considered that the motor rotation is abnormal, such as the abnormal scenario of motor stalling or obstruction by people / objects, and the driving of the antenna rotation is stopped to avoid damage to the motor components and extend the service life of the motor.

[0028] In a third aspect, the present application provides a network device, comprising a memory and a processor; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the antenna rotation control method of the first aspect or the second aspect.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the antenna rotation control method of the first aspect or the second aspect is implemented.

[0030] In a fifth aspect, the present application provides a chip coupled to a memory in a network device, and the chip is used to control the network device to execute the antenna rotation control method of the first aspect or the second aspect.

[0031] In addition, the technical effects brought about by the third to fifth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of the structure of a driving device in a router provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of a process of executing antenna rotation of a router provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of a flow chart of a router implementing rotation angle error compensation based on a magnetometer according to an embodiment of the present application;

[0035] Figure 4 A schematic diagram of an antenna provided in an embodiment of the present application having an inaccessible area during rotation;

[0036] Figure 5 A schematic diagram of a process for a router to cope with abnormal scenarios provided in an embodiment of the present application;

[0037] Figure 6 is a flow chart of an antenna rotation control method provided by another embodiment of the present application;

[0038] Figure 7 is a flow chart of an antenna rotation control method provided by another embodiment of the present application;

[0039] Figure 8 is a schematic diagram of an application scenario of an antenna rotation control method provided by another embodiment of the present application;

[0040] Fig. 9 This is a hardware architecture diagram of a router provided in one embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "or", "for example" is intended to present related concepts in a concrete way.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified in the present application, " / " means or. For example, A / B can represent A or B. "And / or" in the present application is only a kind of association relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations. It should be understood that the order of the steps shown in the flowchart of this article can be changed, and some can also be omitted.

[0044] In order to facilitate users to adjust the direction of the router antenna and keep the signal received by the wireless network device in a better state, the existing router supports receiving the antenna rotation instruction issued by the user to drive the motor to adjust the direction of the antenna. For example, the user can issue the antenna rotation instruction through the application installed in the terminal device (for example, a mobile phone), the router receives the antenna rotation instruction, and drives the motor to adjust the direction of the antenna based on the antenna rotation instruction. For example, the antenna rotation instruction can carry the rotation direction and rotation angle of the antenna. Each time the antenna rotates, an angle rotation error may occur due to software or hardware reasons. After multiple rotations, a large angle accumulation error may occur, which leads to a large angle difference between the actual rotation angle of the antenna and the expected rotation angle when the antenna is subsequently controlled to rotate. Software reasons may include differences between the theoretical value and the actual value of the number of pulse width modulation (PWM) signals output based on the antenna rotation instruction, and hardware reasons may include the meshing gap between the motor shaft and the gear that drives the antenna to rotate.

[0045] In order to solve the above technical problems, an embodiment of the present application provides an antenna rotation control method, which can offset the previous angle rotation error before driving the antenna to rotate each time the motor is driven to adjust the antenna angle and direction, thereby avoiding the generation of angle accumulation errors, so that the angle error can be kept at the order of a single rotation error as much as possible, thereby improving the accuracy of antenna rotation, thereby improving the transmission and coverage range of wireless network signals of network devices, and further improving the user's Internet experience.

[0046] The antenna rotation control method provided in the embodiment of the present application can be applied to a router or other network devices with antenna rotation requirements, and the embodiment of the present application does not limit this. The router involved in the embodiment of the present application can be an outdoor wireless router or an indoor home wireless router. The router can support at least one of the wireless fidelity (Wi-Fi) 2.4G band, 5G band, WiFi-6E band and above general bands, and the present application does not specifically limit this.

[0047] like Figure 1 As shown, the router includes an antenna 10, a driving device 20 and a controller 30. The controller 30 is used to control the driving device 20 to work or not work, and the driving device 20 is used to drive the antenna 10 to rotate. For example, the controller 30 can output a PWM signal to the driving device 20 based on the received antenna rotation instruction, and the driving device 20 drives the antenna 10 to rotate based on the PWM signal. The controller 30 may include a control chip and a PWM controller, and the PWM controller generates a PWM signal based on the control signal output by the control chip. In other embodiments, the PWM signal can also be directly generated by the control chip. The control chip can be a central processing unit (CPU), a microcontroller unit (MCU), a programmable logic device (PLD), etc.

[0048] The driving device 20 includes a motor, which may be a motor with a reducer or a motor without a reducer. The types of motors include but are not limited to servo motors, stepper motors, torque motors, switched reluctance motors, and brushless DC motors. The motor can drive the antenna 10 to rotate around the axis L1.

[0049] For example, the output shaft of the motor can be directly connected to the antenna 10, that is, no transmission device is required, and the motor can also be connected to the antenna 10 through a transmission device. Figure 1The motor is shown to be connected to the antenna 10 through a transmission device. The transmission device may include a driving gear and a driven gear, or a driving gear and a toothed disc. The specific structure of the transmission device is not limited in this application. For example, the driving gear is fixedly connected to the output shaft of the motor, and the driven gear / toothed disc is fixedly connected to the antenna 10, thereby realizing the rotation of the antenna driven by the motor.

[0050] As mentioned above, after multiple rotations, the antenna may produce a large angle cumulative error. The problem of angle cumulative error lies mainly in "accumulation". If the angle error caused by the previous antenna rotation can be offset each time the antenna is driven to rotate, the angle error will always remain at the level of a single rotation error, and there will be no "accumulation" effect. Antenna rotation mainly includes two parameters: rotation direction and rotation angle.

[0051] Assume that the rotation angle of antenna 10 is defined as θ d,a ,θ d,a =(θ d ,θ a ), where θ d is the direction of rotation, θ a is the rotation angle, θ a Satisfy the equation: 0°≤θ a ≤360°, θ d The value range of can be defined as follows:

[0052]

[0053] In some embodiments, when the router receives an antenna rotation instruction for controlling the rotation of the antenna, the router can convert the antenna rotation instruction into a rotation angle based on a preset antenna control algorithm and send it to the motor driver. The motor driver drives the motor to drive the antenna to rotate based on the rotation angle, so that the antenna 10 rotates in the rotation direction defined in the rotation angle, and the angle of the antenna rotation is the rotation angle defined in the rotation angle. The preset antenna control algorithm can be executed by the controller 30, and the antenna control algorithm can be an existing control algorithm for driving the antenna to rotate, which is not limited in the embodiments of the present application.

[0054] like Figure 2 As shown, the operating system deployed on the router is divided into an application layer and a kernel layer, and the kernel layer can communicate with the hardware layer. The application layer may include a series of application software, such as a first software for controlling the rotation of the antenna, and the first software may execute an antenna control algorithm. The kernel layer is a layer between hardware and software. The kernel layer at least includes a motor driver. The kernel layer is the core of the router's operating system, provides the most basic functions of the operating system, and is the basis for the operation of the operating system. The hardware layer is the hardware of the router, and the hardware layer at least includes a motor.

[0055] In a process of driving the antenna to rotate, the first software at the application layer can obtain the rotation angle to be issued in this rotation process by executing the antenna control algorithm, and issue the rotation angle to the motor driver at the core layer. The motor driver drives the motor to rotate the antenna based on the rotation angle issued by the application layer. The first software can record the rotation angle issued each time.

[0056] In order to avoid angle accumulation error and improve the accuracy of antenna rotation, in the process of driving the antenna to rotate once, it is assumed that Indicates the rotation angle that the antenna control algorithm pre-delivers in this rotation process. It can be obtained based on the antenna rotation instruction received by the router this time. Indicates the previous rotation angle of the antenna in the last rotation process. It can be obtained based on the rotation angle recorded by the first software. For example, the previous rotation angle of the antenna in the last rotation process is the rotation angle required to be rotated in the last rotation process issued by the first software. Indicates the rotation angle that the antenna needs to rotate in this rotation process. All refer to θ d,a The parameters defined are Both include the rotation direction and the rotation angle.

[0057] Before driving the antenna to rotate, the controller 30 can and Correct the current angle error and calculate Based on Drive the antenna to rotate to eliminate the angle error caused by the last antenna rotation. The specific implementation plan is as follows:

[0058] (1) Drive the antenna to rotate

[0059] The motor is rotated to compensate for the error caused by the previous rotation. The rotation angle is The controller 30 may be configured according to Calculated in is the rotation direction of the antenna in the last rotation process, For In the opposite direction, It is the rotation angle of the antenna in the last rotation process.

[0060] In getting After that, the rotation angle sent to the motor drive is The antenna is driven to rotate to the rotation start position of the last rotation process, and the rotation start position is also the position after the last rotation process is completed.

[0061] (2) Driving the antenna to rotate

[0062] The controller 30 may be configured according to and Calculated in, is the rotation direction pre-issued by the antenna control algorithm in this rotation process, is the rotation angle pre-issued by the antenna control algorithm in this rotation process, It can be expressed as:

[0063] The absolute value of .

[0064] In getting After that, the rotation angle required for this rotation process is sent to the motor driver. The antenna is driven to rotate from the current rotation position (the position after the rotation in (1) above) in the direction of rotation. The rotation angle is and will Updated to So that in the next antenna rotation process, the rotation angle of the antenna is

[0065] In some embodiments, if the antenna of the router is rotating for the first time, since there is no previous rotation process, the first rotation does not rotate the antenna, and the antenna can be directly rotated according to Rotate and Updated to

[0066] Through the above-mentioned slewing compensation method, before each time the antenna is driven to rotate, a rotation is performed, and the rotation angle of the antenna rotation is the rotation angle of the last antenna rotation, which can avoid the accumulation of angle errors, reduce the counting error of the PWM signal, and keep the angle error at the level of one rotation. Due to software and / or hardware reasons, the angle errors of rotations at the same angle and in different directions may not be completely consistent. The above-mentioned slewing compensation method may make the angle error above the level of one rotation, but compared with the existing rotation directly according to the rotation angle issued by the antenna control algorithm each time, the error after slewing compensation is still greatly reduced, which can effectively reduce the level of accumulated angle errors.

[0067] Although the above rotation compensation method can effectively reduce the magnitude of the accumulated angle error, the angle error may still increase after the router rotates multiple times. In order to solve this problem, the embodiment of the present application also proposes a hardware-based angle error compensation solution.

[0068] Specifically, the first software (software used to control the rotation of the antenna) records the rotation angle and rotation direction of each time the antenna is driven to rotate, and then calculates the angular offset of the theoretical position of the antenna relative to the reference point. The reference point can be the starting position of the antenna in this rotation, or a fixed position point on the router; the angular offset of the actual position of the antenna relative to the reference point is then obtained through the sensor and fed back to the first software. The first software can then perform compensatory rotation based on the difference between the theoretical and actual offsets, thereby compensating for the angular error of the rotation and improving the accuracy of the antenna rotation.

[0069] For example, the sensor is a magnetometer, and the transmission device includes a driving gear and a toothed disc. The driving gear is fixedly connected to the output shaft of the motor, and the toothed disc is fixedly connected to the antenna 10. The motor drives the toothed disc to rotate through the driving gear. The toothed disc can be set on a turntable, and the turntable can rotate relative to the main body of the router with the toothed disc. A magnet can be embedded in the turntable. The shape of the magnet is not limited in this application. For example, it can be a square magnet or a round magnet. The size of the magnet can be set according to the actual magnetic detection requirements, and the magnet must be smoothly embedded in the turntable. The magnet can rotate with the rotation of the turntable, that is, the magnet and the antenna rotate synchronously. The magnetometer can be fixedly installed on the main body of the router and keep a certain distance from the turntable, and will not rotate with the rotation of the turntable. The distance can be set according to the actual magnetic detection requirements, and the embodiment of the application does not limit this.

[0070] In the process of driving the antenna to rotate once, the controller 30 can send a first motor drive signal to the drive device 20 based on the received antenna rotation instruction. The drive device 20 drives the antenna 10 to rotate based on the first motor drive signal. The magnet can rotate with the turntable, and the distance between the magnetometer and the disk changes. The magnetometer can sense different magnetic field strengths. For example, the magnetometer can detect the magnetic field data of the three axes of X, Y, and Z. The magnetometer can convert the magnetic field data of the three axes into the coordinate data of the three axes of X, Y, and Z in the magnetometer coordinate system and feed it back to the controller 30. The controller 30 can calculate the actual rotation angle of the antenna 10 based on the coordinate data of the three axes of X, Y, and Z, and compare the actual rotation angle of the antenna with the theoretical rotation angle to calculate the angle difference between the actual rotation angle and the theoretical rotation angle. The theoretical rotation angle can refer to the rotation angle specified by the antenna rotation instruction. For example, the user sends a clockwise rotation instruction of 30° to the router through the mobile phone APP. The theoretical rotation angle is 30° in the clockwise direction. The controller 30 may send a second motor driving signal to the driving device 20 based on the calculated angle difference, so that the driving device 20 may drive the antenna 10 to perform a compensating rotation for the angle difference based on the second motor driving signal.

[0071] like Figure 3As shown, the kernel layer includes motor driver and magnetometer driver, and the hardware layer includes motor and magnetometer.

[0072] When the router receives the antenna rotation instruction, the first software at the application layer can obtain the first rotation angle to be issued in this rotation process by executing the antenna control algorithm, and send the first rotation angle to the motor driver at the kernel layer. The motor driver drives the motor to rotate the antenna 10 based on the first rotation angle issued by the application layer. The magnet can rotate with the rotation of the disk.

[0073] The magnetometer at the hardware layer can detect the magnetic field data of the three axes X, Y, and Z as the magnet rotates with the disk, and convert the magnetic field data of the three axes X, Y, and Z into coordinate data of the three axes X, Y, and Z and feed it back to the magnetometer driver at the kernel layer. The magnetometer driver passes the coordinate data of the three axes X, Y, and Z to the first software at the application layer, and the first software can calculate the rotation angle of the magnet based on the coordinate data of the three axes X, Y, and Z. The rotation angle of the magnet is the actual rotation angle of the antenna 10.

[0074] In some embodiments, the turntable rotates on a two-dimensional plane, that is, the magnet also rotates on a two-dimensional plane, and the magnetic field data of the three axes X, Y, and Z detected by the magnetometer only have two axes whose magnetic field data change greatly, and the magnetic field data of the other axis remains basically unchanged. The two axes whose magnetic field data change greatly can be any two axes of the three axes X, Y, and Z, which is related to the installation position of the magnetometer and the definition of the magnetometer coordinate system, and this application does not limit this. Assuming that the two axes whose magnetic field data change greatly are the X and Y axes, the first software can calculate the actual rotation angle of the antenna 10 based on the coordinate data of the X and Y axes.

[0075] For example, a turntable coordinate system can be constructed using the surface of the turntable (the plane where the magnet is located), and the coordinate data of the X and Y axes of the magnet in the magnetometer coordinate system can be converted to the turntable coordinate system. Then, based on the coordinates in the turntable coordinate system, the rotation angle of the magnet can be obtained, which is the actual rotation angle of the antenna 10.

[0076] In some embodiments, the first software can also perform linear fitting on the coordinate data of the X and Y axes in the magnetometer coordinate system, and determine the coordinates of the magnet at the start and end of the rotation based on the linear fitting results, so as to facilitate the subsequent conversion of the coordinates of the start and end of the rotation to the turntable coordinate system to obtain the rotation angle of the magnet. Linear fitting can refer to the process of seeking the best k (slope) and b (intercept) values ​​based on multiple sets of X and Y axis coordinate data (coordinate data sensed by the magnetometer from the start to the end of the rotation of the magnet). For example, after determining the k and b values, the starting point and end point of the straight line determined by k and b can be used as the coordinates of the magnet at the start and end of the rotation.

[0077] After obtaining the actual rotation angle of the antenna 10, the first software at the application layer can compare the actual rotation angle with the theoretical rotation angle to obtain the angle difference between the actual rotation angle and the theoretical rotation angle. The first software can send a second rotation angle to the motor driver at the core layer based on the angle difference. The motor driver drives the motor to drive the antenna 10 to perform a compensatory rotation of the angle difference based on the second rotation angle sent by the application layer.

[0078] The above hardware-based angle error compensation solution obtains the actual rotation angle of the antenna through the magnetometer each time the antenna is driven to rotate, and performs compensatory rotation according to the difference between the actual rotation angle and the theoretical rotation angle, thereby compensating for the rotation angle error and improving the accuracy of the antenna rotation.

[0079] In some embodiments, due to the design of the hardware structure of the driving device 20 or the design of the antenna 10, there may be an area that cannot be reached by rotation. Figure 4 As shown, it is assumed that the inaccessible area Ar1 is 45° and the accessible area Ar2 is 315°. When the antenna rotates to the edge of area Ar1, the motor will be stalled at the edge of area Ar1. Long-term stalling may cause the temperature of the motor to rise, damage the motor components and reduce the service life of the motor. For example, when the angle formed by the current position of the antenna and the edge of area Ar1 is less than the target rotation angle, the motor will continue to be stalled at the edge of area Ar1.

[0080] In the actual application scenarios of routers, when the antenna is rotating, the motor's rotation resistance may increase due to obstruction by people or objects. The motor may experience a surge in load due to the increase in rotation resistance. The increase in load will intensify the rise in motor temperature, which may damage the motor's components and reduce the motor's service life.

[0081] For the above-mentioned abnormal scenarios of stalling due to the inaccessible area caused by rotation or obstruction by people / objects, the embodiment of the present application also proposes a solution based on a magnetometer.

[0082] Specifically, the magnetometer can be used to sense the rotation angle of the antenna. During the process of the motor driving the antenna to rotate, by comparing the changes in the magnetic field data sensed by the magnetometer within a certain period of time, it can be determined whether the antenna has rotated a certain angle, thereby determining whether there is a stall or other abnormal situation that causes the motor resistance to increase. If the change in the magnetic field data sensed by the magnetometer does not meet the preset requirements within a certain period of time, it can be considered that the motor rotation is abnormal. In this case, the motor can be controlled to stop rotating to avoid damage to the motor parts and extend the service life of the motor. If the change in the magnetic field data sensed by the magnetometer meets the preset requirements within a certain period of time, it can be considered that the motor rotation is normal and no additional processing is required until the motor completes the rotation task and stops rotating automatically.

[0083] Reference Figure 5 As shown, the specific implementation scheme is as follows:

[0084] (1) The first software located in the application layer sends an instruction to the magnetometer driver to obtain the rotation angle of the antenna. The magnetometer driver can drive the magnetometer based on the instruction to sense the rotation angle of the antenna in real time. For example, the magnetometer can convert the sensed magnetic field data of the three axes of X, Y, and Z into coordinate data of the three axes of X, Y, and Z and feed it back to the magnetometer driver located in the core layer. The magnetometer driver passes the coordinate data of the three axes of X, Y, and Z to the first software located in the application layer. The first software can record the coordinate data of the three axes of X, Y, and Z, and determine the rotation angle of the antenna based on the coordinate data of the three axes of X, Y, and Z;

[0085] (2) The first software starts a timer. The timer interval can be set according to actual detection requirements, and the embodiment of the present application does not limit this. For example, the timer interval is 140 ms, and the motor can drive the antenna to rotate by an angle of 5° or more in 140 ms. When the timer is started, the first software can record the first coordinate data of the three axes X, Y, and Z currently sensed by the magnetometer;

[0086] (3) The first software sends a command for driving the motor to rotate (the command includes a rotation angle) to the motor driver, and the motor driver drives the motor to start rotating based on the command, thereby driving the antenna and the magnet to rotate;

[0087] (4) When the timer expires, the first software obtains the second coordinate data of the X, Y, and Z axes currently sensed by the magnetometer, and obtains the rotation angle of the antenna within 140ms based on the first coordinate data and the second coordinate data. If the rotation angle is less than 5°, it is considered that the motor has abnormal rotation. The first software sends a command to stop the rotation of the generator to the motor drive to stop the driving motor from rotating. If the rotation angle is greater than or equal to 5°, it is considered that the motor is rotating normally, and process (5) is executed;

[0088] (5) Repeat steps (2) to (4) until the accumulated timing time of the timer is greater than the rotation time set for the motor.

[0089] For example, corresponding to different rotation angles, different rotation times can be pre-set for the motor, and the greater the rotation angle, the greater the rotation time.

[0090] In some embodiments, after the motor stops rotating due to abnormal rotation, the router can also output abnormal rotation information to the terminal device connected to it, so that the APP on the terminal device side can output preset prompt information based on the abnormal rotation information to remind the user to check whether the router antenna is blocked by people or objects, or whether a stall occurs.

[0091] In some embodiments, if there is an area where the antenna of the router cannot be reached during rotation, the blocking feature can be used to avoid angle accumulation errors and improve the accuracy of antenna rotation.

[0092] In the process of driving the antenna to rotate, the antenna position can be calibrated first. The calibration method can be that the first software issues a rotation instruction of a larger angle, for example, a rotation instruction of 360°, so that the motor drives the antenna to rotate a larger angle, and the antenna is stuck at the baffle position, causing the motor to be blocked, and the antenna then rotates with the baffle position as the starting rotation position. The specific implementation plan is as follows:

[0093] (1) Using the stall mechanism, the first software sends a preset rotation angle to the motor driver, and the motor driver drives the motor to drive the antenna to rotate from the current position until it is stuck at the baffle position, the motor is stalled, and the motor stops rotating;

[0094] (2) Assumptions Indicates the rotation angle pre-issued by the antenna control algorithm in this rotation process, based on Convert the rotation angle based on the baffle position It can be obtained based on the antenna rotation instruction received by the router this time;

[0095] For example, the rotation angle from the current position to the baffle position can be recorded, and then based on Converted to the rotation angle Assuming that the motor is a stepper motor, when the stepper driver receives a PWM signal, the stepper driver drives the stepper motor to rotate a fixed angle (i.e., step angle) in the set direction. By counting the number of PWM signals from the current position to the baffle position, and then based on the corresponding relationship between the preset antenna rotation angle and the step angle, the rotation angle from the current position to the baffle position is determined.

[0096] For example, in the process of driving the antenna to rotate, To rotate 60° clockwise from the current position, assuming that the rotation angle from the current position to the baffle position is 130°, the rotation angle based on the baffle position can be obtained Rotate 70° counterclockwise.

[0097] (3) Based on the baffle position, the first software sends the rotation angle To the motor drive, the motor drive drives the motor to drive the antenna to rotate.

[0098] See also Figure 6 As shown, the antenna rotation control method provided by the embodiment of the present application is described. The antenna rotation control method is described by taking the application of a router as an example, and the router includes a rotatable antenna. The antenna rotation control method includes:

[0099] S601: Receive an antenna rotation instruction, where the antenna rotation instruction includes a first rotation angle.

[0100] The antenna rotation instruction may be issued by the terminal device. For example, after the terminal device establishes a connection with the router, the user may issue the antenna rotation instruction through an application installed in the terminal device. The antenna rotation instruction includes the first rotation angle in this rotation process, and the first rotation angle includes the rotation direction and the rotation angle. For example, the first rotation angle is 60° clockwise rotation, that is, the rotation direction is clockwise and the rotation angle is 60°.

[0101] S602: Obtain the previous rotation angle of the antenna during the last rotation.

[0102] The previous rotation angle of the antenna in the last rotation process may refer to the rotation angle of the antenna after the last rotation process. If the current rotation process is the first rotation of the antenna, that is, since there is no previous rotation angle record of the last rotation process, the antenna can be driven to rotate directly based on the first rotation angle, and steps S603 to S606 do not need to be performed again.

[0103] S603: Determine a second rotation angle of the antenna for this rotation based on the first rotation angle and the previous rotation angle.

[0104] For example, the previous rotation angle of the last rotation process for: is the rotation direction of the antenna during the last rotation process, The rotation angle of the antenna in the last rotation process. for: is the rotation direction of the antenna in the current rotation process, is the rotation angle of the antenna in the current rotation process, the second rotation angle Obtained through the following formula:

[0105] is the actual rotation direction of the antenna in this rotation process, is the actual rotation angle of the antenna in this rotation process, where:

[0106] or

[0107] S604: Determine a third rotation angle for the antenna based on the previous rotation angle.

[0108] The third rotation angle Can be: and have opposite directions.

[0109] In some embodiments, step S603 and step S604 may be executed in parallel, or step S604 may be executed before step S603.

[0110] S605: Drive the antenna to rotate based on the third rotation angle.

[0111] After determining the third rotation angle of the antenna, the antenna can be driven to rotate based on the third rotation angle, that is, according to Indicates the direction to drive the antenna to rotate

[0112] S606: When the rotation is completed, drive the antenna to rotate based on the second rotation angle.

[0113] After the rotation is completed, the antenna is driven to rotate based on the second rotation angle, that is, according to Indicates the direction to drive the antenna to rotate

[0114] In some embodiments, after driving the antenna to rotate based on the second rotation angle, the previous rotation angle that the antenna needs to follow when rotating next time can be determined based on the second rotation angle. Updated to So that in the next antenna rotation process, the rotation angle of the antenna is

[0115] In some embodiments, in order to further improve the position accuracy of the antenna rotation, the router may also be provided with a test piece that can rotate synchronously with the antenna, and a sensor for sensing the position information of the test piece. For example, the test piece is a magnet, and the sensor is a magnetometer. The embodiments of the present application do not limit the types of the test piece and the sensor. By using the sensor to obtain the actual rotation angle of the antenna (i.e., the rotation angle of the test piece) during the process of driving the antenna to rotate, and performing compensatory rotation according to the difference between the actual rotation angle of the antenna and the theoretical rotation angle, the angle error existing in the antenna rotation process can be further reduced, thereby improving the accuracy of the antenna rotation.

[0116] For example, in the process of driving the antenna to rotate based on the second rotation angle, the sensing data of the sensor (hereinafter referred to as the first sensing data) can be obtained. When the antenna stops rotating, the actual rotation angle of the antenna is determined based on the first sensing data, and then the compensation rotation angle is determined based on the difference between the actual rotation angle and the second rotation angle. Finally, the antenna is driven to rotate based on the compensation rotation angle.

[0117] For example, in the process of driving the antenna to rotate based on the third rotation angle, the sensing data of the sensor (hereinafter referred to as the second sensing data) is obtained. When the antenna finishes rotating, the actual rotation angle of the antenna is determined based on the second sensing data, and then the compensation rotation angle is determined based on the difference between the actual rotation angle and the third rotation angle. Finally, the antenna is driven to rotate based on the compensation rotation angle.

[0118] In the actual application scenario of the router, during the rotation of the antenna, the motor's rotation resistance may increase due to the obstruction of people / objects. The motor may cause a surge in load due to the increase in rotation resistance. The increase in load will aggravate the rise in motor temperature, which may damage the motor's components and reduce the motor's service life. In order to solve the abnormal scenario of stalling or obstruction of people / objects due to the inaccessible area caused by rotation, the rotation angle of the antenna can be detected once every preset time when the antenna is driven to rotate. If the rotation angle within the preset time is less than the preset angle, it is considered that the motor rotation may be abnormal, and the driving of the antenna to rotate is stopped to avoid damage to the motor's components and extend the service life of the motor. Specifically, when the antenna is driven to rotate, the rotation angle of the antenna is determined based on the first sensing data at every preset time. When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, the driving of the antenna to rotate is stopped.

[0119] See also Figure 7 The figure shows an antenna rotation control method provided by an embodiment of the present application. The antenna rotation control method can be applied to a router, wherein the router includes a rotatable antenna, and the router is also provided with a device to be tested that can rotate synchronously with the antenna, and a sensor for sensing position information of the device to be tested. The antenna rotation control method includes:

[0120] S701, receiving an antenna rotation instruction, where the antenna rotation instruction includes a first rotation angle.

[0121] Step S701 of the embodiment of the present application is similar to step S601 of the aforementioned embodiment, and will not be described again here to avoid repetition.

[0122] S702: Drive the antenna to rotate based on the first rotation angle, and obtain sensing data of the sensor.

[0123] After receiving the antenna rotation instruction, the antenna can be driven to rotate based on the first rotation angle, and sensing data of the sensor can be acquired to facilitate subsequent determination of the actual rotation angle of the antenna.

[0124] S703: When the antenna finishes rotating, determine the actual rotation angle of the antenna based on the sensing data.

[0125] When the antenna is driven to stop rotating based on the first rotation angle, the actual rotation angle of the antenna is determined based on the sensing data, so as to facilitate the subsequent determination of the difference between the actual rotation angle and the first rotation angle for supplementary rotation.

[0126] In some embodiments, the object to be tested can be a magnet, the sensor is a magnetometer, the magnet can be embedded in a turntable, and the antenna can also be fixedly mounted on the turntable. The magnetometer can convert the sensed magnetic field data of the three axes of X, Y, and Z into coordinate data of the three axes of X, Y, and Z and output them. Since the magnet rotates on a two-dimensional plane, the magnetic field data of the three axes of X, Y, and Z detected by the magnetometer only have two axes with relatively large changes in magnetic field data, and the magnetic field data of the other axis remains basically unchanged. The rotation angle of the magnet can be obtained by selecting two-axis coordinate data representing the rotation of the magnet from the three-axis coordinate data and converting based on the two-axis coordinate data. The rotation angle of the magnet is the actual rotation angle of the antenna.

[0127] For example, the two-axis coordinate data can be linearly fitted, and the starting and ending two-axis coordinates of the magnet in the magnetometer coordinate system can be obtained based on the linear fitting results; the starting and ending two-axis coordinates of the magnet in the magnetometer coordinate system can be converted into the starting and ending two-axis coordinates in the target coordinate system, the target coordinate system is a two-axis coordinate system based on the plane where the magnet is located, and finally the rotation angle of the magnet can be obtained based on the starting and ending two-axis coordinates of the magnet in the target coordinate system.

[0128] S704: Determine a second rotation angle based on a difference between the actual rotation angle and the first rotation angle.

[0129] After obtaining the actual rotation angle of the antenna, the difference between the actual rotation angle and the first rotation angle can be calculated to determine the second rotation angle. For example, if the first rotation angle is 60° clockwise, and it is determined that the actual rotation angle of the antenna is 55° clockwise, the second rotation angle is 5° clockwise.

[0130] S705: driving the antenna to rotate based on the second rotation angle.

[0131] After the second rotation angle is obtained, the antenna can continue to be driven to rotate based on the second rotation angle to compensate for the angle error existing in the rotation of the antenna and improve the accuracy of the rotation position of the antenna.

[0132] In some embodiments, when the antenna is driven to rotate, the rotation angle of the antenna can also be determined based on the first sensing data at preset time intervals. When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, the driving of the antenna to rotate is stopped. This can solve abnormal scenarios such as stalling due to inaccessible areas due to rotation or obstruction by people / objects, avoid damage to motor components, and extend the service life of the motor.

[0133] See also Figure 8 , introduces an example of an application scenario of the antenna rotation control method in an embodiment of the present application.

[0134] like Figure 8 As shown, taking the antenna rotation control method applied to an indoor home wireless router 100 as an example, a user can access the router 100 through the client 200 to realize the rotation control of the antenna of the router 100. The client 200 can be a mobile phone, a tablet computer and other devices. The client 200 can be installed with a router management APP, such as Honor Smart Space.

[0135] Since the angle of the router antenna will affect the coverage of the wireless network signal, or in a home scenario, the antenna at certain angles may be blocked by objects or walls and affect the coverage or quality of the wireless network signal. Therefore, in actual use, the user may need to adjust the antenna angle due to different locations in the home, or the user may need to adjust the antenna angle in order to maximize the coverage of the wireless network signal.

[0136] When the user wants to adjust the antenna angle of the router 100, the user can log in to the router management APP of the client 200. The interface of the router management APP can display the current angle of the antenna, and can support the user to set the rotation angle of the antenna, that is, the user can set the rotation direction and rotation angle of the antenna in the interface of the router management APP. After setting the rotation direction and rotation angle of the antenna, the user can confirm to start the antenna rotation of the router 100 in the interface of the router management APP. For example, the user can confirm to start the antenna rotation of the router 100 by clicking the "rotate" icon in the interface, triggering the client 200 to send the antenna rotation instruction to the router 100, and the antenna rotation instruction carries the rotation direction and rotation angle of the antenna driven to rotate this time.

[0137] After receiving the antenna rotation instruction sent by the client 200, the router 100 can respond to the antenna rotation instruction by Figure 6 or Figure 7 The antenna rotation control method controls the antenna to rotate.

[0138] In some embodiments, after establishing a communication connection with the client 200, the router 100 may also send the current angle of the antenna to the client 200 at preset intervals, so that the router management APP can timely update the current angle of the antenna displayed therein.

[0139] Fig. 9Schematic diagram of a router in an embodiment of the present application. Router 100 includes a processor 1001, a memory 1002 coupled to the processor 1001, and a transceiver 1003. Processor 1001 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP. Processor 1001 may also be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Processor 1001 may refer to one processor or may include multiple processors. Transceiver 1003 is used to send and receive data. For example, received data may be sent to processor 1001 for processing. Transceiver 1003 includes a rotatable antenna. The memory 1002 may include a volatile memory, such as a random-access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 1002 may also include a combination of the above-mentioned types of memory. One or more computer programs 1004 are stored in the memory 1002. The one or more computer programs 1004 are configured to be executed by the processor 1001. The one or more computer programs 1004 include instructions, and the above instructions can be used to implement the execution of the following in the router 100: Figure 6 or Figure 7 The antenna rotation control method.

[0140] This embodiment also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on a router, the router executes the above-mentioned related method steps to implement the antenna rotation control method in the above-mentioned embodiment.

[0141] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the antenna rotation control method in the above-mentioned embodiment.

[0142] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the antenna rotation control method in the above-mentioned method embodiments.

[0143] Among them, the router, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0144] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0147] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.

[0149] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. An antenna rotation control method, applied to a network device, characterized in that: The network device includes a rotatable antenna, and the method includes: receiving an antenna rotation instruction, wherein the antenna rotation instruction includes a first rotation angle; Obtaining a previous rotation angle of the antenna during a previous rotation; Determine a second rotation angle for rotating the antenna this time based on the first rotation angle and the previous rotation angle; Determining a third rotation angle of the antenna based on the previous rotation angle; Driving the antenna to rotate based on the third rotation angle; When the rotation is completed, the antenna is driven to rotate based on the second rotation angle.

2. The method according to claim 1, characterized in that After driving the antenna to rotate based on the second rotation angle, the method further includes: Based on the second rotation angle, a previous rotation angle according to which the antenna should rotate next time is determined.

3. The method according to claim 1 or 2, characterized in that The previous rotation angle θ of the antenna during the last rotation o d,a It is expressed as: indicates the previous rotation direction of the antenna in the last rotation, represents the previous rotation angle of the antenna during the last rotation, the third rotation angle It is expressed as: and having opposite directions; The first rotation angle It is expressed as: is the pre-rotation direction of the antenna for this rotation, is the pre-rotation angle of the antenna for this rotation, and the second rotation angle Obtained through the following formula: is the actual rotation direction of the antenna in this rotation, is the actual rotation angle of the antenna in this rotation, where or 4. The method according to any one of claims 1 to 3, characterized in that The network device is further provided with a device under test that can rotate synchronously with the antenna, and a sensor for sensing position information of the device under test, and the driving the antenna to rotate based on the second rotation angle includes: driving the antenna to rotate based on the second rotation angle, and acquiring first sensing data of the sensor; When the antenna stops rotating, determining an actual rotation angle of the antenna based on the first sensing data; Determining a compensation rotation angle based on a difference between the actual rotation angle and the second rotation angle; The antenna is driven to rotate based on the compensation rotation angle.

5. The method according to claim 4, characterized in that The driving the antenna to rotate based on the third rotation angle comprises: driving the antenna to rotate based on the third rotation angle, and acquiring second sensing data of the sensor; When the antenna finishes rotating, determining an actual rotating angle of the antenna based on the second sensing data; Determining a compensation rotation angle based on a difference between the actual rotation angle and the third rotation angle; The antenna is driven to rotate based on the compensation rotation angle.

6. The method according to claim 4, characterized in that The method further comprises: In a case where the antenna is driven to rotate, determining a rotation angle of the antenna based on the first sensing data at every preset time; When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, driving the antenna to rotate is stopped.

7. An antenna rotation control method, applied to a network device, characterized in that: The network device includes a rotatable antenna, a device to be tested that can rotate synchronously with the antenna, and a sensor for sensing position information of the device to be tested. The method includes: receiving an antenna rotation instruction, wherein the antenna rotation instruction includes a first rotation angle; driving the antenna to rotate based on the first rotation angle, and acquiring sensing data of the sensor; When the antenna stops rotating, determining an actual rotation angle of the antenna based on the sensing data; Determining a second rotation angle based on a difference between the actual rotation angle and the first rotation angle; The antenna is driven to rotate based on the second rotation angle.

8. The method according to claim 7, characterized in that The object to be tested is a magnet, the sensor is a magnetometer, and acquiring sensing data of the sensor includes: Acquire the three-axis coordinate data of the magnet sensed by the magnetometer in the magnetometer coordinate system; The determining the actual rotation angle of the antenna based on the sensing data comprises: Selecting two-axis coordinate data representing the rotation of the magnet from the three-axis coordinate data, and determining the rotation angle of the magnet based on the two-axis coordinate data; The rotation angle of the magnet is taken as the actual rotation angle of the antenna.

9. The method according to claim 8, characterized in that The determining the rotation angle of the magnet based on the two-axis coordinate data comprises: Performing linear fitting processing on the two-axis coordinate data, and obtaining the starting two-axis coordinates and the ending two-axis coordinates of the magnet rotating in the magnetometer coordinate system based on the linear fitting result; Convert the starting two-axis coordinates and the ending two-axis coordinates of the magnet in the magnetometer coordinate system into the starting two-axis coordinates and the ending two-axis coordinates in the target coordinate system, wherein the target coordinate system is a two-dimensional coordinate system constructed based on the plane where the magnet is located; The rotation angle of the magnet is determined based on the starting two-axis coordinates and the ending two-axis coordinates of the magnet in the target coordinate system.

10. The method according to claim 7, characterized in that The method further comprises: In a case where the antenna is driven to rotate, determining a rotation angle of the antenna based on the sensing data at every preset time; When it is determined that the rotation angle of the antenna within the preset time is less than the preset angle, driving the antenna to rotate is stopped.

11. A network device, characterized in that: The network device memory and processor; The memory is used to store program instructions; The processor is used to read the program instructions stored in the memory to implement the antenna rotation control method as described in any one of claims 1 to 6, or to implement the antenna rotation control method as described in any one of claims 7 to 10.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the antenna rotation control method as described in any one of claims 1 to 6 is implemented, or the antenna rotation control method as described in any one of claims 7 to 10 is implemented.

13. A chip coupled to a memory in a network device, characterized in that: The chip is used to control the network device to execute the antenna rotation control method as described in any one of claims 1 to 6, or to execute the antenna rotation control method as described in any one of claims 7 to 10.

Citation Information

Patent Citations

  • Automatic compensation method based on angular speed meter of mobile satellite antenna

    CN102539838A

  • Magnetic angle encoder and electronic water meter

    CN103913183A

  • Camera rotating control method used for mobile terminal and mobile terminal

    CN104301609A

  • Automatic reset control device and method for rotation system, wet-spraying machine and storage medium

    CN110501953A

  • Antenna component and client terminal equipment

    CN110931976A