CN103729245B - A kind of OSEK operating system nucleus dynamic process static method - Google Patents

A kind of OSEK operating system nucleus dynamic process static method Download PDF

Info

Publication number
CN103729245B
CN103729245B CN201310743373.3A CN201310743373A CN103729245B CN 103729245 B CN103729245 B CN 103729245B CN 201310743373 A CN201310743373 A CN 201310743373A CN 103729245 B CN103729245 B CN 103729245B
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.)
Active
Application number
CN201310743373.3A
Other languages
Chinese (zh)
Other versions
CN103729245A (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

Abstract

The invention provides a kind of OSEK operating system nucleus dynamic process static method, will OSEK operating system nucleus priority bitmap and the ready insertion that lines up and deletion action turned completed by operating system configuration tool:Task priority is divided into some priority groups by configuration tool, priority value in each priority groups is ranked up, and calculate priority groups numerical value and its mask bit in the priority groups of a certain task, the priority index in this, as a certain task and mask.Technical scheme enhances configuration tool function, simplifies the bitmap structure of OSEK operating system nucleus, has saved memory source, at utmost simplifies O/S kernel dynamic operation process, improves kernel real-time and reliability.

Description

A kind of OSEK operating system nucleus dynamic process static method
Technical field
The invention belongs to equipment control field, is related to a kind of task priority processing method, more particularly to a kind of automobile electricity Sub- OSEK operating system nucleus dynamic process static method.
Background technology
Operating system can provide abundant control strategy according to the actual demand of user.Each task of operating system it Between, relative independence was both maintained, the reliability of system has been in turn ensure that, and system can be ensured by special scheduling strategy There is higher real-time.So in the environment complicated, requirement of real-time is high, RTOS(Real time operating system)Obtain wide General application.In order to meet the exploitation needs of increasingly huge and complicated Vehicle Electronic Control software, that realizes application software can Compatibility between transplantability and different vendor's control module, German automobiles industrial quarters in 1993 are combined and are proposed opening for automotive electronics Put formula system and interface-OSEK/VDX (Open Systems and the Corresponding Interfaces For Automotive Electronics) specification, it is intended to the work of an open architecture is provided for the control unit of the distribution on automobile Industry standard, essentially, this is also the result of each industrial chain harmony of interests of Automobile Electronic Industry.OSEK specification is from real-time operation System(Real-Time Operating System,RTOS), software interface, the electricity of the aspect to automobile such as communication and network management Sub- control software development platform has been made more comprehensively to define and regulation.Meet the specification real time operating system we can unite Referred to as OSEK operating system.
Automobile Electronic Industry introduces the purpose of operating system and is to provide general fortune for auto electronics embedded development Row environment.In the industry standard OSEK specification that automotive electronics operating system is followed, to task, event, resource, counting The management of the OS object such as device, interruption has carried out explicitly stated, has also formulated api interface and the parameter type of standard.And one The operating system of the specification is complied fully with, the standardization level of whole automotive electronics basic software platform can be necessarily improved, from And strengthen the portability of its application system, reduce the expense of later maintenance and extension.
Demand is widely applied in order to meet vehicle electric field, OSEK operating system nucleus needs to be cut out according to demand Cut(Such as it is divided into and different meets class), then the preemption mechanism for determining kernel.OSEK operating system needs to have this flexible and changeable Core architecture, so as to strengthen adaptive and portability, be really achieved the purpose of demand for services.Accomplish this point, it is necessary to right Application demand is parsed, abstract so that become the foundation of kernel-reduce.
Used as basic operating system object, the role management unit of OSEK operating system needs the work(for line module Can the abundant solution of demand offer.Operating system will be according to demand logic behaviour, select different tasks to realize, and Kernel passes through with reference to resource and event, enters line activating to task, the operation such as seizes, terminates, and completes task status management, task and turns Change and task between interoperability and synchronization.Significantly the task of OSEK operating system is Static Design, so this Kind of strategy can be unnecessary in minimizing system the degree of coupling, improve the security of system.In addition, when OSEK operating system is applied, Must be by the outstanding developing instrument of Automobile Electronic Industry(Such as Matlab etc.)Which is made to be truly realized the optimization of task configuration.
Can there is the demand of a large amount of thread synchronization and mutual exclusion in vehicle electric field, this is the two classes performance of task interoperability Form.The event and resource of OSEK operating system is the tasks synchronization of application, and resource-sharing is provided with mutual exclusion and effectively managed Mechanism.Here event has abundant content, such as whether receiving some information;One timeout signal;Or the accounting for of efficient resource Have the right.Equally, resource can be actual hardware device, or a certain section of program, or specific memory space. These select and mechanism brings 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 is provided based on timer and alarm Service.Here timer can be drawn by a global clock source, form the timer of a software, and alarm is then based on and is somebody's turn to do Timer extends different behaviors.By arranging the count frequency of timer, alarm device can trigger different types of service, such as Activation task, some event is set, or directly invokes a call back function that is safeguarded by user.Exactly there is readjustment letter Number, OSEK operating system greatly enhance the self-defined behavior of user, are also provided using other services of operating system for user More selections.
Either back-fore ground system, or OSEK operating system, it is necessary to which the interruption high to real-time is processed.Difference It is:OSEK system will interrupt bringing in the system similar to task, event, resource being managed.This mode not only continues The advantage for interrupting high real-time is held, also fully by the system of this hardware based Real-Time Extension to task and resource (Such as using ceiling pri-oritizing mechanism)So that task priority obtains lifting, so as to enhance real-time.
In traditional kernel of prior art, to the process of priority it is in real time and repeatedly, this tupe is being answered To the weakness such as pay(useful) load is low, system real time is not strong will be exposed during hard real time application.
Content of the invention
In view of this, it is an object of the invention to provide a kind of reinforcing configuration tool function so as at utmost can simplify O/S kernel dynamic operation process, and then the method for designing of the kernel real-time of raising and reliability.
For reaching above-mentioned purpose, concrete technical scheme is as follows:
A kind of OSEK operating system nucleus dynamic process static method, comprises the following steps:
Step 1, completes the configuration of some task priority value using OSEK operating system configuration tool;
Some task priority value are divided into some priority groups by step 2, the configuration tool, and define priority Group numerical value;
Priority value in each priority groups is sorted by step 3, the configuration tool;
Step 4, the configuration tool calculate the priority groups numerical value of a certain task and its mask bit in priority groups;
Step 5, the configuration tool generate operating system task priority index according to numerical priority value and algorithm and cover Code.
Preferably, also include step 6, priority index that the OSEK operating system nucleus is generated according to configuration tool and Mask carries out "or" and NOT operation, to realize task priority bitmap and the ready insertion that lines up and deletion action.
Preferably, the priority value in each priority groups is sorted by order from small to large in the step 3.
Preferably, in the step 1, the priority value of some tasks is some continuous relative priority value.
With respect to prior art, the advantage of technical scheme has:
Technical scheme simplifies bitmap structure, saves memory source, enhances configuration tool function, maximum journey Degree simplifies O/S kernel dynamic operation process, improves kernel real-time and reliability.
Description of the drawings
The accompanying drawing for constituting the part of the present invention is used for providing a further understanding of the present invention, the schematic reality of the present invention Apply example and its illustrate, for the present invention is explained, not constituting inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the structural representation of the bitmap of embodiments of the invention.
Specific 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 carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
It should be noted that in the case of not conflicting, the embodiment in the present invention and the feature in embodiment can phases Mutually combine.
Embodiments of the invention are done with concrete explaination below with reference to accompanying drawing.
A kind of OSEK operating system nucleus dynamic process static method of embodiments of the invention as shown in Figure 1, OSEK operating system includes the configuration work of the priority bitmap for executing some tasks and the ready insertion that lines up and deletion action Tool, comprises the following steps:
Step 1, some tasks are configured with some different priority values;
Some tasks are divided into some priority groups by step 2, configuration tool, and define priority groups numerical value:
Priority value in each priority groups is sorted by step 3, configuration tool;
Step 4 and 5, configuration tool calculate the priority groups numerical value of a certain task and its mask bit in priority groups, And generate priority index and the mask of a certain task.
The present invention mainly around OSEK operating system nucleus the aspect such as hard real-time launching, for existing core design In strategy, dynamic is excessively not enough so as to cause system entirety real-time to decline this, it is proposed that a kind of reinforcing configuration tool work( Can so as to can at utmost simplify O/S kernel dynamic operation process, and then the method for the kernel real-time of raising and reliability.
Kernel dynamic process is broadly divided into kernel state transformation and context switches two parts, the latter and hardware platform phase Close, so being difficult to static.Kernel state transformation mainly includes that priority is calculated, ready queue is inserted and deleted, parameter The contents such as judgement, Obj State setting.Used as the operating system for following strictly OSEK specification, its kernel parameter judges and right As the method and steps that state is arranged is metastable, so the optimization of kernel state transformation dynamic process is mainly just concentrated on Priority processing, two aspects of ready queue insertion and deletion.
In traditional kernel, to the process of priority it is in real time and repeatedly, this tupe is answered in reply hard real time Used time will expose the weakness such as pay(useful) load is low, system real time is not strong.Embodiments of the invention use OS configuration tool pair Priority processing process is peeled off, and user configured numerical priority value is converted into the index value that O/S kernel directly can be processed (Os_TaskPrioIndex[object])And mask(Os_TaskReadyPrioSet[object]), reduce at priority Numerical priority value-Priority Mask-priority index the switching motion being repeated during reason, it is achieved thereby that O/S kernel is dynamic The static of state process is the lifting of real-time.
Mainly comprising set and removing, they are all based on the priority of OS object for the operation of bitmap.The reality of the present invention Example is applied using configuration tool to priority index(As Os_TaskPrioIndex [object])And mask(Os_ TaskReadyPrioSet[object])Carry out assignment so that the insertion of priority bitmap and deletion action process simplification are base This "AND" inclusive-OR operation:
Therefore, embodiments of the invention are by the static optimization to O/S kernel dynamic process, the real-time for making kernel overall It is significantly improved.
In an embodiment of the present invention, priority is relative priority, and from the beginning of 0, numerical value is bigger, and priority is got over High.For example, if two task task 0 of user configuring and Task1, Task0 priority are less than Task1, then configuration work Tool can be followed successively by 0 and 1 for the priority of two task distribution.
Assume 17 tasks of user configuring, the priority of each task is all differed, the wherein ID of task 1 is 0, excellent First level 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, 17 Individual priority is divided into two groups according to the mode that the continuous different priorities per 16 are a group(The label of array from the beginning of 0, so Here group number is also started counting up from 0, to 1,2 groups altogether), in order to apply conveniently, configuration tool define and generate one grand PRIORITY_GROUP is representing the numerical value of priority groups.
As shown in fig. 1, in an embodiment of the present invention, wherein, numerical value belongs to group 0 for the priority of 0-15, and numerical value is 16 priority belongs to group 1.While configuration tool can be ranked up to every group of priority, and calculate the excellent of every group of priority place First level group and priority mask position(Size order according to task ID is carried out), as a result it is stored in above defined two arrays (Os_TaskPrioIndex and Os_TaskReadyPrioSet)In.And each task all can inquire about its priority by ID The group at place and priority mask position information.
The bitmap of embodiments of the invention(Os_ReadyMap)Space size(That is PRIORITY_GROUP)Can according to should Demand flexible configuration is used, so as to reduce the occupancy of ROM.Further, since OS priority algorithm is only related to task, resource, Therefore in an embodiment of the present invention, kernel is calculated according to configuration tool task priority and the index of resource prioritization Os_TaskPrioIndex, mask Os_TaskReadyPrioSet and bitmap arithmetic achieve task ID, resource ID and position The association of figure Os_ReadyMap.
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.Configuration work It is as follows that tool generates related information in file:
When O/S kernel is being scheduling, especially in the insertion and deletion action of execution priority bitmap and ready queue When, so that it may directly invoking the priority groups of each task and Priority Mask in above-mentioned array carries out the simple fortune of "or" and " non-" Calculate.Rather than pass through:Obtain numerical priority value, dynamic in kernel, repeat enter row operation, obtain priority groups and preferential Insertion and the deletion of priority bitmap and ready queue are carried out after the operation result of level mask again.It can be seen that, this priority processing Method takes full advantage of the static characteristic of OS configuration tool, and the dynamic process that O/S kernel medium priority is processed is split and quiet State, so as to shorten whole process cycle, improves the real-time of O/S kernel.
Specific embodiment to the present invention has been described in detail above, but which is only used as example, and the present invention is not intended to limit In particular embodiments described above.To those skilled in the art, any equivalent modifications carried out by the practicality and replace In generation, is also all among scope of the invention.Therefore, the equalization that is made without departing from the spirit and scope of the invention is converted and is repaiied Change, should all cover within the scope of the invention.

Claims (4)

1. a kind of OSEK operating system nucleus dynamic process static method, it is characterised in that comprise the following steps:
Step 1, completes the configuration of some task priority value using OSEK operating system configuration tool;
Some task priority value are divided into some priority groups by step 2, the configuration tool, and define priority groups number Value;
Priority value in each priority groups is sorted by step 3, the configuration tool;
Step 4, the configuration tool calculate the priority groups numerical value of a certain task and its mask bit in priority groups;
Step 5, the configuration tool generate operating system task priority index and mask according to numerical priority value and algorithm.
2. OSEK operating system nucleus dynamic process static method as claimed in claim 1, it is characterised in that also include step Rapid 6, the priority index that the OSEK operating system nucleus is generated according to configuration tool and mask carry out "or" and NOT operation, To realize task priority bitmap and the ready insertion that lines up and deletion action.
3. OSEK operating system nucleus dynamic process static method as claimed in claim 2, it is characterised in that the step The priority value in each priority groups is sorted by order from small to large in 3.
4. OSEK operating system nucleus dynamic process static method as claimed in claim 3, it is characterised in that the step In 1, the priority value of some tasks is some continuous relative priority value.
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 CN103729245A (en) 2014-04-16
CN103729245B true 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
CN103729245A (en) 2014-04-16

Similar Documents

Publication Publication Date Title
US10452605B2 (en) Method and apparatus for task scheduling on heterogeneous multi-core reconfigurable computing platform
US8447346B2 (en) SDR terminal and reconfiguration method
EP4191355A1 (en) Uds-based communication method, ecu and upper computer
CN103412755A (en) Hardware real-time operation system
CN108829529A (en) Virutal machine memory sharing method, device, computer equipment and storage medium
CN110166485B (en) Protocol scheduling and using method and device
CN109976737A (en) A kind of generation method and device of RTE code
CN108829530B (en) Image processing method and device
EP3737038A1 (en) Method and device for configuring base station
CN103729245B (en) A kind of OSEK operating system nucleus dynamic process static method
CN105426197A (en) Hierarchical design method for embedded product
CN109857382B (en) SoC chip software defined radio decoupling design method
CN115617407A (en) Hardware driving method of embedded operating system
Hecht et al. A distributed object system approach for dynamic reconfiguration
CN101246421A (en) Universal frame work based on workflow engine
Silva et al. Java framework for distributed real-time embedded systems
Silva Jr et al. An infrastructure for hardware-software co-design of embedded Real-Time Java applications
CN112463710A (en) Inter-core communication method and system based on embedded platform
Lu et al. Constructing ECU Software Architecture Based on OSEK
CN110377272A (en) A kind of implementation method and device of the SDK based on TBOX
CN102520622A (en) Vehicle embedded real-time control system performance modeling language
CN110417791A (en) A kind of encryption device and network data method, apparatus
Mendoza et al. Developing CAN based networks on RT-Linux
CN110380991A (en) A kind of IOCP mechanism and the Internet of Things Network Communication acceleration system based on eFPGA and IOCP
CN103186425A (en) Method for acquiring hardware resource, method for acquiring soft ware resource and electronic device

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