Electric energy meter clock precision adjustment method and device, electronic equipment and storage medium

By utilizing the capture and counting technology of the high-frequency RC oscillator on the clock management chip of the smart energy meter to adjust the frequency adjustment register, the problem of cost, power consumption and accuracy is solved, high-precision clock management is achieved, and hardware costs are reduced. .

CN118860064APending Publication Date: 2024-10-29SHENZHEN CLOU ELECTRONICS
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410858045.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing smart energy meters are difficult to balance between cost, power consumption and clock accuracy. High-frequency crystal oscillators provide high accuracy but high cost and power consumption, while low-frequency RC oscillators have low accuracy but low cost and power consumption.

Method used

By making the high-frequency RC oscillator work after the clock management chip is powered on, the capture counting technology of the internal and external clock sources is used to adjust the frequency adjustment register of the high-frequency RC oscillator to improve clock accuracy.

Benefits of technology

Without increasing hardware cost and power consumption, the clock accuracy of the clock management chip is improved, thereby improving the clock accuracy of the energy meter and meeting the requirements of high-speed data processing and communication interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860064A_ABST
    Figure CN118860064A_ABST
Patent Text Reader

Abstract

The invention provides an electric energy meter clock precision adjustment method and device, electronic equipment and a storage medium. The method provided by the invention comprises the following steps: after a clock management chip is electrified, enabling the clock management chip to work as a clock of a high-frequency RC oscillator; taking the first preset frequency clock signal as a signal counting source, taking a second preset frequency clock signal output by an external clock source crystal as a signal capturing source, and capturing and counting the second preset frequency clock signal to obtain a capturing and counting value; and determining a deviation value according to the captured count value and a standard count value of the second preset frequency clock signal, adjusting an original frequency adjustment value of the frequency adjustment register according to the deviation value to obtain an adjusted frequency adjustment value, and enabling a main clock of the clock management chip to operate according to the adjusted frequency adjustment value. According to the method provided by the invention, the clock precision of the clock management chip can be improved under the condition of not increasing more hardware cost and more power consumption, and the clock precision of the electric energy meter can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric energy meters, and in particular to an electric energy meter clock precision adjustment method, device, electronic equipment and storage medium. Background Art

[0002] Smart energy meters generally have functions such as energy metering, data processing, real-time monitoring, automatic control, and information interaction. Smart energy meters can include a metering module (metering core) and a management module (management core). The metering module is mainly used to realize metering, clock, freezing, events, communication and other functions. The management module needs to participate in the external communication of the energy meter. At the same time, it also needs to forward the communication of the main station to the metering module and the expansion module to the corresponding module. After the corresponding module responds, the management core forwards it to the main station. Since the management module needs to undertake the data processing of the multi-functional module, it needs to run an MCU (Microcontroller Unit) with a higher system clock to provide it with a clock.

[0003] The Fudan Micro FM33A0XXEV clock management chip contains clock sources such as low-frequency crystal oscillator circuit, high-frequency crystal oscillator, high-frequency RC oscillator, low-power internal ring oscillator, phase-locked loop PLL_L and phase-locked loop PLL_H. The clock generation module inside the chip will integrate these clock sources to provide the required clock for each module. When the clock management chip provides the system clock for the management module, the combination of high-frequency crystal oscillator and phase-locked loop PLL_H can provide a system clock of up to 64MHz, but because the combination includes an additional external high-frequency crystal, it will increase the cost and power consumption. The combination of high-frequency RC oscillator, low-frequency crystal oscillator circuit and phase-locked loop PLL_H can also provide a system clock of up to 64MHz. This combination uses an internal high-frequency RC oscillator and an external low-speed 32768Hz crystal, with lower cost and power consumption, but the accuracy of the system clock is also relatively low due to the use of an internal high-frequency RC oscillator. Summary of the invention

[0004] The object of the present invention is to provide a method, device, electronic device and storage medium for adjusting the clock accuracy of an electric energy meter, so as to solve the technical problem in the prior art that cost, power consumption and accuracy cannot be taken into account at the same time.

[0005] The technical solution of the present invention is as follows, which provides a method for adjusting the clock accuracy of an electric energy meter, comprising:

[0006] After the clock management chip is powered on, the clock management chip is operated with a clock of a high-frequency RC oscillator;

[0007] Using a first preset frequency clock signal outputted from the clock management chip as a signal counting source, and using a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capturing source, capturing and counting the second preset frequency clock signal to obtain a captured count value;

[0008] A deviation value is determined based on the captured count value and the standard count value of the second preset frequency clock signal, and the original frequency calibration value of the frequency calibration register of the high-frequency RC oscillator is adjusted according to the deviation value to obtain an adjusted frequency calibration value, so that the main clock of the clock management chip runs according to the adjusted frequency calibration value.

[0009] Further, taking a first preset frequency clock signal outputted from the clock management chip as a signal counting source, taking a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capture source, and capturing and counting the second preset frequency clock signal, including:

[0010] When the clock management chip is initialized, or when the temperature change value inside the clock management chip exceeds a preset temperature change threshold within a preset time, the first preset frequency clock signal output from the clock management chip is used as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as a signal capture source to capture and count the second preset frequency clock signal.

[0011] Further, taking a first preset frequency clock signal outputted from the clock management chip as a signal counting source, taking a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capture source, and capturing and counting the second preset frequency clock signal, including:

[0012] The first preset frequency clock signal output from the clock management chip is used as the signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as the signal capture source. The single pulse period capture mode is used to capture the rising edge of the signal capture source to capture and count the second preset frequency clock signal.

[0013] Further, determining the deviation value according to the captured count value and the standard count value of the second preset frequency clock signal includes:

[0014] Determine the deviation value according to the captured count value, the standard count value of the second preset frequency clock signal and a deviation calculation formula, wherein the deviation calculation formula includes

[0015]

[0016] Among them, m is the deviation value, N1 is the captured count value, N0 is the standard count value, F1 is the first preset frequency, F2 is the second preset frequency, α is the pre-division value of the signal count source, and β is a multiple of the center frequency of the frequency adjustment register.

[0017] Further, adjusting the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value includes:

[0018] Determine whether the deviation value is greater than a preset deviation threshold. If so, re-determine the deviation value until a preset number of determinations is reached. Otherwise, adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value.

[0019] Furthermore, the first preset frequency clock signal outputted from the clock management chip is used as a signal counting source, including:

[0020] The 64 MHz main clock signal outputted from the clock management chip or the 8 MHz clock signal obtained by dividing the 64 MHz main clock signal is used as a signal counting source.

[0021] Furthermore, using a second preset frequency clock signal output by a clock source crystal outside the clock management chip as a signal capture source includes:

[0022] A second preset frequency clock signal output by a low-frequency crystal oscillator circuit crystal outside the clock management chip is used as a signal capture source.

[0023] Another technical solution of the present invention is as follows: a device for adjusting the clock accuracy of an electric energy meter is provided, comprising an enabling module, a capture counting module and an adjusting module;

[0024] The enabling module is used to enable the clock management chip to work with the clock of the high-frequency RC oscillator after the clock management chip is powered on;

[0025] The capture counting module is used to use the first preset frequency clock signal output from the clock management chip as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip as a signal capture source, to capture and count the second preset frequency clock signal to obtain a capture count value;

[0026] The adjustment module is used to determine the deviation value according to the captured count value and the standard count value of the second preset frequency clock signal, and adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value to obtain the adjusted frequency adjustment value, so that the main clock of the clock management chip runs according to the adjusted frequency adjustment value.

[0027] Another technical solution of the present invention is as follows: an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the method for adjusting the clock accuracy of an electric energy meter as described in any of the above technical solutions is implemented.

[0028] Another technical solution of the present invention is as follows: a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for adjusting the clock accuracy of an electric energy meter according to any of the technical solutions described above is implemented.

