CN114242150B - Method for detecting data storage function of electric energy meter - Google Patents

Method for detecting data storage function of electric energy meter Download PDF

Info

Publication number
CN114242150B
CN114242150B CN202210165322.6A CN202210165322A CN114242150B CN 114242150 B CN114242150 B CN 114242150B CN 202210165322 A CN202210165322 A CN 202210165322A CN 114242150 B CN114242150 B CN 114242150B
Authority
CN
China
Prior art keywords
data
electric energy
energy meter
test
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210165322.6A
Other languages
Chinese (zh)
Other versions
CN114242150A (en
Inventor
李席
李峥
王强
张权
王世勇
张磊
刘国军
张祖
李义真
张光亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shijiazhuang Kelin Electric Co Ltd
Original Assignee
Shijiazhuang Kelin Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shijiazhuang Kelin Electric Co Ltd filed Critical Shijiazhuang Kelin Electric Co Ltd
Priority to CN202210165322.6A priority Critical patent/CN114242150B/en
Publication of CN114242150A publication Critical patent/CN114242150A/en
Application granted granted Critical
Publication of CN114242150B publication Critical patent/CN114242150B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R35/00Testing or calibrating of apparatus covered by the other groups of this subclass
    • G01R35/04Testing or calibrating of apparatus covered by the other groups of this subclass of instruments for measuring time integral of power or current

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

A method for detecting the data storage function of an electric energy meter relates to the digital data processing technology, in particular to the data storage in the electric energy meter, in particular to the verification of the data organization and storage function of the electric energy meter, and comprises the following steps: the method comprises the steps of obtaining a data storage configuration table of the electric energy meter, reading data in the storage areas one by one according to the storage configuration table, generating test data different from the read data, writing the test data into corresponding addresses by using functional modules of the electric energy meter, reading the data in the storage areas again and comparing the data, and accordingly verifying the writing function of the electric energy meter. By adopting the invention, the test of the data storage function of the electric energy meter is automatically completed without establishing a complete true test environment, the requirement on testers is low, and the defect of manual test is avoided; the whole storage area is covered in the test process, and omission is avoided; the test data different from the original stored data is adopted, so that the reliability of the test result is ensured, and misjudgment caused by the same data can be avoided.

Description

Method for detecting data storage function of electric energy meter
Technical Field
The invention relates to a digital data processing technology, in particular to data storage in an electric energy meter, and especially relates to verification of data organization and storage functions of the electric energy meter.
Background
With the continuous development of the electric power metering technology in China, the integration level and the intelligent degree of the electric energy meter are gradually improved. As a metering device at the user side, the electric energy meter can acquire various data at the user side of the power grid in real time and provide required data for upper-layer application. In order to provide more detailed power analysis data and running state records of the electric energy meter, stored data of the electric energy meter is more and more huge, software and hardware designs are more and more complex, factors influencing data of the electric energy meter are relatively increased, the results of power analysis and running state monitoring of the electric energy meter are directly influenced by the correctness of the stored data, and some data relate to law-related problems, such as electricity stealing, and high reliability of the stored data of the electric energy meter is required.
The high reliability of data storage depends on the reliability of the storage device and the perfection of the data organization and writing function of the electric energy meter.
The electric energy meter has a plurality of types of stored data, different storage areas are divided by different data due to the characteristics of various storage devices (EEPROM, flash, RAM and FRAM, but not limited to the EEPROM, flash, RAM and FRAM), the same storage area is not limited to one type of data item (some storage areas only store active electric quantity, and some storage areas store the set of data of active electric energy, time, voltage and the like), and the storage devices can meet the storage requirements of the electric energy meter.
The data organization and writing functions of the electric energy meter need to be tested for verification.
Whether various data are stored in the set storage area or not, whether the data are correct or not, whether the test needs to cover all the set area or not, whether the test method is reliable and complete or not and directly influence the test result.
At present, the stored data test of the electric energy meter is manually completed, a tester modifies certain parameters of the electric energy meter and the external power environment according to own ideas, so that the electric energy meter generates data which the tester wants to test in an expected test state, then the stored data in the electric energy meter is copied by using copy software, and the tester checks the correctness of the stored data one by one.
In the existing testing method, the dependence degree on testing personnel is high, and the testing personnel need to know each functional module of the electric energy meter; the speed of generating test data is slow, and the test progress is influenced; a complex test environment for normal operation of the electric energy meter needs to be established; the test data generated by the tester may have certain repeatability, which affects the test result; due to the manual mode, the problem of missed testing can also occur, and comprehensive functional verification cannot be guaranteed.
Disclosure of Invention
Aiming at the problems, the invention provides a method for automatically and comprehensively detecting the data storage function of an electric energy meter.
The technical scheme adopted by the invention is as follows: a method for detecting the data storage function of an electric energy meter is characterized by comprising the following steps:
A. the corresponding relation between the storage address and the functional module is set in the electric energy meter,
B. acquiring a data storage configuration table of the electric energy meter,
C. determining the initial Address and the storage length Len of the current test storage area according to the data storage configuration table,
D. reading the data in the current test area of the electric energy meter,
E. generating test Data _ change different from the Data read in step D according to the storage length Len,
F. generating a detection packet to be sent to the electric energy meter, wherein the detection packet comprises a starting Address of the current test storage area and test Data _ change,
G. the electric energy meter executes the corresponding functional module according to the initial Address, and writes the test data into the corresponding storage area;
H. reading the data in the current test area of the electric energy meter,
I. judging the read Data and the Data _ change, if the read Data is inconsistent with the Data _ change, reporting an error by the system, and ending; otherwise, the step J is executed,
J. and C, judging whether all the storage areas are tested or not according to the data storage configuration table, if so, finishing the test, and otherwise, executing the step C.
Further: the step D comprises the following steps:
d1, reading the data in the current test area,
d2, reading data in the adjacent address of the current test area;
the step E comprises the following steps:
e1, generating the test Data _ change which is different from the Data read in the step D1 according to the storage length Len,
e2, adding one byte for the test Data _ change, wherein the added byte is different from the Data read in the step D2;
the step H comprises the following steps:
h1, reading the data in the current test area,
h2, reading data in the address adjacent to the current test area;
the step I comprises the following steps:
i1, judging the read Data in the current test area to be consistent with the Data _ change, if so, detecting and reporting errors, and ending; otherwise, the step I2 is executed,
i2, judging whether the data read in the step D2 and the data read in the step H2 are inconsistent, detecting and reporting errors, and ending; otherwise, step J is performed.
According to requirements, a designer allocates a designated storage area for data to be stored in the electric energy meter, and the data can only be stored in the designated area, and if the data are stored in other areas, data errors can be caused.
The design idea of the invention is that according to the storage area designed by the electric energy meter, the storage function module of the electric energy meter is used, and the test data is written into all the storage spaces in times according to the configuration table, and then read out and compared.
By adopting the technical scheme provided by the invention, a full-true test environment is not required to be established, the test of the data storage function of the electric energy meter is automatically completed, the requirement on testers is low, and the defect of manual test is avoided; the whole storage area is covered in the test process, and omission is avoided; the test data different from the original stored data is adopted, so that the reliability of the test result is ensured, and misjudgment caused by the same data is avoided.
Drawings
FIG. 1 is a process flow diagram of the present invention.
Detailed Description
The electric energy meter has a plurality of types of stored data, and designers divide different storage areas for different data in the electric energy meter according to the characteristics of used storage devices, and generally speaking, the space of all the storage devices uses continuous addresses and is increased from 0 to the maximum design capacity. The data occupies the whole byte, and the condition that the front bits in one byte belong to one storage area and the rear bits belong to the other storage area can not occur.
The following examples are only for better understanding of the present invention and are not intended to limit the present invention.
In an embodiment, the generated detection packet includes the following:
ID_1+Len_1+Data_change_1+ ID_2+Len_2+Data_change_2+…+ID_n+Len_n+ Data_change_n。
wherein, ID _ x represents Data items, each Data item has a unique Data ID, Len _ x represents the length of the test Data of the Data item, and Data _ change _ x represents the generated test Data.
The following examples refer to fig. 1.
Example 1.
The same storage area can store only one type of data, such as active electric quantity, and can also store different data, such as a set of data of active electric energy, time, voltage and the like, in the storage area. And each storage area is written by one functional module of the electric energy meter. In order to verify the correctness of data storage of the electric energy meter, in the test process, data writing needs to call a corresponding functional module in the electric energy meter. Therefore, in step A of the invention, the corresponding relation between the storage address and the functional module is set in the electric energy meter.
The detection needs the cooperation of an upper computer. The upper computer software integrates a meter reading protocol DLT-645/698 of the electric energy meter, communicates with the electric energy meter in modes of 485 communication, infrared communication and the like, generates and issues test data, reads the content in the memory and automatically completes the test process.
The data storage configuration table of the electric energy meter comprises a head address, a tail address, data items and the like of a storage area, and the following table gives example contents of the data storage configuration table.
Table 1: data storage configuration table
Figure 904396DEST_PATH_IMAGE001
And step B, acquiring a data storage configuration table of the electric energy meter to prepare for testing.
And the data storage configuration table is used for determining the initial Address and the storage length Len of the current test storage area, and analyzing various types of contained storage data (for example, the current test storage area contains voltage, current, time, electric quantity and the like, and each type of data has a unique data ID).
In designing a memory area, the following errors may occur: two adjacent memory regions overlap. If one memory region has an address of 0x30-0x33 and another memory region has an address of 0x32-0x37, there is an address cross of 2 bytes in the two memory spaces, which may cause an error in the application. Therefore, in the present invention, the system checks whether the storage structure has an error according to the configuration simulation storage structure, that is, step B2, determines whether there is an overlap according to the head and tail addresses of each storage area in the data storage configuration table, and if there is an overlap, detects an error.
There is also a case where a certain address segment is not present in the data storage configuration table, i.e., certain locations in memory are not used in the current design. This situation can be judged whether to cover the continuous area to obtain the free area by sequencing the head and tail addresses of all the storage areas. The occurrence of a free area of the memory does not affect the use of the electric energy meter, and the situation can be judged without.
And detecting the region by region according to the data storage configuration table of the electric energy meter.
C. And determining the initial Address and the storage length Len of the current test storage area according to the data storage configuration table.
In this embodiment, the current test area is the serial number 1 of the storage area in the table above, the start Address is the first Address 0x00, the storage length is the difference between the first and last addresses, and the storage length Len =4 of the current test area.
D. And reading data in the current test area of the electric energy meter.
Reading the current data is in preparation for generating test data.
E. According to the storage length Len, test Data _ change different from the Data read in step D is generated.
If the data in the current test area in the electric energy meter is the same as the test data, the comparison data has no difference after the writing and the reading are finished, but whether the electric energy meter writes the test data into the current test area cannot be guaranteed. Therefore, in the invention, the generated test data is different from the original data of the current test area so as to ensure the reliability of the test.
Such as test data generated as 0x 100 x 110 x 120 x 13.
F. And generating a detection packet and sending the detection packet to the electric energy meter, wherein the detection packet comprises a start Address of the current test storage area and test Data _ change, namely Address + ID +4 +0x 100 x 110 x 120 x13, and the ID represents a Data item.
G. And the electric energy meter executes the corresponding functional module according to the initial Address, and writes the received data into the corresponding storage area.
The basis for completing the step is that the corresponding relation between the storage address and the functional module is set in the electric energy meter. And the functional module with the storage Address corresponding to the initial Address completes the data writing in the current test area.
H. And reading data in the current test area of the electric energy meter.
The upper computer software integrates a meter reading protocol DLT-645/698 of the electric energy meter, and communicates with the electric energy meter in modes of 485 communication, infrared communication and the like to read specific data.
I. Judging the read Data and the Data _ change, if the read Data is inconsistent with the Data _ change, reporting an error by the system, and ending; otherwise, step J is performed.
Assuming that the data in the current test area in the electric energy meter is 0x 000 x 010 x 020 x03, the test data is the same as the data in the current test area in the electric energy meter, and is also 0x 000 x 010 x 020 x 03. If the writing module of the electric energy meter cannot write the data into the correct address, but the read data is consistent with the test data, the misjudgment is generated.
Therefore, in step E, if the generated test data is 0x 100 x 110 x 120 x13, after the writing and reading are completed, if the read data is 0x 000 x 010 x 020 x03, it indicates that the electric energy meter does not write the specified data at the specified address; if the read data is 0x 100 x 110 x 120 x13, the writing function of the electric energy meter in the area can be verified.
J. And C, judging whether all the storage areas are tested or not according to the data storage configuration table, if so, finishing the test, and otherwise, executing the step C.
The above process detects all storage areas within the electric energy meter.
In the above process, if the data storage configuration meter and the functional module of the electric energy meter are coordinated and consistent, the writing function of the functional module can be verified.
Example 2.
Consider the following: if the data storage configuration table is inconsistent with the functional modules in the electric energy meter, the length of a certain storage area in the data storage configuration table is a, and the length of the data actually written by the corresponding functional module of the electric energy meter is b, the following two situations can occur:
1. a > b, such as a =4, b = 2. The information of the storage area is read, assuming the following:
table 2: information of storage area
Figure 1577DEST_PATH_IMAGE002
The generated test data are: 0x 110 x 120 x 130 x 14.
Because the actual written data length of the corresponding electric energy meter functional module is 2, the information of the storage area after writing is performed as follows:
table 3: information 1 after writing
Figure 396786DEST_PATH_IMAGE003
Since the last two bytes read are not identical to the test data, this error can be detected using the previous method.
2. a < b, e.g., a =2, b = 4.
The information of the storage area is read, assuming the following:
table 4: information of storage area
Figure 211158DEST_PATH_IMAGE004
The generated test data are: 0x 110 x 12.
Because the actual written data length of the corresponding electric energy meter functional module is 4, the information of the storage area after writing is:
table 5: information 2 after writing
Figure 33621DEST_PATH_IMAGE005
Since 4 bytes are written, the first two bytes are generated test data, the written contents of the second two bytes are unknown, and since the length of the storage area in the data storage configuration table is 2, only the contents of 2 bytes are read and compared, the comparison result is correct, and the error cannot be detected by the method.
In view of the above situation, the present embodiment adopts the following method:
the step D comprises the following steps:
and D1, reading the data in the current test area, wherein the read data is 0x 010 x02 in the embodiment.
D2, reading data in the adjacent address of the current test area; in this embodiment, the adjacent address refers to an address of one byte after the current test area, and the read data is 0 × 03.
The step E comprises the following steps:
e1, generating test Data _ change different from the Data read in step D1 according to the storage length Len, wherein the generated test Data is 0x 110 x12 in the embodiment.
E2, adding one byte for the test Data _ change, wherein the added byte is different from the Data read in the step D2; in this embodiment, the added test data is 0x 13.
In the above step, the generated test Data _ change is 0x 110 x 120 x 13.
F. And generating a detection packet and sending the detection packet to the electric energy meter, wherein the detection packet comprises a start Address of the current test storage area and test Data _ change, namely Address + ID +3+0x 110 x 120 x13, and the ID represents a Data item.
The actual written data length of the corresponding electric energy meter functional module is 4, and the information of the storage area after writing is as follows:
table 6: written information 3
Figure 300654DEST_PATH_IMAGE006
The step H comprises the following steps:
h1, reading the data in the current test area, in this embodiment, the read data is 0x 110 x 12.
H2, reading data in the address adjacent to the current test area; in this embodiment, since 4 pieces of data are written in the functional module in the electric energy meter, the read data is 0x 13.
The step I comprises the following steps:
i1, judging the read Data in the current test area to be consistent with the Data _ change, if so, detecting and reporting errors, and ending; otherwise, the step I2 is executed,
i2, judging whether the data read in the step D2 and the data read in the step H2 are inconsistent, detecting and reporting errors, and ending; otherwise, step J is performed.
In step I1, the two are consistent; in step I2, the two data are inconsistent and an error is detected.
When generating the test Data, it is ensured that the test Data _ change is different from the Data read in steps D1 and D2 for each byte, i.e. there is a difference in the Data at the corresponding positions. This condition may detect errors such as:
data read out: 0x 010 x 020 x 030 x04 and
test data: 0x 110 x 020 x 130 x14
Although there is a difference, the second position is 0x02, which may cause the extreme case that the false detection is not possible: the writing in the other three locations is not problematic and only in the second location. Such errors may occur: data transmission is carried out between the electric energy meter and the EEPROM storage device through an IIC communication protocol, and data received by the EEPROM and data sent by the electric energy meter are possibly inconsistent in the transmission process, so that stored data errors are caused.
In the method, the steps D2 and H2 only read the content of the next byte of the current test area, in order to detect more comprehensively, the content of the previous byte of the current test area can also be read in the two steps, and comparison is performed in the step I2, so that whether the functional module of the electric energy meter wrongly writes data into the front and rear adjacent addresses can be detected.
If only one kind of data is stored in one storage area, the functional module of the electric energy meter is directly written in; if a plurality of different types of data are stored in the storage area, the electric energy meter needs to sort the data and then perform writing operation before storing. For example, the data to be stored in a certain data storage area is: the electric energy meter needs to sort the data according to the sequence, then communicate with the storage device and write the data into the storage device. If the sorting is in a problem, since the data can only be analyzed according to the sorting when being read, the read data is inconsistent with the written data, and errors occur; and the module for monitoring the shell state of the electric energy meter writes opening time when opening and writes closing time when closing.
In the two embodiments, a storage area is detected as a whole, but data sorting errors of the electric energy meter cannot be found.
Example 3.
In the test area, there are the following data items:
table 7: data item Table 1
Figure 561871DEST_PATH_IMAGE007
ID1 represents forward active power and ID2 represents reverse active power.
The testing steps are as follows:
according to the data storage configuration table, the initial Address and the storage length Len of the current test storage area are determined, various types of storage data are analyzed, and the data items contained in the embodiment are 4 bytes of forward active electric energy and 4 bytes of reverse functional electric energy.
Reading the current data of the current test area of the electric energy meter and one byte of data of the front and rear adjacent areas, wherein the data is shown in the table before test.
Test Data _ change different from the read Data is generated according to the storage length.
In this embodiment, the current test area has two data items, the forward active power of the first data item is 4 bytes, and in order to detect whether there is cross coverage between data, the generated test data needs 5 bytes: 0x 410 x 420 x 430 x 440 x 45; the second data item is reverse active energy 4 bytes, and in order to detect whether cross coverage exists between data, the generated test data needs 5 bytes: 0x 460 x 470 x 480 x 490 x4A, the test data are shown in the table above-test data.
And sending the test packets to the electric energy meter, wherein the sending data format is Address + ID1+5+ 0x 410 x 420 x 430 x 440 x45 + ID2+5+0x 460 x 470 x 480 x 490 x 4A.
The electric energy meter executes corresponding module program organization data according to the Address, and in the embodiment, the forward active electric energy is 4 bytes and the reverse active electric energy is 4 bytes in sequence, and 8 bytes of data are stored.
Reading the data of the current storage area and one byte of data of the front and back adjacent storage areas, judging whether the current test storage area is consistent with the written data, if not, the system reports an error, judging whether the data of the front and back adjacent storage areas is changed, and if so, the system reports an error.
There are several situations:
1. storing data forward overlay
If the storage start address of the current storage area is wrong, the start address of the test area in this embodiment is 0x20, and if the designer calculates the storage start address incorrectly in designing the program, the start address uses 0x1F, so that when the previous adjacent storage area is determined, data change is detected, and an error is reported.
2. Storing data back overlays
For example: the 4 bytes of reverse active electric energy take 5 bytes of data when the data are actually organized, so that 1 byte is covered backwards, and when the adjacent storage area behind is judged, data change is detected and an error is reported.
3. Currently testing memory region data errors
In the test data 1 in table 1 issued in this example, the data after performing writing and reading should be 0x 410 x 420 x 430 x 440 x 460 x 470 x 480 x49, and if not, an error is detected.
If the read data is 0x 460 x 470 x 480 x 490 x 410 x 420 x 430 x44, the data of each data item is written correctly, but the location is wrong, which indicates that the electric energy meter organizes data in error.
Example 4.
If there are multiple data items in a test area, test data is generated for each data item separately for each data item.
In the test area, there are the following data items:
table 8: data item Table 2
Figure 230750DEST_PATH_IMAGE008
According to the data storage configuration table, the start Address and the storage length Len of the current test storage area are determined, and various types of storage data are analyzed, wherein the data items included in the embodiment are parameter 1 (2 bytes), parameter 2 (3 bytes) and parameter 3 (4 bytes).
And reading the current data of the current test area of the electric energy meter and one byte of data of the front and rear adjacent areas.
Generating test Data _ change different from the read Data according to the storage length
In this embodiment, the current test area has 3 data, the first test is performed first, the data parameter is 1 (2 bytes), in order to detect whether there is cross coverage between data, the generated test data needs 3 bytes, and the test data is shown in the table above.
And sending the Address of the current test area and the generated test data to the electric energy meter, wherein the sending data format is Address + ID5+3+0x 560 x 570 x 58.
The electric energy meter executes a corresponding module program according to the Address, and the parameter 1 is modified in the embodiment.
Reading the current storage area and the front and back adjacent storage areas, judging whether the current test storage area is consistent with the written data or not, if not, the system reports an error, judging whether the data of the front and back adjacent storage areas are changed or not, and if so, the system reports an error.
There are several error cases as follows:
1. the parameter 1 data is overlaid forward.
After the test data writing is executed, it is detected that the data of the adjacent area in front of the current test storage area is changed and does not actually change,
2. parameter 1 overrides parameter 2.
3. The current test storage area data is erroneous.
And after the current data item is tested, changing the data source, and executing the detection process from reading to the storage area again for detection. It should be noted that, in the same storage area, the start addresses of the test areas are consistent for different data items, and the power meter determines the start address of the data item in the storage area according to the type ID of the data item.
A method for generating test data.
To avoid the potential risk of detection, if the test data is 0x 110 x 120 x 110 x13, if the first and third locations are written in reverse order, the error cannot be detected because the data in the two locations are the same.
The test Data _ change generated by the present invention is different from the read Data in each byte, and has no duplicate byte.
The method for generating the test Data _ change comprises the following steps:
the Data read out is Data _ get and has a length L. Data _ get is Data in the current test area or Data in the current test area +1 byte Data of the neighboring area. L is a memory length Len or a memory length Len + 1.
K1, generating a byte by using a pseudo random function, if the byte is different from the first byte in the Data _ get, setting i =1, i as the number of generated bytes, executing K2, otherwise, executing K1 again;
k2, generating a byte by using a pseudo random function, if the byte is different from the ith byte in the Data _ get and the byte is different from all the generated bytes in the Data _ change, setting i = i +1, executing K2 till generating all test Data, wherein the length of the test Data is L; otherwise, K2 is executed.
In step K1, to verify whether the writing function of the power meter covers the address space in front of the current test area, a byte Df in front of the current test area may be read first; a pseudo-random function is used to generate a byte that requires a different byte than the first byte in the Data _ get and Df.
The data generated by the above method is referred to as data having uniqueness in the present invention.
The invention also provides another method for generating test data.
Suppose the read Data is Data _ get, which is Data in the test area, and has a length of L, Fd is Data of a byte adjacent to the front of the current test area, and Bd is Data of a byte adjacent to the back of the current test area.
Data_change[j]= ((Fd<<4|(Fd&0xF0)>>4)^ Data_get[j])+(Bd^(Bd>> (j%8)))
Wherein j represents a data position, 1< = j < = L;
^ is exclusive OR, & is bitwise AND, + is addition, > > is data right shift, < < is data left shift, j%8 represents the remainder of j divided by 8;
Data_change[L+1]= ((Fd<<4|(Fd&0xF0)>>4)^ Bd)。
as shown in the following table:
table 9: storing information
Figure 224114DEST_PATH_IMAGE009
L=3,Bd=0x23,Fd=0x30,Data_get[1]=0x72,Data_get[2]=0x73,Data_get[3]=0x74。
Data_change[1]= ((0x23<<4|(0x23&0xF0)>>4)^ 0x72)+(0x30^(0x30>> 1))
=((0x30|0x02)^0x72)+(0x30^0x18)=(0x32^0x72)+0x28=0x40+0x28=0x68,
Data_change[2]= ((0x23<<4|(0x23&0xF0)>>4)^ 0x73)+(0x30^(0x30>>2))=0x7B,
Data_change[3]= ((0x23<<4|(0x23&0xF0)>>4)^ 0x74)+(0x30^(0x30>>3))=0x8C,
Data_change[4]= ((0x23<<4|(0x23&0xF0)>>4)^ 0x30)=0x70。
Generated Data _ change =0x 680 x7B 0x8C 0x 70.
In the formula, original data in a current test area is used as a data reference, previous adjacent data is used as a dispersion factor, algorithm dispersion is carried out, generated data is unequal to the original data and the previous adjacent data, the next adjacent data is used as increment of the generated data after dispersion, and the generated data is further unequal to the next adjacent data.
Since the test data has one more byte than the original data, the last byte of the test data is based on the data of the byte following the current memory area.
When testing the starting memory region, the current test region has no preceding adjacent bytes, and Fd takes the value 0x 00.
The formula does not use a pseudo-random function, and is based on original data, so that the data generation speed is higher, and the randomness is stronger.
Note that when Fd =0x00, Bd =0x00, and Data _ get [ j ] =0x00, Data _ change [ j ] =0 is calculated. In order to avoid this, when the above-described situation occurs, Bd is calculated as any value other than 0.

Claims (7)

1. A method for detecting the data storage function of an electric energy meter is characterized by comprising the following steps:
A. the corresponding relation between the storage address and the functional module is set in the electric energy meter,
B. acquiring a data storage configuration table of the electric energy meter,
C. determining the initial Address and the storage length Len of the current test storage area according to the data storage configuration table,
D. reading the data in the current test area of the electric energy meter,
E. generating test Data _ change different from the Data read in step D according to the storage length Len,
F. generating a detection packet to be sent to the electric energy meter, wherein the detection packet comprises a starting Address of the current test storage area and test Data _ change,
G. the electric energy meter executes the corresponding functional module according to the initial Address, and writes the test data into the corresponding storage area;
H. reading the data in the current test area of the electric energy meter,
I. judging the read Data and the Data _ change, if the read Data is inconsistent with the Data _ change, reporting an error by the system, and ending; otherwise, the step J is executed,
J. judging whether all the storage areas are tested or not according to the data storage configuration table, if so, finishing the test, otherwise, executing the step C;
the step D comprises the following steps:
d1, reading the data in the current test area,
d2, reading data in the adjacent address of the current test area;
the step E comprises the following steps:
e1, generating the test Data _ change which is different from the Data read in the step D1 according to the storage length Len,
e2, adding one byte for the test Data _ change, wherein the added byte is different from the Data read in the step D2;
the step H comprises the following steps:
h1, reading the data in the current test area,
h2, reading data in the address adjacent to the current test area;
the step I comprises the following steps:
i1, judging the read Data in the current test area to be consistent with the Data _ change, if so, detecting and reporting errors, and ending; otherwise, the step I2 is executed,
i2, judging whether the data read in the step D2 and the data read in the step H2 are inconsistent, detecting and reporting errors, and ending; otherwise, step J is performed.
2. The method for detecting the data storage function of the electric energy meter according to claim 1,
the test Data _ change generated in step E is not identical to the Data read in steps D1 and D2 every byte.
3. The method for testing the data storage function of an electric energy meter according to claim 1, wherein if there are a plurality of data items in a test area, each data item is tested separately.
4. The method for detecting the data storage function of the electric energy meter according to claim 1, wherein the step B comprises the following steps:
b1, obtaining a data storage configuration table of the electric energy meter,
b2, according to the head and tail addresses of each storage area in the data storage configuration table, judging whether there is overlap, if there is overlap, detecting and reporting error, ending, otherwise, continuing the detection process.
5. The method for detecting the Data storage function of the electric energy meter according to the claim 1 or 2, characterized in that, in the test Data _ change, there are no repeated bytes.
6. The method for detecting the Data storage function of the electric energy meter as claimed in claim 5, wherein the method for generating the test Data _ change is as follows:
the Data read out is Data get, length L,
k1, generating a byte by using a pseudo random function, if the byte is different from the first byte in the Data _ get, setting i =1, i as the number of generated bytes, executing K2, otherwise, executing K1 again;
k2, generating a byte using a pseudo random function, if the byte is different from the ith byte in Data _ get and the byte is different from all bytes generated in Data _ change, setting i = i +1, and executing K2 to generate all test Data; otherwise, K2 is executed.
7. The method for detecting the Data storage function of the electric energy meter as claimed in claim 2, wherein the method for generating the test Data _ change is as follows:
the Data read out is Data _ get with length L, Fd is the Data of one byte adjacent to the front of the current test area, Bd is the Data of one byte adjacent to the back of the current test area,
Data_change[j]= ((Fd<<4|(F&0xF0)>>4)^ Data_get[j])+(Bd^(Bd>> (j%8)))
wherein j represents a data position, 1< = j < = L;
Data_change[L+1]= ((Fd<<4|(F&0xF0)>>4)^ Bd)。
CN202210165322.6A 2022-02-23 2022-02-23 Method for detecting data storage function of electric energy meter Active CN114242150B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210165322.6A CN114242150B (en) 2022-02-23 2022-02-23 Method for detecting data storage function of electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210165322.6A CN114242150B (en) 2022-02-23 2022-02-23 Method for detecting data storage function of electric energy meter

Publications (2)

Publication Number Publication Date
CN114242150A CN114242150A (en) 2022-03-25
CN114242150B true CN114242150B (en) 2022-05-10

Family

ID=80747788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210165322.6A Active CN114242150B (en) 2022-02-23 2022-02-23 Method for detecting data storage function of electric energy meter

Country Status (1)

Country Link
CN (1) CN114242150B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650847A (en) * 2009-08-28 2010-02-17 杭州海兴电力科技有限公司 Check gauge of prepayment IC-card electric energy meter and method thereof
CN105738854A (en) * 2014-12-12 2016-07-06 国家电网公司 Simulation memory test board system for intelligent ammeter embedded application and test method
CN107656233A (en) * 2017-09-04 2018-02-02 国家电网公司 A kind of method tested automatically for electric energy meter software
CN111210034A (en) * 2020-01-07 2020-05-29 南京天溯自动化控制系统有限公司 Abnormal information processing method of intelligent electric meter, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326029A (en) * 2016-08-09 2017-01-11 浙江万胜智能科技股份有限公司 Data storage method for electric power meter

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650847A (en) * 2009-08-28 2010-02-17 杭州海兴电力科技有限公司 Check gauge of prepayment IC-card electric energy meter and method thereof
CN105738854A (en) * 2014-12-12 2016-07-06 国家电网公司 Simulation memory test board system for intelligent ammeter embedded application and test method
CN107656233A (en) * 2017-09-04 2018-02-02 国家电网公司 A kind of method tested automatically for electric energy meter software
CN111210034A (en) * 2020-01-07 2020-05-29 南京天溯自动化控制系统有限公司 Abnormal information processing method of intelligent electric meter, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114242150A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN106940695B (en) Data source information verification method and device
TWI476425B (en) Automatic test equipment
CN102156237B (en) Method for detecting automotive harnesses
CN109299719A (en) Barrage method of calibration, device, terminal and storage medium based on Character segmentation
CN103279401B (en) A kind of method and device of accessing storer
CN114242150B (en) Method for detecting data storage function of electric energy meter
CN112153375A (en) Front-end performance testing method, device, equipment and medium based on video information
CN108681510A (en) Data processing method and device
Kang et al. Dependability arguments with trusted bases
CN118091369A (en) Chip testing method, system, device and computer readable storage medium
CN114389978A (en) Network protocol side channel detection method and system based on static taint analysis
CN112416733B (en) Memory detection method, memory detection device and intelligent device
CN109901962B (en) Method and system for testing synchronous mixed pressure of AEP memory under Linux
Yang et al. Hybrid fault diagnosability with unreliable communication links
CN114697127B (en) Service session risk processing method based on cloud computing and server
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium
CN113409873B (en) System, method and executing device for testing erasing interference
CN115499348A (en) Local communication micro application detection system and method
US20020157047A1 (en) Logical verification apparatus and method for memory control circuit
CN113820649A (en) Method and device for testing service life reliability of electric energy meter firmware
CN107423168A (en) Method of testing and test device
CN112992252A (en) Read-write reliability detection method and device, electronic equipment and readable storage medium
CN111179997B (en) Method and device for storing test data of semiconductor memory
CN108665938B (en) Write test method, read-write test method and terminal equipment
WO2016138814A1 (en) Method and device for testing synchronous dynamic random access memory (sdram)

Legal Events

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