Electric energy meter built-in memory data storage monitoring method and system
By dividing the built-in memory of the electric energy meter into multiple storage areas and establishing a script table, the problem of memory failure caused by frequent reading and writing is solved, timely alarms of electric energy meter faults are achieved, management efficiency is improved, and the reliability of the electric energy meter is improved.
Patent Information
- Application Number
- CN202111462567.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-02
AI Technical Summary
The built-in memory of existing electric energy meters is prone to failure after frequent read and write operations, and lacks data management logs, resulting in low management efficiency and difficulty in identifying and troubleshooting faults.
By dividing the built-in memory of the electric energy meter into multiple storage areas, a script table containing data addresses and data lengths is established, the actual data length is calculated, and comprehensive judgments and alarm prompts are made based on this to improve troubleshooting and management efficiency.
It realizes timely alarms and troubleshooting of electric energy meter operation faults, improves the reliability and management efficiency of electric energy meters, and prevents unreasonable designs from flowing into production.
Smart Images

Figure CN114138201B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric energy meter storage, and in particular to a method and system for storing and monitoring data in a built-in memory of an electric energy meter. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] With the increasing popularity of smart energy meters, power companies have put forward higher requirements for the intelligence of energy meters, such as requiring energy meters to provide more data such as power curves, demand curves, load curves and event records, and these data must be stored for more than several years, so as to provide strong data support for the business development of power companies. Currently, these data are usually stored in the built-in memory of the energy meter, such as the built-in memory is EEPROM or DATAFLASH.
[0004] However, there are some problems with the existing built-in memory of electricity meters in terms of the supervision of electricity meter data: for the storage allocation and read and write operations of electricity meter data, the built-in memory will usually fail due to frequent read and write operations, and there are currently no logs available for analysis. This results in the defects of the built-in memory management solution being difficult to identify in the research and development stage, but will gradually manifest itself after the electricity meter has been running for a long time, which reduces the management efficiency of the built-in memory of the electricity meter. Summary of the invention
[0005] In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a method for storing and monitoring data in a built-in memory of an electric energy meter, which is convenient for timely giving an alarm when an operating failure occurs in the electric energy meter, thereby providing troubleshooting and analysis for operation and maintenance and R&D personnel, thereby improving the reliability of the electric energy meter design.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] In a first aspect, a method for storing and monitoring data in a built-in memory of an electric energy meter is disclosed, comprising:
[0008] Dividing the built-in memory of the electric energy meter to obtain multiple storage areas;
[0009] A script table including data address and data length is established for each storage area obtained after the division;
[0010] Calculate the actual data length of the corresponding storage area based on the script table;
[0011] A comprehensive judgment is made on the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area, and then a corresponding prompt is given to the electric energy meter based on the judgment result.
[0012] In a further technical solution, when the built-in memory of the electric energy meter is divided, the capacity of the built-in memory of the electric energy meter is N, the total number of storage areas obtained after the division is M, and the i-th storage area is marked as M i , storage area M i The allocated storage capacity is marked as L i , storage area M i The storage address is marked as A i , 1≤i≤M;
[0013] According to a further technical solution, each record in the script table includes a current data address descriptor and a data length descriptor, and the data in each storage area and the newly added data are sequentially inserted into the script table to which the area belongs.
[0014] A further technical solution is to calculate the actual data length of the corresponding storage area based on the script table, specifically:
[0015] The script table of each storage area obtained after the division is traversed and calculated in turn to obtain the actual data length of each storage area.
[0016] A further technical solution is to calculate the sum of the actual data lengths of all storage areas based on the actual data length of each storage area, and make a comparison and judgment based on the sum of the actual data lengths and the capacity of the built-in memory of the electric energy meter:
[0017] When the sum of the actual data lengths obtained is greater than the capacity of the built-in memory of the electric energy meter, the factory state of the electric energy meter is detected. When the electric energy meter is in the factory state, the operation is stopped and an alarm prompt operation is executed; otherwise, an alarm prompt operation is executed.
[0018] A further technical solution is to compare and judge the actual capacity of each storage area with the storage capacity allocated to each storage area when the sum of the actual data lengths obtained is less than or equal to the capacity of the built-in memory of the electric energy meter:
[0019] When the actual capacity of any storage area is greater than its allocated storage capacity, the factory status of the electric energy meter is detected. When the electric energy meter is in the factory status, the operation is stopped and an alarm prompt operation is executed; otherwise, an alarm prompt operation is executed.
[0020] A further technical solution is that when the actual capacity of any storage area is less than or equal to its allocated storage capacity, a judgment is made as to whether there is any boundary overlap between the two storage areas. When there is a boundary overlap, the factory status of the electric energy meter is detected. When the electric energy meter is in the factory status, the operation is stopped and an alarm prompt operation is executed; otherwise, an alarm prompt operation is executed.
[0021] A further technical solution includes recording the error information corresponding to the alarm prompt operation in a log, and sending the recorded error information to the main station for processing;
[0022] Preferably, statistics are collected for the maximum number of reads, the cumulative number of reads, the maximum number of writes and the cumulative number of writes of each storage area, and the statistical results are sent to the master station for processing.
[0023] In a further preferred technical solution, the maximum number of reads of the storage area is calculated in the following manner:
[0024] When reading Len bytes from any address A and condition A is met i ≤A i+1 When Len>R i_max , the number of bytes Len is used as the maximum number of reads for the storage area;
[0025] Among them, A i is the starting address of the memory area where any address A is located, A i+1 is the starting address of the next storage area of the memory area where any address A is located, Len is the byte length read locally, R i_max The maximum length of data read from the memory area where any address A is located;
[0026] Preferably, the cumulative number of reads of the storage area is calculated as follows:
[0027] When reading Len bytes from any address A and condition A is met i ≤A i+1 When , the cumulative number of reads of the storage area is recorded as R i_max +Len;
[0028] Preferably, the maximum number of write times for a storage area is calculated as follows:
[0029] When writing Len bytes at any address A and condition A is met i ≤A i+1 When Len>W i_max , the number of bytes Len is used as the maximum number of write times for the storage area;
[0030] Among them, W i_max The maximum length of data written to the memory area where any address A is located;
[0031] Preferably, in the method for managing the built-in memory of the electric energy meter, the cumulative number of writes to the storage area is calculated in the following manner:
[0032] When writing Len bytes at any address A and condition A is met i ≤A i+1 When , the cumulative number of writes to the storage area is recorded as W i_max +Len.
[0033] A further technical solution also includes: printing out the maximum read times, cumulative read times, maximum write times and cumulative write times of each storage area through the serial port at preset intervals.
[0034] Preferably, the preset interval is 10s.
[0035] The above method of the present invention is applicable to both the design verification stage and the grid operation stage of the electric energy meter. In the design stage, the output log is analyzed and adjusted in advance to avoid unreasonable designs from flowing into the batch production table. It can only be used as a means of alarm or device analysis in the batch table.
[0036] In a second aspect, a data storage and monitoring system for an electric energy meter with a built-in memory is disclosed, comprising:
[0037] The storage area division module is configured to: divide the built-in memory of the electric energy meter to obtain a plurality of storage areas;
[0038] The script table establishment module is configured to: establish a script table including data address and data length for each storage area obtained after the division;
[0039] The comprehensive judgment module is configured to: calculate the actual data length of the corresponding storage area based on the script table;
[0040] A comprehensive judgment is made on the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area, and then a corresponding prompt is given to the electric energy meter based on the judgment result.
[0041] One or more of the above technical solutions have the following beneficial effects:
[0042] The present invention divides the built-in memory of an electric energy meter to obtain multiple storage areas, then establishes a script table containing data addresses and data lengths for each storage area obtained after the division, and calculates the actual data length of the corresponding storage area based on the script table, and then uses the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area for comparison and judgment, and then makes corresponding alarm prompts based on whether the electric energy meter is in a factory state or a factory state, so as to facilitate timely alarm when an operating failure occurs in the electric energy meter, and then provide troubleshooting and analysis for operation and maintenance and R&D personnel, thereby improving the reliability of the electric energy meter design.
[0043] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0045] Figure 1 The figure is a flow chart of a method for managing a built-in memory of an electric energy meter in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0047] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0048] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0049] Embodiment 1
[0050] This embodiment discloses a method for monitoring data storage in a built-in memory of an electric energy meter. Specifically, see Figure 1 As shown, the method for managing the built-in memory of the electric energy meter of this embodiment includes the following steps 1 to 8:
[0051] Step 1: divide the memory of the built-in memory of the electric energy meter to obtain multiple storage areas; wherein the capacity of the built-in memory of the electric energy meter is N, the total number of storage areas obtained after division is M, and the i-th storage area is marked as M i , storage area M iThe allocated storage capacity is marked as L i , storage area M i The storage address is marked as A i , 1≤i≤M; A i+1 =A i +L i ;
[0052] In this step, each storage area is allocated to match the functional module of the electric energy meter, which is convenient for flexible configuration and management of each functional module. For data that is written frequently, multiple areas need to be allocated to ensure that the number of writes to each area is within the range required by the device.
[0053] Step 2, for each storage area obtained after the division, respectively establish a script table containing data address and data length; wherein each record in the script table includes a current data address descriptor and a data length descriptor, and the data in the storage area and the newly added data are sequentially inserted into the script table; the data in the above storage area is the data to be stored, including the address and length of the data to be stored;
[0054] In this step, a mapping relationship between data address and data length is established to facilitate subsequent data management. The purpose of establishing the script table is another innovation of the invention, that is, to avoid data address overlap. When data address overlap occurs due to improper design, an alarm can be prompted or the operation can be stopped.
[0055] Step 3, traverse the script table of each storage area obtained after the division and calculate the address and length of the stored data in turn to obtain the actual data length of each storage area; wherein, the storage area M i The actual data length is marked as l i ;
[0056] Step 4, calculate the sum of the actual data lengths of all storage areas;
[0057] Step 5: Compare and judge the sum of the actual data lengths and the capacity of the built-in memory of the electric energy meter:
[0058] When the sum of the actual data lengths obtained is greater than the capacity of the built-in memory of the electric energy meter, proceed to step 8; otherwise, proceed to step 6;
[0059] Step 6: Compare and judge the actual capacity of each storage area with the storage capacity allocated to each storage area:
[0060] When the actual capacity of any storage area is greater than its allocated storage capacity, go to step 8; otherwise, go to step 7;
[0061] Step 7: Determine whether there is boundary overlap between the front and rear storage areas:
[0062] If there is boundary overlap, go to step 8; otherwise, no alarm prompt operation is performed;
[0063] Through the above steps 5-7, it is possible to determine whether data allocation exceeds the limit according to the actual length of the data and the storage allocation capacity, so as to perform corresponding processing.
[0064] Step 8: Detect the factory status of the electric energy meter and make a judgment based on the factory status:
[0065] When the electric energy meter is in the factory state (the factory state is specifically the state of the electric energy meter during factory maintenance, which is often referred to as the factory mode), the operation is stopped and the alarm prompt operation is performed; otherwise, the electric energy meter is determined to be in the factory state, and the alarm prompt operation is performed. In this embodiment, the error information corresponding to the alarm prompt operation is also recorded in the log, and the recorded error information is sent to the master station for processing.
[0066] Of course, according to actual management needs, the built-in memory management method of the electric energy meter in this embodiment will also count the maximum read times, cumulative read times, maximum write times and cumulative write times of each storage area; and send each statistical result to the main station for processing. It is convenient for the main station to timely count the storage operation status of the electric energy meter. When the number of write times in a certain area exceeds the range, it is recommended that the power company replace the electric energy meter. For example, in this embodiment, the statistical processing method of the electric energy meter is as follows:
[0067] (1) The maximum number of reads of a storage area is calculated as follows: when Len bytes are read starting from any address A and condition A is met i <A<A i+1 When Len>R i_max , the number of bytes Len is used as the maximum number of reads for the storage area; where A i is the starting address of the memory area where any address A is located, A i+1 is the starting address of the next storage area of the memory area where any address A is located, Len is the byte length read locally, R i_max The maximum length of data to be read from the memory area where any address A is located.
[0068] (2) The cumulative number of reads of the storage area is counted as follows: when Len bytes are read starting from any address A and condition A is met i ≤A i+1 When , the cumulative number of reads of the storage area is recorded as R i_max +Len.
[0069] (3) The maximum number of writes to the storage area is calculated as follows: when writing Len bytes at any address A and condition A is met i ≤A i+1 When Len>W i_max , the number of bytes Len is used as the maximum number of write times for the storage area; where W i_max The maximum length of data written to the memory area where any address A is located.
[0070] (4) The cumulative number of writes to the storage area is calculated as follows: when writing Len bytes at any address A and condition A is met i ≤A i+1 When , the cumulative number of writes to the storage area is recorded as W i_max +Len.
[0071] In order to meet the subsequent operation and maintenance needs, in this embodiment, the energy meter will also print out the maximum read times, cumulative read times, maximum write times and cumulative write times of each storage area through the serial port at preset intervals. In this way, the energy meter can send each statistical number to the main station, which will form a report for the R&D personnel of the energy meter to do research and analysis. The preset interval here is set to 10s.
[0072] The measure to reduce the frequency of the embodiment of the present invention is through balancing. In the prior art, the frequent reading and writing operations of some data will exceed the writing life of the device. Due to the lack of monitoring measures, unreasonable designs cannot be discovered and adjusted in time. The present invention prints out the maximum reading times, cumulative reading times, maximum writing times and cumulative writing times of each storage area through the serial port at preset intervals for analysis by designers.
[0073] Embodiment 2
[0074] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the program.
[0075] Embodiment 3
[0076] The purpose of this embodiment is to provide a computer-readable storage medium.
[0077] A computer-readable storage medium stores a computer program, which executes the steps of the above method when executed by a processor.
[0078] Embodiment 4
[0079] The purpose of this embodiment is to provide a built-in memory data storage and monitoring system for an electric energy meter, comprising:
[0080] The storage area division module is configured to: divide the built-in memory of the electric energy meter to obtain a plurality of storage areas;
[0081] The script table establishment module is configured to: establish a script table including data address and data length for each storage area obtained after the division;
[0082] The comprehensive judgment module is configured to: calculate the actual data length of the corresponding storage area based on the script table;
[0083] A comprehensive judgment is made on the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area, and then a corresponding prompt is given to the electric energy meter based on the judgment result.
[0084] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0085] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0086] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to 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 storing and monitoring data in a built-in memory of an electric energy meter, characterized in that: include: Dividing the built-in memory of the electric energy meter to obtain multiple storage areas; A script table including data address and data length is established for each storage area obtained after the division; Each record in the script table includes a current data address descriptor and a data length descriptor, and the data in each storage area and the newly added data are sequentially inserted into the script table to which the area belongs; Calculate the actual data length of the corresponding storage area based on the script table; Specifically: Perform traversal calculations on the script table of each storage area obtained after the division in turn to obtain the actual data length of each storage area; Comprehensively judge the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area, and then give corresponding prompts to the electric energy meter based on the judgment result; Based on the actual data length of each storage area, the sum of the actual data lengths of all storage areas is calculated, and a comparison and judgment is made based on the sum of the actual data lengths and the capacity of the built-in memory of the electric energy meter: When the sum of the actual data lengths obtained is greater than the capacity of the built-in memory of the electric energy meter, the factory state of the electric energy meter is detected. When the electric energy meter is in the factory state, the operation is stopped and an alarm prompt operation is performed; otherwise, an alarm prompt operation is performed; when the sum of the actual data lengths obtained is less than or equal to the capacity of the built-in memory of the electric energy meter, a comparison and judgment process is made between the actual capacity of each storage area and the storage capacity allocated to each storage area: When the actual capacity of any storage area is greater than its allocated storage capacity, the factory state of the electric energy meter is detected. When the electric energy meter is in the factory state, the operation is stopped and an alarm prompt operation is performed; otherwise, an alarm prompt operation is performed; When the actual capacity of any storage area is less than or equal to its allocated storage capacity, a judgment is made as to whether there is boundary overlap between the two storage areas. When there is boundary overlap, the factory state of the electric energy meter is detected. When the electric energy meter is in the factory state, the operation is stopped and an alarm prompt operation is performed; otherwise, an alarm prompt operation is performed; It also includes logging the error information corresponding to the alarm prompt operation and sending the logged error information to the main station for processing.
2. The method for storing and monitoring data in the built-in memory of an electric energy meter as claimed in claim 1, characterized in that: When the built-in memory of the electric energy meter is divided, the capacity of the built-in memory of the electric energy meter is , the total number of storage areas obtained after division is , No. The storage area is marked as , storage area The allocated storage capacity is marked as , storage area The storage address is marked as , ; .
3. The method for storing and monitoring data in the built-in memory of an electric energy meter as claimed in claim 1, characterized in that: The maximum number of reads, cumulative number of reads, maximum number of writes and cumulative number of writes of each storage area are counted respectively, and the statistical results are sent to the master station for processing.
4. The method for storing and monitoring data in the built-in memory of an electric energy meter as claimed in claim 3, characterized in that: The maximum number of reads of a storage area is calculated as follows: When at any address Start reading bytes and meets the conditions When , then in bytes As the maximum number of reads for this storage area; in, For any address The starting address of the memory area, For any address The starting address of the next storage area in the memory area. is the byte length read locally, For any address The maximum length of the data read from the memory area; The cumulative number of reads of the storage area is calculated as follows: When at any address Start reading bytes and meets the conditions , the cumulative number of reads of the storage area is recorded as ; The maximum number of writes to a storage area is calculated as follows: When at any address Start writing bytes and meets the conditions When , then in bytes As the maximum number of writes to this storage area; in, For any address The maximum length of data written in the memory area; In the method for managing the built-in memory of the electric energy meter, the method for calculating the cumulative number of write times of the storage area is as follows: When at any address Start writing bytes and meets the conditions , the cumulative number of writes to the storage area is recorded as .
5. The method for storing and monitoring data in the built-in memory of an electric energy meter as claimed in claim 3, characterized in that: It also includes: printing and outputting the maximum read times, cumulative read times, maximum write times and cumulative write times of each storage area through the serial port at preset intervals; The preset interval is 10s.
6. A built-in memory data storage and monitoring system for electric energy meters based on the method according to any one of claims 1 to 5, characterized in that: include: The storage area division module is configured to: divide the built-in memory of the electric energy meter to obtain a plurality of storage areas; The script table establishment module is configured to: establish a script table including data address and data length for each storage area obtained after the division; The comprehensive judgment module is configured to: calculate the actual data length of the corresponding storage area based on the script table; A comprehensive judgment is made on the actual data length of the storage area, the capacity of the built-in memory of the electric energy meter and the storage capacity allocated to each storage area, and then a corresponding prompt is given to the electric energy meter based on the judgment result.
7. A computing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are performed.
