Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
For a better understanding of the aspects of the embodiments of the present application, the following description will first be made with respect to terms and concepts that may be related to the embodiments of the present application, and the following description is made with respect to the principle of UWB ranging:
Two-Way Time of Flight (TW-TOF), for example, each UWB module generates an independent Time stamp from start-up. The transmitter of UWB module a transmits a pulse signal of a requested nature at Ta1 on its time stamp, UWB module B transmits a signal of a responsive nature at time Tb2, which is received by UWB module a at its own time stamp Ta2, whereby the time of flight of the pulse signal between the two UWB modules can be calculated, and the flight distance S, s= C x [ (Ta 2-Ta 1) - (Tb 2-Tb 1) ] (C is the speed of light) is determined.
The TOF ranging method belongs to Two-way ranging technology (Two WAY RANGING, TWR), which mainly uses the time of flight of signals between Two asynchronous transceivers (transceivers) to measure the distance between nodes. Since the TOF-based ranging method is linear with distance in a line-of-sight environment, the result is more accurate. The time interval between the data packet sent by the sending end and the response received by the receiving end is marked as TTAT, and then the time TTOF of the data packet in one-way flight in the air can be calculated as: ttof= (TTOT-TTAT)/2, and then the distance d=cxttof between the two points can be calculated according to the performance of TTOF and the propagation speed of electromagnetic wave. The method of UWB ranging is not described in detail herein.
In the following description of the control system based on the ultra wideband ranging according to the embodiment of the present application with reference to fig. 1, fig. 1 is a schematic diagram of an architecture of the control system based on the ultra wideband ranging according to the embodiment of the present application, where the control system 100 includes an ultra wideband chip 110, a processor 120, a crystal oscillator 130, and a memory 140, the ultra wideband chip 110 includes an ultra wideband protocol unit 111, an ultra wideband radio frequency transceiver unit 112, the ultra wideband chip 110 is respectively connected to the processor 120 and the crystal oscillator 130, the processor 120 is further connected to the memory 140, where the ultra wideband protocol unit 110 is connected to the ultra wideband radio frequency transceiver unit 112, the ultra wideband protocol unit 110 may be a micro control unit (Microcontroller Unit, MCU) for controlling the ultra wideband radio frequency unit 112 to send signals and receive signals, the ultra wideband radio frequency transceiver unit 112 may be a radio frequency transceiver for transmitting and receiving signals, and also may be used for receiving clock signals of the crystal oscillator 130 and transferring to the processor 120, the processor 120 may call a detection algorithm from the memory 140 to process the clock signal to control whether the ultra wideband radio frequency transceiver unit 112 starts to send signals, i.e. to the ultra wideband radio frequency transceiver unit 112 starts sending instructions.
In the following, description will be given of functional units of a control system according to an embodiment of the present application with reference to fig. 2, fig. 2 is a schematic diagram of functional units of a control system based on ultra wideband ranging according to an embodiment of the present application, specifically including a UWB protocol control unit 210, a UWB radio frequency transceiver unit 220, a crystal unit 230, and a clock detection unit 240, where the UWB protocol control unit 210 is respectively connected to the UWB radio frequency transceiver unit 220 and the clock detection unit 240, the UWB radio frequency transceiver unit 220 is respectively connected to the crystal unit 230 and the clock detection unit 240, specifically, the UWB radio frequency transceiver unit 220 may acquire a clock signal of the crystal unit 230 and send the clock signal to the clock detection unit 240, the clock detection unit 240 may analyze the acquired clock signal to determine whether the operation state of the crystal unit 230 is stable, and then send a relevant notification message to the UWB protocol control unit 210 based on the operation state of the crystal unit 230,
Through the system architecture, the state of the crystal vibrator can be automatically determined to determine the time for starting UWB ranging before UWB ranging, the situation that the crystal vibrator is unstable is avoided, and the ranging accuracy is greatly improved.
The following describes a control method based on ultra wideband in the embodiment of the present application with reference to fig. 3, where the method is applied to a control system based on ultra wideband ranging, the system includes an ultra wideband chip, a processor, a crystal oscillator, and a memory, the ultra wideband chip includes an ultra wideband protocol unit, an ultra wideband radio frequency transceiver unit, the ultra wideband chip is respectively connected to the processor and the crystal oscillator, the processor is further connected to the memory, and fig. 3 is a flow diagram of the control method based on ultra wideband provided by the embodiment of the present application, and specifically includes the following steps:
in step 301, the processor invokes a clock detection algorithm built in the memory to acquire clock data of the crystal oscillator.
The memory is internally provided with a related clock detection algorithm, the clock detection algorithm can be used for acquiring clock data of the crystal oscillator and analyzing and processing the clock data, specifically, the processor can receive the clock data, i.e. clock signals, of the crystal oscillator within a preset period, which are sent by the ultra-wideband radio frequency transceiver unit, and it can be understood that the clock data are clock signals of the crystal oscillator within a period.
When the ultra-wideband radio frequency transceiver unit is in a restarting state, the clock signal of the crystal oscillator is acquired in the preset period, the restarting state can comprise any one of starting, powering up again, resetting and restarting, and it can be understood that the restarting state of the ultra-wideband radio frequency transceiver unit is triggered by the ultra-wideband protocol control unit as long as the ultra-wideband radio frequency transceiver unit is converted from a dormant state to a working state.
Therefore, the processor calls a clock detection algorithm built in the memory to acquire clock data of the crystal oscillator, so that the UWB module can be prevented from ranging when the UWB module is just awakened, and the situation that the accuracy of the ranging is low due to instability of the crystal oscillator is avoided.
In step 302, the processor determines a working state of the crystal oscillator according to the clock data.
Wherein the operating state comprises a steady state representing a frequency of the crystal oscillator proximate to the nominal frequency.
Specifically, the processor may calculate frequency data of the crystal oscillator in a preset period according to the clock data, split the preset period into a plurality of first sampling periods and a plurality of second sampling periods, calculate a frequency value of the crystal oscillator once every other first sampling period, calculate a maximum frequency and a minimum frequency in the current second sampling period once every other second sampling period, and the duration of the second sampling period is an integer multiple of the first sampling period. For example, as shown in fig. 4, fig. 4 is a schematic diagram of frequency variation of a crystal oscillator according to an embodiment of the present application, it can be seen that the preset period is composed of four second sampling periods Δt2, each second sampling period Δt2 is composed of four first sampling periods Δt1, the processor calculates the frequency of the crystal oscillator once every Δt1, determines the maximum frequency fmax_k and the minimum frequency fmin_k of each Δt2, obtains the ratio Δfk/f0 between the frequency difference data Δfk of the maximum frequency fmax_k and the minimum frequency fmin_k and the nominal frequency f0, the nominal frequency f0 is configured to the memory by the ultra wideband protocol control unit, and indicates the frequency at which the crystal oscillator operates normally,
When Δfk/f0 is less than a preset threshold, the processor determines that the crystal oscillator is in the steady state;
and when the delta fk/f0 is larger than or equal to the preset threshold value, the processor determines that the crystal oscillator is in an unstable state.
The above-mentioned preset threshold is also preconfigured by the ultra wideband protocol control unit, and is not limited herein, and it should be noted that fig. 4 is a case where Δfk/f0 is determined to be smaller than the preset threshold only in the fourth second sampling period Δt2, and if Δfk/f0 is determined to be smaller than the preset threshold in the first second sampling period Δt2, it may be determined that the crystal oscillator is in a stable state without waiting for the preset period to reach the time limit.
Therefore, the working state of the crystal oscillator is determined by the processor according to the clock data, whether the crystal oscillator is stable or not can be determined before UWB ranging, and the problem that the accuracy is lower due to direct ranging when the crystal oscillator is unstable is avoided.
Step 303, in the stable state, the processor sends a first notification message to the ultra wideband protocol unit.
The first notification message is used to enable the UWB protocol unit to control the UWB transceiver unit to transmit signals and receive signals, i.e., start ranging, and the UWB ranging process is not described herein.
By the method, the state of the crystal vibrator can be automatically determined to determine the time for starting UWB ranging before UWB ranging, and the ranging accuracy is greatly improved.
The following describes another control method based on ultra-wideband ranging in the embodiment of the present application with reference to fig. 5, where the method is applied to a control system based on ultra-wideband ranging, the system includes an ultra-wideband chip, a processor, a crystal oscillator, and a memory, the ultra-wideband chip includes an ultra-wideband protocol unit, an ultra-wideband radio frequency transceiver unit, the ultra-wideband chip is respectively connected to the processor and the crystal oscillator, the processor is further connected to the memory, and fig. 5 is a flow diagram of another control method based on ultra-wideband ranging provided in the embodiment of the present application, and specifically includes the following steps:
in step 501, the processor invokes a clock detection algorithm built in the memory to acquire clock data of the crystal oscillator.
Step 502, the processor determines the working state of the crystal oscillator according to the clock data.
Wherein the operating state comprises an unstable state.
In step 503, in the unstable state, the processor continues to receive clock data of the crystal oscillator in a maximum sampling period and determines an operating state of the crystal oscillator according to the clock data.
Wherein the maximum sampling period indicates a preset period, that is, the processor continues to receive the clock signal of the crystal oscillator sent by the ultra wideband radio frequency transceiver unit in the preset period, and as illustrated by the example in fig. 4,
It can be seen that the preset period is composed of four second sampling periods Δt2, and each second sampling period Δt2 is composed of four first sampling periods Δt1, the processor calculates the frequency of the crystal oscillator once every Δt1, determines the maximum frequency fmax_k and the minimum frequency fmin_k of each Δt2, and obtains the ratio Δfk/f0 between the frequency difference data Δfk of the maximum frequency fmax_k and the minimum frequency fmin_k and the nominal frequency f0, the nominal frequency f0 is configured to the memory by the ultra wideband protocol control unit, at this time, the frequency representing the normal operation frequency of the crystal oscillator is greater than or equal to the preset threshold value in the first Δt2, the processor determines that the crystal oscillator is in an unstable state, at this time, and further calculates the ratio Δfk/f0 between the frequency difference data Δfk of the maximum frequency fmax_k and the minimum frequency fmin_k and the nominal frequency f0, and the nominal frequency f0 is not smaller than the preset threshold value in the first Δt2, and the second Δfk/f0 can be further processed in the fourth step 504, and the fourth step Δf0 is not smaller than the preset threshold value in the first Δt2, and the fourth step 504 can be further described.
Therefore, in the unstable state, the processor continuously receives clock data of the crystal oscillator in the maximum sampling period and determines the working state of the crystal oscillator according to the clock data, so that the UWB module can be prevented from ranging immediately after being awakened.
Step 504, if the working state is still the unstable state when the maximum sampling period is exceeded, the processor sends a second notification message to the ultra wideband protocol unit.
The second notification message indicates that the crystal oscillator is in fault, so that the processor is prevented from detecting the crystal oscillator all the time, a user is reminded of repairing the UWB module in time, and the use experience is greatly improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional units of the electronic device according to the method example, for example, each functional unit can be divided corresponding to each function, and two or more functions can be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
An electronic device according to an embodiment of the present application will be described in detail below with reference to fig. 6, where fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application, and includes a processor 610, a memory 620, a communication interface 630, and one or more programs 621, where the one or more programs 621 are stored in the memory 620 and configured to be executed by the processor 610, and the one or more programs 621 include instructions for executing any steps in the method embodiments. The electronic device 600 includes a control system based on ultra wideband ranging, the system includes an ultra wideband chip, a processor, a crystal oscillator, and a memory, the ultra wideband chip includes an ultra wideband protocol unit, an ultra wideband radio frequency transceiver unit, the ultra wideband chip is respectively connected to the processor and the crystal oscillator, the processor is also connected to the memory,
In one possible embodiment, the program 621 includes instructions for performing the steps of:
acquiring clock data of the crystal oscillator;
determining a working state of the crystal oscillator according to the clock data, wherein the working state comprises a stable state;
And in the stable state, a first notification message is sent to the ultra-wideband protocol unit, and the first notification message is used for enabling the ultra-wideband protocol unit to control the ultra-wideband radio frequency transceiver unit to transmit signals and receive signals.
Firstly, the processor calls a clock detection algorithm built in the memory to acquire clock data of the crystal oscillator; the processor determines the working state of the crystal oscillator according to the clock data, wherein the working state comprises a stable state; and in the stable state, the processor sends a first notification message to the ultra-wideband protocol unit, wherein the first notification message is used for enabling the ultra-wideband protocol unit to control the ultra-wideband radio frequency transceiver unit to transmit signals and receive signals. The state of the crystal vibrator can be automatically determined to determine the time for starting UWB ranging before UWB ranging, and the ranging accuracy is greatly improved.
In an alternative embodiment, the instructions in the program 621 are specifically configured to, in terms of invoking the clock detection algorithm built in the memory to obtain clock data of the crystal oscillator:
and receiving clock data of the crystal oscillator in a preset period, wherein the clock data comprise clock signals, and the clock data are sent by the ultra-wideband radio frequency transceiver unit.
In an alternative embodiment, the instructions in program 621 are specifically configured to, in determining the operational state of the crystal oscillator based on the clock data:
Calculating frequency data of the crystal oscillator in the preset period according to the clock data;
The processor determines the working state of the crystal oscillator according to the frequency data.
In an alternative embodiment, the preset period is composed of a first sampling period and a second sampling period, and the second sampling period is an integer multiple of the first sampling period; the frequency data includes a maximum frequency and a minimum frequency; in terms of calculating the frequency data of the crystal oscillator in the preset period according to the clock data, the instructions in the program 621 are specifically configured to perform the following operations:
The processor calculates a frequency value of the crystal oscillator in each first sampling period according to the clock data;
the processor determines the maximum frequency and the minimum frequency from the frequency value of each first sampling period within the second sampling period.
In an alternative embodiment, the instructions in program 621 are specifically configured to, in determining the operating state of the crystal oscillator from the frequency data:
Acquiring the ratio between the frequency difference data of the maximum frequency and the minimum frequency and the nominal frequency, wherein the nominal frequency is configured to the memory by the ultra-wideband protocol control unit and represents the frequency of the normal operation of the crystal oscillator;
When the ratio is less than the preset threshold, the processor determines that the crystal oscillator is in the stable state;
And when the ratio is greater than or equal to the preset threshold value, the processor determines that the crystal oscillator is in an unstable state.
In an alternative embodiment, the operating state comprises an unstable state; in terms of determining the operational state of the crystal oscillator from the clock data, the instructions in the program 621 are specifically further operable to:
In the unstable state, the processor continuously receives clock data of the crystal oscillator in a maximum sampling period and determines the working state of the crystal oscillator according to the clock data;
and if the working state is still the unstable state when the maximum sampling period is exceeded, the processor sends a second notification message to the ultra-wideband protocol unit, wherein the second notification message indicates that the crystal oscillator is in fault.
The embodiment of the application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program makes a computer execute part or all of the steps of any one of the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform part or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising an electronic device.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a usb disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the application, wherein the principles and embodiments of the application are explained in detail using specific examples, the above examples being provided solely to facilitate the understanding of the method and core concepts of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.