[0029] The beneficial effects of the present invention are as follows: after the clock management chip is powered on, the clock management chip works with the clock of the high-frequency RC oscillator; the first preset frequency clock signal output from the clock management chip is used as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as a signal capture source, and the second preset frequency clock signal is captured and counted to obtain a captured count value; according to the captured count value and the standard count value of the second preset frequency clock signal, a deviation value is determined, and according to the deviation value, the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator is adjusted to obtain an adjusted frequency adjustment value, so that the main clock of the clock management chip runs according to the adjusted frequency adjustment value; through the above technical scheme, the clock accuracy of the clock management chip can be improved without increasing more hardware costs and more power consumption, thereby improving the clock accuracy of the electric energy meter. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a flow chart of a method for adjusting the clock accuracy of an electric energy meter provided by an embodiment of the present invention;

[0031] Figure 2 A schematic diagram of the structure of a clock accuracy adjustment device for an electric energy meter provided by an embodiment of the present invention;

[0032] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0033] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0036] Figure 1 1 is a flow chart of a method for adjusting the clock accuracy of an electric energy meter according to an embodiment of the present invention. It should be noted that the method for adjusting the clock accuracy of an electric energy meter according to the present invention is not limited to the method for adjusting the clock accuracy of an electric energy meter according to an embodiment of the present invention. Figure 1 The process sequence shown is limited. Figure 1 As shown, the method for adjusting the clock accuracy of the electric energy meter comprises the following steps:

[0037] S101, after the clock management chip is powered on, the clock management chip is operated with a clock of a high frequency RC oscillator;

[0038] In a specific embodiment, after the FM33A0610EV clock management chip is powered on, the 8MHz clock of the high-frequency RC oscillator (RCHF) is put into operation, and the hardware circuit of the FM33A0610EV clock management chip reads the 8MHz calibration value from the LDT1 pin of the clock management chip, so that the frequency error at normal temperature is less than + / -0.5%, and the variation in the entire temperature range is less than + / -2%.

[0039] S102, using a first preset frequency clock signal outputted from the clock management chip as a signal counting source, and using a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capture source, capturing and counting the second preset frequency clock signal to obtain a capture count value;

[0040] It should be noted that the second preset frequency output by the clock source crystal outside the clock management chip is not affected by the temperature change inside the clock management chip, so it can be used as a signal capture source.

[0041] In some embodiments, a first preset frequency clock signal outputted from the clock management chip is used as a signal counting source, and a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip is used as a signal capture source, and the second preset frequency clock signal is captured and counted, including:

[0042] When the clock management chip is initialized, or when the temperature change value inside the clock management chip exceeds a preset temperature change threshold within a preset time, the first preset frequency clock signal output from the clock management chip is used as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as a signal capture source to capture and count the second preset frequency clock signal.

[0043] In a specific embodiment, after the clock management chip is initialized, the main clock runs at 64Mhz, and the electric energy meter can obtain the internal temperature of the clock management chip through the temperature sensor at preset time intervals, for example, every 10s; when the clock management chip is initialized, or the internal temperature change value of the clock management chip exceeds the preset temperature change threshold, the second preset frequency clock signal is captured and counted once, and then the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator is adjusted once, wherein the internal temperature change value of the clock management chip within the preset time can be the absolute value of the difference between the internal temperature value of the clock management chip at the start time point of the preset time and the internal temperature value of the clock management chip at the end time point of the preset time, for example, the preset temperature change threshold can be 5°C.

[0044] In some embodiments, a first preset frequency clock signal outputted from the clock management chip is used as a signal counting source, and a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip is used as a signal capture source, and the second preset frequency clock signal is captured and counted, including:

[0045] The first preset frequency clock signal output from the clock management chip is used as the signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as the signal capture source. The single pulse period capture mode is used to capture the rising edge of the signal capture source to capture and count the second preset frequency clock signal.

