CN102520223B - 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
CN102520223B
CN102520223B CN201110340705.4A CN201110340705A CN102520223B CN 102520223 B CN102520223 B CN 102520223B CN 201110340705 A CN201110340705 A CN 201110340705A CN 102520223 B CN102520223 B CN 102520223B
Authority
CN
China
Prior art keywords
record
coding
data message
read
correct
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
CN201110340705.4A
Other languages
Chinese (zh)
Other versions
CN102520223A (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

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

For the software anti-interference method of electric energy meter
Technical field
The present invention relates to software technology field, is specifically the software anti-interference method for electric energy meter.
Background technology
Electric energy meter generally adopts single-chip microcomputer as central processing unit, and because singlechip computer system is in the time that industry spot is used, working environment is more severe, and interference source is more, and its reliability should be put in the first place in overal system design.Interference source can upset system move; make system produce various mistakes; so in the time of system; not only to carry out well-designed to the reliability of hardware; and to well design the reliability of controlling software; especially fault-tolerant design; so-called " fault-tolerant design " refers to when system operation makes a mistake; software itself has the ability of certain tolerance mistake; though make a mistake while being system operation; mistake is to instigate the damage of system data information or loss etc., but can shut down modification hardware and software, and system still can correctly be carried out the operation of reservation.When the program segment that much completes specific function is combined into a large system software, often easily go wrong, system software is larger, and interrelated between each program segment deal with more difficult more.Some mistake is hidden, and isolated analysis is difficult for finding; Some mistake is just may occur under specified conditions, and as in the time that system power failure is restarted or reset, intrasystem data message is probably changed, and produces system mistake.These are because the software error that interference produces can make system fluctuation of service, bad when fashion, can make system data information damage or lose, and shutdown modification hardware and software extremely bothers.
Summary of the invention
Technical matters to be solved by this invention is; provide and avoid the system fluctuation of service that causes because of external interference; system data information can not be damaged or be lost, and needn't shut down modification hardware and software systems and still can correctly carry out the software anti-interference method for electric energy meter of subscribing operation.
For solving the problems of the technologies described above, the software anti-interference method for electric energy meter provided by the invention, it comprises the following steps:
(1), in the time of software input data information, the coding that unique correspondence is set respectively for each data message is encrypted and forms a record, then many parts of storages of each record backup;
(2), when reading information according to the judgement to coding, the data message in corresponding record is read.
Described according to the judgement to coding, the data message in corresponding record is read and referred to:
While reading stored record, first check the coding in this record, if coding is correct, this is recorded as correct record, reads the data message in record; Incorrect if encoded, check the coding of the backup of this record, until it is correct to encode, this duplicated record is correct record, reads the data message in duplicated record; As all incorrect in the coding in duplicated record, carry out system initialization.
It is the coding encrypting that each byte of showing the each data message of composition configures unique correspondence that the coding that unique correspondence is set respectively for each data message in described step 1 is encrypted.
Described step 2 also comprises:
In the time that system restarts or resets because of power down, judgement system is electrification reset or system reset, if electrification reset carries out system initialization; If system reset reads the record of storage, and according to the judgement to coding, the data message in corresponding record is read.
Described judgement system is that electrification reset or system reset are achieved in the following ways:
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, in the time that system restarts or resets because of power down, first program judges whether the flag information that powers on changes, if powered on, flag information changes, and system is electrification reset; If powered on, flag information is constant, and system is system reset.
As seen from the above technical solution provided by the invention, there is following advantage in the present invention: the present invention arranges coding encrypting to the data message in software, when read data information, all to verify the coding in data message, correct rear readable data information, if incorrect, reads duplicated record and the checking of encoding, until coding is correct, read data information working procedure.When such mode makes system wrong because interference produces, can whether data message be changed and be judged, and owing to there being duplicated record, system data information can not lose or damage, the reliability of system is improved; And set up the flag information position that powers on to judge it is electrification reset or system reset in specific RAM district, in order to determine to carry out system initialization or system recovery; If needing system recovers according to the judgement to corresponding coding, data message in corresponding record is read, such mode makes can effectively judge in the time that system power failure is restarted or reset whether intrasystem data message changes, if data message changes, system initialization, makes the system can error running; If data message is constant, can continue working procedure.Needn't detect to judge that whether system is normal to system, needn't shut down modification hardware and software.
Accompanying drawing explanation
Fig. 1 is the software anti-interference method process flow diagram of the present invention for electric energy meter.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in more detail.
The present invention is known for the software anti-interference method process flow diagram of electric energy meter as shown in Figure 1, and it comprises the following steps:
Step 1, in the time of software input data information, the coding that unique correspondence is set respectively for each data message is encrypted a record of formation, then many parts of storages of each record backup;
Step 2, according to the judgement to coding, reads the data message in corresponding record when reading information.
It is the coding encrypting that each byte of showing the each data message of composition configures unique correspondence that the coding that unique correspondence is set respectively for each data message in described step 1 is encrypted.As bought electric weight EEPROM storage user, buying electric weight is two bytes, join 5AH to each byte and encrypt a record of formation, then 3 parts of storages of this record backup.
Described according to the judgement to coding, the data message in corresponding record is read and referred to:
While reading stored record, first check the coding in this record, if coding is correct, this is recorded as correct record, reads the data message in record; Incorrect if encoded, check the coding of the backup of this record, until it is correct to encode, this duplicated record is correct record, reads the data message in duplicated record; As all incorrect in the coding in duplicated record, carry out system initialization.Described judge whether coding correctly refers to that the coding of this record setting compares when reading coding in record with input data information, if both are identical, coding correctly; If both are not identical, encode incorrect.
Described step 2 also comprises:
In the time that system restarts or resets because of power down, judgement system is electrification reset or system reset, if electrification reset carries out system initialization; If system reset reads the record of storage, and according to the judgement to corresponding coding, the data message in corresponding record is read.Described electrification reset refers to while normally switching on power, and a series of initialization operations that now single-chip microcomputer need to carry out, comprise initialization register, each hardware of initialization etc.Described system reset refers to due to abnormal cause system crash, after system is restarted, and can be according to the operation before the information recovery system collapse of record.
Described judgement system is that electrification reset or system reset are achieved in the following ways:
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, the flag information that powers on is program coding, as 55H0AAH5AH0A5H, in the time that system restarts or resets because of power down, first program judges whether the flag information that powers in RAM district changes, if powered on, flag information changes, and system is electrification reset; If powered on, flag information is constant, and system is system reset.Described RAM district refers to the data storage cell in single-chip microcomputer.
Below only apply preferably example with regard to the present invention and made explanation, but can not be interpreted as it is limitations on claims, structure of the present invention can have other to change, and is not limited to said structure.In a word, all various variations of doing in the protection domain of independent claims of the present invention are all in protection scope of the present invention.

Claims (4)

1. for a software anti-interference method for electric energy meter, it is characterized in that, it comprises the following steps:
(1), in the time of software input data information, the coding that unique correspondence is set respectively for each data message is encrypted and forms a record, then many parts of storages of each record backup;
(2), when reading information according to the judgement to coding, the data message in corresponding record is read;
Described according to the judgement to coding, the data message in corresponding record is read and referred to:
While reading stored record, first check the coding in this record, if coding is correct, this is recorded as correct record, reads the data message in record; Incorrect if encoded, check the coding of the backup of this record, until it is correct to encode, this duplicated record is correct record, reads the data message in duplicated record; As all incorrect in the coding in duplicated record, carry out system initialization.
2. the software anti-interference method for electric energy meter according to claim 1, it is characterized in that, it is the coding encrypting that each byte of showing the each data message of composition configures unique correspondence that the coding that unique correspondence is set respectively for each data message in described step 1 is encrypted.
3. the software anti-interference method for electric energy meter according to claim 1, is characterized in that, described step 2 also comprises:
In the time that system restarts or resets because of power down, judgement system is electrification reset or system reset, if electrification reset carries out system initialization; If system reset reads the record of storage, and according to the judgement to coding, the data message in corresponding record is read.
4. the software anti-interference method for electric energy meter according to claim 3, is characterized in that, described judgement system is that electrification reset or system reset are achieved in the following ways:
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, in the time that system restarts or resets because of power down, first program judges whether the flag information that powers on changes, if powered on, flag information changes, and system is electrification reset; If powered on, flag information is constant, and 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 CN102520223A (en) 2012-06-27
CN102520223B true 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)

Families Citing this family (5)

* 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
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
CN113239067B (en) * 2021-04-30 2023-07-18 国网河北省电力有限公司沧州供电分公司 Anti-counterfeiting method for right-confirming certificate

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 (6)

* Cited by examiner, † Cited by third party
Title
数据库加密技术概述;魏慧彩;《职业与教育》;20071231(第6期);第110页 *
数据库系统安全性浅析;荀珂;《电脑知识与技术》;20110630;第7卷(第18期);第4286-4288页 *
李君茹等.浅谈数据库系统的安全性.《科技天地》.2010,(第2期),第45-46页.
浅谈数据库系统的安全性;李君茹等;《科技天地》;20101231(第2期);第45-46页 *
荀珂.数据库系统安全性浅析.《电脑知识与技术》.2011,第7卷(第18期),第4286-4288页.
魏慧彩.数据库加密技术概述.《职业与教育》.2007,(第6期),第110页.

Also Published As

Publication number Publication date
CN102520223A (en) 2012-06-27

Similar Documents

Publication Publication Date Title
US10229016B2 (en) Redundant computer system utilizing comparison diagnostics and voting techniques
CN102279775B (en) Method for processing failure of hard disk under Linux system
CN102520223B (en) Software anti-interference method used for electric energy meter
US8713251B2 (en) Storage system, control method therefor, and program
US8171379B2 (en) Methods, systems and media for data recovery using global parity for multiple independent RAID levels
CN105589776B (en) A kind of Fault Locating Method and server
CN108062259B (en) MCU internal data storage ECC processing system and processing method thereof
CN103631721A (en) Method and system for isolating bad blocks in internal storage
CN102411523B (en) Method and device for storing file backups and backup method for file systems
CN101246443B (en) Method and system for repairing memory failures
CN103970481A (en) Method and device for reconstructing memory array
CN106371947B (en) A kind of multiple faults disk data reconstruction method and its system for RAID
CN107315616B (en) Firmware loading method and device and electronic equipment
CA2836333A1 (en) Firmware upgrade error detection and automatic rollback
US9952579B2 (en) Control device
CN102135925A (en) Method and device for detecting error check and correcting memory
CN104503781A (en) Firmware upgrading method for hard disk and storage system
CN105259863A (en) PLC warm backup redundancy method and system
CN104598335A (en) Method and device for restoring backup of NV parameters
CN106708646A (en) Hard disk abnormal condition automatic resetting method and device thereof
CN102646453A (en) Method and system for testing error correcting code module in NandFlash controller
US20130151886A1 (en) Computing device and method for switching physical links of a sas expander of the computing device
WO2021088368A1 (en) Method and device for repairing memory
CN105824719A (en) Method and system for detecting random access memory
CN111752755B (en) Relay protection key data redundancy storage and reliability recovery system and method

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