Method and device for adjusting communication rate of electric energy meter based on frequency following
By following and smoothing the main frequency of the power meter system, dynamically adjusting the communication rate, the problem of unstable communication of the power meter is solved, the communication success rate and stability are improved, and hardware resource consumption is reduced.
Patent Information
- Application Number
- CN202510679484.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-08
AI Technical Summary
During the communication process, existing power meters have insufficient redundancy at the receiving end and large redundancy at the sending end, resulting in unstable communication, high hardware resource consumption, and low communication success rate, so accurate data upload cannot be achieved.
By following and smoothing the main frequency of the system, calculating the real-time operating frequency, dynamically adjusting the communication rate of the power meter to ensure that adjustments are made within the allowable error range.
It improves the accuracy and stability of power meter communication, reduces hardware resource consumption, and solves the problem of communication failure caused by system frequency drift.
Smart Images

Figure CN120455366A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric meter communication, and in particular relates to a method and device for adjusting the communication rate of an electric energy meter based on frequency following. Background Art
[0002] With the rapid development of smart grids, electricity meters, as key terminal devices for energy measurement and management, play a vital role in automating electricity trade settlement. To ensure that the data collection system can accurately collect meter data for processing and analysis, stable and reliable communication is essential. During communication, electricity meters often encounter communication failures or data frame asymmetry, preventing the collection system from correctly collecting meter data. This results in low communication success rates, preventing meter data from being uploaded to the master system, and ultimately preventing customers from using meter data for online trade settlement. Further analysis revealed that existing electricity meters suffer from insufficient redundancy on the receiving end and excessive redundancy on the transmitting end in terms of communication rate design. Specifically, the receiving end has a low tolerance for baud rate errors, making it prone to data frame misjudgment or discarding due to system clock skew. While the transmitting end has high redundancy, this redundancy does not effectively improve communication stability. Instead, it increases hardware resource consumption and power consumption, hindering the overall performance optimization of the electricity meter. Summary of the Invention
[0003] In order to solve the above problems in the prior art, the present invention provides a method for adjusting the communication rate of an electric energy meter based on frequency following, comprising the following steps: Step S1: reference frequency F S Follow to get the feedback value, and get the main frequency of the system according to the feedback value within one cycle F SYS : ; in, F SYS is the main frequency of the system, n is the number of feedback times, is the i-th feedback value; Step S2: the main frequency of the system F SYS Perform smoothing to obtain real-time operating frequency F RT ; Step S3, according to the real-time operating frequency F RT Calculating the expected communication rate R b ; Step S4: The actual communication rate R aCompare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; Step S5: If the communication rate of the electric energy meter exceeds the allowable error range, the actual communication rate R of the electric energy meter is set to s Adjust to the expected communication rate R b .
[0004] Furthermore, in step S2, the system main frequency is smoothed by a sliding method, specifically including: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the window length is T, the slip is c, and the real-time operating frequency is calculated through the system main frequency sequence: ; in, is the real-time running frequency of the i-th time.
[0005] Alternatively, in step S2, the system main frequency is smoothed by an interval method, specifically including: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the interval is M, and the real-time operating frequency is calculated through the system main frequency sequence: ; ; ...; .
[0006] Based on the above solution, in step S4, the actual communication rate is calculated using (a) or (b). R a Communication rate deviation from the last communication rate: (a); (b); And determine whether the calculated communication rate deviation is within the allowable error range of the communication rate of the electric energy meter; wherein, is the theoretical communication rate, The last communication rate.
[0007] Based on the above scheme, the reference frequency is obtained by dividing the RTC clock frequency, the feedback value is the count value of multiple CLK pulses captured within a reference frequency period, and the system main frequency is the accumulated value of the count value of CLK pulses.
[0008] Based on the above solution, it also includes judging whether the main frequency of the system is valid: The system main frequency obtained in step S1 F SYS Frequency at reference temperature F TS Make comparisons; like , then the system main frequency obtained by this frequency following operation is valid.
[0009] The present application also provides a device for adjusting the communication rate of an electric energy meter based on frequency following, comprising: Main frequency follower module, used to follow the reference frequency F S Follow to get the feedback value, and get the main frequency of the system according to the feedback value within one cycle F SYS ; Smoothing module, used to adjust the system main frequency F SYS Perform smoothing to obtain real-time operating frequency F RT ; The communication rate calculation module is based on the real-time operating frequency F RT Calculating the expected communication rate R b ; Comparison module, the actual communication rate R a Compare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; If the communication rate of the electric energy meter exceeds the allowable error range, the adjustment module adjusts the actual communication rate R of the electric energy meter. s Adjust to the expected communication rate R b .
[0010] Based on the above scheme, the main frequency following module includes a control module, a counter module and a capture module. Within a reference frequency cycle, the control module collects the pulse count value from the counter module and the pulse generation time information of the capture module to calculate the system main frequency.
[0011] On the other hand, the present application provides an electric energy meter, which uses the above-mentioned method for adjusting the communication rate of the electric energy meter based on frequency following to adjust the communication rate.
[0012] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is used to call and run the computer program stored in the memory to execute the steps of the above-mentioned method for adjusting the communication rate of the electric energy meter based on frequency following.
[0013] Compared with the prior art, the present invention has the following beneficial effects: 1. The method of the present invention calculates the main frequency of the system in real time and adjusts the communication rate to ensure a high communication success rate, thus solving the problem of inaccurate communication rate of the electric energy meter; 2. The system's main frequency is filtered and optimized through a smoothing algorithm to achieve stable output of the real-time operating frequency and improve the robustness and adaptability of communication rate adjustment; 3. Through the adjustment method of the present invention, dynamic monitoring and intelligent adjustment of the communication baud rate of the electric energy meter are realized, which not only solves the communication failure problem caused by system frequency drift of traditional electric energy meters, but also significantly improves the accuracy and stability of communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flow chart of the method for adjusting the communication frequency for this application; Figure 2 This is the frequency following relationship diagram for this application; Figure 3 Test the communication receiving rate range for this application. DETAILED DESCRIPTION
[0015] During the communication process, electricity meters often experience communication failures or data frame asymmetry, preventing the data collection system from correctly capturing meter data. This leads to low communication success rates, preventing meter data from being uploaded to the master station system, and ultimately preventing customers from performing online trade settlements based on meter data. The main causes of inaccurate meter communication rates are: 1) low redundancy in the meter's receive rate and high redundancy in the transmit rate; and 2) temperature-dependent communication rate fluctuations.
[0016] Directly adjusting the system's main frequency to match the standard frequency requires high-precision frequency adjustment capabilities and temperature measurement mechanisms to achieve accurate frequency feedback. However, in practical applications, this approach often fails to achieve the desired results due to limitations in component performance, cost control, and environmental factors.
[0017] Therefore, to address this issue, this application adopts a frequency following strategy. This strategy periodically samples and feeds back the system's main frequency, combines it with a smoothing algorithm to obtain the real-time operating frequency, and dynamically adjusts the communication rate accordingly. This method eliminates the need for physical adjustments to the system's main frequency, reduces hardware precision requirements, and improves the system's adaptability and robustness. It is suitable for scenarios with high communication stability requirements, such as smart energy meters.
[0018] The invention will be further described below with reference to specific embodiments.
[0019] Example 1 like Figure 1 and Figure 2 As shown, this embodiment adopts communication rate adjustment, follows the system main frequency through a reference and performs feedback calculation (referred to as frequency following), obtains the actual operating frequency, calculates and adjusts the communication rate, including: Step S1: First, select a high-precision and stable real-time clock (RTC) signal source as the initial frequency reference, divide the RTC clock frequency appropriately and use it as the reference frequency. S Follow up to get the feedback value. Specifically, in each sampling period, the system monitors and records the number of CLK pulses received in real time. The CLK pulse value captured in a sampling period is the feedback value. All feedback values are accumulated to form the feedback value within the period. This value directly reflects the operating frequency status of the system in the current sampling period. That is, the system main frequency F is obtained based on the feedback value within a period. SYS : ; Among them, F SYS is the main frequency of the system, n is the number of feedback times, ) is the i-th feedback value.
[0020] like Figure 2 As shown in the figure, the RTC clock frequency is 32.768KHZ, which is divided by 128 to obtain a reference frequency of 256HZ. Therefore, 256 CLKs are output in one cycle (1s). The main frequency of the system is obtained by calculating the 256 CLK capture counters.
[0021] The method further includes step S11, determining whether the system main frequency calculated in step S1 is valid: The system main frequency F obtained in step S1 SYS The frequency F at the reference temperature TS For comparison, the frequency at the reference temperature is the ideal value that the system main frequency should reach under standard test conditions; The permissible error is relaxed to ±8%, that is, if , then the system main frequency obtained by this frequency following operation is valid. By judging the validity of the main frequency, the system main frequency obtained by frequency following is screened, so as to determine that the system main frequency obtained by frequency following is reasonable, thereby improving the communication quality and data transmission accuracy.
[0022] Step S2: Since the main frequency of the system obtained in step S1 fluctuates due to the influence of noise and has a certain instability, the main frequency of the system is adjusted. F SYS Perform smoothing to obtain real-time operating frequency F RT ; For example, for the last N sampling periods F SYS The values are averaged to calculate the current F RT .
[0023] Step S3, according to the real-time operating frequency F RT Calculate the expected communication rate R b , according to the real-time operating frequency F RT Calculating the expected communication rate R b : ; D is the frequency division coefficient, which refers to a fixed value that converts the real-time operating frequency into the communication rate.
[0024] Step S4: The actual communication rate of the energy meter R a Compare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; the actual communication rate R a It is the internal clock frequency / division factor of the energy meter.
[0025] Use (a) or (b) to calculate the actual communication rate R a Communication rate deviation from the last communication rate: (a); (b); in, is the theoretical communication rate, is the last communication rate; Then, it is determined whether the calculated communication rate deviation is within the allowable error range of the communication rate of the electric energy meter.
[0026] Step S5: If the actual communication rate of the electric energy meter exceeds the allowable error range, the expected communication rate is set to Rb Adjust the communication rate for this time.
[0027] Specifically, since the communication rate of the energy meter allows an error range of ±2%, if or , then the If the requirements are met, no adjustment will be made; or , then it is not within the allowable error range, and the expected communication rate is adjusted as the current communication rate. It should be noted that the error range here is usually the communication sending rate. In theory, the error range of the communication receiving rate is as large as possible. However, in actual applications, the communication receiving rate redundancy is generally 2 or 2.5 times the sending rate, achieving a relatively wide error range. In other words, if the communication receiving error range is within ±5%, the receiving rate redundancy is considered good.
[0028] Therefore, if or , then the If the requirements are met, no adjustment will be made; or , it is not within the allowable error range, and the expected communication rate is adjusted as the current communication rate. At this time, the error range refers to the communication receiving rate, and the redundancy of the communication receiving rate is limited to ±5%, which matches the actual application.
[0029] Example 2 This embodiment is optimized based on the first embodiment, and specifically includes: The step S2 is to adjust the main frequency of the system F SYS Perform smoothing to obtain real-time operating frequency F RT Preferably, the present application smoothes the main frequency of the system by a slip method, which has high real-time performance and can capture short-term load fluctuations, specifically including: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the window length is T, the slip is c, and the real-time operating frequency is calculated through the system main frequency sequence: ; ; ; ...; ; This embodiment smoothes the system's main frequency to reduce the impact of outliers caused by accidental factors on overall judgment, thereby reducing the probability of unnecessary adjustment operations. For equipment such as electricity meters, this helps to filter out instantaneous frequency changes caused by environmental factors or other external interference. Sliding smoothing can adjust the window size according to different needs. By flexibly selecting the window size, the relationship between noise suppression and response speed is balanced, thereby increasing the adaptability of the system.
[0030] If T=5 and c is 1, the real-time operating frequency is updated as follows: The first calculation: average the system main frequency from 1 to 5 to get the real-time operating frequency; Second calculation: average the system main frequency from 2 to 6 to get the real-time operating frequency; Nth calculation: Average the system main frequency from N to (N+4) to obtain the real-time operating frequency.
[0031] Example 3 This embodiment is another smoothing method of embodiment 2. In step S2, the system main frequency is smoothed using an interval method, specifically including: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the interval is M, and the real-time operating frequency is calculated through the system main frequency sequence: ; ; ...; ; By comprehensively considering all data points within the selected interval, the impact of a single data point on the overall result can be significantly reduced, thereby providing a more stable and smooth result; according to the present application, more complex smoothing methods such as weighted averaging or Kalman filtering can also be used.
[0032] Example 4 After the communication rate is adjusted according to step S4, the communication sending frequency and receiving frequency of the electric energy meter at different temperatures are calculated to determine whether the communication rate of the electric energy meter is related to the temperature.
[0033] like Figure 3 As shown in the figure, the range of the rate of communication reception of the energy meter is obtained through experiments. It can be seen that the maximum baud rate and the minimum baud rate are consistent at different temperatures. In the application of this application, the baud rate is equivalent to the communication rate. By calculating the baud rate deviation, the redundancy of the energy meter communication reception rate is obtained:
[0034]
[0035] ; ; The above calculations prove that the communication receiving rate redundancy of the electric energy meter is approximately ±4%, which is better than the allowable error (±5%). In addition, a larger range indicates better receiving redundancy. Even if the rate deviation sent by the other party is large, the data can still be received normally. Therefore, it shows that the receiving end has strong baud rate adaptability and strong communication robustness.
[0036] The range of the communication transmission rate of the energy meter was obtained through experiments, and it was found that the communication rate was consistent at different temperatures inside the energy meter: ; It is proved that the redundancy of the communication transmission rate of the electricity meter is about 0.156%. The smaller the communication transmission rate error, the smaller the communication rate deviation. It is completely better than the allowable error (±2%). The accuracy is high enough, which improves the overall communication reliability.
[0037] Based on the same technical concept, the present invention also provides a device for adjusting the communication rate of an electric energy meter based on frequency following, comprising: The main frequency follower module is used to follow the reference frequency F S Follow to get the feedback value, and get the main frequency of the system according to the feedback value within one cycle F SYS ; The main frequency following module includes a control module, a counter module and an acquirer module. In a reference frequency cycle, the control module collects the pulse count value from the counter module and the pulse generation time information of the acquirer module to calculate the system main frequency.
[0038] Smoothing module, used to adjust the system main frequency F SYS Perform smoothing to obtain real-time operating frequency F RT ; The communication rate calculation module is based on the real-time operating frequency F RT Calculating the expected communication rate R b ; Comparison module, the actual communication rate R a Compare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; If the communication rate of the electric energy meter exceeds the allowable error range, the adjustment module will adjust the actual communication rate of the electric energy meter.R a Adjust to the expected communication rate R b , that is, when the comparison module detects that the deviation exceeds the allowable range, it performs a baud rate reset operation to change the actual communication rate to R a Update to the desired rate R b .
[0039] The embodiment of this device is basically the same as the embodiment of the above method, and will not be described in detail here.
[0040] The present invention also provides an electric energy meter, which uses the above-mentioned method of adjusting the communication rate of the electric energy meter based on frequency following to adjust the communication rate, thereby solving the problem of inaccurate communication rate of the electric energy meter and ensuring that the electric energy meter can communicate with a high success rate.
[0041] An electronic device provided in an embodiment of the present application may include a processor and a memory. The processor and the memory may be connected via a bus. The electronic device may be any type of portable device (such as a smart camera, a smartphone, a tablet computer, etc.) or any type of fixed device (such as a desktop computer, a server, etc.).
[0042] The processor can perform various actions and processes according to the program stored in the memory. Specifically, the processor can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can be an X86 architecture or an ARM architecture.
[0043] The memory stores computer-executable instructions that, when executed by the processor, implement the aforementioned method for adjusting the communication rate of an electric energy meter based on frequency following. Memory 302 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which functions as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory used in the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0044] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0045] Although the above describes the specific implementation methods of the present invention, it does not limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for adjusting the communication rate of an electric energy meter based on frequency following, characterized in that: The following steps are involved: Step S1: reference frequency F S Follow to get the feedback value, and get the main frequency of the system according to the feedback value within one cycle F SYS : ; in, F SYS is the main frequency of the system, n is the number of feedback times, is the i-th feedback value; Step S2: the main frequency of the system F SYS Perform smoothing to obtain real-time operating frequency F RT ; Step S3, according to the real-time operating frequency F RT Calculating the expected communication rate R b ; Step S4: The actual communication rate R a Compare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; Step S5: If the communication rate of the electric energy meter exceeds the allowable error range, the actual communication rate R of the electric energy meter is set to s Adjust to the expected communication rate R b .
2. The method for adjusting the communication rate of an electric energy meter based on frequency following according to claim 1, characterized in that: The step S2 of smoothing the main frequency of the system by using a sliding method specifically includes: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the window length is T, the slip is c, and the real-time operating frequency is calculated through the system main frequency sequence: ; in, is the real-time running frequency of the i-th time.
3. The method for adjusting the communication rate of an electric energy meter based on frequency following according to claim 1, characterized in that: The step S2 of smoothing the main frequency of the system by using an interval method specifically includes: System main frequency F SYS The sequence is: F SYS(1) , F SYS(2) , F SYS(3) ,...,F SYS(N) , the interval is M, and the real-time operating frequency is calculated through the system main frequency sequence: ; ; ...; 。 4. A method for adjusting the communication rate of an electric energy meter based on frequency following according to claim 2 or 3, characterized in that: In step S4, the actual communication rate is calculated using (a) or (b). R a Communication rate deviation from the last communication rate: (a); (b); And determine whether the calculated communication rate deviation is within the allowable error range of the communication rate of the electric energy meter; wherein, is the theoretical communication rate, The last communication rate.
5. The method for adjusting the communication rate of an electric energy meter based on frequency following according to claim 1, characterized in that: The reference frequency is obtained by dividing the RTC clock frequency, the feedback value is the count value of multiple CLK pulses captured within a reference frequency period, and the system main frequency is the accumulated value of the count value of the CLK pulses.
6. The method for adjusting the communication rate of an electric energy meter based on frequency following according to claim 5, characterized in that: It also includes judging whether the system main frequency is valid: The system main frequency obtained in step S1 F SYS Frequency at reference temperature F TS Make comparisons; like , then the system main frequency obtained by this frequency following operation is valid.
7. A device for adjusting the communication rate of an electric energy meter based on frequency following, characterized in that: include: Main frequency follower module, used to follow the reference frequency F S Follow to get the feedback value, and get the main frequency of the system according to the feedback value within one cycle F SYS ; Smoothing module, used to adjust the system main frequency F SYS Perform smoothing to obtain real-time operating frequency F RT ; The communication rate calculation module is based on the real-time operating frequency F RT Calculating the expected communication rate R b ; The comparison module compares the actual communication rate R a Compare with the previous communication rate to determine whether the communication rate of the energy meter is within the allowable error range; If the communication rate of the electric energy meter exceeds the allowable error range, the adjustment module adjusts the actual communication rate R of the electric energy meter. s Adjust to the expected communication rate R b .
8. The device for adjusting the communication rate of an electric energy meter based on frequency following according to claim 7, characterized in that: The main frequency following module includes a control module, a counter module and an acquirer module. In a reference frequency cycle, the control module collects the pulse count value from the counter module and the pulse generation time information of the acquirer module to calculate the system main frequency.
9. An electric energy meter, characterized in that: The communication rate is adjusted using the method for adjusting the communication rate of an electric energy meter based on frequency following as described in any one of claims 1 to 6.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 6.