CN106708639A - VxWorks system based data timing accurate recording method - Google Patents
VxWorks system based data timing accurate recording method Download PDFInfo
- Publication number
- CN106708639A CN106708639A CN201510777226.7A CN201510777226A CN106708639A CN 106708639 A CN106708639 A CN 106708639A CN 201510777226 A CN201510777226 A CN 201510777226A CN 106708639 A CN106708639 A CN 106708639A
- Authority
- CN
- China
- Prior art keywords
- tick
- deviations
- data
- record
- vxworks
- 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/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
- G06F11/0754—Error or fault detection not based on redundancy by exceeding limits
- G06F11/0757—Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0766—Error or fault reporting or storing
Abstract
The invention relates to a VxWorks system based data timing accurate recording method. The method includes steps: acquiring a tick deviation value of a watchdog timer period; performing VxWorks system based data timing recording according to the tick deviation value; executing each mission in a black box file according to an obtained system clock; meanwhile, accumulating tick deviation values to enable one-to-one time correspondence of a data recording file to the black box file. By compensation of tick deviation in a system clock process, the accurate system clock is obtained, and accordingly accuracy in mission execution time and black box recording time is realized.
Description
Technical field
The present invention relates to a kind of accurate recording method of the data timing based on VxWorks system, belong to embedded development skill
Art field.
Background technology
VxWorks are the operating system softwares designed and developed exclusively for real time embedded system, can improve real-time task tune
The function such as communication between degree, interrupt management, real-time system resource and real-time task.It is exploitation VxWorks application software that Tornado is
The IDE of offer, Tornado energy utilizing works management systems combine user program with VxWorks core.Seeing
In the application of door dog timer, if over-burden for a certain process, there is time delay in the cycle for being easily caused WatchDog Timer, causes
There is deviation in system clock, and error also occurs in the time in document data record.Data timing of the research based on VxWorks system
Accurate recording method, with significant application value and practical significance.
Doorway timer allows any C function to be associated with specific time delay to seeing in VxWorks.WatchDog Timer
It is a part for system tick interrupt service routine.The use principle of WatchDog Timer is as shown in Figure 1.
, it is necessary to following several control commands, its detailed command functions and implication see below in the application of house dog timing
Text.
Semaphore control command and its implication mainly have following several:
1. semBCreate (int options, SEM_B_STATEinitialState):Distribute and initialize one two
Binary signal amount;
②semDelete(SEM_ID semId):Terminate and discharge a semaphore;
3. semTake (SEM_ID semId, int timeout):Take a semaphore;
④semGive(SEM_ID semId):One semaphore of release.
The order and its implication that house dog uses mainly have following:
①wdCreate():Distribution and initialization WatchDog Timer;
②wdDelete():Terminate and discharge WatchDog Timer;
③wdStart():Start WatchDog Timer;
④wdCancel():Cancel just in the WatchDog Timer of timing.
A kind of research accurate recording method of data timing based on VxWorks system, occurs in compensation WatchDog Timer
Time delay, it is ensured that mission perform the time accurate and document data record in time without delay, be easy to correctly analyze
With treatment test data, be conducive to being smoothed out for engineering test, valency is had important practical significance and applied to Practical Project
Value.
The content of the invention
The weakness that the present invention postpones for WatchDog Timer existence time, it is proposed that a kind of based on VxWorks system
The accurate recording method of data timing, is capable of achieving time accurate system clock and document data record, it is ensured that black box file sum
Corresponded according to the time of log file.
The technical scheme that is used to achieve the above object of the present invention is:A kind of data timing based on VxWorks system
Accurate recording method, comprises the following steps:
Obtain the tick deviations in WatchDog Timer cycle;
The data timing based on VxWorks system is carried out according to the tick deviations to record;
Every mission in black box file is performed according to the system clock for obtaining;Meanwhile, made by cumulative tick deviations
The time of document data record corresponds with the time of black box file.
The tick deviations in the WatchDog Timer cycle subtract a cycle by the tick numbers in end cycle
At the end of tick numbers obtain, specifically include following steps:
Definition and statement global variable:Flag bit, tickEnd1 and tickEnd2 and tick deviations Tickspan are 0;
The tick numbers of current period are obtained by VxWorks system function tickGet ().
The tick numbers that current period is obtained by VxWorks system function tickGet (), including:
If flag bit is equal to 1, current tick numbers are ordered by tickGet () and obtain and be assigned to tickEnd1,
Flag bit resets, and tick deviations Tickspan is equal to (tickEnd1-tickEnd2);Otherwise current tick numbers pass through
TickGet () orders are obtained and are assigned to tickEnd1, mark position 1, and cycle tick number Tickspan is equal to
(tickEnd2–tickEnd1)。
The data timing record based on VxWorks system includes:
Add up the tick deviations in the end-around carry where system clock, when adding up and more than 6tick, system
Clock additionally increases by 100 milliseconds;
In the process of data record, only record tick deviations, are not added up.
It is described the time of document data record is corresponded with the time of black box file by the tick deviations that add up, tool
Body is:
Using data post-processing software, when document data record .dat forms are converted into readable .txt files, tire out
Plus tick deviations, when adding up and more than given threshold, a line is skipped in .txt files.
The present invention has advantages below and beneficial effect:
1. the present invention gets accurate system clock so that mission by the tick deviations in compensation system clock process
The execution time is accurate, and the black box record time is accurate.
2. the present invention is recorded tick deviations in control software under water, remembers data in data post-processing software
Record file .dat forms compensate tick deviations when being converted to readable .txt files, it is ensured that document data record it is accurate
Record.
3. the accurate recording method of the data timing based on VxWorks system of present invention design, it is ensured that it is accurate that mission is performed,
The data record time is accurate, conveniently can correctly analyze and process test data, is conducive to engineer applied to be smoothed out.
Brief description of the drawings
Fig. 1 is the use principle figure of WatchDog Timer;
Fig. 2 is underwater robot control system clock compensation policy map of the invention;
Fig. 3 is underwater robot control system data record process-time deviation compensation policy map of the invention.
Specific embodiment
Below in conjunction with the accompanying drawings and embodiment the present invention is described in further detail.
Needed in the automatic Pilot unit of underwater robot to mission implementation status and carrier dynamical system, control system,
Energy resource system, sensor device etc. carry out real-time data record.Due to underwater robot system inaccurate clock, record mission is held
Postponing occurs in the black box file of market condition;Data record process for recording underwater robot equipment situation and control information goes out
Now postpone.The accurate recording method of data timing based on VxWorks system is broadly divided into two parts:1. in computing system clock
Process in, the process is circulated with the fixed cycle and performed, and due to the above reason, fixed cycle and non-temporal are fixed, and are needed
Carry out irregular time bias.By recording the tick numbers in each cycle, (tick refers to the secondary of middle timer interruption per second
Number.In VxWorks, the default setting of tick is 60, hereafter together), tick numbers corresponding with fixed cycle time are poor, because real
The border cycle always postpones, and corresponding tick numbers are more than the tick numbers of fixed cycle, so deviation is all positive number.Again by tick deviations
Accumulative superposition, when adding up and more than 6tick, system clock is extra on normal increment base to increase by 100 milliseconds.Ensure that and be
The accuracy of system clock, error is less than 100 milliseconds, and the black box data record time is recorded according to system clock, so really
The accurate record of black box log file is protected.Idiographic flow is as shown in Figure 2.2. in the process of document data record, the process
Also circulated with the fixed cycle and performed, the calculating for tick deviations is identical with 1. process, and the deviation of each cycle period is carried out
Data record.In data post-processing software, when user selects some data to be changed to readable from .dat document data records
.txt tick deviations and added up during file, in the poster processing soft reads data log file, when cumulative and more than threshold value
When, data record skips a line to compensate record time deviation in .txt files, because data record time interval is short, data note
Record is almost considered as continuous data, lacks analysis and judgement that a line does not influence data, it is ensured that document data record
Accurate record.Idiographic flow is as shown in Figure 3.
Tick numbers when the tick numbers that described tick deviations calculate during using the end cycle subtract a upper end cycle, if
Meter is as follows:Global variable is defined and stated first:Flag bit, tickEnd1 and tickEnd2 and tick deviations Tickspan are
0.Then the tick numbers of current period are obtained by VxWorks system function tickGet (), accurate tick deviations are obtained
The detailed process of Tickspan is as follows:If flag bit is equal to 1, current tick numbers are ordered by tickGet () and obtained simultaneously
TickEnd1 is assigned to, flag bit resets, and tick deviations Tickspan is equal to (tickEnd1-tickEnd2), otherwise currently
Tick numbers ordered by tickGet () and obtain and be assigned to tickEnd1, mark position 1, and cycle tick number Tickspan
Equal to (tickEnd2-tickEnd1).Said process ensure that tick deviations subtract the cycle equal to tick at the end of this cycle
At the end of tick, it is impossible to tick at the end of this cycle subtract this cycle start when tick because tick is not at the end of the upper cycle
Tick when necessarily starting equal to this cycle.
The sentence of above-mentioned acquisition tick deviations need not be positioned over end-around carry or data record process where system clock
End, as long as being placed in end-around carry;System clock is compensated and data record tick deviations must be placed in claim 2
Behind middle calculating tick deviation sentences, and centre can not have other time-consuming functions.
The embodiment of the accurate recording method of the data timing based on VxWorks system of the invention, comprises the following steps:
The first step:The tick deviations in WatchDog Timer cycle are obtained, is described as follows:
Global variable is defined and stated first:Flag bit, tickEnd1 and tickEnd2 and tick deviations Tickspan are
It is 0.Then the tick numbers of current period are obtained by tickGet () function, following pseudo-code statement can obtain accurate
Tick deviations Tickspan.
If (flag bit==1)
{
TickEnd1=tickGet ();
Flag bit resets;
Tickspan=tickEnd1-tickEnd2;
}
Otherwise
{
TickEnd1=tickGet ();
Mark position 1;
Tickspan=tickEnd2-tickEnd1;
}
From above-mentioned false code, the tick numbers that tick deviations calculate during using the end cycle subtract a upper end cycle
When tick numbers.
Second step:The tick deviations in the WatchDog Timer cycle obtained according to the first step, design is based on VxWorks system
The accurate recording method of data timing of system, mainly including following two aspects:
(1) deviation is added up in the end-around carry where system clock, when this is cumulative and more than 6tick, system
Clock additionally increases by 100 milliseconds;
(2) in the process of data record, only record tick deviations, do not carry out accumulation calculating.
3rd step:
(1) accurate system clock is got according to second step, the mission in black box file is performed and uses system clock, is made
The time for obtaining every mission execution is accurate, finally ensures that the time in black box file is accurate;
(2) data post-processing software is used, when document data record .dat forms are converted into readable .txt files, is tired out
Plus tick deviations, when adding up and more than threshold value, a line is skipped in .txt files, it is ensured that the time of document data record is accurate
Really record.
By (1) and (2) two aspects, the time finally given in black box file is accurate with the time of document data record .txt
Really and can correspond.
Claims (5)
1. the accurate recording method of a kind of data timing based on VxWorks system, it is characterised in that comprise the following steps:
Obtain the tick deviations in WatchDog Timer cycle;
The data timing based on VxWorks system is carried out according to the tick deviations to record;
Every mission in black box file is performed according to the system clock for obtaining;Meanwhile, data are made by cumulative tick deviations
The time of log file corresponds with the time of black box file.
2. a kind of accurate recording method of data timing based on VxWorks system according to claim 1, its feature exists
In when the tick deviations in the WatchDog Timer cycle subtract an end cycle by the tick numbers in end cycle
Tick numbers are obtained, and specifically include following steps:
Definition and statement global variable:Flag bit, tickEnd1 and tickEnd2 and tick deviations Tickspan are 0;
The tick numbers of current period are obtained by VxWorks system function tickGet ().
3. a kind of accurate recording method of data timing based on VxWorks system according to claim 2, its feature exists
In, the tick numbers that current period is obtained by VxWorks system function tickGet (), including:
If flag bit is equal to 1, current tick numbers are ordered by tickGet () and obtain and be assigned to tickEnd1, are indicated
Position resets, and tick deviations Tickspan is equal to (tickEnd1-tickEnd2);Otherwise current tick numbers pass through tickGet
() order obtain and be assigned to tickEnd1, mark position 1, and cycle tick number Tickspan be equal to (tickEnd2-
tickEnd1)。
4. a kind of accurate recording method of data timing based on VxWorks system according to claim 1, its feature exists
In the data timing record based on VxWorks system includes:
Add up the tick deviations in the end-around carry where system clock, when adding up and more than 6tick, system clock
It is extra to increase by 100 milliseconds;
In the process of data record, only record tick deviations, are not added up.
5. a kind of accurate recording method of data timing based on VxWorks system according to claim 1, its feature exists
In, it is described the time of document data record is corresponded with the time of black box file by the tick deviations that add up, specially:
Using data post-processing software, when document data record .dat forms are converted into readable .txt files, add up
Tick deviations, when adding up and more than given threshold, a line are skipped in .txt files.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510777226.7A CN106708639B (en) | 2015-11-13 | 2015-11-13 | Data timing accurate recording method based on VxWorks system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510777226.7A CN106708639B (en) | 2015-11-13 | 2015-11-13 | Data timing accurate recording method based on VxWorks system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106708639A true CN106708639A (en) | 2017-05-24 |
CN106708639B CN106708639B (en) | 2020-05-05 |
Family
ID=58930218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510777226.7A Active CN106708639B (en) | 2015-11-13 | 2015-11-13 | Data timing accurate recording method based on VxWorks system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106708639B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143048A (en) * | 2019-12-25 | 2020-05-12 | 西安电子工程研究所 | Radar accurate timing method based on VxWorks system clock |
CN111585556A (en) * | 2020-05-08 | 2020-08-25 | 南京南瑞继保电气有限公司 | Method for accurately controlling timing switching value output by distributed system |
CN114546413A (en) * | 2022-02-21 | 2022-05-27 | 深圳市佳贤通信设备有限公司 | Method for automatic deployment and automatic optimization of monitoring function time consumption |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949129A (en) * | 2006-11-27 | 2007-04-18 | 杭州华为三康技术有限公司 | Time synchronizing method and device |
CN102929735A (en) * | 2012-10-19 | 2013-02-13 | 北京星网锐捷网络技术有限公司 | Clock-correcting method and equipment |
-
2015
- 2015-11-13 CN CN201510777226.7A patent/CN106708639B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949129A (en) * | 2006-11-27 | 2007-04-18 | 杭州华为三康技术有限公司 | Time synchronizing method and device |
CN102929735A (en) * | 2012-10-19 | 2013-02-13 | 北京星网锐捷网络技术有限公司 | Clock-correcting method and equipment |
Non-Patent Citations (1)
Title |
---|
刘磊等: "VxWorks下的多重定时器设计", 《单片机与嵌入式系统应用》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143048A (en) * | 2019-12-25 | 2020-05-12 | 西安电子工程研究所 | Radar accurate timing method based on VxWorks system clock |
CN111143048B (en) * | 2019-12-25 | 2022-10-28 | 西安电子工程研究所 | Radar accurate timing method based on VxWorks system clock |
CN111585556A (en) * | 2020-05-08 | 2020-08-25 | 南京南瑞继保电气有限公司 | Method for accurately controlling timing switching value output by distributed system |
CN114546413A (en) * | 2022-02-21 | 2022-05-27 | 深圳市佳贤通信设备有限公司 | Method for automatic deployment and automatic optimization of monitoring function time consumption |
Also Published As
Publication number | Publication date |
---|---|
CN106708639B (en) | 2020-05-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102354294B (en) | Method for detecting spatial single event upset of space-borne DSP (Digital Signal Processor) chip | |
US10108763B2 (en) | Method and simulation arrangement for simulating an automated industrial plant | |
KR102161192B1 (en) | Method and apparatus for data mining from core trace | |
CN106708639A (en) | VxWorks system based data timing accurate recording method | |
CN110647318B (en) | Method, device, equipment and medium for creating instance of stateful application | |
US11403202B2 (en) | Power monitoring system for virtual platform simulation | |
Sun et al. | Verifying noninterference in a cyber-physical system the advanced electric power grid | |
CN110866306A (en) | Train whole vehicle simulation verification method and system | |
CN104063245A (en) | Memory analysis and optimization method and system based on garbage collection | |
US20080162900A1 (en) | System, Method and Apparatus for Observing a Control Device | |
CN103036947A (en) | Virtual machine transferring method based on kernel-based virtual machine (KVM) and virtual machine transferring method based on KVM | |
US10614193B2 (en) | Power mode-based operational capability-aware code coverage | |
CN103399813B (en) | A kind of embedded system off-line trace analysis method based on Trace information | |
CN103838666A (en) | Method and device for determining code execution coverage rate | |
Law et al. | Effective Worst-Case Execution Time Analysis of DO178C Level A Software. | |
Pazzaglia et al. | Characterizing the effect of deadline misses on time-triggered task chains | |
US10176276B2 (en) | Determining an optimal global quantum for an event-driven simulation | |
CN104267622A (en) | Satellite telemetering acquisition device and method based on tasks and time | |
US10223077B2 (en) | Determination of signals for readback from FPGA | |
CN103677849B (en) | Embedded software credibility guaranteeing method | |
US8024168B2 (en) | Detecting X state transitions and storing compressed debug information | |
Mühlberg et al. | Verifying FreeRTOS: from requirements to binary code | |
CN102819508B (en) | Method for responding to signals from security monitoring subsystem | |
Zhang et al. | Timing challenges in automotive software architectures | |
CN106293835A (en) | A kind of method and system of smart machine firmware upgrade |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |