CN107480045A - The error-detection error-correction and trace tracking method of a kind of electric energy meter software - Google Patents

The error-detection error-correction and trace tracking method of a kind of electric energy meter software Download PDF

Info

Publication number
CN107480045A
CN107480045A CN201710541354.0A CN201710541354A CN107480045A CN 107480045 A CN107480045 A CN 107480045A CN 201710541354 A CN201710541354 A CN 201710541354A CN 107480045 A CN107480045 A CN 107480045A
Authority
CN
China
Prior art keywords
data
electric energy
energy meter
head
software
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.)
Pending
Application number
CN201710541354.0A
Other languages
Chinese (zh)
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.)
Integrated Electronic Systems Lab Co Ltd
Original Assignee
Integrated Electronic Systems Lab 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 Integrated Electronic Systems Lab Co Ltd filed Critical Integrated Electronic Systems Lab Co Ltd
Priority to CN201710541354.0A priority Critical patent/CN107480045A/en
Publication of CN107480045A publication Critical patent/CN107480045A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of error-detection error-correction of electric energy meter software and trace tracking method, 1, increase CS check bytes for data structure and carry out CS verifications;2nd, the head and the tail tagged word byte for increasing fixed value for data structure carries out head and the tail tagged word verification;3rd, judge whether data buffer zone overflows;4th, judge whether data stack space is less than early warning value set in advance;5th, validity checking is carried out to the important suction parameter of handling function, invalid information is exported if being unsatisfactory for handling function and performing requirement;6th, electric energy meter software running orbit output function is designed, electric energy meter software running orbit information and running state information are output to computer end, easily check Current software operation conditions.The present invention gathers all kinds of error detection correction mechanisms, and is uniformly output to computer end by lopcus function the problem of will find out, and quick positioning question position simultaneously feeds back to developer and modified, and the software issue of electric energy meter is preferably minimized.

Description

The error-detection error-correction and trace tracking method of a kind of electric energy meter software
Technical field
The invention belongs to electric energy meter technical field, and in particular to a kind of error-detection error-correction of electric energy meter software and track following side Method.
Background technology
With the formal implementation of State Grid Corporation of China's intelligent electric energy meter series standard, the function showed increased of electric energy meter, electricity Energy table software code amount reaches as many as 100,000 rows, and software debugging and problem investigation work are very arduous.In spite of supplier inside The full performance test that the product systems test of progress is carried out with national grid measurement centre, but many problems hide deep, reproduction frequency Rate is small, for example, variable by it is abnormal rewrite, buffering area or stack overflow, software anomaly reset ... etc., can not confirm all hidden Mistake is hidden, national grid is forbidden upgrading the electric energy meter software of scene operation in addition, and causing partial error can not be before dispatching from the factory Eliminate, have impact on the use at scene.
The content of the invention
In order to solve the above technical problems, the present invention proposes a kind of error-detection error-correction of electric energy meter software and track following side Method, software issue is evaded in coding stage, while once make a mistake and location of mistake can be tracked quickly.
The technical solution adopted in the present invention is as follows:
The error-detection error-correction and trace tracking method of a kind of electric energy meter software, comprise the following steps:
Step 1, it is elder generation when data structure defined in electric energy meter software increases CS check bytes, storage or reading variable CS verifications are carried out according to CS check bytes;
Carry out comprising the following steps that for CS verifications:
When the 1.1st, writing data, the CS check bytes of data structure variable, CS check bytes=data knot is first calculated The data value sum of its dependent variable in structure body in addition to CS check bytes, the CS check bytes and data that then will be calculated Memory block is write together;
When the 1.2nd, reading data, following steps are performed:
1.2.1, the data value of other varying bytes in data structure in addition to CS check bytes is carried out cumulative To CS1, then by CS1 compared with the CS check bytes that the data structure stores, judge whether the two is equal, if then Read and use data, read end of data, if otherwise turning 1.2.2;
1.2.2, judge whether the data of backup area run through, if then reset default and exporting Debugging message, reading According to end, if otherwise turning in next step;
1.2.3 backup area data, are read, and go to step 1.2.1.
By increasing CS check bytes to the data structure in electric energy meter software, data knot can be judged according to check results Whether the data of structure body are destroyed, and this can be solved after data are destroyed by the structured data of reading backup by, which confirming, asks Topic, ensure that the correctness of data, which is most important for the parameters of electric energy meter that electric energy meter to be ensured correctly is run.
Step 2, for defined in electric energy meter software data structure increase fixed value head and the tail tagged word byte, storage or Head and the tail tagged word verification is first carried out according to head and the tail tagged word byte when reading variable;
Carry out comprising the following steps that for head and the tail tagged word verification:
Following steps are performed when the 2.1st, writing data:
2.1.1 the head and the tail tagged word and the head of fixed value set in advance in data structure for the variable to be write, are judged Whether tail tagged word is consistent, if then stored data and head and the tail tagged word, write end of data, if otherwise turning next simultaneously Step;
2.1.2, reset default and Debugging message is exported, stores default data;
2.2nd, read to perform following steps during data:
2.2.1 the head and the tail tagged word and the head of fixed value set in advance in data structure for the variable to be read, are judged Whether tail tagged word is consistent, if then reading and using data, reading end of data, if otherwise turning in next step;
2.2.2, judge whether the data of backup area run through, if then reset default and exporting Debugging message, reading According to end, if otherwise turning in next step;
2.2.3 backup area data, are read, and go to step 2.2.1.
, can be according to the value of head and the tail tagged word by increasing head and the tail tagged word byte to the data structure in electric energy meter software Whether it is changed and judges whether structured data is destroyed, confirms that data can be by reading backup architecture body number after destroyed Solves the problem according to mode, correct operation of the which for electric energy meter is equally most important.
Step 3, first judge whether data buffer zone overflows before using data buffer zone defined in electric energy meter software, If then exporting flooding information, if otherwise normal use data buffer zone.
Factor data buffering area is once overflow, and all operations in electric energy meter to buffering area are faulty operation, and which can To remind developer to enter row buffer adjustment in time, stop the error running of electric energy meter software.
Step 4, whether first judge data stack space before using data stack space defined in electric energy meter software Less than early warning value set in advance, if then output data stack space warning message, if otherwise normal use data stack is empty Between.
Factor data stack space once exceedes early warning value, and data stack probably just, which occurs, in running overflows, and makes Crashed into electric energy meter software, which can remind developer to pay attention to the remaining size in data stack space in time, in time more Change data stack space to avoid overflowing.
Step 5, the important suction parameter to handling function defined in electric energy meter software carry out validity checking, if discontented Sufficient handling function, which performs, to be required then to export invalid information.
Once illegal data are passed to without judgement, it will result in the incorrect execution of function or return to error result, be somebody's turn to do Mode can ensure that the legitimacy of function entrance parameter, it is ensured that the correct execution of function.
Step 6, design electric energy meter software running orbit output function, it is defeated to perform running orbit at the crucial operation of software Go out function, electric energy meter software running orbit information and running state information are output to computer end, exported according to running orbit The output information of function easily checks the operation conditions of Current software.
By checking the trace information in electric energy meter software running, the real time execution shape of electric energy meter software can be controlled Condition, the whether vicious logical relation of electric energy meter can be checked, the position that can be made a mistake with fast positioning, which is for adjusting Examination electric energy meter software, investigation problem serve very important effect.
Beneficial effect caused by the present invention:Although also there are all kinds of error detection correction mechanisms in the software of electric energy meter at present, deposit Common problem be that all kinds of mechanism are independent operatings, problem, normal course of operation can only be presented in software debugging process In once there is software issue, can not just inform errors present.The present invention gathers all kinds of error detection correction mechanisms, and will be each The problem of class mechanism is found out uniformly runs function by track and is output to computer end, and then quick positioning question position and feeds back Modified to developer, the software issue of electric energy meter is preferably minimized.
Brief description of the drawings
Fig. 1, read to carry out the flow chart of CS verifications during data;
Fig. 2, read to carry out the flow chart of head and the tail tagged word verification during data;
Fig. 3, judge the flow chart whether data buffer zone overflows;
Fig. 4, judge whether data stack space is less than the flow chart of early warning value set in advance.
Embodiment
Below in conjunction with the accompanying drawings, embodiments of the present invention are illustrated.
The error-detection error-correction and trace tracking method of a kind of electric energy meter software, comprise the following steps:
Step 1, it is elder generation when data structure defined in electric energy meter software increases CS check bytes, storage or reading variable CS verifications are carried out according to CS check bytes;
The program code for increasing CS check bytes for data structure is as follows:
Verification and decision function CHECK_STRUCT_SUM (), verification and setting function SET_STRUCT_SUM ();
Carry out comprising the following steps that for CS verifications:
When the 1.1st, writing data, the CS check bytes of data structure variable, CS check bytes=data knot is first calculated The data value sum of its dependent variable in structure body in addition to CS check bytes, the CS check bytes and data that then will be calculated Memory block is write together;
When the 1.2nd, reading data, as shown in figure 1, performing following steps:
1.2.1, the data value of other varying bytes in data structure in addition to CS check bytes is carried out cumulative To CS1, then by CS1 compared with the CS check bytes that the data structure stores, judge whether the two is equal, if then Read and use data, read end of data, if otherwise turning 1.2.2;
1.2.2, judge whether the data of backup area run through, if then reset default and exporting Debugging message, reading According to end, if otherwise turning in next step;
1.2.3 backup area data, are read, and go to step 1.2.1.
Step 2, the head and the tail tagged word for data structure increase fixed value (such as 0x55) defined in electric energy meter software Head and the tail tagged word verification is first carried out according to head and the tail tagged word byte when byte, storage or reading variable;
The program code for increasing the head and the tail tagged word byte of fixed value for data structure is as follows:
Carry out comprising the following steps that for head and the tail tagged word verification:
Following steps are performed when the 2.1st, writing data:
2.1.1 the head and the tail tagged word and the head of fixed value set in advance in data structure for the variable to be write, are judged Whether tail tagged word is consistent, if then stored data and head and the tail tagged word, write end of data, if otherwise turning next simultaneously Step;
2.1.2, reset default and Debugging message is exported, stores default data;
When the 2.2nd, reading data, as shown in Fig. 2 performing following steps:
2.2.1 the head and the tail tagged word and the head of fixed value set in advance in data structure for the variable to be read, are judged Whether tail tagged word is consistent, if then reading and using data, reading end of data, if otherwise turning in next step;
2.2.2, judge whether the data of backup area run through, if then reset default and exporting Debugging message, reading According to end, if otherwise turning in next step;
2.2.3 backup area data, are read, and go to step 2.2.1.
Step 3, first judge whether data buffer zone overflows before using data buffer zone defined in electric energy meter software, If then exporting flooding information, if otherwise normal use data buffer zone, specific steps are as shown in Figure 3.
Step 4, whether first judge data stack space before using data stack space defined in electric energy meter software Less than early warning value set in advance, if then output data stack space warning message, if otherwise normal use data stack is empty Between, specific steps are as shown in Figure 4.
Step 5, the important suction parameter to handling function defined in electric energy meter software carry out validity checking, if discontented Sufficient handling function, which performs, to be required then to export invalid information.
Step 6, design electric energy meter software running orbit output function, it is defeated to perform running orbit at the crucial operation of software Go out function, electric energy meter software running orbit information and running state information are output to computer end, exported according to running orbit The output information of function easily checks the operation conditions of Current software.
The program code for defining running orbit output function is as follows:
Debug_Print (char*format ...), output function is expert at, current variable values, higher level's call function etc. Information.

Claims (3)

1. the error-detection error-correction and trace tracking method of a kind of electric energy meter software, it is characterised in that comprise the following steps:
Step 1, be defined in electric energy meter software data structure increase CS check bytes, storage or read variable when elder generation according to CS check bytes carry out CS verifications;
Step 2, the head and the tail tagged word byte for data structure increase fixed value defined in electric energy meter software, storage or reading Head and the tail tagged word verification is first carried out according to head and the tail tagged word byte during variable;
Step 3, first judge whether data buffer zone overflows before using data buffer zone defined in electric energy meter software, if Flooding information is then exported, if otherwise normal use data buffer zone;
Step 4, first judge whether data stack space is less than before using data stack space defined in electric energy meter software Early warning value set in advance, if then output data stack space warning message, if otherwise normal use data stack space;
Step 5, the important suction parameter to handling function defined in electric energy meter software carry out validity checking, if being unsatisfactory for grasping Make function execution to require then to export invalid information;
Step 6, design electric energy meter software running orbit output function, running orbit output letter is performed at the crucial operation of software Number, is output to computer end, according to running orbit output function by electric energy meter software running orbit information and running state information Output information easily check the operation conditions of Current software.
2. the error-detection error-correction and trace tracking method of a kind of electric energy meter software according to claim 1, it is characterised in that step Progress CS verifications described in rapid 1 comprise the following steps that:
When the 1.1st, writing data, the CS check byte values of data structure variable, CS check bytes value=data knot is first calculated The data value sum of its dependent variable in structure body in addition to CS check bytes, the CS check bytes value and number that then will be calculated According to writing memory block together;
When the 1.2nd, reading data, following steps are performed:
1.2.1, the data value of other varying bytes in data structure in addition to CS check bytes is added up to obtain CS1, then by CS1 compared with the CS check bytes that the data structure stores, judge whether the two is equal, if then reading Take and use data, read end of data, if otherwise turning 1.2.2;
1.2.2, judge whether the data of backup area run through, if then reset default and export Debugging message, read data knot Beam, if otherwise turning in next step;
1.2.3 backup area data, are read, and go to step 1.2.1.
3. the error-detection error-correction and trace tracking method of a kind of electric energy meter software according to claim 1, it is characterised in that step Progress head and the tail tagged word verification described in rapid 2 comprises the following steps that:
Following steps are performed when the 2.1st, writing data:
2.1.1, judge that head and the tail tagged word and the head and the tail of fixed value set in advance in data structure of the variable to be write are special Whether consistent word is levied, if then stored data and head and the tail tagged word, write end of data simultaneously, if otherwise turning in next step;
2.1.2, reset default and Debugging message is exported, stores default data;
2.2nd, read to perform following steps during data:
2.2.1, judge that head and the tail tagged word and the head and the tail of fixed value set in advance in data structure of the variable to be read are special Whether consistent word is levied, if then reading and using data, reading end of data, if otherwise turning 2.2.2;
2.2.2, judge whether the data of backup area run through, if then reset default and export Debugging message, read data knot Beam, if otherwise turning in next step;
2.2.3 backup area data, are read, and go to step 2.2.1.
CN201710541354.0A 2017-07-05 2017-07-05 The error-detection error-correction and trace tracking method of a kind of electric energy meter software Pending CN107480045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710541354.0A CN107480045A (en) 2017-07-05 2017-07-05 The error-detection error-correction and trace tracking method of a kind of electric energy meter software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710541354.0A CN107480045A (en) 2017-07-05 2017-07-05 The error-detection error-correction and trace tracking method of a kind of electric energy meter software

Publications (1)

Publication Number Publication Date
CN107480045A true CN107480045A (en) 2017-12-15

Family

ID=60596390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710541354.0A Pending CN107480045A (en) 2017-07-05 2017-07-05 The error-detection error-correction and trace tracking method of a kind of electric energy meter software

Country Status (1)

Country Link
CN (1) CN107480045A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683861A (en) * 2018-12-10 2019-04-26 积成电子股份有限公司 A kind of light-duty collaborative operating system and its implementation of electric energy meter
CN110674050A (en) * 2019-10-08 2020-01-10 腾讯科技(深圳)有限公司 Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN112614331A (en) * 2020-12-14 2021-04-06 杭州海兴电力科技股份有限公司 Method for reading electric energy meter event and electric energy meter event reading system
CN115080648A (en) * 2022-06-27 2022-09-20 厦门市美亚柏科信息股份有限公司 Method and system for acquiring trajectory data of chart machine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877793A (en) * 2009-06-01 2010-11-03 杭州海康威视软件有限公司 Data transmitting method, error detecting method, system thereof and device thereof
CN102937944A (en) * 2012-10-16 2013-02-20 北京交控科技有限公司 Serial server based on Arcnet
CN103607258A (en) * 2013-11-18 2014-02-26 深圳市道通科技有限公司 Method, device and system for communication between primary device and secondary device in vehicle computer diagnosis device
CN106126367A (en) * 2016-06-28 2016-11-16 湖北锐世数字医学影像科技有限公司 A kind of self checking method and system of file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877793A (en) * 2009-06-01 2010-11-03 杭州海康威视软件有限公司 Data transmitting method, error detecting method, system thereof and device thereof
CN102937944A (en) * 2012-10-16 2013-02-20 北京交控科技有限公司 Serial server based on Arcnet
CN103607258A (en) * 2013-11-18 2014-02-26 深圳市道通科技有限公司 Method, device and system for communication between primary device and secondary device in vehicle computer diagnosis device
CN106126367A (en) * 2016-06-28 2016-11-16 湖北锐世数字医学影像科技有限公司 A kind of self checking method and system of file

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
吴朔媚 等: "《计算机网络安全技术研究》", 31 March 2017, 东北师范大学出版社 *
张勇 等: "《嵌入式实时操作系统μC/OS-Ⅲ应用技术——基于ARM Cortex-M3 LPC1788》", 30 April 2013, 北京航空航天大学出版社 *
陈敏: "《OPNET物联网仿真》", 30 April 2015, 华中科技大学出版社 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683861A (en) * 2018-12-10 2019-04-26 积成电子股份有限公司 A kind of light-duty collaborative operating system and its implementation of electric energy meter
CN110674050A (en) * 2019-10-08 2020-01-10 腾讯科技(深圳)有限公司 Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN110674050B (en) * 2019-10-08 2022-04-19 腾讯科技(深圳)有限公司 Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN112614331A (en) * 2020-12-14 2021-04-06 杭州海兴电力科技股份有限公司 Method for reading electric energy meter event and electric energy meter event reading system
CN115080648A (en) * 2022-06-27 2022-09-20 厦门市美亚柏科信息股份有限公司 Method and system for acquiring trajectory data of chart machine

Similar Documents

Publication Publication Date Title
CN107480045A (en) The error-detection error-correction and trace tracking method of a kind of electric energy meter software
CN108710551B (en) SPARC processor-based single event upset fault injection test method and system
US7320114B1 (en) Method and system for verification of soft error handling with application to CMT processors
CN100419695C (en) Vectoring process-kill errors to an application program
EP2770507B1 (en) Memory circuits, method for accessing a memory and method for repairing a memory
CN102301427A (en) Analyzing monitor data information from memory devices having finite endurance and/or retention
CN106776095A (en) SSD solid state hard disc data reliability intelligent detecting methods and detection means
CN108446189A (en) A kind of fault-tolerant activation system of spaceborne embedded software and method
CN101334754A (en) Fault infusion based embedded system evaluation method
CN103984630A (en) Single event upset fault processing method based on AT697 processor
CN105320579B (en) Towards the selfreparing dual redundant streamline and fault-tolerance approach of SPARC V8 processors
WO2022037022A1 (en) Online parallel processing soft error real-time error detection and recovery method and system
CN103778030A (en) Write-in method, error tracking method and processor for blog subsystem
CN109933340A (en) A kind of spacecraft EEPROM in-orbit write-in and self checking method based on page mode
CN110489285B (en) Abnormal branch testing method and system for solid state disk
CN100501686C (en) Method , processor and system for processing mistake during execution of mistake processing program
US6539338B1 (en) Self-diagnostic testing of a network interface adapter
CN113342571A (en) Method for preventing EEPROM data from losing in case of power failure applied to embedded system
CN106815153A (en) A kind of method for secure storing, device and system
CN104597807A (en) Space-borne integrated electronic CPU (central processing unit) turnover reinforcement system and method
CN114974388B (en) Single-particle error evaluation system and method for high-speed DDR memory
Lee et al. Evaluation of error detection coverage and fault-tolerance of digital plant protection system in nuclear power plants
CN109885342A (en) A kind of system program restorative procedure of law-enforcing recorder
CN112542208B (en) SD NAND testing method and device, storage medium and terminal
CN203882621U (en) Storing device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171215