A self-detection method and system for electric energy meter
By implementing self-testing methods in smart energy meters, including MCU self-testing and real-time monitoring, the problem of incomplete detection of chip and hardware problems in the existing technology is solved, timely discovery and processing of energy meter faults is achieved, and the failure rate is reduced. , improve operation and maintenance efficiency and user experience.
Patent Information
- Application Number
- CN202111002904.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-08-30
AI Technical Summary
The existing redundant design of smart energy meters mainly focuses on the software perspective and lacks comprehensive closed-loop detection of chip and hardware problems, resulting in the inability to effectively handle random failures of energy meters.
Propose a self-test method and system for electric energy meters. By starting the main controller MCU for self-test, real-time monitoring of the RAM and code areas, and multi-dimensional detection according to preset time intervals, including register write-read-compare, power supply voltage Detection, ADC component measurement, clock source oscillation and external storage working status, timely detection and processing of faults.
The electric energy meter can detect potential faults as early as possible at each stage, automatically process or issue fault warnings, reduce the failure rate, reduce the burden of operation and maintenance, save costs, and improve the service level and user experience of the power grid company.
Smart Images

Figure CN113917385B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent electricity consumption technology, and more specifically, to a self-detection method and system for an electric energy meter. Background Art
[0002] As the terminal of power grid marketing business, power consumption information and energy distribution, the basic equipment of power consumption information collection system and the key power metering instrument, the high reliability of smart power meter is crucial to the whole system. Since the operating environment of power meter may have harsh conditions such as high temperature, high humidity, low temperature, salt spray, and the functions of power meter are becoming more and more complex, various random failures may occur in power meter. It is generally believed that random failures that may occur in the life cycle of power meter should include but not be limited to: CPU register and program pointer failure, interrupt response failure; clock failure, including clock stop and abnormal clock frequency; memory failure, including single bit or multi-bit error of non-volatile memory, DC failure of volatile memory; analog circuit failure; chip IO and external board-level signal connection failure, etc.
[0003] At present, the reliability design of the electric energy meter during operation mainly focuses on the redundancy design from the software perspective, such as data backup storage, parameters, variables, etc., to reduce the interference of system errors on the operation of the electric energy meter. The disadvantage is that although the redundant design mentioned above can solve some problems in the operation of the electric energy meter, its treatment is not comprehensive enough, especially for the lack of closed-loop detection of chip and hardware problems. Summary of the invention
[0004] The present invention provides a self-detection method and system for an electric energy meter to solve the problem of how to realize the self-detection of the electric energy meter.
[0005] In order to solve the above problem, according to one aspect of the present invention, a self-detection method for an electric energy meter is provided, the method comprising:
[0006] After starting the main controller MCU of the energy meter, self-check the MCU operating environment and internal components of the energy meter;
[0007] When the self-test passes, real-time monitoring of the RAM and code area is performed during program execution;
[0008] During the software operation, the electric energy meter is tested in different dimensions at preset time intervals.
[0009] Preferably, the self-checking of the MCU operating environment and internal components of the electric energy meter includes:
[0010] Check whether the write-read-compare of the MCU core related registers is correct;
[0011] Check whether the MCU's RAM is working properly and whether there are any abnormal bits;
[0012] Check whether the program area of MCU is complete;
[0013] Set up the MCU peripherals to check whether the write-read-compare is consistent;
[0014] Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range;
[0015] Check the accuracy of the ADC component measurement to determine whether the ADC component is normal;
[0016] Check whether the associated clock source is oscillating and has a reasonable frequency;
[0017] Check whether the associated external storage is working properly; and
[0018] When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
[0019] Preferably, the real-time monitoring of RAM and code area includes:
[0020] Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing;
[0021] Real-time detection of ECC legitimacy of flash memory data; and
[0022] When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the DCC is illegal, an interrupt or reset is generated, and the application performs alarm and recovery operations according to the error indication.
[0023] Preferably, the detecting of different dimensions of the electric energy meter at preset time intervals includes:
[0024] Check whether the status of kernel-related peripheral registers meets the legality requirements;
[0025] Perform read and write tests on critical RAM areas;
[0026] Regularly perform CRC check of the code area;
[0027] Compare the current register value with the design target value to monitor the peripheral registers;
[0028] Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified;
[0029] During program execution, the legality and compliance of the running variables are checked, wherein the running variables include: key variables, loops and pointers.
[0030] Preferably, the method comprises:
[0031] By combining with hardware circuits, the stability of the power supply can be monitored in real time, including:
[0032] Check whether the load of the relevant power supply is within a reasonable range;
[0033] For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply;
[0034] The power supply circuits of external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external circuit is cut off.
[0035] Preferably, the method further comprises:
[0036] Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering chip;
[0037] When the clock accuracy requirement is lower than the preset requirement, choose to use the clock oscillation source in the chip to reduce the MCU running clock's dependence on external components;
[0038] The MCU exchanges data with external components. When variable data is transmitted during the communication process, a method of "mirroring" and then transmitting is adopted; or a method of multiple reading is adopted.
[0039] According to another aspect of the present invention, a self-detection system for an electric energy meter is provided, the system comprising:
[0040] A self-check unit is used to perform a self-check of the MCU operating environment and internal components of the electric energy meter after starting the main controller MCU of the electric energy meter;
[0041] Real-time monitoring unit, used to perform real-time monitoring of RAM and code areas during program execution after self-test passes;
[0042] The detection unit is used to detect different dimensions of the electric energy meter at preset time intervals during the software operation.
[0043] Preferably, the self-checking unit performs a self-check on the MCU operating environment and internal components of the electric energy meter, including:
[0044] Check whether the write-read-compare of the MCU core related registers is correct;
[0045] Check whether the MCU's RAM is working properly and whether there are any abnormal bits;
[0046] Check whether the program area of MCU is complete;
[0047] Set up the MCU peripherals to check whether the write-read-compare is consistent;
[0048] Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range;
[0049] Check the accuracy of the ADC component measurement to determine whether the ADC component is normal;
[0050] Check whether the associated clock source is oscillating and has a reasonable frequency;
[0051] Check whether the associated external storage is working properly; and
[0052] When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
[0053] Preferably, the real-time monitoring unit performs real-time monitoring of the RAM and code area, including:
[0054] Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing;
[0055] Real-time detection of ECC legitimacy of flash memory data; and
[0056] When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the DCC is illegal, an interrupt or reset is generated, and the application performs alarm and recovery operations according to the error indication.
[0057] Preferably, the detection unit performs detection of different dimensions on the electric energy meter at preset time intervals, including:
[0058] Check whether the status of kernel-related peripheral registers meets the legality requirements;
[0059] Perform read and write tests on critical RAM areas;
[0060] Regularly perform CRC check of the code area;
[0061] Compare the current register value with the design target value to monitor the peripheral registers;
[0062] Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified;
[0063] During program execution, the legality and compliance of the running variables are checked, wherein the running variables include: key variables, loops and pointers.
[0064] Preferably, the system comprises:
[0065] The stability detection unit is used to monitor the stability of the power supply in real time by combining with the hardware circuit, including:
[0066] Check whether the load of the relevant power supply is within a reasonable range;
[0067] For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply;
[0068] The power supply circuits of external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external circuit is cut off.
[0069] Preferably, the system further comprises:
[0070] Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering chip;
[0071] When the clock accuracy requirement is lower than the preset requirement, choose to use the clock oscillation source in the chip to reduce the MCU running clock's dependence on external components;
[0072] The MCU exchanges data with external components. When variable data is transmitted during the communication process, a method of "mirroring" and then transmitting is adopted; or a method of multiple reading is adopted.
[0073] The present invention provides a self-detection method and system for an electric energy meter. The MCU used has a flash memory ECC error correction / detection function, and the RAM has real-time byte parity check, internal oscillator, clock stop detection, write protection of key registers and other functions; the software has an independently running reliability check module, and the software module can be combined with the self-detection means provided by the MCU hardware to realize fault discovery, early warning and recovery, and eliminate the fault of the electric energy meter as early as possible to avoid irreversible damage; the method of the present invention can enable the electric energy meter to discover potential faults as early as possible in various stages such as overall design, production and manufacturing, performance testing and even grid operation, automatically handle and solve the faults or issue fault warnings in time, greatly reduce the failure rate of the electric energy meter, reduce the workload of the electric energy meter operation and maintenance personnel, and also save a lot of operation and maintenance costs and the cost of repairing and replacing the electric energy meter for the power grid company, improve the operation reliability of the electric energy meter, and improve the service level of the power grid company and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:
[0075] Figure 1 is a flow chart of a self-detection method 100 for an electric energy meter according to an embodiment of the present invention;
[0076] Figure 2 A flowchart of starting a self-check according to an embodiment of the present invention;
[0077] Figure 3 A flowchart of timing monitoring during software operation according to an embodiment of the present invention;
[0078] Figure 4 4 is a schematic structural diagram of a self-detection system 400 for an electric energy meter according to an embodiment of the present invention. DETAILED DESCRIPTION
[0079] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.
[0080] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.
[0081] Figure 1 FIG. 1 is a flow chart of a self-detection method 100 for an electric energy meter according to an embodiment of the present invention. Figure 1 As shown, the self-detection method for an electric energy meter provided by an embodiment of the present invention includes:
[0082] Step 101, after starting the main controller MCU of the electric energy meter, a self-check of the MCU operating environment and internal components of the electric energy meter is performed.
[0083] Preferably, the self-checking of the MCU operating environment and internal components of the electric energy meter includes:
[0084] Check whether the write-read-compare of the MCU core related registers is correct;
[0085] Check whether the MCU's RAM is working properly and whether there are any abnormal bits;
[0086] Check whether the program area of MCU is complete;
[0087] Set up the MCU peripherals to check whether the write-read-compare is consistent;
[0088] Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range;
[0089] Check the accuracy of the ADC component measurement to determine whether the ADC component is normal;
[0090] Check whether the associated clock source is oscillating and has a reasonable frequency;
[0091] Check whether the associated external storage is working properly; and
[0092] When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
[0093] Combination Figure 2 As shown, in the present invention, after the MCU is started and before the application is run, the MCU operating environment and peripheral self-checks are first performed. Specifically, it includes:
[0094] a) Check whether the write-read-compare of the MCU core-related registers is correct; implementation method: write a specific value into the MCU core register, and then compare the value with the written value to see if they are consistent.
[0095] b) Check whether the MCU's RAM is working properly and whether there are "bad spots"; implementation method: first read out the current value backup of a certain address RAM, then write a specific value to the address RAM, and then read out the value, and compare the written value with the read value to see if they are consistent. If they are inconsistent, the RAM is abnormal. If they are consistent, the RAM is normal. Restore the previous value of the address, and the RAM test of the address is completed.
[0096] c) Check whether the MCU program area is complete; Implementation method: Perform CRC calculation or HASH calculation on the MCU program to find out whether the program space has been accidentally changed.
[0097] d) Set up the MCU peripherals and check whether the write-read-compare is consistent; implementation method: turn on the write switch of the relevant peripherals, then write a specific value to the register, and then read out whether the comparison is consistent.
[0098] e) Start the MCU power supply voltage detection function to determine whether the power supply voltage is within a reasonable range; and determine whether the power supply voltage reaches the operating voltage of related peripherals based on the power supply voltage. For example: the target power supply voltage is 5V, and its voltage range is detected to determine whether it exceeds the tolerance range of ±5%; whether the power supply voltage reaches the operating voltage range of the ADC component.
[0099] f) ADC component measurement accuracy check; Implementation method: First, check whether the working power supply and clock of the ADC component meet the working conditions. If yes, start the ADC to measure the benchmark reference voltage, and convert the measured value of the benchmark voltage to see if it meets the design expectations. If yes, it means that the ADC component is working normally, otherwise the ADC component is abnormal.
[0100] g) Check whether the relevant clock source is oscillating and the frequency is reasonable. Implementation method: Use the MCU internal oscillator as the counting source to capture the frequency of the external clock source. The external clock frequency should not exceed the reasonable error range.
[0101] h) The MCU related input / output status is correct; Implementation method: For output IO, check whether the output result is correct by outputting high and low levels and through the feedback circuit, and at the same time detect the input signal of the adjacent IO to determine whether there is a short circuit, adhesion, etc. If an error occurs, an error alarm will be issued.
[0102] i) Check whether the relevant external storage is working normally. Implementation method: reserve test storage space in the external memory, and the MCU performs read-erase-read-write-read and other processes on the test space to check whether the memory is working normally. If not, a memory error alarm is issued.
[0103] Step 102, when the self-check is passed, real-time monitoring of the RAM and code area is performed during program execution.
[0104] Preferably, the real-time monitoring of RAM and code area includes:
[0105] Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing;
[0106] Real-time detection of ECC legitimacy of flash memory data; and
[0107] When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the DCC is illegal, an interrupt or reset is generated, and the application performs alarm and recovery operations according to the error indication.
[0108] In the present invention, during program operation, the self-checking characteristic of the MCU is fully utilized to perform real-time monitoring of the RAM and code area.
[0109] 1. RAM detection: MCU has a RAM parity check module to monitor the reading and writing of data in RAM in real time. When writing to RAM, a check code will be generated and saved. When reading, the check code will be automatically compared. If it is inconsistent, an interrupt or reset will be generated. The application will alarm and recover according to the error indication;
[0110] 2. Code area detection: The MCU has a flash memory ECC module, which detects the ECC legitimacy of the flash memory data in real time. If there is any inconsistency, an interrupt is generated, and the application performs alarm and recovery operations.
[0111] Step 103, during the software operation, the electric energy meter is tested in different dimensions at preset time intervals.
[0112] Preferably, the detecting of different dimensions of the electric energy meter at preset time intervals includes:
[0113] Check whether the status of kernel-related peripheral registers meets the legality requirements;
[0114] Perform read and write tests on critical RAM areas;
[0115] Regularly perform CRC check of the code area;
[0116] Compare the current register value with the design target value to monitor the peripheral registers;
[0117] Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified;
[0118] During program execution, the legality and compliance of the running variables are checked, wherein the running variables include: key variables, loops and pointers.
[0119] Combination Figure 3As shown, in the present invention, during the software operation, the MCU kernel, operating parameters, operating variables, program area codes, etc. are regularly checked for legality and correctness. Specifically, it includes:
[0120] (1) Kernel detection: Check the status legitimacy of kernel-related peripheral registers.
[0121] (2) RAM test: Perform read and write tests on critical RAM areas.
[0122] (3) Regularly perform CRC check of the code area.
[0123] (4) Peripheral register detection; read the current register value and compare it with the design target value. If they are the same, it is qualified; otherwise, it is changed to the design value; key functions are monitored for operation. For example, important beat / cycle timers use timer A and timer B with at least two independent clock sources. Timer B runs in a high-priority interrupt service to monitor whether timer A generates a cycle within a reasonable time range.
[0124] (5) Operation parameters: Check the legality of the parameters used in the operation of the electric energy meter, identify whether they are qualified through algorithms such as CRC, and compare them with the data in the parameter memory to prevent abnormal changes in the parameters during operation.
[0125] (6) Running variables: During program execution, key variables, loops, pointers, etc. are checked for legality and compliance to prevent illegal execution of the program.
[0126] Preferably, the method comprises:
[0127] By combining with hardware circuits, the stability of the power supply can be monitored in real time, including:
[0128] Check whether the load of the relevant power supply is within a reasonable range;
[0129] For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply;
[0130] The power supply circuits of external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external circuit is cut off.
[0131] Preferably, the method further comprises:
[0132] Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering chip;
[0133] When the clock accuracy requirement is lower than the preset requirement, choose to use the clock oscillation source in the chip to reduce the MCU running clock's dependence on external components;
[0134] The MCU exchanges data with external components. When variable data is transmitted during the communication process, a method of "mirroring" and then transmitting is adopted; or a method of multiple reading is adopted.
[0135] The present invention can also perform self-test based on the cooperation between MCU and external hardware. It includes:
[0136] (1) Software and hardware circuits work together to perform real-time stability testing of system power supplies, etc.:
[0137] a) Check whether the load of the relevant power supply is within a reasonable range; implementation method: Use a load sensor (resistor) in series with the main circuit of the power supply, use ADC to detect the voltage across the resistor, and calculate the load current of the power supply.
[0138] b) For the MCU side power supply, use a comparator or analog-to-digital converter (ADC) to detect the amplitude, ripple, maximum load, etc. of the system power supply;
[0139] c) Open the power supply circuit of external devices in sequence. If the power supply is found to be abnormally overloaded, an overload alarm will be issued and the power supply of the external circuit will be cut off. It has the ability to track external devices that cause sudden load changes in the system (determine which device status changes cause the load change); it has the ability to control the power supply of devices related to product safety, and can cut off their power supply in the event of a safety crisis.
[0140] (2) For the power supplies of different power domains of the MCU, add detection circuits and provide detection feedback loops. When serious situations such as power failure and voltage drop occur in other power domains, the operation of devices in this power domain is prohibited, and the key information fed back should be handled with caution and fault tolerance.
[0141] (3) Metering modules and other modules that measure precisely use matching resistors, capacitors and other hardware means to ensure that the metering module is still within the tolerable range when it is not calibrated. This ensures that reliable measurement can be performed when an abnormality such as a reset of the metering chip occurs, without causing the power to be lost.
[0142] (4) For system operation, the crystal oscillator should have the function of stopping oscillation detection:
[0143] a) The MCU operating clock should minimize its reliance on external components. If the clock accuracy is not high, choose to use the clock oscillator source inside the chip. If an external crystal is used, it can automatically switch to the backup oscillator when the crystal stops to ensure that the software or related components continue to run.
[0144] b) The metering chip has high requirements for clock accuracy and generally uses an external crystal. However, when the external crystal stops oscillating, the internal oscillator should be able to be used to continue working and alarm abnormally.
[0145] (5) When the MCU interacts with external components, when variable data is transmitted during the communication process, the method of "mirroring" before transmission should be adopted to prevent data synchronization errors caused by carry during data access; or multiple readings can be used to solve synchronization problems. For example: 1) When reading the accumulated power data of the electric energy meter through communication, the program should save a backup of the current power data when the interrupt is turned off, and then use the backup power data as the response data to prevent interrupts and other changes during the data response; 2) When the MCU reads the calendar time information, the time carry may occur during the reading process, resulting in an error in the read calendar time. During program processing, multiple readings should be compared in a short period of time to ensure the same.
[0146] The self-detection technology of the electric energy meter of the present invention can realize the self-diagnosis of the electric energy meter through the functional components such as the electric energy meter MCU and external circuit. The overall reliability of the electric energy meter mainly depends on the reliability of the chip, peripheral devices, and the reliability of the overall PCB design and processing. The electric energy meter self-detection technology proposed in this patent can quickly diagnose the fault when a problem occurs in the device. The key methods involved are listed as follows:
[0147] (1) Flash memory error correction code (ECC)
[0148] By using ECC encoding technology in Flash, storage reliability can be greatly improved. When a random 1-bit error (noise, single particle, power supply abnormality, etc.) is caused by external interference or system abnormality, the ECC code can achieve self-correction to prevent CPU instruction execution errors; when a random 2-bit error occurs, ECC can achieve error detection and interrupt CPU execution through abnormality. When the electric energy meter uses an MCU that adopts this technology, it can effectively reduce the probability of abnormal program execution and metering and billing errors caused by flash memory failure, thereby improving the reliability of the electric energy meter throughout its life cycle.
[0149] (2) RAM Parity
[0150] It is used to detect the correctness of dynamic data on RAM or bus. It can detect single-bit data errors, but cannot correct them. After the hardware circuit detects the parity error, it generates an interrupt or reset. The software can perform a check or data recovery operation on the RAM according to the fault prompt to avoid affecting metering and billing. The check bit is usually formed in bytes. In a 32-bit MCU, by expanding the RAM bus to 36 bits, each byte of RAM has a 1-bit check bit. The chip hardware is responsible for automatically generating the check bit when writing data to the RAM, and automatically checking the check bit when reading data.
[0151] (3) Flash CRC check
[0152] After the electric energy meter is powered on, the software will perform an integrity check on the program code and data in the flash memory. After confirming that the code and data are complete and correct, the application software will start booting. The data integrity check is performed using the chip's CRC circuit, and after the calculation is completed, it is compared with the image saved in the flash memory. In addition to running this operation after power-on, it can also be run regularly during the life cycle of the electric energy meter to confirm in real time that there are no errors in the program and data in the flash memory.
[0153] (4) RAM power-on self-test and periodic self-test
[0154] In order to prevent the failure of individual RAM units during the life cycle of the MCU, such as stuck-at failure of individual data bits due to aging, the MCU RAM self-check should be performed regularly when the meter is powered on and during real-time operation. The self-check can be performed by the March-C algorithm implemented in the MCU hardware, and the results can be called and queried by the software. If a RAM error is detected, appropriate measures should be taken to ensure the basic functions of the meter and record diagnostic information.
[0155] The present invention is based on the self-checking technology of the main control MCU (microcontroller) of the electric energy meter, supplemented by corresponding software detection technology, and proposes a self-checking technology of the electric energy meter combining software and hardware. The MCU used in the present invention has the ECC error correction / detection function of the flash memory, and the RAM has the functions of real-time byte parity check, internal oscillator, clock stop detection, write protection of key registers, etc.; the software has an independently running reliability check module, and the software module can be combined with the self-checking means provided by the MCU hardware to realize fault discovery, early warning, and recovery, so as to eliminate the fault of the electric energy meter as early as possible and avoid irreversible damage.
[0156] The present invention can provide a method for quickly detecting common faults of electric energy meters caused by factors such as external environment or internal device damage. This method can enable the electric energy meter to discover potential faults as early as possible in various stages such as overall design, production and manufacturing, performance testing and even grid operation, automatically handle and solve the faults or issue fault warnings in time, greatly reduce the failure rate of the electric energy meter, and reduce the workload of the electric energy meter operation and maintenance personnel. At the same time, it also saves a lot of operation and maintenance costs and the cost of repairing and replacing the electric energy meter for the power grid company, improves the operation reliability of the electric energy meter, and improves the service level of the power grid company and the user experience.
[0157] Figure 4 FIG. 4 is a schematic diagram of a self-detection system 400 for an electric energy meter according to an embodiment of the present invention. Figure 4 As shown, the self-detection system 400 for electric energy meters provided in the embodiment of the present invention includes: a self-detection unit 401 , a real-time monitoring unit 402 and a detection unit 403 .
[0158] Preferably, the self-check unit 401 is used to perform a self-check of the MCU operating environment and internal components of the electric energy meter after starting the main controller MCU of the electric energy meter.
[0159] Preferably, the self-checking unit 401 performs a self-check on the MCU operating environment and internal components of the electric energy meter, including:
[0160] Check whether the write-read-compare of the MCU core related registers is correct;
[0161] Check whether the MCU's RAM is working properly and whether there are any abnormal bits;
[0162] Check whether the program area of MCU is complete;
[0163] Set up the MCU peripherals to check whether the write-read-compare is consistent;
[0164] Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range;
[0165] Check the accuracy of the ADC component measurement to determine whether the ADC component is normal;
[0166] Check whether the associated clock source is oscillating and has a reasonable frequency;
[0167] Check whether the associated external storage is working properly; and
[0168] When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
[0169] Preferably, the real-time monitoring unit 402 is used to perform real-time monitoring of the RAM and code area during program execution after the self-check is passed.
[0170] Preferably, the real-time monitoring unit 402 performs real-time monitoring of the RAM and code area, including:
[0171] Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing;
[0172] Real-time detection of ECC legitimacy of flash memory data; and
[0173] When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the DCC is illegal, an interrupt or reset is generated, and the application performs alarm and recovery operations according to the error indication.
[0174] Preferably, the detection unit 403 is used to detect different dimensions of the electric energy meter at preset time intervals during the software operation.
[0175] Preferably, the detection unit 403 performs detection of different dimensions on the electric energy meter at preset time intervals, including:
[0176] Check whether the status of kernel-related peripheral registers meets the legality requirements;
[0177] Perform read and write tests on critical RAM areas;
[0178] Regularly perform CRC check of the code area;
[0179] Compare the current register value with the design target value to monitor the peripheral registers;
[0180] Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified;
[0181] During program execution, the legality and compliance of the running variables are checked, wherein the running variables include: key variables, loops and pointers.
[0182] Preferably, the system comprises:
[0183] The stability detection unit is used to monitor the stability of the power supply in real time by combining with the hardware circuit, including:
[0184] Check whether the load of the relevant power supply is within a reasonable range;
[0185] For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply;
[0186] The power supply circuits of external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external circuit is cut off.
[0187] Preferably, the system further comprises:
[0188] Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering chip;
[0189] When the clock accuracy requirement is lower than the preset requirement, choose to use the clock oscillation source in the chip to reduce the MCU running clock's dependence on external components;
[0190] The MCU exchanges data with external components. When variable data is transmitted during the communication process, a method of "mirroring" and then transmitting is adopted; or a method of multiple reading is adopted.
[0191] The self-detection system 400 for an electric energy meter according to an embodiment of the present invention corresponds to the self-detection method 100 for an electric energy meter according to another embodiment of the present invention, and will not be described in detail herein.
[0192] The invention has been described above with reference to a few embodiments. However, it is readily apparent to a person skilled in the art that other embodiments than the ones disclosed above are equally within the scope of the invention, as defined by the appended patent claims.
[0193] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / said / the [means, components, etc.]" are to be openly interpreted as at least one instance of the means, components, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not necessarily have to be performed in the exact order disclosed, unless explicitly stated otherwise.
[0194] 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.
[0195] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0196] 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 comprising 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.
[0197] 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.
[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A self-detection method for an electric energy meter, characterized in that: The method comprises: After starting the main controller MCU of the energy meter, self-check the MCU operating environment and internal components of the energy meter; When the self-test passes, real-time monitoring of the RAM and code area is performed during program execution; During the software operation, the electric energy meter is tested in different dimensions at preset time intervals; The detecting of different dimensions of the electric energy meter at preset time intervals includes: Check whether the status of kernel-related peripheral registers meets the legality requirements; Perform read and write tests on critical RAM areas; Regularly perform CRC check of the code area; Compare the current register value with the design target value to monitor the peripheral registers; Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified; During program execution, the operation variables are checked for legality and compliance; wherein the operation variables include: key variables, loops and pointers; Wherein, the method further comprises: Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering module; When the clock accuracy requirement is lower than the preset requirement, select the clock oscillation source in the MCU to reduce the reliance of the MCU operating clock on external components; The MCU exchanges data with external components. When variable data is transmitted during the communication process, the method of "mirroring" first and then transmitting is adopted; or the method of multiple reading is adopted.
2. The method according to claim 1, characterized in that: The self-test of the MCU operating environment and internal components of the electric energy meter includes: Check whether the write-read-compare of the MCU core related registers is correct; Check whether the MCU's RAM is working properly and whether there are any abnormal bits; Check whether the program area of MCU is complete; Set up the MCU peripherals to detect whether the write-read-compare is consistent; Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range; Check the accuracy of the ADC component measurement to determine whether the ADC component is normal; Check whether the associated clock source is oscillating and has a reasonable frequency; Check whether the associated external storage is working properly; and When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
3. The method according to claim 1, characterized in that: The real-time monitoring of the RAM and code area includes: Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing; Real-time detection of ECC legitimacy of flash memory data; and When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the ECC is illegal, an interrupt or reset is generated, and an alarm and recovery operation are performed according to the error indication.
4. The method according to claim 1, characterized in that: The method comprises: By combining with hardware circuits, the stability of the power supply can be monitored in real time, including: Check whether the load of the relevant power supply is within a reasonable range; For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply; The power supply circuits of the external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external devices is cut off.
5. A self-detection system for electric energy meters, characterized in that: The system comprises: A self-check unit is used to perform a self-check of the MCU operating environment and internal components of the electric energy meter after starting the main controller MCU of the electric energy meter; Real-time monitoring unit, used to perform real-time monitoring of RAM and code areas during program execution after self-test passes; The detection unit is used to detect different dimensions of the electric energy meter at preset time intervals during the software operation; The detection unit performs detection of different dimensions on the electric energy meter at preset time intervals, including: Check whether the status of kernel-related peripheral registers meets the legality requirements; Perform read and write tests on critical RAM areas; Regularly perform CRC check of the code area; Compare the current register value with the design target value to monitor the peripheral registers; Check the legality of the parameters used in the operation of the electric energy meter, and use the CRC algorithm to identify whether the parameters used are qualified; During program execution, the operation variables are checked for legality and compliance; wherein the operation variables include: key variables, loops and pointers; Wherein, the system further comprises: Use matching resistors or capacitors to ensure that the metering module is within a preset tolerance range when it is not calibrated, so that reliable metering can be achieved when an abnormality occurs in the metering module; When the clock accuracy requirement is lower than the preset requirement, select the clock oscillation source in the MCU to reduce the reliance of the MCU operating clock on external components; The MCU exchanges data with external components. When variable data is transmitted during the communication process, the method of "mirroring" first and then transmitting is adopted; or the method of multiple reading is adopted.
6. The system according to claim 5, characterized in that The self-checking unit performs self-checking of the MCU operating environment and internal components of the electric energy meter, including: Check whether the write-read-compare of the MCU core related registers is correct; Check whether the MCU's RAM is working properly and whether there are any abnormal bits; Check whether the program area of MCU is complete; Set up the MCU peripherals to detect whether the write-read-compare is consistent; Use the MCU power supply voltage detection function to detect whether the power supply voltage is within a reasonable range; Check the accuracy of the ADC component measurement to determine whether the ADC component is normal; Check whether the associated clock source is oscillating and has a reasonable frequency; Check whether the associated external storage is working properly; and When the test results of each of the above tests indicate normal, the self-test result is determined to be normal; when the test results of any of the above tests indicate abnormal, the self-test result is determined to be abnormal, and an alarm is issued according to the abnormal item.
7. The system according to claim 5, characterized in that The real-time monitoring unit performs real-time monitoring of the RAM and code area, including: Monitor the reading and writing of data in RAM in real time, and automatically compare the reading with the checksum generated when writing; Real-time detection of ECC legitimacy of flash memory data; and When the comparison is consistent and the ECC is legal, the real-time monitoring result is determined to be normal; when the comparison is inconsistent or the ECC is illegal, an interrupt or reset is generated, and an alarm and recovery operation are performed according to the error indication.
8. The system according to claim 5, characterized in that The system comprises: The stability detection unit is used to monitor the stability of the power supply in real time by combining with the hardware circuit, including: Check whether the load of the relevant power supply is within a reasonable range; For the MCU side power supply, a comparator or analog-to-digital converter (ADC) is used to detect the amplitude, ripple and maximum load of the system power supply; The power supply circuits of the external devices are opened sequentially to determine whether there is an abnormal power overload. When an abnormal power overload is found, an overload alarm is issued and the power supply of the external devices is cut off.
Citation Information
Cited By
Calibration period dynamic adjustment method and system for electric energy meter
CN122109975A
Method and system for dynamic adjustment of calibration period for electric energy meter
CN122109975B
