KR20000039974A - Method for compensating time offset during performing periodically repeated work in real time system - Google Patents
Method for compensating time offset during performing periodically repeated work in real time system Download PDFInfo
- Publication number
- KR20000039974A KR20000039974A KR1019980055479A KR19980055479A KR20000039974A KR 20000039974 A KR20000039974 A KR 20000039974A KR 1019980055479 A KR1019980055479 A KR 1019980055479A KR 19980055479 A KR19980055479 A KR 19980055479A KR 20000039974 A KR20000039974 A KR 20000039974A
- Authority
- KR
- South Korea
- Prior art keywords
- time
- task
- work
- start time
- period
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/28—Timers or timing mechanisms used in protocols
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Electric Clocks (AREA)
Abstract
Description
본 발명은 이동통신 시스템과 같은 실시간 시스템에 관한 것으로, 특히 실시간 시스템에 있어서 주기적으로 수행되어야 하는 반복작업의 경우 발생할 수 있는 미세한 시간오차를 보정하여 시스템의 안정성을 향상시키기 위한 방법에 관한 것이다.The present invention relates to a real-time system, such as a mobile communication system, and more particularly to a method for improving the stability of the system by correcting the minute time error that can occur in the case of repetitive tasks that must be performed periodically in a real-time system.
일반적으로 이동통신 시스템은 매주 짧은 시간 동안 여러 가지 동작을 동시다발적으로 수행하거나 정해진 시간 내에 어떤 동작을 완료해야 하는 등의 제약조건이 있다. 이러한 이동통신 시스템과 같은 경우 실시간 운영체제를 주로 사용하여 이러한 제약조건들을 충족한다. 따라서 이러한 시스템을 실시간 시스템 또는 실시간성이 강한 시스템 등과 같이 명한다.In general, mobile communication systems have constraints such as performing various operations simultaneously for a short time every week or completing certain operations within a predetermined time. In such a mobile communication system, the real-time operating system is mainly used to satisfy these constraints. Therefore, such a system is referred to as a real-time system or a system having a strong real-time.
실시간 운영체제는 일반 범용 운영체제에 비해 실시간성이 특히 뛰어나지만, 실시간 운영체제를 사용하더라도 경미한 시간오차는 발생한 가능성이 매우 높다. 특히 주기적으로 반복하여 수행되는 작업의 경우 정확한 주기로 실행되지 않는 경우가 대부분이다.The real-time operating system is particularly superior to the general-purpose operating system in real time, but there is a high possibility that a slight time error occurs even when using the real-time operating system. In particular, in the case of tasks that are performed repeatedly, most of the time, they are not executed at the correct cycle.
그러나 주기적인 작업을 수행할 때 그 작업의 1회 수행 시간은 고려하지 않고 작업이 끝난 시각부터 다음에 그 작업이 수행될 때의 시작 시각까지의 시각 간격만 일정하게 유지하는 것이 일반적인 방법이기 때문에 수행시간에 따라 크고 작은 시간오차가 발생하게 되어, 시스템의 실시간성이 약화되는 문제점이 있었다.However, when performing periodic tasks, it is common practice to keep constant the time interval from the end of the task to the start time of the next task without considering the one-time execution of the task. There was a problem that large and small time errors occur over time, weakening the real-time of the system.
이에 본 발명은 상기와 같은 종래의 제반 문제점을 해소하기 위해 제안된 것으로, 본 발명의 목적은 실시간 시스템에 있어서 주기적으로 수행되어야 하는 반복작업의 경우 발생할 수 있는 미세한 시간오차를 보정하여 시스템의 안정성을 향상시킬 수 있는 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법을 제공하는 데 있다.Accordingly, the present invention has been proposed to solve the conventional problems as described above, and an object of the present invention is to improve the stability of the system by correcting minute time errors that may occur in the case of repetitive tasks that must be performed periodically in a real-time system. It is to provide a time error correction method for performing periodic iterations in a real-time system that can be improved.
상기와 같은 목적을 달성하기 위하여 본 발명에 의한 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법은,In order to achieve the above object, in the real-time system according to the present invention, the time error correction method at the time of performing periodic iterations,
현재 시각을 구하여 기준 시각으로 정하고, 매 작업 수행 시작 시각은 상기 기준 시각으로부터 주기의 정수배 만큼 더한 시각이 되도록 설정하고, 작업 시작 시각이 기준 시각 이후이면 작업 수행 시작 시각에서 기준 시각을 뺀 시간 동안 대기하다가 그 후에 깨어나 작업을 수행하고, 작업 시작 시각이 기준 시각과 동일하거나 기준 시각 이전이면 작업 수행이 이미 지연되었다고 판단하고 작업을 수행함을 그 기술적 구성상의 특징으로 한다.The current time is determined and set as the reference time. The start time for each task is set to be the time plus the integer multiple of the period from the reference time. If the start time of the task is after the reference time, the task execution time is subtracted from the reference time. Then, after waking up and performing work, if the work start time is the same as or before the reference time, it is determined that the work is already delayed and the work is performed.
도1은 일반적인 주기적 작업수행을 보인 예시도이고,1 is an exemplary view showing a general periodic work,
도2는 일반적인 주기적인 반복작업 수행시의 시간오차 발생을 보인 예시도이며,2 is an exemplary view showing the occurrence of a time error when performing a general periodic repetitive operation,
도3은 본 발명에 의한 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법을 보인 흐름도이다.3 is a flowchart illustrating a time error correction method when performing periodic iterations in a real-time system according to the present invention.
이하, 상기와 같은 본 발명 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법의 기술적 사상에 따른 일실시예를 첨부한 도면에 의거 상세히 설명하면 다음과 같다.Hereinafter, with reference to the accompanying drawings an embodiment according to the technical idea of the time error correction method when performing periodic iterations in the present invention real-time system as described above in detail.
먼저 정확한 의미의 주기적인 작업수행이라 함은 매 작업 수행의 시작 시각들간의 간격이 일정함을 의미한다.First of all, the periodic work execution in the correct meaning means that the intervals between the start times of each work execution are constant.
도1은 일반적인 주기적 작업수행의 이상적인 형태를 보인 예시도이다.1 is an exemplary view showing an ideal form of general periodic work.
도1에서, 주기T는 반복주기를 의미하고, 작업A는 주기T의 시간간격으로 수행되어야할 작업을 의미하며, t1 내지 t8은 시간을 의미한다.In Fig. 1, period T means repetition period, job A means work to be performed at a time interval of period T, and t1 to t8 means time.
그래서 임의의 작업A가 주기T의 시간 간격마다 정확하게 수행되는 경우를 나타낸 것이다. 작업A의 수행 시간은 항상 일정하게 t(1)이 걸리는 것으로 가정하였다. 여기서 t(1)은 임의의 상수 시간을 나타내고 t(i)=i*t(1)로 정의한다.Thus, the case where any task A is performed correctly at each time interval of the period T is shown. The execution time of task A is assumed to always take t (1). Where t (1) represents an arbitrary constant time and is defined as t (i) = i * t (1).
종래에는 주기적인 작업을 수행하도록 할 때 매 작업 수행이 끝나는 시점에 주기 시간 만큼 대기하고 그 시간이 경과한 후에 다음 작업을 수행하는 방법을 사용한다. 그러나 이 방식은 매 작업의 수행 시간을 고려하지 않기 때문에 이 시간 만큼의 오차가 발생할 수 있다. 이렇게 발생하는 시간 오차는 대체로 간과되기 쉽다. 그러나 반복 횟수가 증가할수록 시간 오차는 점점 커지게 되어 문제가 될 수 있다. 특히 수행시간이 비교적 긴 작업이 반복될 경우 그 시간오차는 간과할 수 없을 만큼 커지게 된다.Conventionally, when a periodic task is to be performed, a method of waiting for a cycle time at the end of each task execution and performing the next task after the elapsed time is used. However, this method does not take into account the execution time of each task, so this error can occur. This time error is usually overlooked. However, as the number of repetitions increases, the time error becomes more and more problematic. In particular, when a task with a relatively long execution time is repeated, the time error becomes large enough to be overlooked.
도2는 일반적인 주기적인 반복작업 수행시의 시간오차 발생을 보인 예시도이다.2 is an exemplary view showing the occurrence of a time error when performing a general periodic repetition task.
여기서 주기T, 작업A, t1 내지 t8은 도1에서의 의미와 동일하고, 오차1 및 오차2는 시간 오차를 의미한다.Here, the period T, the work A, and the t1 to t8 have the same meanings as in Fig. 1, and the error 1 and the error 2 mean a time error.
이러한 도2는 시간오차 발생의 예를 도시한 것으로, 임의의 작업A가 주기T의 시간 간격마다 수행되도록 하기 위해 매 작업 수행이 끝나는 시점에 주기 시간 만큼 대기하고, 그 시간이 경과한 후에 다음 작업을 수행하는 방식을 사용한 것이다.Figure 2 shows an example of a time error occurrence, in which a task A waits for a cycle time at the end of each task execution in order to be performed at a time interval of period T, and then the next task after that time has elapsed. This is how you do it.
도2에서는 도1과 같이 작업A의 수행시간이 항상 t(1)로 일정한 경우로 가정하였으므로 도1과 비교하였을 때 두 번째 작업 수행시에는 t(1) 만큼의 시간 오차가 발생하고, 세 번째 작업 수행시에는 t(2) 만큼의 시간 오차가 발생하게 된다.In FIG. 2, as shown in FIG. 1, it is assumed that the execution time of Task A is always t (1), and thus, when compared to FIG. 1, a time error of t (1) occurs when performing the second task. When the operation is performed, a time error of t (2) occurs.
이러한 문제점을 해결하고 도1과 같이 정확한 주기적 수행을 가능하게 하기 위해서는 다음과 같이 한다.In order to solve this problem and enable accurate periodic execution as shown in FIG.
먼저, 주기적인 작업을 시작하기 전에 현재 시각을 구하여 기준 시각으로 정한다. 그리고 이 기준 시각에 주기를 더한 시각을 최초 작업 시각으로 정한다. 지정한 최초 작업 시작 시각에 작업이 수행되고 나면 그 최초 작업 시작 시각에 주기를 더하여 그 값을 두 번째 작업 시작 시각으로 결정한다. 두 번째 작업이 수행되고 나면 다시 두 번째 작업 시작 시각에 주기를 더하여 세 번째 작업 시작 시각을 구한다.First, before starting the periodic work, the current time is obtained and set as the reference time. And the time which added the period to this reference time is set as the initial working time. After the task is performed at the start time of the specified first task, the period is added to the start time of the first task to determine the value as the second task start time. After the second task has been performed, add the cycle to the second task start time again to get the third task start time.
이와 같이 수행하면 매 작업 수행 시작 시각은 기준 시각으로부터 주기의 정수배 만큼 더한 시각이 된다. 이처럼 반복하여 매 작업 수행이 끝나면 다음 작업 시작 시각까지는 대기한다. 이 시간 동안에는 일반적으로 다른 작업들이 처리된다.In this manner, the start time for each work execution is a time obtained by adding an integer multiple of the period from the reference time. After repeating each task like this, it waits until the next task start time. During this time, other tasks are usually handled.
상기 동작은 첨부한 도면 도3과 같이 구현될 수 있다.The operation may be implemented as shown in FIG. 3.
도3은 본 발명에 의한 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법을 보인 흐름도이다.3 is a flowchart illustrating a time error correction method when performing periodic iterations in a real-time system according to the present invention.
그래서 현재 시각을 구하여 t1이라 하고, t1에 주기T를 더하여 다음 작업 시작 시각인 t2를 구한다(ST1 - ST3).Thus, the current time is obtained and called t1. The period T is added to t1 to obtain the next work start time t2 (ST1-ST3).
그리고 현재 시각 t1과 다음 작업 시작 시각 t2를 비교한다(ST4).Then, the current time t1 is compared with the next work start time t2 (ST4).
다음 작업 시작 시각이 현재 시각 이후일 경우(t1 t2)에는 (t2 - t1)의 시간 동안 대기하다가 그 후에 깨어나 작업을 수행한다.If the next task start time is after the current time (t1 t2), it waits for the time of (t2-t1) and then wakes up and performs the task.
반면에 만약 다음 작업 시작 시각이 현재 시각과 동일하거나 현재 시각 이전일 경우(t1 = t2)에는 이미 작업 수행이 지연되었음을 의미하므로 대기하지 않고 바로 작업을 수행한다(ST5 - ST7).On the other hand, if the next task start time is the same as the current time or before the current time (t1 = t2), it means that the task execution has already been delayed. Therefore, the task is executed immediately without waiting (ST5-ST7).
실제로 시스템에는 여러 가지 인터럽트가 발생할 수 있다. 따라서 작업의 수행 도중에 인터럽트가 발생하여 그 처리 시간 만큼 현재 작업 수행이 지연되는 경우가 발생할 수 있다.In fact, many interrupts can occur in the system. As a result, an interrupt may occur during the execution of the task, which may delay the execution of the current task by the processing time.
매 작업 수행이 끝나면 다시 현재 시각을 구하여 t1로 놓고 직전 작업 시작 시각 t2에 주기T를 더하여 다음 작업 시작 시각 t2를 구한다. 이와 같이 수행하여 동일한 작업을 반복한다.After each operation is completed, the current time is found again as t1, and the period T is added to the previous work start time t2 to obtain the next work start time t2. Do this and repeat the same task.
이처럼 본 발명은 종래의 방법에서 발생하는 시간 오차를 보정할 수 있고, 그 결과 도1과 같이 비교적 정확한 주기로 작업 수행이 가능하게 되는 것이다.As such, the present invention can correct the time error occurring in the conventional method, and as a result, the operation can be performed at a relatively accurate period as shown in FIG.
이상에서 본 발명의 바람직한 실시예를 설명하였으나, 본 발명은 다양한 변화와 변경 및 균등물을 사용할 수 있다. 본 발명은 상기 실시예를 적절히 변형하여 동일하게 응용할 수 있음이 명확하다. 따라서 상기 기재 내용은 하기 특허청구범위의 한계에 의해 정해지는 본 발명의 범위를 한정하는 것이 아니다.Although the preferred embodiment of the present invention has been described above, the present invention may use various changes, modifications, and equivalents. It is clear that the present invention can be applied in the same manner by appropriately modifying the above embodiments. Accordingly, the above description does not limit the scope of the invention as defined by the limitations of the following claims.
이상에서 살펴본 바와 같이, 본 발명에 의한 실시간 시스템에서 주기적인 반복작업 수행시의 시간오차 보정방법은 실시간 시스템의 주기적인 작업 수행시 발생하는 시간 오차를 효과적으로 보정하여 미세한 시간 오차로 인해 발생할 수 있는 문제점들을 예방 및 해결할 수 있고, 시스템의 안정성을 향상시킬 수 있는 효과가 있게 된다.As described above, in the real-time system according to the present invention, the time error correction method when performing periodic repetitive work effectively corrects the time error that occurs during the periodic work of the real-time system, which may occur due to minute time error. Can be prevented and solved, and the stability of the system can be improved.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019980055479A KR20000039974A (en) | 1998-12-16 | 1998-12-16 | Method for compensating time offset during performing periodically repeated work in real time system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019980055479A KR20000039974A (en) | 1998-12-16 | 1998-12-16 | Method for compensating time offset during performing periodically repeated work in real time system |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20000039974A true KR20000039974A (en) | 2000-07-05 |
Family
ID=19563202
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1019980055479A KR20000039974A (en) | 1998-12-16 | 1998-12-16 | Method for compensating time offset during performing periodically repeated work in real time system |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20000039974A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109686073A (en) * | 2019-01-23 | 2019-04-26 | 积成电子股份有限公司 | A kind of method that batch automatically generates acquisition terminal task |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0271190A (en) * | 1988-09-06 | 1990-03-09 | Toshiba Corp | Method for time calibration of computer system |
JPH04188334A (en) * | 1990-11-22 | 1992-07-06 | Fujitsu Ltd | Real rime processing simulation system |
KR950009436A (en) * | 1993-09-27 | 1995-04-24 | 백중영 | Real time error correction method of terminal |
JPH07280969A (en) * | 1994-04-07 | 1995-10-27 | Nissin Electric Co Ltd | Monitoring control system with time synchronizing function |
JPH07280970A (en) * | 1994-04-07 | 1995-10-27 | Nissin Electric Co Ltd | Monitoring control system with time synchronizing function |
-
1998
- 1998-12-16 KR KR1019980055479A patent/KR20000039974A/en not_active Application Discontinuation
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0271190A (en) * | 1988-09-06 | 1990-03-09 | Toshiba Corp | Method for time calibration of computer system |
JPH04188334A (en) * | 1990-11-22 | 1992-07-06 | Fujitsu Ltd | Real rime processing simulation system |
KR950009436A (en) * | 1993-09-27 | 1995-04-24 | 백중영 | Real time error correction method of terminal |
JPH07280969A (en) * | 1994-04-07 | 1995-10-27 | Nissin Electric Co Ltd | Monitoring control system with time synchronizing function |
JPH07280970A (en) * | 1994-04-07 | 1995-10-27 | Nissin Electric Co Ltd | Monitoring control system with time synchronizing function |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109686073A (en) * | 2019-01-23 | 2019-04-26 | 积成电子股份有限公司 | A kind of method that batch automatically generates acquisition terminal task |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6363496B1 (en) | Apparatus and method for reducing duration of timeout periods in fault-tolerant distributed computer systems | |
KR20010037622A (en) | A independent checkpointing method using memory checkpoint on distributed system | |
CN108292236B (en) | Information processing method and device | |
CN100511155C (en) | Method for implementing non accumulation inaccuracy and self-adaption timer | |
US7852777B2 (en) | Network hardware device | |
US6809556B1 (en) | Self-compensating glitch free clock switch | |
KR20000039974A (en) | Method for compensating time offset during performing periodically repeated work in real time system | |
CN113711158A (en) | Time synchronization system, master control device, slave device, and program | |
KR20010097857A (en) | Time error correcting method of real time system | |
CN103455402A (en) | Timer control method without accumulated error | |
KR20150058618A (en) | Method and apparatus for compensating delay in real-time embedded system | |
JP2008103863A (en) | Clock asynchronous switching device, circuit and method for canceling noise, and program | |
JP2000105604A (en) | Method for making output interval constant at constant scan setting of programmable controller | |
US6571137B1 (en) | System and method for reducing jitter in a signal | |
KR101290784B1 (en) | Apparatus and method for task synchronization in distributed control system | |
JP4390522B2 (en) | Time information creation device, image processing system and method | |
CN114326928B (en) | Method, apparatus, control device and computer readable storage medium for time synchronization | |
WO2017032064A1 (en) | Time conversion method, terminal and storage medium | |
US5325514A (en) | Program executive timing apparatus for ensuring that state changes of a reference clock signal used to time the execution of the program are not missed | |
JPH10253778A (en) | Time exchanging clock system | |
JPH0392904A (en) | Programmable controller | |
JP2012117840A (en) | Electronic equipment | |
CN116700936A (en) | Timing task execution method, terminal device and computer readable storage medium | |
CN114489239A (en) | Method and device for dynamically calibrating real-time clock | |
KR20210064039A (en) | Programmable controller system and module |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
N231 | Notification of change of applicant | ||
N231 | Notification of change of applicant | ||
E902 | Notification of reason for refusal | ||
E601 | Decision to refuse application |