[0046] In a specific embodiment, a single pulse period capture mode is used to capture the rising edge of the signal capture source to capture and count the second preset frequency clock signal to obtain a capture count value N1. The capture count value N1 corresponds to the period of the clock signal output by the clock source crystal, that is, corresponds to the second preset frequency.

[0047] In some embodiments, determining the deviation value according to the captured count value and the standard count value of the second preset frequency clock signal includes:

[0048] Determine the deviation value according to the captured count value, the standard count value of the second preset frequency clock signal and a deviation calculation formula, wherein the deviation calculation formula includes

[0049]

[0050] Among them, m is the deviation value, N1 is the captured count value, N0 is the standard count value, F1 is the first preset frequency, F2 is the second preset frequency, α is the pre-division value of the signal count source, and β is a multiple of the center frequency of the frequency adjustment register.

[0051] In an embodiment of the present invention, a deviation value is determined based on the captured count value and the standard count value of the second preset frequency clock signal and a deviation calculation formula, thereby determining the deviation of the frequency adjustment register of the high-frequency RC oscillator caused by the influence of temperature, and compensating for the deviation, thereby improving the clock accuracy of the clock management chip in the electric energy meter.

[0052] In some embodiments, using a first preset frequency clock signal outputted from the clock management chip as a signal counting source includes:

[0053] The 64 MHz main clock signal outputted from the clock management chip or the 8 MHz clock signal obtained by dividing the 64 MHz main clock signal is used as a signal counting source.

[0054] It should be noted that the 8 MHz clock of the high frequency RC oscillator is multiplied by the phase-locked loop PLL_H to obtain a 64 MHz main clock signal.

[0055] In some embodiments, using a second preset frequency clock signal output by a clock source crystal outside the clock management chip as a signal capture source includes:

[0056] A second preset frequency clock signal output by a low-frequency crystal oscillator circuit crystal outside the clock management chip is used as a signal capture source.

[0057] In a specific embodiment, the 8MHz clock signal after the 64Mhz main clock signal outputted from the internal of the clock management chip is divided as the signal counting source, and the 32768Hz clock signal outputted from the low-frequency crystal oscillator circuit crystal outside the clock management chip is used as the signal capture source. The pre-division value α of the signal counting source is 128, and the multiple β of the center frequency of the frequency adjustment register is 0.25%. Then,

[0058]

[0059] S103, determining a deviation value according to the captured count value and the standard count value of the second preset frequency clock signal, adjusting the original frequency calibration value of the frequency calibration register of the high-frequency RC oscillator according to the deviation value to obtain an adjusted frequency calibration value, so that the main clock of the clock management chip runs according to the adjusted frequency calibration value.

[0060] In some embodiments, adjusting the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value includes:

[0061] Determine whether the deviation value is greater than a preset deviation threshold. If so, re-determine the deviation value until a preset number of determinations is reached. Otherwise, adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value.

[0062] In a specific embodiment, if the deviation value is greater than the preset deviation threshold, it means that the capture count is not accurate enough, and the count needs to be recaptured and the deviation value needs to be re-determined until the preset determination times are reached. The preset determination times may be 5, and the preset deviation threshold may be determined according to actual conditions. If the deviation value is still greater than the preset deviation threshold before the preset determination times are reached, the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator is not adjusted, so that the high-frequency RC oscillator works at the default 8MHz clock.

[0063] In a specific embodiment, in the frequency adjustment register of the high-frequency RC oscillator, 8'h00 indicates the lowest frequency, and 8'hFF indicates the highest frequency. The adjustment range is + / -30% of the center frequency, and the adjustment step is β times the center frequency, and β can be 0.25%. When the frequency adjustment register of the high-frequency RC oscillator needs to be adjusted, the 8MHz calibration value is first read from the LDT1 pin, and then the required frequency adjustment value is written into the RCHFTR register (frequency adjustment register) of the high-frequency RC oscillator, and the original frequency adjustment value rchf_Trim of the frequency adjustment register of the high-frequency RC oscillator is subtracted from m to obtain the adjusted frequency adjustment value, and the adjusted frequency adjustment value is used as the latest frequency adjustment value of the frequency adjustment register, so that the main clock of the clock management chip runs according to the latest frequency adjustment value. The above-mentioned original frequency adjustment value can be the frequency adjustment value before adjustment. When the frequency adjustment register of the high-frequency RC oscillator needs to be adjusted again, the latest frequency adjustment value of the frequency adjustment register can be used as its original frequency adjustment value, and the latest frequency adjustment value of this adjustment is determined according to the latest deviation value.

[0064] The clock accuracy adjustment method of the electric energy meter provided by the embodiment of the present invention is to make the clock management chip work with the clock of the high-frequency RC oscillator after the clock management chip is powered on; take the first preset frequency clock signal outputted from the clock management chip as the signal counting source, take the second preset frequency clock signal outputted from the clock source crystal outside the clock management chip as the signal capture source, and capture and count the second preset frequency clock signal to obtain the capture count value; determine the deviation value according to the capture count value and the standard count value of the second preset frequency clock signal, and adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value to obtain the adjusted frequency adjustment value, so that the main clock of the clock management chip runs according to the adjusted frequency adjustment value; without increasing more hardware costs and more power consumption, the clock accuracy of the clock management chip can be improved, thereby improving the clock accuracy of the electric energy meter. The clock accuracy adjustment method of the electric energy meter provided by the embodiment of the present invention does not need to use high-frequency crystals, saves hardware costs, ensures the clock accuracy requirements of the smart electric energy meter within the full temperature range, and can meet the requirements of high-speed data processing and communication interaction of each route of the smart electric energy meter.

[0065] Based on the above-mentioned method for adjusting the clock accuracy of an electric energy meter, an embodiment of the present invention further provides a device for adjusting the clock accuracy of an electric energy meter, as shown in FIG. Figure 2 As shown, the electric energy meter clock accuracy adjustment device 20 includes an enabling module 21, a capture counting module 22 and an adjustment module 23;

[0066] The enabling module 21 is used to enable the clock management chip to work with the clock of the high-frequency RC oscillator after the clock management chip is powered on;

[0067] The capture counting module 22 is used to use the first preset frequency clock signal output from the clock management chip as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip as a signal capture source, and to capture and count the second preset frequency clock signal to obtain a capture count value;

[0068] The adjustment module 23 is used to determine the deviation value according to the captured count value and the standard count value of the second preset frequency clock signal, and adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value to obtain the adjusted frequency adjustment value, so that the main clock of the clock management chip runs according to the adjusted frequency adjustment value.

[0069] For other details about how the modules in the above-mentioned electric energy meter clock accuracy adjustment device implement the above-mentioned technical solution, please refer to the description of the electric energy meter clock accuracy adjustment method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0070] Based on the above-mentioned method for adjusting the clock accuracy of an electric energy meter, an embodiment of the present invention further provides an electronic device, a structural diagram of which is shown in FIG. Figure 3 As shown, the electronic device 30 includes a processor 31 and a memory 32 coupled to the processor 31. The memory 32 stores a computer program, and when the computer program is executed by the processor 31, the processor 31 executes the steps of the method for adjusting the clock accuracy of the electric energy meter in the above embodiment.

[0071] For other details about the processor 31 in the electronic device 30 implementing the above technical solution, please refer to the description of the electric energy meter clock accuracy adjustment method provided in the above invention embodiment, which will not be repeated here.

[0072] Among them, the processor 31 can also be called a CPU (Central Processing Unit), and the processor 31 may be an integrated circuit chip with signal processing capabilities; the processor 31 can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor 31 can also be any conventional processor, etc.

[0073] The embodiment of the present invention further provides a computer-readable storage medium, a schematic diagram of which is shown in FIG. Figure 4 As shown, a readable computer program 41 is stored on the storage medium 40; wherein, the computer program 41 can be stored in the above storage medium 40 in the form of a software product, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium 40 includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0074] 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 only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, 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 modules, which can be electrical, mechanical or other forms.

[0075] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0076] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0077] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0078] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0079] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0080] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0081] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0082] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0084] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for adjusting the clock accuracy of an electric energy meter, characterized in that: include: After the clock management chip is powered on, the clock management chip is operated with a clock of a high-frequency RC oscillator; Using a first preset frequency clock signal outputted from the clock management chip as a signal counting source, and using a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capturing source, capturing and counting the second preset frequency clock signal to obtain a captured count value; A deviation value is determined based on the captured count value and the standard count value of the second preset frequency clock signal, and the original frequency calibration value of the frequency calibration register of the high-frequency RC oscillator is adjusted according to the deviation value to obtain an adjusted frequency calibration value, so that the main clock of the clock management chip runs according to the adjusted frequency calibration value.

2. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: Taking a first preset frequency clock signal outputted from the clock management chip as a signal counting source, taking a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capturing source, and capturing and counting the second preset frequency clock signal, including: When the clock management chip is initialized, or when the temperature change value inside the clock management chip exceeds a preset temperature change threshold within a preset time, the first preset frequency clock signal output from the clock management chip is used as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as a signal capture source to capture and count the second preset frequency clock signal.

3. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: Taking a first preset frequency clock signal outputted from the clock management chip as a signal counting source, taking a second preset frequency clock signal outputted from a clock source crystal outside the clock management chip as a signal capturing source, and capturing and counting the second preset frequency clock signal, including: The first preset frequency clock signal output from the clock management chip is used as the signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip is used as the signal capture source. The single pulse period capture mode is used to capture the rising edge of the signal capture source to capture and count the second preset frequency clock signal.

4. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: Determining a deviation value according to the captured count value and a standard count value of the second preset frequency clock signal includes: Determine the deviation value according to the captured count value, the standard count value of the second preset frequency clock signal and a deviation calculation formula, wherein the deviation calculation formula includes Among them, m is the deviation value, N1 is the captured count value, N0 is the standard count value, F1 is the first preset frequency, F2 is the second preset frequency, α is the pre-division value of the signal count source, and β is a multiple of the center frequency of the frequency adjustment register.

5. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: Adjusting the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value includes: Determine whether the deviation value is greater than a preset deviation threshold. If so, re-determine the deviation value until a preset number of determinations is reached. Otherwise, adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value.

6. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: Using a first preset frequency clock signal outputted from the clock management chip as a signal counting source includes: The 64 MHz main clock signal outputted from the clock management chip or the 8 MHz clock signal obtained by dividing the 64 MHz main clock signal is used as a signal counting source.

7. The method for adjusting the clock accuracy of an electric energy meter according to claim 1, characterized in that: The method uses a second preset frequency clock signal output by a clock source crystal outside the clock management chip as a signal capture source, including: A second preset frequency clock signal output by a low-frequency crystal oscillator circuit crystal outside the clock management chip is used as a signal capture source.

8. An electric energy meter clock accuracy adjustment device, characterized in that: It includes an enabling module, a capture counting module and an adjusting module; The enabling module is used to enable the clock management chip to work with the clock of the high-frequency RC oscillator after the clock management chip is powered on; The capture counting module is used to use the first preset frequency clock signal output from the clock management chip as a signal counting source, and the second preset frequency clock signal output from the clock source crystal outside the clock management chip as a signal capture source, to capture and count the second preset frequency clock signal to obtain a capture count value; The adjustment module is used to determine the deviation value according to the captured count value and the standard count value of the second preset frequency clock signal, and adjust the original frequency adjustment value of the frequency adjustment register of the high-frequency RC oscillator according to the deviation value to obtain the adjusted frequency adjustment value, so that the main clock of the clock management chip runs according to the adjusted frequency adjustment value.

9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, wherein: When the processor executes the computer program, the method for adjusting the clock accuracy of an electric energy meter as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for adjusting the clock accuracy of an electric energy meter as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Clock signal generation method and device, electronic equipment and readable medium

    CN119556764A