CN102520223A - Software anti-interference method used for electric energy meter - Google Patents

Software anti-interference method used for electric energy meter Download PDF

Info

Publication number
CN102520223A
CN102520223A CN2011103407054A CN201110340705A CN102520223A CN 102520223 A CN102520223 A CN 102520223A CN 2011103407054 A CN2011103407054 A CN 2011103407054A CN 201110340705 A CN201110340705 A CN 201110340705A CN 102520223 A CN102520223 A CN 102520223A
Authority
CN
China
Prior art keywords
record
coding
data message
correct
read
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.)
Granted
Application number
CN2011103407054A
Other languages
Chinese (zh)
Other versions
CN102520223B (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.)
Ningbo Sanxing Smart Electric Co Ltd
Original Assignee
Ningbo Sanxing 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 Ningbo Sanxing Electric Co Ltd filed Critical Ningbo Sanxing Electric Co Ltd
Priority to CN201110340705.4A priority Critical patent/CN102520223B/en
Publication of CN102520223A publication Critical patent/CN102520223A/en
Application granted granted Critical
Publication of CN102520223B publication Critical patent/CN102520223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Emergency Protection Circuit Devices (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a software anti-interference method used for an electric energy meter. A coding number is arranged for data information in software and is encrypted; when the data information is read, the coding number in the data information is verified; if the coding number is correct, the data information can be read; and if the coding number is not correct, a backup record is read and coding number verification is carried out; and the data information can not be read until the coding number is correct and then a program is operated; power-on mark information is established at a specific RAM region and it is determined whether the system is in a power-on reset state or a system reset state so as to decide whether to carry out system initialization or system recovery. If it is necessary to carry out system recovery, according to determination on a corresponding coding number, data information in a corresponding record is read. According to the invention, unstable operation of a system can be avoided, wherein the unstable operation is caused by an external interference; system data information will not be damaged or lost; and a preset operation can be correctly executed under circumstances that it is unnecessary to modify hardware and software systems by shutdown of the system.

Description

The software anti-interference method that is used for electric energy meter
Technical field
The present invention relates to software technology field, specifically is the software anti-interference method that is used for electric energy meter.
Background technology
Electric energy meter generally adopts single-chip microcomputer as central processing unit, because singlechip computer system is when industry spot is used, working environment is more abominable, and interference source is more, and its reliability should be put in the first place in overal system design.Interference source can the upset system move, and makes system produce various mistakes, so when system design; Not only to carry out well-designedly to the reliability of hardware, and will the reliability of Control Software well be designed especially fault-tolerant design; So-called " fault-tolerant design " is meant when system's operation makes a mistake; Software itself has the ability of certain tolerance mistake, though i.e. system's operation the time makes a mistake, mistake is to instigate system data information to damage or lose etc.; But can shut down the modification hardware and software, the operation that system still can correct execution subscribes.When the program segment of much accomplishing specific function is combined into a big system software, often go wrong easily, system software is big more, and interrelated more between each program segment deal with more difficult more.Some mistake is hidden, and isolated the analysis is difficult for finding; Some mistake is just possibly take place under the specified conditions, and as when system's power-down rebooting or when resetting, intrasystem data message is changed probably, produces system mistake.These are because the software errors that disturb to produce can make system's fluctuation of service, and are bad during fashion, can make system data information damage or lose, and shut down and revise hardware and software and extremely bother.
Summary of the invention
Technical matters to be solved by this invention is; Provide and avoid system's fluctuation of service of causing because of external interference; System data information can not damaged or lost, and needn't shut down the modification hardware and software systems and still can correct execution subscribe the software anti-interference method that is used for electric energy meter of operation.
For solving the problems of the technologies described above, the software anti-interference method that is used for electric energy meter provided by the invention, it may further comprise the steps:
(1), when the software input data information, encrypt and constitute a record for each data message is provided with unique corresponding codes respectively, again many parts of storages of each record backup;
(2), basis reads the data message in the corresponding record the judgement of coding when reading information.
In the described step 1 is to show each byte of forming each data message to dispose unique corresponding codes and encrypt for each data message is provided with respectively that unique corresponding codes encrypts.
Described basis is to the judgement of coding, the data message in the corresponding record read be meant:
When reading stored record, at first check the coding in this record, if coding is correct, then this is recorded as correct record, the data message in the reading and recording; Incorrect if encode, then check the coding of the backup of this record, correct up to coding, then this duplicated record is correct record, reads the data message in the duplicated record; All incorrect like the coding in the duplicated record, then carry out system initialization.
Described step 2 also comprises:
When system restarted because of power down or resets, the judgement system was electrification reset or system reset, if electrification reset then carries out system initialization; If the record of storage is then read in system reset, and, the data message in the corresponding record is read according to judgement to coding.
Described judgement system is that electrification reset or system reset are to realize in the following manner:
System power on for the first time or long-time power down after power on again; Program is carried out initialization; And the flag information that powers on is set in specific RAM district, when system restarted because of power down or resets, program judged at first whether the flag information that powers on changes; Flag information changes if power on, and then system is an electrification reset; Flag information is constant if power on, and then system is system reset.
Technical scheme by the invention described above provides can find out that there is following advantage in the present invention: the present invention is provided with coding encrypting to the data message in the software, during read data information; All to verify the coding in the data message; If correct rear readable data information incorrect, then reads duplicated record and the checking of encoding; Correct up to coding, then read data information and working procedure.Whether such mode makes system owing to disturb when producing mistake, can change to data message and judge, and because duplicated record is arranged, system data information can not lose or damage, and the reliability of system is improved greatly; And set up the flag information position that powers on to judge it is electrification reset or system reset in specific RAM district, carry out system initialization or system recovery in order to decision; If need system recovery then according to judgement to respective coding; Data message in the corresponding record reads; Such mode makes when system's power-down rebooting or can judge effectively whether intrasystem data message changes when resetting; If data message changes, system initialization then makes the system can error running; If data message is constant, then can continue working procedure.Needn't detect to judge whether system is normal, needn't shut down the modification hardware and software to system.
Description of drawings
Fig. 1 is the software anti-interference method process flow diagram that the present invention is used for electric energy meter.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is done explanation in further detail.
The software anti-interference method process flow diagram that is used for electric energy meter by the present invention shown in Figure 1 can know that it may further comprise the steps:
Step 1 when the software input data information, is encrypted record of formation for each data message is provided with unique corresponding codes respectively, again many parts of storages of each record backup;
Step 2 according to the judgement to coding, reads the data message in the corresponding record when reading information.
In the described step 1 is to show each byte of forming each data message to dispose unique corresponding codes and encrypt for each data message is provided with respectively that unique corresponding codes encrypts.As buying electric weight EEPROM storage user, buying electric weight is two bytes, joins 5AH for each byte and encrypts record of formation, again 3 parts of storages of this record backup.
Described basis is to the judgement of coding, the data message in the corresponding record read be meant:
When reading stored record, at first check the coding in this record, if coding is correct, then this is recorded as correct record, the data message in the reading and recording; Incorrect if encode, then check the coding of the backup of this record, correct up to coding, then this duplicated record is correct record, reads the data message in the duplicated record; All incorrect like the coding in the duplicated record, then carry out system initialization.The coding of this recording setting compared when whether described judgement coding correctly was meant coding in the reading and recording and input data information, if both are identical, then coding is correct; If both are inequality, it is incorrect then to encode.
Described step 2 also comprises:
When system restarted because of power down or resets, the judgement system was electrification reset or system reset, if electrification reset then carries out system initialization; If the record of storage is then read in system reset, and, the data message in the corresponding record is read according to judgement to respective coding.When described electrification reset was meant normal energized, a series of initialization operations that this moment, single-chip microcomputer need carry out comprised initialization register, each hardware of initialization or the like.Described system reset is meant because the abnormal cause system crash after system restarts, can be collapsed preceding operation according to the information recorded recovery system.
Described judgement system is that electrification reset or system reset are to realize in the following manner:
System power on for the first time or long-time power down after power on again, program is carried out initialization, and in specific RAM district the setting flag information that powers on; The flag information that powers on is a program coding; Like 55H 0AAH 5AH 0A5H, when system restarted because of power down or resets, program judged at first whether the flag information that powers in RAM district changes; Flag information changes if power on, and then system is an electrification reset; Flag information is constant if power on, and then system is system reset.Described RAM district is meant the data storage cell in the single-chip microcomputer.
Below only use preferable instance with regard to the present invention and made explanation, but can not be interpreted as it is the restriction to claim, structure of the present invention can have other variations, is not limited to said structure.In a word, all various variations of in the protection domain of independent claims of the present invention, being done are all in protection scope of the present invention.

Claims (5)

1. software anti-interference method that is used for electric energy meter is characterized in that it may further comprise the steps:
(1), when the software input data information, encrypt and constitute a record for each data message is provided with unique corresponding codes respectively, again many parts of storages of each record backup;
(2), basis reads the data message in the corresponding record the judgement of coding when reading information.
2. the software anti-interference method that is used for electric energy meter according to claim 1; It is characterized in that in the described step 1 is to show each byte of forming each data message to dispose unique corresponding codes and encrypt for each data message is provided with respectively that unique corresponding codes encrypts.
3. the software anti-interference method that is used for electric energy meter according to claim 1 is characterized in that, described basis is to the judgement of coding, the data message in the corresponding record is read be meant:
When reading stored record, at first check the coding in this record, if coding is correct, then this is recorded as correct record, the data message in the reading and recording; Incorrect if encode, then check the coding of the backup of this record, correct up to coding, then this duplicated record is correct record, reads the data message in the duplicated record; All incorrect like the coding in the duplicated record, then carry out system initialization.
4. according to claim 1 or the 3 described software anti-interference methods that are used for electric energy meter, it is characterized in that described step 2 also comprises:
When system restarted because of power down or resets, the judgement system was electrification reset or system reset, if electrification reset then carries out system initialization; If the record of storage is then read in system reset, and, the data message in the corresponding record is read according to judgement to coding.
5. the software anti-interference method that is used for electric energy meter according to claim 4 is characterized in that, described judgement system is that electrification reset or system reset are to realize in the following manner:
System power on for the first time or long-time power down after power on again; Program is carried out initialization; And the flag information that powers on is set in specific RAM district, when system restarted because of power down or resets, program judged at first whether the flag information that powers on changes; Flag information changes if power on, and then system is an electrification reset; Flag information is constant if power on, and then system is system reset.
CN201110340705.4A 2011-11-02 2011-11-02 Software anti-interference method used for electric energy meter Active CN102520223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110340705.4A CN102520223B (en) 2011-11-02 2011-11-02 Software anti-interference method used for electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110340705.4A CN102520223B (en) 2011-11-02 2011-11-02 Software anti-interference method used for electric energy meter

Publications (2)

Publication Number Publication Date
CN102520223A true CN102520223A (en) 2012-06-27
CN102520223B CN102520223B (en) 2014-05-14

Family

ID=46291211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110340705.4A Active CN102520223B (en) 2011-11-02 2011-11-02 Software anti-interference method used for electric energy meter

Country Status (1)

Country Link
CN (1) CN102520223B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109444523A (en) * 2018-10-23 2019-03-08 广州汉光电气股份有限公司 A kind of electric energy calculates display storage method and device
CN110880353A (en) * 2018-09-06 2020-03-13 华邦电子股份有限公司 Electronic device and operation method thereof
CN112462909A (en) * 2020-11-23 2021-03-09 广州朗国电子科技有限公司 Reset control method and device of all-in-one switching equipment and storage medium
CN113239067A (en) * 2021-04-30 2021-08-10 国网河北省电力有限公司沧州供电分公司 Anti-counterfeiting method of right-confirming certificate
US11314596B2 (en) 2018-07-20 2022-04-26 Winbond Electronics Corp. Electronic apparatus and operative method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2039039U (en) * 1988-09-21 1989-06-07 天津大学 Anti-tracking encrypted protection keylock for softwore of a microcomputor
CN1317774A (en) * 2001-05-15 2001-10-17 郭宝平 Enciphering method of photoelectric information
CN1585321A (en) * 2004-06-07 2005-02-23 北京交通大学 Digital information anti-interference soft encrypted method and system based on Turbo code-encode
CN101364984A (en) * 2008-08-13 2009-02-11 西安鼎蓝通信技术有限公司 Method for guarantee safety of electronic file
CN102149078A (en) * 2010-02-09 2011-08-10 北京数字天域科技有限责任公司 Backup and restoring method for cellphone enterprise address list

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2039039U (en) * 1988-09-21 1989-06-07 天津大学 Anti-tracking encrypted protection keylock for softwore of a microcomputor
CN1317774A (en) * 2001-05-15 2001-10-17 郭宝平 Enciphering method of photoelectric information
CN1585321A (en) * 2004-06-07 2005-02-23 北京交通大学 Digital information anti-interference soft encrypted method and system based on Turbo code-encode
CN101364984A (en) * 2008-08-13 2009-02-11 西安鼎蓝通信技术有限公司 Method for guarantee safety of electronic file
CN102149078A (en) * 2010-02-09 2011-08-10 北京数字天域科技有限责任公司 Backup and restoring method for cellphone enterprise address list

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李君茹等: "浅谈数据库系统的安全性", 《科技天地》 *
荀珂: "数据库系统安全性浅析", 《电脑知识与技术》 *
魏慧彩: "数据库加密技术概述", 《职业与教育》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11314596B2 (en) 2018-07-20 2022-04-26 Winbond Electronics Corp. Electronic apparatus and operative method
CN110880353A (en) * 2018-09-06 2020-03-13 华邦电子股份有限公司 Electronic device and operation method thereof
CN110880353B (en) * 2018-09-06 2022-06-07 华邦电子股份有限公司 Electronic device and operation method thereof
CN109444523A (en) * 2018-10-23 2019-03-08 广州汉光电气股份有限公司 A kind of electric energy calculates display storage method and device
CN112462909A (en) * 2020-11-23 2021-03-09 广州朗国电子科技有限公司 Reset control method and device of all-in-one switching equipment and storage medium
CN113239067A (en) * 2021-04-30 2021-08-10 国网河北省电力有限公司沧州供电分公司 Anti-counterfeiting method of right-confirming certificate
CN113239067B (en) * 2021-04-30 2023-07-18 国网河北省电力有限公司沧州供电分公司 Anti-counterfeiting method for right-confirming certificate

Also Published As

Publication number Publication date
CN102520223B (en) 2014-05-14

Similar Documents

Publication Publication Date Title
CN100489805C (en) Autonomous memory checker for runtime security assurance and method therefore
CN102279775B (en) Method for processing failure of hard disk under Linux system
CN112579130B (en) Interactive IAP upgrading method
CN105589776B (en) A kind of Fault Locating Method and server
CN103631721A (en) Method and system for isolating bad blocks in internal storage
CN102279776B (en) Error checking and correcting ability testing method and device
US20140189335A1 (en) Firmware upgrade error detection and automatic rollback
CN106021002B (en) Data reading and writing method and device for embedded equipment
CN103164523A (en) Inspection method, device and system of data consistency inspection
CN102520223B (en) Software anti-interference method used for electric energy meter
CN102385671B (en) Software enciphering method and system
CN105843699A (en) Error monitoring of a memory device containing embedded error correction
CN102135925B (en) Method and device for detecting error check and correcting memory
CN103745753A (en) Error correction method and system based on flash memory
CN102646453A (en) Method and system for testing error correcting code module in NandFlash controller
CN102402470A (en) Method and device for automatically correcting error of program of flash memory and repairing program of flash memory
CN108089892A (en) A kind of method, apparatus of safety startup of system, set-top box and storage medium
US20130151886A1 (en) Computing device and method for switching physical links of a sas expander of the computing device
CN103593301A (en) Bad block management method and system
WO2021088368A1 (en) Method and device for repairing memory
CN111428280A (en) SoC (System on chip) security chip key information integrity storage and error self-repairing method
CN112306410B (en) Data processing method and device for electric energy meter, storage medium and electric energy meter
CN110083478B (en) Data recovery method, data recovery system and solid state disk
CN109144409B (en) Data processing method and device, storage medium and data system
US9075715B2 (en) Isolating and correcting VPD data mismatch and/or corruption

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP03 Change of name, title or address

Address after: 315191 Yinzhou Industrial Park, Zhejiang, Ningbo, Yinzhou District, Ningbo

Patentee after: NINGBO SANXING MEDICAL ELECTRIC CO., LTD.

Address before: 315191 Zhejiang city of Ningbo province Jiangshan town Yinzhou District Mingguang Road No. 1166

Patentee before: Ningbo Sanxing Electric Co., Ltd.

TR01 Transfer of patent right

Effective date of registration: 20210813

Address after: No.16 Fengwan Road, Cicheng Town, Jiangbei District, Ningbo City, Zhejiang Province

Patentee after: NINGBO SANXING SMART ELECTRIC Co.,Ltd.

Address before: 315191 Yinzhou Industrial Park, Ningbo City, Zhejiang Province (Jiangshan Town, Yinzhou District, Ningbo City)

Patentee before: NINGBO SANXING ELECTRIC Co.,Ltd.

TR01 Transfer of patent right