CN106354635A - Embedded device procedure code segment self-inspection method and device - Google Patents
Embedded device procedure code segment self-inspection method and device Download PDFInfo
- Publication number
- CN106354635A CN106354635A CN201610727513.1A CN201610727513A CN106354635A CN 106354635 A CN106354635 A CN 106354635A CN 201610727513 A CN201610727513 A CN 201610727513A CN 106354635 A CN106354635 A CN 106354635A
- Authority
- CN
- China
- Prior art keywords
- self
- program code
- data
- inspection
- threshold value
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3612—Software analysis for verifying properties of programs by runtime analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (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 invention discloses an embedded device procedure code segment self-inspection method and device, belonging to field of applied technology in embedded system. The method comprises the steps of analyzing the target document, obtaining locating information In the internal storage of the logging program code area and the length of the code area, making a backup for the backup are of the whole program code in the internal storage; When the program is in operation, conduct real-time comparison and inspection upon program running area and backup area date; Disposing of compared results, if the results are the same, then the data is right, otherwise, the date is wrong, which shall be reported. After the function concerning program code segment self inspection is added, real-time inspection of program code segment could be conducted during the operation of the equipment, in addition, the abnormality may be found immediately. In case of the occurrence of the abnormality, the equipment would record such abnormality and alarm, assist the field working staff in locating the problem and solve the problemto prevent the problem from worsening, rendering irretrievable loss.
Description
Technical field
The invention belongs to embedded system applied technical field and in particular to a kind of program code segments of embedded device from
Detecting method and device.
Background technology
The reliability of embedded device and the general requirement of real-time are all very high, will ensure the reliability of equipment in any case
Action, improving the reliability of equipment and real-time is the major tasks that embedded product designs.Due to some uncertain because
Potential danger that is plain or not having discovery leads to program code segments abnormal, and equipment may be led to produce unpredictable danger,
In this case it is difficult to ensure that the reliability of device action, or even system can be caused with serious consequence.
Content of the invention
It is an object of the invention to provide a kind of program code segments self checking method of embedded device, in order to solve embedded setting
The problem of standby program code segments runtimeerror.
For solving above-mentioned technical problem, the present invention provides a kind of program code segments self checking method of embedded device, step
Including:
1) parse file destination, obtain the internal memory location information of logging program code area, code section length, and by whole journey
Backup area in internal memory for the sequence code is backed up;
2), when program is run, detection program Operational Zone and backup area data are compared in real time;
3) process comparative result, if unanimously, data is normal;If inconsistent, data exception, and alert.
Further, also include real-time detection and judge cpu load condition, for setting program code segment self-inspection task gate
The step of threshold value, described threshold value includes monitoring time interval data self-inspection granularity;When cpu load increases, reduce data certainly
Inspection granularity and/or increase monitoring time interval;When cpu load reduces, increase data self-inspection granularity and/or reduce between the monitoring time
Every.
Further, when setting threshold value, the change of cpu load is divided into several scopes, corresponding one of each scope
Threshold value.
Further, when also including data exception, by the step of abnormal conditions write report.
The present invention also provides a kind of program code segments self-checking unit of embedded device, including such as lower module: for parsing
File destination, obtains internal memory location information, the code section length of logging program code area, and by whole program code in internal memory
The module that backed up of backup area;When running for program, compare detection program Operational Zone and the mould of backup area data in real time
Block;For processing comparative result, if unanimously, data is normal;If inconsistent, data exception, and the module alerting.
Further, also include for real-time detection and judge cpu load condition, appoint for setting program code segment self-inspection
The module of business threshold value, described threshold value includes monitoring time interval data self-inspection granularity;When cpu load increases, reduce number
According to self-inspection granularity and/or increase detection time interval;When cpu load reduces, when increasing data self-inspection granularity and/or reducing monitoring
Between be spaced.
Further, when setting threshold value, cpu load variations are divided into several scopes, each scope corresponds to a door
Threshold value.
Further, when also including for data exception, by the module of abnormal conditions write report.
The invention has the beneficial effects as follows: when parsing file destination, program code area is backuped in the internal memory formulated,
Equipment compares detection program Operational Zone and Backup Data when running in real time.The program code segments self-checking function adding, causes the device to
Enough real-time detection program code segments in running, and timely unusual circumstance, once noting abnormalities, equipment can be by exception
Situation record simultaneously alerts;Help field personnel position as soon as possible and solve problem it is ensured that equipment run safety and
Reliability, it is to avoid the expansion of problem and cause irremediable loss.
Brief description
Fig. 1 is program code segments self-inspection mission flow diagram;
Fig. 2 is cpu occupancy Detection task flow chart.
Specific embodiment
Illustrate below in conjunction with the accompanying drawings, the present invention will be described in further detail.
The present invention provides a kind of program code segments self checking method of embedded device, and specific implementation step is as shown in Figure 1.
First, initialization needs the file destination of parsing and the default value of self-inspection task threshold.Parsing file destination obtains
The address of program code segments and size, and by the data duplication of program code segments to a core position specified, as backup
Code area.The default value of self-defined self-inspection task threshold, including monitoring time interval data self-inspection granularity.In this embodiment
In, monitoring time interval default value is set to 10ms, and data self-inspection granularity default value is set to 128 bytes.
Then, carry out program code segments Detection task.When equipment runs, real-time comparison program Operational Zone code segment and backup
The binary data of 128 bytes of area code section, realizes the detection to code segment.Extremely just do not detect next 128 byte
Data, if it find that abnormal then alert and abnormal conditions are write report, makes Field Force note abnormalities in time, and facilitates technology
Personnel are accurately positioned exception and right a wrong.
Wherein, when equipment runs, code segment self-inspection task can set code segment self-inspection according to the load condition of cpu
Threshold value, threshold value includes monitoring time interval data self-inspection granularity, accomplishes to ensure in the case of not affecting equipment performance
The safety and reliability that equipment runs.Concrete cpu occupancy Detection task method is as shown in Figure 2.
In initial phase, record the time interval of one section of constant time lag, now other tasks all do not start to run, can
Obtain a more accurate standard reference time interval.During this task run, the time interval of one section of constant time lag of record
(the same with interval during this task initialization), equipment run duration, the priority of this task is minimum, as long as there being other tasks to transport
OK, this task will be interrupted and execute other tasks, until other tasks are carried out finishing and are in suspended state, this task
Just can continue to execute.Cpu task is more, and execution is more frequent, and the time interval of actual count is longer.By standard reference time
Interval and this time interval compares the occupation rate that just can obtain cpu it is known that the payload of cpu.
When cpu duty ratio is larger, current cpu task burdensome, call change program code segments self-inspection task threshold
Interface, the data self-inspection particle size reduction of program code segments self-inspection task or monitoring time interval are increased, or subtract simultaneously
Small data self-inspection granularity and increase monitoring time interval, reduces self-inspection speed so that program code segments task by the method
The little consumption reducing to cpu as far as possible.
When cpu duty ratio is less, current cpu task is lighter, calls change program code segments self-inspection task threshold
Interface, the data self-inspection granularity of program code segments self-inspection task is increased or monitoring time interval reduces, or increase simultaneously
Big data self-inspection granularity and reduction monitoring time interval, improve self-inspection speed by the method.
Can be specifically configured to: when cpu occupation rate is less than 30%, cpu self-inspection task call change program code segments are certainly
The interface of inspection task threshold, the monitoring time interval of program code segments self-inspection task is changed to 2ms, data self-inspection granularity is changed to
256 bytes;When cpu occupation rate is between 30%~60%, threshold is all recovered default value;When cpu occupation rate is more than
When 60%, the interface of program code segments self-inspection task threshold is changed in cpu self-inspection task call, by program code segments self-inspection task
Time interval is changed to 20ms, data self-inspection granularity is changed to 64 bytes for monitoring.
That is, between less than 30%, 30%~60% in the above-described embodiments, cpu load condition is divided into three scopes,
More than 60%, each scope corresponds to a threshold value, and that is, 30% with lower threshold value for monitoring time interval 2ms, data self-inspection
Granularity 256 byte;Between 30%~60%, threshold value is monitoring time interval 10ms, data self-inspection granularity 128 byte;60% with
Upper is monitoring time interval 20ms, data self-inspection granularity 64 byte.As other embodiment, can be according to practical situation, by cpu
Load condition is further subdivided into more scopes, and corresponding more threshold values, even each cpu load value correspond to a door
Threshold value, now can determine threshold value by directly calculating or tabling look-up.
The present invention also provides a kind of program code segments self-checking unit of embedded device, including such as lower module: for parsing
File destination, obtains internal memory location information, the code section length of logging program code area, and by whole program code in internal memory
The module that backed up of backup area;When running for program, compare detection program Operational Zone and the mould of backup area data in real time
Block;For processing comparative result, if unanimously, data is normal;If inconsistent, data exception, and the module alerting.
The program code segments self-checking unit of above-mentioned embedded device, is actually based on a kind of meter of the inventive method flow process
Calculation machine solution, i.e. a kind of software architecture, above-mentioned various modules are each treatment progress corresponding with method flow or journey
Sequence.Due to complete to the introduction sufficiently clear of said method, therefore this device is no longer described in detail.
Claims (8)
1. a kind of program code segments self checking method of embedded device is it is characterised in that comprise the steps:
1) parse file destination, obtain the internal memory location information of logging program code area, code section length, and by whole program generation
Backup area in internal memory for the code is backed up;
2), when program is run, detection program Operational Zone and backup area data are compared in real time;
3) process comparative result, if unanimously, data is normal;If inconsistent, data exception, and alert.
2. the program code segments self checking method of embedded device according to claim 1 is it is characterised in that also include in real time
Detect and judge cpu load condition, for the step of setting program code segment self-inspection task threshold value, described threshold value includes supervising
Survey time interval data self-inspection granularity;When cpu load increases, reduce data self-inspection granularity and/or increase monitoring time interval;
When cpu load reduces, increase data self-inspection granularity and/or reduce monitoring time interval.
3. the program code segments self checking method of embedded device according to claim 2 is it is characterised in that set threshold value
When, the change of cpu load is divided into several scopes, each scope corresponds to a threshold value.
4. the program code segments self checking method of embedded device according to claim 1 is it is characterised in that also include data
When abnormal, by the step of abnormal conditions write report.
5. a kind of program code segments self-checking unit of embedded device is it is characterised in that include as lower module:
1) it is used for parsing file destination, obtain internal memory location information, the code section length of logging program code area, and by whole journey
The module that backup area in internal memory for the sequence code is backed up;
2), when being used for program operation, detection program Operational Zone and the module of backup area data are compared in real time;
3) it is used for processing comparative result, if unanimously, data is normal;If inconsistent, data exception, and the module alerting.
6. embedded device according to claim 5 program code segments self-checking unit it is characterised in that also include for
Real-time detection simultaneously judges cpu load condition, for the module of setting program code segment self-inspection task threshold value, described threshold value bag
Include monitoring time interval data self-inspection granularity;When cpu load increases, reduce data self-inspection granularity and/or increase detection time
Interval;When cpu load reduces, increase data self-inspection granularity and/or reduce monitoring time interval.
7. the program code segments self-checking unit of embedded device according to claim 6 is it is characterised in that set threshold value
When, cpu load variations are divided into several scopes, each scope corresponds to a threshold value.
8. embedded device according to claim 5 program code segments self-checking unit it is characterised in that also include for
During data exception, by the module of abnormal conditions write report.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610727513.1A CN106354635B (en) | 2016-08-25 | 2016-08-25 | A kind of the program code segments self checking method and device of embedded device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610727513.1A CN106354635B (en) | 2016-08-25 | 2016-08-25 | A kind of the program code segments self checking method and device of embedded device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106354635A true CN106354635A (en) | 2017-01-25 |
CN106354635B CN106354635B (en) | 2018-11-09 |
Family
ID=57854227
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610727513.1A Active CN106354635B (en) | 2016-08-25 | 2016-08-25 | A kind of the program code segments self checking method and device of embedded device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106354635B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766267A (en) * | 2018-12-15 | 2019-05-17 | 中国平安人寿保险股份有限公司 | CPU high consumes Code location method, apparatus, electronic equipment and storage medium |
CN111027072A (en) * | 2019-12-20 | 2020-04-17 | 北京安天网络安全技术有限公司 | Kernel Rootkit detection method and device based on elf binary system standard analysis under Linux |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1908909A (en) * | 2006-08-24 | 2007-02-07 | 无敌科技(西安)有限公司 | Supported system of startup program and method thereof |
US7191445B2 (en) * | 2001-08-31 | 2007-03-13 | Texas Instruments Incorporated | Method using embedded real-time analysis components with corresponding real-time operating system software objects |
CN102520974A (en) * | 2011-10-26 | 2012-06-27 | 京信通信系统(中国)有限公司 | Method and device for automatic recovery of repeater station radio frequency data table |
CN104298599A (en) * | 2014-10-21 | 2015-01-21 | 卡斯柯信号有限公司 | Online embedded-software runtime fault self-checking and slice recovering method and device |
CN104572414A (en) * | 2014-12-23 | 2015-04-29 | 深圳市邦彦信息技术有限公司 | Method and system for detecting CPU (Central Processing Unit) occupancy rate of vxWorks |
-
2016
- 2016-08-25 CN CN201610727513.1A patent/CN106354635B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7191445B2 (en) * | 2001-08-31 | 2007-03-13 | Texas Instruments Incorporated | Method using embedded real-time analysis components with corresponding real-time operating system software objects |
CN1908909A (en) * | 2006-08-24 | 2007-02-07 | 无敌科技(西安)有限公司 | Supported system of startup program and method thereof |
CN102520974A (en) * | 2011-10-26 | 2012-06-27 | 京信通信系统(中国)有限公司 | Method and device for automatic recovery of repeater station radio frequency data table |
CN104298599A (en) * | 2014-10-21 | 2015-01-21 | 卡斯柯信号有限公司 | Online embedded-software runtime fault self-checking and slice recovering method and device |
CN104572414A (en) * | 2014-12-23 | 2015-04-29 | 深圳市邦彦信息技术有限公司 | Method and system for detecting CPU (Central Processing Unit) occupancy rate of vxWorks |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766267A (en) * | 2018-12-15 | 2019-05-17 | 中国平安人寿保险股份有限公司 | CPU high consumes Code location method, apparatus, electronic equipment and storage medium |
CN111027072A (en) * | 2019-12-20 | 2020-04-17 | 北京安天网络安全技术有限公司 | Kernel Rootkit detection method and device based on elf binary system standard analysis under Linux |
CN111027072B (en) * | 2019-12-20 | 2024-02-27 | 北京安天网络安全技术有限公司 | Kernel Rootkit detection method and device based on elf binary standard analysis under Linux |
Also Published As
Publication number | Publication date |
---|---|
CN106354635B (en) | 2018-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11138056B2 (en) | System and method for unsupervised prediction of machine failures | |
US10579453B2 (en) | Stream-processing data | |
WO2020052147A1 (en) | Monitoring device fault detection method and apparatus | |
US11403551B2 (en) | System and method for validating unsupervised machine learning models | |
EP3355197B1 (en) | Fault processing method, related apparatus, and computer | |
US20180348747A1 (en) | System and method for unsupervised root cause analysis of machine failures | |
CN113658414B (en) | Mine equipment fault early warning method and device, terminal equipment and storage medium | |
CN105512027B (en) | Process status monitoring method and device | |
CN105549508B (en) | A kind of alarm method and device merged based on information | |
CN109088775B (en) | Abnormity monitoring method and device and server | |
US11733688B2 (en) | System and method for recognizing and forecasting anomalous sensory behavioral patterns of a machine | |
CN109976975B (en) | Disk capacity prediction method and device, electronic equipment and storage medium | |
CN108238538A (en) | The fault monitoring method and fault monitoring system of a kind of escalator | |
CN108170581A (en) | A kind of fault early warning method, device and electronic equipment | |
CN104044969A (en) | Elevator fault early warning method and system | |
CN104331310A (en) | Background application one-click installation method and system | |
CN106354635A (en) | Embedded device procedure code segment self-inspection method and device | |
CN111310778A (en) | Detection device, detection method, and recording medium on which detection program is recorded | |
CN112534371A (en) | Optimizing accuracy of machine learning algorithms for monitoring operation of industrial machines | |
KR20150007913A (en) | Failure Prediction Device | |
KR102213676B1 (en) | Terminal apparatus for autosar system with arithmetic operation supervision function and arithmetic operation supervision method of autosar system | |
CN111193617B (en) | Webpage tampering identification method and device, electronic equipment and storage medium | |
CN108880881A (en) | The method and apparatus of monitoring resource under a kind of cloud environment | |
CN114755036A (en) | Fault detection method, device, equipment and medium for suspension system of magnetic-levitation train | |
CN103678095A (en) | Warning detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |