Processing method and system of timers and asynchronous events

An asynchronous event and processing method technology, applied in the field of data communication, can solve the problem that the use time does not meet the high precision and affect the execution efficiency of the system, and achieve the effect of facilitating maintenance and debugging, improving execution efficiency and ensuring flexibility.

Active Publication Date: 2014-02-12
MAIPU COMM TECH CO LTD
View PDF2 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In terms of real-time performance, the system interrupt service routine (ISR) can be used to maintain user timers to process related events, but user timers have many limitations in use and may not meet high-precision requirements in time, such as gatekeepers Dog timer; you can also use a dedicated task timer to process related events, which can meet the high-precision requirements, but if there are multiple user timers with different priorities in the system, you need multiple different tasks; In terms of the ability of asynchronous events, multiple different tasks may also be processed at the same time. When there are many tasks, frequent switching between tasks will inevitably affect the execution efficiency of the system.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Processing method and system of timers and asynchronous events
  • Processing method and system of timers and asynchronous events
  • Processing method and system of timers and asynchronous events

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0043] Asynchronous events and user timers require simultaneous multi-thread scheduling processing:

[0044] In this embodiment, multi-thread scheduling needs to process asynchronous events and user timers at the same time. Messages from the system or control messages from external devices need to be processed by the system (asynchronous event). In this embodiment, there are two user timers that need to be started, user timer Timer1 (the timing interval is 30 milliseconds) and user timer Timer2 (the timing interval is 50 milliseconds). Event; in the first cycle, when the scheduling task module is waiting for the synchronous semaphore, the interface module receives an asynchronous event that needs to be scheduled.

[0045] Such as image 3 As shown, the process steps of multi-thread scheduling in Embodiment 1 are described in detail, wherein the execution process of steps 303-310 is an infinite loop process:

[0046] Step 301, the queue module initializes the user queue and ...

Embodiment 2

[0057] Only asynchronous events require multi-threaded scheduling.

[0058] In addition to processing multiple asynchronous events and timers simultaneously in the multi-thread scheduling process of Embodiment 1, it can also be used to only process asynchronous events or timers. This embodiment describes in detail the process of multi-thread scheduling for processing asynchronous events, wherein the execution process of steps 403-409 is an infinite loop process:

[0059] In this example, if Figure 4 As mentioned above, the method and system of the present invention are used to process various asynchronous events. According to the nature of the asynchronous events, corresponding to multiple different priorities, the asynchronous events requiring high priority are processed first. For ease of illustration, asynchronous events are recorded as event1, event2, and event3, and the order of occurrence among them is random.

[0060]Step 401: The queue module initializes the user qu...

Embodiment 3

[0069] Embedded multi-thread scheduling system, the system is composed of four parts: interface module, queue module, scheduling task module and interrupt module, such as Figure 5 , where the direction of the arrow represents the flow of data, and the letters in the figure represent the interaction labels between modules.

[0070] The interface module provides a unified interface for external asynchronous events or timers, and is responsible for converting them into an executable thread control block and storing it in the user queue. The thread structure can be recognized by the scheduling task module.

[0071] The queue module is responsible for creating and maintaining the ready queue and the user queue. The user queue receives notifications of asynchronous events that need to be scheduled or timer events that need to be started from other task modules through the interface module, and the ready queue is responsible for storing the tasks that will be executed by the scheduli...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a method capable of ensuring ordered control of multiple user timers and asynchronous events in an embedded system, and also improving the execution efficiency of the existing user timers and asynchronous events, and the invention also provides a system for realizing the method. The method provided by the invention can simultaneously start multiple user timers as well as simultaneously process multiple asynchronous events, thus ensuring the versatility of the technical scheme. Because the user timers and the asynchronous events are simultaneously executed in multiple threads of one task (scheduler task of the invention), the expense for switching between tasks is reduced, the execution efficiency is improved, and the corresponding threads for executing the asynchronous events or the user timers are orderly controlled by the release of synchronous signals.

Description

technical field [0001] The present invention relates to technologies in the field of data communication and computer field, in particular to a multi-thread scheduling technology. Background technique [0002] At present, the embedded system software needs to deal with many periodic affairs, such as the timing sending of the message and so on. These periodic transactions often require high real-time performance, so the embedded software must provide the support of high-precision timer mechanism. On the other hand, in the actual environment, most embedded systems are event-driven or message-driven systems, and the external events processed are multiple and concurrent random events. In order to effectively deal with these external concurrent events, embedded software often adopts a multi-task and multi-process operating mechanism to process these external events asynchronously. A task (process) is usually defined by the industry as a running program instance, which is the bas...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/48
Inventor 徐海兵李永合
Owner MAIPU COMM TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products