CN115941150B - Clock output method, clock module, electronic device and storage medium - Google Patents

Clock output method, clock module, electronic device and storage medium Download PDF

Info

Publication number
CN115941150B
CN115941150B CN202211288927.0A CN202211288927A CN115941150B CN 115941150 B CN115941150 B CN 115941150B CN 202211288927 A CN202211288927 A CN 202211288927A CN 115941150 B CN115941150 B CN 115941150B
Authority
CN
China
Prior art keywords
clock signal
clock
signal
offset
internal clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211288927.0A
Other languages
Chinese (zh)
Other versions
CN115941150A (en
Inventor
陈功
刘搏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Gencotech Communication Equipment Co ltd
Original Assignee
Shenzhen Gencotech Communication Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Gencotech Communication Equipment Co ltd filed Critical Shenzhen Gencotech Communication Equipment Co ltd
Priority to CN202211288927.0A priority Critical patent/CN115941150B/en
Publication of CN115941150A publication Critical patent/CN115941150A/en
Application granted granted Critical
Publication of CN115941150B publication Critical patent/CN115941150B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Oscillators With Electromechanical Resonators (AREA)

Abstract

The application belongs to the technical field of communication, and provides a clock output method, a clock module, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring the current ambient temperature; when a normal external clock signal is received, determining a clock offset of an internal clock signal corresponding to the current ambient temperature, and determining the internal clock signal according to the clock offset; updating the corresponding relation between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal; when the external clock signal is obtained abnormally, according to the environment temperature obtained in real time, the corresponding relation between the updated temperature and the clock offset is combined, and the internal clock signal is determined and used as an output signal of the clock module. Based on the corresponding relation between the dynamic updating temperature of the external clock signal and the clock offset, the accuracy of the internal clock signal output according to the corresponding relation of the dynamic updating is higher, and the communication reliability by using the clock signal is improved.

Description

Clock output method, clock module, electronic device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a clock output method, a clock module, an electronic device, and a storage medium.
Background
When the devices perform synchronous communication, the clock frequency between the two devices in synchronous communication needs to be ensured to be consistent, so that the receiving end can accurately analyze the data sent by the sending end according to the clock frequency after synchronization. With the development of communication technology, the accuracy of clock frequency is also increasingly required in some fields. For example, for an unmanned car, it is possible to communicate in real time with other devices of intelligent transportation by receiving 1PPS (pulse signal per second) supplied from GPS as a reference clock. However, when the unmanned vehicle enters a tunnel, a room, or the like, the reference clock provided by the GPS cannot be accurately acquired. At this point, the clock frequency used by the device switches to the clock frequency provided by the device's own clock module. Thus, the accuracy of the clock frequency of the clock module itself may affect the reliability of real-time communications.
However, the crystal oscillator in the clock module is also affected by environmental factors such as temperature when generating the reference frequency. For example, when a vehicle enters a tunnel or the like, the reference frequency output by the crystal oscillator may change due to the change of the environmental temperature, so that the reliability of real-time communication may be affected.
Disclosure of Invention
The embodiment of the application provides a clock output method, a clock module, electronic equipment and a storage medium, which can solve the problem that the output of an internal clock signal is affected by temperature and is inaccurate.
In a first aspect, an embodiment of the present application provides a clock output method, including the steps of:
acquiring the current ambient temperature;
when a normal external clock signal is received, determining the clock offset of an internal clock signal corresponding to the current ambient temperature according to the corresponding relation between the pre-stored temperature and the clock offset, wherein the precision of the external clock signal is higher than that of the internal clock signal;
updating the corresponding relation between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal;
when the external clock signal is obtained abnormally, according to the environment temperature obtained in real time, the corresponding relation between the updated temperature and the clock offset is combined, the internal clock signal is determined, and the internal clock signal is used as an output signal of the clock module.
In a possible implementation manner of the first aspect, updating the correspondence between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal includes:
when the difference between the external clock signal and the internal clock signal is larger than a preset value, the corresponding relation between the temperature and the clock offset is updated according to the external clock signal.
In a possible implementation manner of the first aspect, updating the correspondence between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal includes:
according to a preset updating period, the corresponding relation between the temperature and the clock offset is updated by combining the difference between the external clock signal and the internal clock signal in an iterative updating mode.
In a possible implementation manner of the first aspect, updating the correspondence between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal includes:
determining a control signal of a current internal clock source when a difference between the external clock signal and the internal clock signal is less than a predetermined difference threshold;
and updating the corresponding relation between the current ambient temperature and the clock offset according to the corresponding relation between the control signal of the internal clock source and the clock offset.
In a possible implementation manner of the first aspect, after updating the correspondence between the temperature and the clock offset according to a difference between the external clock signal and the internal clock signal, the method further includes:
searching a preset number of temperatures in the updated corresponding relation by taking the current ambient temperature as the center, and determining the corresponding relation between the searched temperatures and the clock offset;
and determining fitting points according to the searched corresponding relation between the preset number of temperatures and the clock offset, and generating a fitting curve according to the fitting points.
In a possible implementation manner of the first aspect, the external clock signal is a second pulse signal in the satellite signal, and the internal clock signal is a clock signal of the crystal oscillator.
In a possible implementation manner of the first aspect, the crystal oscillator is a voltage-controlled crystal oscillator;
according to the environment temperature obtained in real time, combining the corresponding relation between the updated temperature and the clock offset, determining an internal clock signal comprises:
according to the environment temperature obtained in real time, the corresponding relation between the updated temperature and the clock offset is combined, and the size of the clock offset is determined;
when the clock offset is negative, reducing the voltage-controlled voltage of the crystal oscillator according to the magnitude of the clock offset;
and when the clock offset is positive, increasing the voltage-controlled voltage of the crystal oscillator according to the size of the clock offset.
In a second aspect, an embodiment of the present application provides a clock module, the module including:
an internal clock source for generating an internal clock signal;
the controller determines the clock offset of the internal clock signal corresponding to the current ambient temperature according to the corresponding relation between the pre-stored temperature and the clock offset, and determines the internal clock signal according to the clock offset, wherein the precision of the external clock signal is higher than that of the internal clock signal; updating the corresponding relation between the temperature and the clock offset according to the difference between the external clock signal and the internal clock signal; according to the environment temperature acquired in real time, the internal clock signal is updated by combining the updated corresponding relation between the temperature and the clock offset;
the temperature sensor is used for acquiring the current ambient temperature;
the first clock output interface is used for outputting the internal clock signal when the external clock signal is obtained abnormally;
a second clock output interface outputting the received external clock signal when receiving the normal external clock signal;
and the clock signal receiving interface is used for receiving an external clock signal.
In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the computer program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium comprising: the computer readable storage medium stores a computer program which, when executed by a processor, implements the steps of the method according to any of the first aspects.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the application, the corresponding relation between the temperature and the clock offset is continuously updated according to the difference between the external clock signal and the internal clock signal and the temperature acquired in real time, so that the precision of the corresponding relation between the temperature and the clock offset is improved, the precision is close to that of the external clock signal, when the corresponding relation between the temperature and the clock offset is applied to determine the internal clock signal, a more accurate internal clock signal can be obtained, and the real-time communication using the clock module can be more reliable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a clock module according to an embodiment of the present application;
FIG. 2 is a flowchart of a clock output method according to an embodiment of the present application;
FIG. 3 is a flow chart of one manner of iterative adjustment provided by an embodiment of the present application;
FIG. 4 is a graph showing a temperature versus clock offset for one embodiment of the present application;
fig. 5 is a schematic diagram of an application scenario of a clock module according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
The application provides a clock output method, a clock module, electronic equipment and a computer storage medium, which can solve the problem that an internal clock signal is not accurate enough under the influence of temperature, and are applied to a scene that an external clock signal such as a satellite cannot be acquired and only the internal clock signal of the equipment can be used for real-time communication.
Fig. 1 is a schematic structural diagram of a clock module according to an embodiment of the present application. As shown in fig. 1, the clock module includes an internal clock source 101, a controller 102, a temperature sensor 103, a first clock output interface 104, a second clock output interface 105, and a clock receiving interface 106. The clock receiving interface 106 may receive a clock signal with high accuracy, such as a unit second pulse signal of a satellite. The clock receiving interface 106 and the second clock output interface 105 may be connected to the controller 102, and when the clock receiving interface 106 receives a normal external clock signal, the received external clock signal may be output by the second clock output interface 105. The corresponding relationship between the temperature and the clock offset may be stored in the controller 102 in advance, and the corresponding clock offset may be found based on the ambient temperature acquired by the temperature sensor 103. Based on the found clock offset, the internal clock signal may be initially adjusted to obtain an internal clock signal output by the internal clock source 101, the internal clock signal is compared with an external clock signal received by the clock receiving interface 106, and according to a difference between the internal clock signal and the external clock signal, the controller 102 generates a control signal to adjust the clock signal of the internal clock source 101, so that the clock signal output by the internal clock source 101 is consistent with the clock signal of the external clock source, thereby obtaining a correspondence relationship between the updated temperature and the clock offset.
In a possible implementation, a driving circuit may be further included between the internal clock source 101 and the controller 102, for performing frequency division or frequency multiplication processing on the clock signal output by the internal clock source 101. The first clock output interface 104 may further include a waveform conversion circuit for converting the output clock signal into a desired waveform, including, for example, a square wave or a sine wave, before outputting the clock signal. When the controller 102 outputs a control signal to adjust the clock offset of the internal clock source 101, the output digital signal can be converted into an analog signal by the digital-to-analog conversion module, so as to adjust the clock offset of the internal clock source 101.
The controller 102 may include a processor such as a single-chip microcomputer, an FPGA, and the internal clock source 101 may include a voltage-controlled crystal oscillator.
Fig. 2 shows a flowchart of a clock output method according to an embodiment of the present application, where an execution body of the clock output method may be a clock module, and the clock output method includes the following steps:
in S201, the current ambient temperature is acquired.
The temperature signal may be acquired based on a temperature sensor 103 included in the clock module, to determine the current ambient temperature of the clock module. In a possible implementation, the temperature sensor 103 may be disposed within a predetermined range of the internal clock source 101, so that the collected ambient temperature can more accurately reflect the ambient temperature of the internal clock source 101 (the clock source generating the internal clock signal).
In S202, when a normal external clock signal is received, the clock offset of the internal clock signal corresponding to the current ambient temperature is determined according to the corresponding relationship between the pre-stored temperature and the clock offset.
Before the clock module leaves the factory, the corresponding relation between the universal temperature and the clock offset can be preset. Based on the correspondence between the universal temperature and the clock offset, the precision requirement of the clock signal output by the clock module can be met when the internal clock source 101 has temperature drift in a specific period of time. However, due to individual differences of the internal clock sources 101 in the clock module and aging occurring with the use of the clock module, the preset temperature and clock offset may not be able to accommodate the requirement of the internal clock sources 101 of the clock module to output accurate clock signals. Thus, embodiments of the present application may update optimizations based on subsequent S203 and S204.
One possible implementation of the external clock signal is a unit second pulse signal (english is abbreviated as 1PPS and english is entirely abbreviated as one pulse per second) sent by a satellite.
It is possible to detect whether a normal unit second pulse signal is received by means of polling. When the external clock signal is a unit second pulse signal transmitted by a satellite, if the clock module is located indoors or passes through a tunnel or the like, the clock module cannot normally receive the unit second pulse signal. When the clock module is in an outdoor scene, a normal unit second pulse signal can be received.
The clock offset may refer to an offset of a clock signal output by the internal clock source 101 in a standard control state from a clock signal expected to be output by the internal clock source 101. For example, the frequency of the clock signal that the internal clock source 101 expects to output is 12MHz, and the frequency of the clock signal that is actually output may be 12.5MHz due to the influence of the ambient temperature. The deviation of the two, i.e. the offset is 12.5MHz-12 mhz=0.5 MHz. When the internal clock source 101 is in the standard control state, the voltage-controlled crystal oscillator may refer to a standard control voltage set in the specification parameters.
According to the corresponding relation between the pre-stored temperature and the clock offset, the clock offset corresponding to the current ambient temperature can be determined, and a corresponding control signal is generated based on the determined clock offset. The internal clock signal output by the internal clock source 101 may be adjusted based on the converted voltage signal by the analog-to-digital conversion circuit, which correspondingly converts the control signal into the voltage signal.
For example, according to the preset corresponding relation between the temperature and the clock offset, the clock offset corresponding to the current ambient temperature is found to be 1.8MHz. An adjustment signal or control signal for the internal clock source 101 may be generated based on the clock offset. After the control pin of the internal clock source 101 receives the control signal, the output frequency of the internal clock source 101 is adjusted, and the output frequency of the internal clock source 101 is primarily increased.
The external clock signal in the embodiment of the application can comprise a high-precision clock signal provided by external equipment such as a satellite. The internal clock signal may comprise a clock signal provided by a crystal oscillator, such as an adjustable output frequency, i.e. the internal clock source 101 may be an adjustable crystal oscillator, including for example a voltage controlled crystal oscillator, etc.
In S203, according to the difference between the external clock signal and the internal clock signal, updating the corresponding relationship between the temperature and the clock offset;
in the above step, one possible implementation manner may be that when the external clock signal of the external clock source can be normally acquired, or the acquired external clock signal is a normal signal (or is an accurate clock signal), a predetermined value may be set, and when a difference between the external clock signal and the internal clock signal determined based on the predetermined correspondence is greater than the predetermined value, the correspondence between the temperature and the clock offset is updated based on the difference.
For example, the internal clock source 101 is a voltage-regulated crystal oscillator, and the larger the voltage, the larger the frequency of the output clock signal. The control voltage of the internal clock source 101 may be adjusted according to the difference between the internal clock signal and the external clock signal to vary the internal clock signal, thereby reducing the difference between the internal clock signal and the external clock signal. For example, when the frequency of the clock signal of the internal clock source 101 is smaller, the voltage control voltage of the internal clock source 101 is increased, and when the frequency of the clock signal of the internal clock source 101 is larger, the voltage control voltage of the internal clock source 101 is decreased.
The difference between the internal clock signal and the external clock signal can be gradually reduced by a plurality of iterative adjustment modes until the difference is smaller than a preset value or the preset requirement is met.
When the difference is smaller than a predetermined value or meets a predetermined requirement, a clock offset corresponding to the updated current ambient temperature may be determined based on the current control signal (e.g., may be a control voltage). For example, when the control voltage is 0.2V, the corresponding clock offset is 0.3MHz.
Fig. 3 shows a flow chart of one way of iterative adjustment described above, comprising the steps of:
s301, presetting an iterative learning period;
segmenting in a certain time period, and performing iterative updating once in each time period;
and optimizing the corresponding relation between the temperature acquired in the last time period and the clock offset in the next time period.
In S302, determining a difference between an external clock signal and an internal clock signal;
firstly, acquiring the clock offset by substituting the temperature acquired in real time into the corresponding relation between the temperature and the clock offset which are stored in advance, determining an internal clock signal according to the clock offset, and then comparing the frequency corresponding relation between the external clock signal and the internal clock signal so as to determine the difference.
In S303, the correspondence between the temperature and the clock offset is updated;
and updating the clock offset at the temperature in the time period according to the difference between the external clock signal and the internal clock signal determined in the step S302.
In S304, according to the correspondence between the updated temperature and the clock offset, the clock offset at the temperature is obtained, and according to the clock offset, the internal clock signal is determined and updated.
In S305, it is determined whether the iteration cycle is ended, when the iteration cycle is ended, S306 is executed, the correspondence between the temperature and the clock offset is determined, and if not, S302 is executed.
It can be understood that when the clock offset corresponding to the temperature is updated, the clock module should be at the same ambient temperature, or the change of the ambient temperature where the clock module is located satisfies the preset temperature range. In order to quickly complete updating of the correspondence between the temperature and the clock offset, an iterative learning period may be preset. For example, the iterative learning period can be set to be 18 seconds, and 10 iterative learning can be completed within 3 minutes, so that the corresponding relation between the temperature and the clock offset can be updated rapidly and accurately.
When the environmental temperature changes, the difference between the internal clock signal and the external clock signal determined according to the corresponding relation currently stored by the clock module can be used for judging whether the corresponding relation between the temperature and the clock needs to be updated or not based on the difference.
Or when the update interval of the temperature and the clock offset exceeds the preset time, the update flow of the corresponding relation of the temperature and the clock offset can be triggered.
In order to promote the application range of the updated correspondence, curve fitting can be performed on a plurality of points in the updated correspondence, and the correspondence between the temperature and the clock offset is updated based on the fitted curve, so that the requirement of clock signal adjustment of the internal clock source 101 in more temperature scenes can be adapted through the updating of the correspondence.
In order to improve the adjustment accuracy of the internal clock source 101, when curve fitting is performed, a predetermined number of temperatures (the predetermined number of temperatures includes the current ambient temperature) close to the current ambient temperature may be found in the correspondence relationship that has been updated previously based on the current ambient temperature as a center. And further determining the corresponding relation between the searched temperature and the clock offset according to the searched temperature. The fitting point is determined based on the corresponding relation between the searched temperature and the clock offset, curve fitting is performed based on the determined fitting point, the fitted curve can more accurately reflect the clock offset corresponding to the current temperature, and according to the fitted curve, the clock control requirement of more environment temperatures can be effectively adapted, and the accuracy of clock signals output by the internal clock source 101 is improved. It can be understood that the fitting curve obtained after curve fitting is performed by taking the current ambient temperature as the center can reduce the influence of errors in generating the corresponding relation, and improve the accuracy of clock control at the current temperature and the temperature near the current temperature. The curve fitting results may be as shown in fig. 4, and the resulting fitted curve may include one or more fitted curve segments.
In S204, when the external clock signal is obtained abnormally, the internal clock signal is updated according to the environmental temperature obtained in real time and in combination with the corresponding relationship between the updated temperature and the clock offset, and the internal clock signal is used as the output signal of the clock module.
When the external clock signal is obtained abnormally, or the obtained external clock signal is abnormal, the corresponding relation between the temperature and the clock offset is updated in the clock module, the clock offset corresponding to the current ambient temperature is searched based on the corresponding relation, the control signal of the internal clock source 101 is output, the internal clock source 101 overcomes the influence caused by the ambient temperature, and a more accurate clock signal is output.
It can be understood that in the embodiment of the application, when the external clock signal can be normally received, the external clock signal can be directly used as the output signal, so that the clock module can output an accurate clock signal.
In a possible implementation manner, after adjusting the frequency of the internal clock signal of the internal clock source 101, the phase of the internal clock source 101 may be further adjusted to enable the phase of the internal clock signal output by the internal clock source 101 to be matched with the phase of the external clock source, so as to further improve the output accuracy of the clock signal of the clock module.
Fig. 5 shows an application scenario of a clock module in this embodiment, where an unmanned automobile obtains a second pulse signal sent by a satellite signal as an external clock signal received by an automobile communication device, uses the external clock signal as a reference signal for communication with other traffic devices, and when the unmanned automobile enters a tunnel or a room or the like and cannot obtain the satellite signal, the automobile communication device uses a built-in clock module to obtain an internal clock signal as the reference signal, the internal clock signal is a clock signal output by a crystal oscillator in an internal clock source 101 in the clock module, the internal clock signal is continuously adjusted by a controller 102, the difference between the internal clock signal and the external clock signal is reduced, and the continuously optimized internal clock signal is used as the reference signal, so that more reliable real-time communication support can be provided for the automobile.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment 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, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 6, the electronic device 6 of this embodiment includes: at least one processor 60 (only one shown in fig. 6), a memory 61 and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, the processor 60 implementing the steps in any of the various clock output method embodiments described above when executing the computer program 62.
The electronic device 6 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The electronic device 6 may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the electronic device 6 and is not meant to be limiting as the electronic device 6, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), the processor 60 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments be an internal storage unit of the electronic device 6, such as a hard disk or a memory of the electronic device 6. The memory 61 may in other embodiments also be an external storage device of the electronic device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 61 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program codes of the computer program. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software 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.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., 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 may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. A method of clock output, the method comprising:
acquiring the current ambient temperature;
when a normal external clock signal is received, determining the clock offset of an internal clock signal corresponding to the current ambient temperature according to the corresponding relation between the pre-stored temperature and the clock offset, and determining the internal clock signal according to the clock offset, wherein the precision of the external clock signal is higher than that of the internal clock signal;
updating the corresponding relation between the current ambient temperature and the clock offset according to the difference between the external clock signal and the internal clock signal, comprising:
when the difference between the external clock signal and the internal clock signal determined based on the corresponding relation between the preset temperature and the clock offset is larger than a preset difference threshold value, adjusting the control voltage of an internal clock source according to the difference between the internal clock signal and the external clock signal, and reducing the difference between the internal clock signal and the external clock signal until the difference between the internal clock signal and the external clock signal is smaller than the preset difference threshold value or meets the preset requirement, and determining the clock offset corresponding to the current environment temperature based on the control voltage;
or according to a preset iterative learning period, adjusting the control voltage of an internal clock source according to the difference between the internal clock signal and the external clock signal, reducing the difference between the internal clock signal and the external clock signal until the difference is smaller than a preset difference threshold or meets a preset requirement, and determining the clock offset corresponding to the current environment temperature based on the control voltage;
when the external clock signal is obtained abnormally, according to the environment temperature obtained in real time, the corresponding relation between the updated temperature and the clock offset is combined, the clock offset corresponding to the current environment temperature is searched, a control signal of an internal clock source is generated based on the clock offset, the control signal is converted into a voltage signal, the output frequency of the internal clock source is adjusted, the internal clock signal is updated, and the internal clock signal is used as an output signal of a clock module.
2. The method of claim 1, wherein updating the current ambient temperature to clock offset correspondence based on the difference between the external clock signal and the internal clock signal comprises:
determining a control signal of a current internal clock source when a difference between the external clock signal and the internal clock signal is less than a predetermined difference threshold;
and updating the corresponding relation between the current ambient temperature and the clock offset according to the corresponding relation between the control signal of the internal clock source and the clock offset.
3. The method of claim 2, wherein after updating the current ambient temperature to clock offset correspondence based on the difference between the external clock signal and the internal clock signal, the method further comprises:
searching a preset number of temperatures in the updated corresponding relation by taking the current ambient temperature as the center, and determining the corresponding relation between the searched temperatures and the clock offset;
and determining fitting points according to the searched corresponding relation between the preset number of temperatures and the clock offset, and generating a fitting curve according to the fitting points.
4. The method of claim 1, wherein the external clock signal is a second pulse signal in a satellite signal and the internal clock signal is a clock signal of a crystal oscillator.
5. The method of claim 4, wherein the crystal oscillator is a voltage controlled crystal oscillator;
according to the environmental temperature acquired in real time, the clock offset corresponding to the current environmental temperature is searched in combination with the updated corresponding relation between the temperature and the clock offset, a control signal of an internal clock source is generated based on the clock offset, and the control signal is converted into a voltage signal, and the method comprises the following steps:
according to the environment temperature obtained in real time, the corresponding relation between the updated temperature and the clock offset is combined, and the size of the clock offset is determined;
when the clock offset is negative, reducing the voltage-controlled voltage of the crystal oscillator according to the magnitude of the clock offset;
and when the clock offset is positive, increasing the voltage-controlled voltage of the crystal oscillator according to the size of the clock offset.
6. A clock module, the module comprising:
an internal clock source for generating an internal clock signal;
the controller determines the clock offset of the internal clock signal corresponding to the current ambient temperature according to the corresponding relation between the pre-stored temperature and the clock offset, and determines the internal clock signal according to the clock offset, wherein the precision of the external clock signal is higher than that of the internal clock signal; updating the corresponding relation between the current ambient temperature and the clock offset according to the difference between the external clock signal and the internal clock signal, comprising: when the difference between the external clock signal and the internal clock signal determined based on the corresponding relation between the preset temperature and the clock offset is larger than a preset difference threshold value, adjusting the control voltage of an internal clock source according to the difference between the internal clock signal and the external clock signal, and reducing the difference between the internal clock signal and the external clock signal until the difference between the internal clock signal and the external clock signal is smaller than the preset difference threshold value or meets the preset requirement, and determining the clock offset corresponding to the current environment temperature based on the control voltage; or according to a preset iterative learning period, adjusting the control voltage of an internal clock source according to the difference between the internal clock signal and the external clock signal, reducing the difference between the internal clock signal and the external clock signal until the difference is smaller than a preset difference threshold or meets a preset requirement, and determining the clock offset corresponding to the current environment temperature based on the control voltage; when the external clock signal is obtained abnormally, according to the environment temperature obtained in real time, the clock offset corresponding to the current environment temperature is searched according to the updated corresponding relation between the temperature and the clock offset, a control signal of an internal clock source is generated based on the clock offset, the control signal is converted into a voltage signal, the output frequency of the internal clock source is adjusted, and the internal clock signal is updated;
the temperature sensor is used for acquiring the current ambient temperature;
the first clock output interface is used for outputting the internal clock signal when the external clock signal is obtained abnormally;
a second clock output interface outputting the received external clock signal when receiving the normal external clock signal;
and the clock signal receiving interface is used for receiving an external clock signal.
7. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 5.
CN202211288927.0A 2022-10-20 2022-10-20 Clock output method, clock module, electronic device and storage medium Active CN115941150B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211288927.0A CN115941150B (en) 2022-10-20 2022-10-20 Clock output method, clock module, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211288927.0A CN115941150B (en) 2022-10-20 2022-10-20 Clock output method, clock module, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115941150A CN115941150A (en) 2023-04-07
CN115941150B true CN115941150B (en) 2023-09-29

Family

ID=86556603

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211288927.0A Active CN115941150B (en) 2022-10-20 2022-10-20 Clock output method, clock module, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115941150B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5864315A (en) * 1997-04-07 1999-01-26 General Electric Company Very low power high accuracy time and frequency circuits in GPS based tracking units
CN101692124A (en) * 2008-02-05 2010-04-07 晨星软件研发(深圳)有限公司 High accuracy satellite receiving controller and associated method
CN108011631A (en) * 2017-12-19 2018-05-08 建荣半导体(深圳)有限公司 Work clock generation method, clock source and chip
CN108663696A (en) * 2018-04-27 2018-10-16 Oppo广东移动通信有限公司 Update method, device, storage medium and the mobile terminal of temperature and frequency deviation relationship
CN112260789A (en) * 2020-10-20 2021-01-22 哲库科技(北京)有限公司 Clock source system, clock synchronization system and clock synchronization method
CN112821976A (en) * 2020-12-31 2021-05-18 锐捷网络股份有限公司 Method and device for maintaining local clock synchronization
WO2022110280A1 (en) * 2020-11-27 2022-06-02 辰芯科技有限公司 Method and apparatus for updating local time, device, and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5864315A (en) * 1997-04-07 1999-01-26 General Electric Company Very low power high accuracy time and frequency circuits in GPS based tracking units
CN101692124A (en) * 2008-02-05 2010-04-07 晨星软件研发(深圳)有限公司 High accuracy satellite receiving controller and associated method
CN108011631A (en) * 2017-12-19 2018-05-08 建荣半导体(深圳)有限公司 Work clock generation method, clock source and chip
CN108663696A (en) * 2018-04-27 2018-10-16 Oppo广东移动通信有限公司 Update method, device, storage medium and the mobile terminal of temperature and frequency deviation relationship
CN112260789A (en) * 2020-10-20 2021-01-22 哲库科技(北京)有限公司 Clock source system, clock synchronization system and clock synchronization method
WO2022110280A1 (en) * 2020-11-27 2022-06-02 辰芯科技有限公司 Method and apparatus for updating local time, device, and storage medium
CN112821976A (en) * 2020-12-31 2021-05-18 锐捷网络股份有限公司 Method and device for maintaining local clock synchronization

Also Published As

Publication number Publication date
CN115941150A (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US10482045B2 (en) Data communication interface for processing data in low power systems
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN111813638B (en) Alarm information processing method and device and terminal equipment
US9436657B2 (en) Computing device and method for analyzing acquisition values
CN111130510B (en) Method and device for outputting second pulse signal
US11696159B2 (en) Method, apparatus, and non-transitory computer readable medium for testing terminals
EP3517984B1 (en) Semiconductor device and semiconductor system
US10534670B2 (en) Electronic device with automatic and stable system restart function
CN113094087A (en) Software configuration method, electronic device and storage medium
CN115941150B (en) Clock output method, clock module, electronic device and storage medium
CN112799459B (en) Power source debugging method and device, storage medium and electronic equipment
CN113660547A (en) Vehicle detection method and device, terminal equipment and readable storage medium
CN117215979A (en) Bus control method, device, storage medium, terminal equipment and bus system
CN113525142A (en) Method and device for reserving charging timing and terminal equipment
CN112114616A (en) Switching method of real-time clock, electronic equipment and computer storage medium
CN116940862A (en) Signal processing method and device and terminal equipment
CN112799315B (en) Radio frequency control method and device and radio frequency source
CN109284239B (en) Method and system for acquiring delay step time in storage module
US11982690B2 (en) Method, system, and non-transitory computer readable medium for detecting time difference
CN112199272B (en) Intelligent terminal testing method and device, terminal equipment and medium
CN114884724B (en) Cloud server interaction method and device, readable storage medium and terminal equipment
CN114513385B (en) Data transmission method, device, electronic equipment and storage medium
CN112799629B (en) Mainboard audio debugging method, device, equipment and storage medium
US12105224B2 (en) LiDAR adaptive single-pass histogramming for low power LiDAR system
CN115834970B (en) Light sensing module control method and device, display equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant