CN103729245A - OSEK operating system kernel dynamic process staticizing method - Google Patents

OSEK operating system kernel dynamic process staticizing method Download PDF

Info

Publication number
CN103729245A
CN103729245A CN201310743373.3A CN201310743373A CN103729245A CN 103729245 A CN103729245 A CN 103729245A CN 201310743373 A CN201310743373 A CN 201310743373A CN 103729245 A CN103729245 A CN 103729245A
Authority
CN
China
Prior art keywords
priority
operating system
task
configuration tool
osek
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
Application number
CN201310743373.3A
Other languages
Chinese (zh)
Other versions
CN103729245B (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.)
ISOFT INFRASTRUCTURE SOFTWARE CO Ltd
Original Assignee
ISOFT INFRASTRUCTURE SOFTWARE 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 ISOFT INFRASTRUCTURE SOFTWARE CO Ltd filed Critical ISOFT INFRASTRUCTURE SOFTWARE CO Ltd
Priority to CN201310743373.3A priority Critical patent/CN103729245B/en
Publication of CN103729245A publication Critical patent/CN103729245A/en
Application granted granted Critical
Publication of CN103729245B publication Critical patent/CN103729245B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides an OSEK operating system kernel dynamic process staticizing method, namely priority bitmaps and the inserting and deleting operation of ready ranks are completed through an operating system configuration tool rather than an OSEK operating system kernel. A task priority is divided by the configuration tool into a plurality of priority sets, priority values in each priority set are ranked, and numerical values of the priority sets of a certain task and shield positions of the numerical values in the priority sets are calculated to serve as priority indexes and priority masks of the certain task. According to the technical scheme, the function of the configuration tool is strengthened, the bitmap structure of the OSEK operating system kernel is simplified, internal storage resources are saved, an OS kernel dynamic operation process is simplified to the maximum degree, and the real-time performance and the reliability of the kernel are improved.

Description

A kind of OSEK operating system nucleus dynamic process staticize method
Technical field
The invention belongs to equipment control field, relate to a kind of task priority disposal route, relate in particular to a kind of automotive electronics OSEK operating system nucleus dynamic process staticize method.
Background technology
Operating system can provide abundant control strategy according to user's actual demand.Between each task of operating system, both kept relative independence, guaranteed again the reliability of system, and can guarantee that system has higher real-time by special scheduling strategy.So in environment complexity, that requirement of real-time is high, RTOS(real time operating system) be widely used.In order to meet the exploitation needs of day by day huge and complicated Vehicle Electronic Control software, realize the portability of application software and the compatibility between different vendor's control module, within 1993, German automobiles industry member is combined open system and interface-OSEK/VDX (the Open Systems and the Corresponding Interfaces For Automotive Electronics) standard of having released automotive electronics, be intended to provide for the control module of the distribution on automobile the industrial standard of an open architecture, say in essence, this is also the result of each industrial chain harmony of interests of Automobile Electronic Industry.OSEK standard has been made comparatively comprehensively definition and regulation from aspects such as real time operating system (Real-Time Operating System, RTOS), software interface, communication and network managements to the Electronic Control Software Development Platform of automobile.Meet this standard real time operating system we can be referred to as OSEK operating system.
The object that Automobile Electronic Industry is introduced operating system is to provide general running environment for auto electronics embedded development.The industry standard of following in automotive electronics operating system---in OSEK standard, the management of the OS objects such as task, event, resource, counter, interruption has been carried out to clear and definite explanation, also formulated api interface and the parameter type of standard.And an operating system that meets this standard completely must improve the standardization level of whole automotive electronics basic software platform, thus strengthen its application system portability, reduce the expense of later maintenance and expansion.
In order to meet vehicle electric field application demand widely, OSEK operating system nucleus need to carry out cutting (as being divided into the different classes that meets) according to demand, then determines the preemption mechanism of kernel.OSEK operating system need to possess this flexible and changeable kernel framework, thereby strengthens adaptive and portability, really reaches the object of demand for services.Accomplish this point, must resolve application demand, abstract, make to become the foundation of kernel-reduce.
As basic operating system object, the task management unit of OSEK operating system need to provide for the functional requirement of line module abundant solution.Operating system will be according to demand logic behavior, select different tasks to realize, and kernel is by conjunction with resource and event, to task activate, seize, the operation such as termination, the interoperability between the condition managing of finishing the work, Task Switching and task and synchronous.Particularly importantly the task of OSEK operating system is Static Design, thus the unnecessary degree of coupling in this strategy meeting minimizing system, the security that improves system.In addition, when application OSEK operating system, must make it really accomplish the optimization of task configuration by the outstanding developing instrument of Automobile Electronic Industry (as Matlab etc.).
At vehicle electric field, can have the demand of a large amount of thread synchronization and mutual exclusion, this is the two class forms of expression of task interoperability.The event of OSEK operating system and resource are the tasks synchronization of application, and resource sharing and mutual exclusion provide effective administrative mechanism.Here event has abundant content, as whether received some information; A timeout signal; Or the right of possession corporeal right of efficient resource etc.Equally, resource can be actual hardware device, can be also a certain section of program, or concrete memory space.These are selected and mechanism has been brought no small enlightenment for the optimization of control system flow process.
In order to tackle the periodic functional requirement of automotive electronics, OSEK operating system provides the service based on timer and alarm.Here timer can be drawn by an overall clock source, forms the timer of a software, and alarm is extended different behaviors based on this timer.By the count frequency of timer is set, alarm device can trigger dissimilar service, as activate a task, some events are set, or directly calls a call back function of being safeguarded by user.Had just call back function, OSEK operating system has strengthened user's self-defined behavior greatly, also for user uses other services of operating system, provides more choices.
No matter be AM/BAM system, or OSEK operating system, all must process the high interruption of real-time.Difference is: OSEK system manages interrupting bringing in the system similar to task, event, resource.This mode has not only been inherited the advantage of interrupting high real-time, also fully by this hardware based Real-Time Extension in the system of task and resource (as used ceiling priority management mechanism), task priority is obtained and promote, thereby strengthened real-time.
In traditional kernel of prior art, to the processing of priority, be in real time also repeatedly, this tupe will expose the weakness such as service load is low, system real time is not strong when the application of reply hard real time.
Summary of the invention
In view of this, the object of this invention is to provide a kind of strengthening configuration tool function, can at utmost simplify OS kernel dynamic operation process, and then the kernel real-time improving and the method for designing of reliability.
For achieving the above object, concrete technical scheme is as follows:
An OSEK operating system nucleus dynamic process staticize method, comprises the following steps:
Step 1, utilizes the configuration tool of OSEK operating system to complete some task priority value configurations;
Step 2, described configuration tool is divided into some priority groups by described some task priority value, and defines priority groups numerical value;
Step 3, described configuration tool is by the priority value sequence in each priority groups;
Step 4, the priority groups numerical value of a certain task and the mask bit in priority groups thereof are calculated in described configuration tool;
Step 5, described configuration tool is according to numerical priority value and algorithm generating run system task priority index and mask.
Preferably, also comprise step 6, priority index and mask that described OSEK operating system nucleus generates according to configuration tool carry out "or" and NOT operation, to realize task priority bitmap and ready insertion of lining up and deletion action.
The order of preferably, pressing in described step 3 from small to large sorts the priority value in each priority groups.
Preferably, in described step 1, the priority value of some tasks is some continuous relative priority values.
With respect to prior art, the advantage of technical scheme of the present invention has:
Technical scheme of the present invention has been simplified bitmap structure, saves memory source, has strengthened configuration tool function, has at utmost simplified OS kernel dynamic operation process, has improved kernel real-time and reliability.
Accompanying drawing explanation
The accompanying drawing that forms a part of the present invention is used to provide a further understanding of the present invention, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the structural representation of the bitmap of embodiments of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, in the situation that not conflicting, embodiment and the feature in embodiment in the present invention can combine mutually.
Below with reference to accompanying drawing, embodiments of the invention are done to concrete explaination.
A kind of OSEK operating system nucleus dynamic process staticize method of embodiments of the invention as shown in Figure 1, OSEK operating system comprises carries out the priority bitmap of some tasks and the configuration tool of ready insertion of lining up and deletion action, comprises the following steps:
Step 1, some tasks dispose some different priority values;
Step 2, configuration tool is divided into some priority groups by some tasks, and defines priority groups numerical value:
Step 3, configuration tool is by the priority value sequence in each priority groups;
Step 4 and 5, the priority groups numerical value of a certain task and the mask bit in priority groups thereof are calculated in configuration tool, and generate priority index and the mask of a certain task.
The present invention mainly launches around the aspects such as hard real-time of OSEK operating system nucleus, thereby too much cause entire system real-time this deficiency that declines for dynamic in existing core design strategy, a kind of strengthening configuration tool function has been proposed, can at utmost simplify OS kernel dynamic operation process, and then the kernel real-time improving and the method for reliability.
Kernel dynamic process is mainly divided into kernel state transformation and context switches two parts, and the latter is relevant to hardware platform, so be difficult to realize staticize.Kernel state transformation mainly comprises the contents such as priority is calculated, ready queue is inserted and deletion, and parameter judges, Obj State arranges.As an operating system of strictly following OSEK standard, method and the step of its kernel parameter judgement and Obj State setting are metastable, so the optimization of kernel state transformation dynamic process mainly just concentrates on processed, ready queue is inserted and two aspects of deletion.
In traditional kernel, to the processing of priority, be in real time also repeatedly, this tupe will expose the weakness such as service load is low, system real time is not strong when the application of reply hard real time.Embodiments of the invention are used OS configuration tool to peel off processed process, user configured numerical priority value is converted into the index value of endorsing direct processing in OS (Os_TaskPrioIndex[object]) and mask (Os_TaskReadyPrioSet[object]), reduced the numerical priority value-priority mask-priority index switching motion repeatedly carrying out in processed process, thereby the staticize that has realized OS kernel dynamic process is the lifting of real-time.
The operation of bitmap mainly comprises set and removing, and they all be take the priority of OS object and are basis.Embodiments of the invention are used configuration tool to carry out assignment to priority index (as Os_TaskPrioIndex[object]) and mask (Os_TaskReadyPrioSet[object]), make the insertion of priority bitmap and deletion action process simplification be basic " with " inclusive-OR operation:
Therefore, embodiments of the invention, by the static optimization to OS kernel dynamic process, are significantly improved the real-time of kernel integral body.
In an embodiment of the present invention, priority is relative priority, and since 0, numerical value is larger, and priority is higher.For instance, if user configures two task task 0 and Task1, Task0 priority is lower than Task1, and configuration tool meeting is that the priority that two tasks are distributed is followed successively by 0 and 1 so.
Suppose that user has configured 17 tasks, the priority of each task is all not identical, and wherein the ID of task 1 is 0, and priority is 0; The ID of task 2 is 1, and priority is 7; The ID of task 17 is 16, and priority is 16.For above-mentioned configuration, the mode that 17 priority is one group according to every 16 continuous different priorities is divided into two groups, and (label of array is since 0, so group number is also since 0 counting here, till 1, amount to 2 groups), in order to apply conveniently, configuration tool defines and generates the numerical value that a grand PRIORITY_GROUP represents priority groups.
As shown in fig. 1, in an embodiment of the present invention, wherein, the priority that numerical value is 0-15 belongs to group 0, and the priority that numerical value is 16 belongs to group 1.The meeting of configuration tool is simultaneously sorted to every group of priority, and calculate priority groups and priority mask position (according to the size order of task ID, the carrying out) at every group of priority place, result is kept at above in defined two arrays (Os_TaskPrioIndex and Os_TaskReadyPrioSet).And each task all can be inquired about by ID group and the priority mask position information at its priority place.
The space size of the bitmap of embodiments of the invention (Os_ReadyMap) (being PRIORITY_GROUP) can be according to application demand flexible configuration, thereby has reduced the occupancy of ROM.In addition, due to OS priority algorithm only with task, resource dependency, therefore in an embodiment of the present invention, the index Os_TaskPrioIndex of the task priority that kernel calculates according to configuration tool and resource prioritization, mask Os_TaskReadyPrioSet have realized task ID with bitmap arithmetic, resource ID is associated with bitmap Os_ReadyMap's.
According to above-mentioned principle, the priority of task 1 and task 2 should be in priority groups 0, and its priority mask position is for being respectively 0x0001 and 0x0080; And the priority of task 17 should be in priority groups 1, its priority mask position is 0x0001.Information relevant in configuration tool spanned file is as follows:
When OS kernel is being dispatched, especially when the insertion of execution priority bitmap and ready queue and deletion action, just can directly call the simple operation that the priority groups of each task in above-mentioned array and priority mask carry out "or" and " non-".Rather than pass through: obtain numerical priority value, dynamic in kernel, repeat carry out computing, obtain insertion and the deletion of carrying out again priority bitmap and ready queue after the operation result of priority groups and priority mask.Visible, this priority processing method takes full advantage of the static characteristics of OS configuration tool, and the dynamic process that OS kernel medium priority is processed splits and staticize, thereby has shortened whole treatment cycle, has improved the real-time of OS kernel.
Above specific embodiments of the invention be have been described in detail, but it is as example, the present invention is not restricted to specific embodiment described above.To those skilled in the art, any equivalent modifications that this practicality is carried out and alternative also all among category of the present invention.Therefore, equalization conversion and the modification done without departing from the spirit and scope of the invention, all should contain within the scope of the invention.

Claims (4)

1. an OSEK operating system nucleus dynamic process staticize method, is characterized in that, comprises the following steps:
Step 1, utilizes the configuration tool of OSEK operating system to complete some task priority value configurations;
Step 2, described configuration tool is divided into some priority groups by described some task priority value, and defines priority groups numerical value;
Step 3, described configuration tool is by the priority value sequence in each priority groups;
Step 4, the priority groups numerical value of a certain task and the mask bit in priority groups thereof are calculated in described configuration tool;
Step 5, described configuration tool is according to numerical priority value and algorithm generating run system task priority index and mask.
2. OSEK operating system nucleus dynamic process staticize method as claimed in claim 1, it is characterized in that, also comprise step 6, priority index and mask that described OSEK operating system nucleus generates according to configuration tool carry out "or" and NOT operation, to realize task priority bitmap and ready insertion of lining up and deletion action.
3. OSEK operating system nucleus dynamic process staticize method as claimed in claim 2, is characterized in that, the order of pressing in described step 3 from small to large sorts the priority value in each priority groups.
4. OSEK operating system nucleus dynamic process staticize method as claimed in claim 3, is characterized in that, in described step 1, the priority value of some tasks is some continuous relative priority values.
CN201310743373.3A 2013-12-27 2013-12-27 A kind of OSEK operating system nucleus dynamic process static method Active CN103729245B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310743373.3A CN103729245B (en) 2013-12-27 2013-12-27 A kind of OSEK operating system nucleus dynamic process static method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310743373.3A CN103729245B (en) 2013-12-27 2013-12-27 A kind of OSEK operating system nucleus dynamic process static method

Publications (2)

Publication Number Publication Date
CN103729245A true CN103729245A (en) 2014-04-16
CN103729245B CN103729245B (en) 2017-03-08

Family

ID=50453328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310743373.3A Active CN103729245B (en) 2013-12-27 2013-12-27 A kind of OSEK operating system nucleus dynamic process static method

Country Status (1)

Country Link
CN (1) CN103729245B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529233A (en) * 2003-10-17 2004-09-15 清华大学 Binary chop type task dispatching method for embedding real-time operating system
CN101833477A (en) * 2010-05-28 2010-09-15 浙江大学 Aperiodic task scheduling method based on SmartOSEK OS
CN102043668A (en) * 2010-12-10 2011-05-04 成电汽车电子产业园(昆山)有限公司 Method for activating task in embedded real-time operating system for multiple times

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529233A (en) * 2003-10-17 2004-09-15 清华大学 Binary chop type task dispatching method for embedding real-time operating system
CN101833477A (en) * 2010-05-28 2010-09-15 浙江大学 Aperiodic task scheduling method based on SmartOSEK OS
CN102043668A (en) * 2010-12-10 2011-05-04 成电汽车电子产业园(昆山)有限公司 Method for activating task in embedded real-time operating system for multiple times

Also Published As

Publication number Publication date
CN103729245B (en) 2017-03-08

Similar Documents

Publication Publication Date Title
EP2328301A1 (en) Method and apparatus for managing the authority in workflow component based on authority component
CN106776023B (en) Task load balancing method for self-adaptive GPU unified dyeing array
CN111858027A (en) Software robot cooperative processing method and system
CN102541642A (en) Task management method for enhancing real-time performance
Omar et al. Comparative analysis of the essential CPU scheduling algorithms
CN114756170A (en) Storage isolation system and method for container application
CN109840141A (en) Thread control method, device, electronic equipment and storage medium based on cloud monitoring
CN105426197A (en) Hierarchical design method for embedded product
CN103729245A (en) OSEK operating system kernel dynamic process staticizing method
CN102541647B (en) Method for calling external function of executable component in software integration process
Zuberi et al. EMERALDS: A small-memory real-time microkernel
CN102520622A (en) Vehicle embedded real-time control system performance modeling language
CN105653370A (en) System and method for obtaining virtual machine resources on PaaS platform
Zhang et al. Design-space reduction for architectural optimization of automotive embedded systems
Lu et al. Constructing ECU Software Architecture Based on OSEK
Khalgui Embedded Computing Systems: Applications, Optimization, and Advanced Design: Applications, Optimization, and Advanced Design
Oliveira et al. Integer formulations for the message scheduling problem on controller area networks
Hsiung et al. Formal verification of embedded real-time software in component-based application frameworks
Hsiung et al. Synthesis of real-time embedded software with local and global deadlines
Dhananjayan et al. A metric temporal logic specification interface for real-time discrete-event control
Wang et al. Frame design for vehicular FlexRay network based on transmission reliability and slot utilization
Fu et al. Runtime Software Selection for Adaptive Automotive Systems
Mishra et al. Performance optimization of task intensive real‐time applications on multicore ECUs—A hybrid scheduler
Hsiung et al. Synthesis of real-time embedded software by timed quasi-static scheduling
CN103164276B (en) Protected object is carried out to method and the device of Embedded process

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