WO2023143020A1 - Generation method and apparatus for real-time operating system, use method and apparatus for real-time operating system, electronic device, and medium - Google Patents

Generation method and apparatus for real-time operating system, use method and apparatus for real-time operating system, electronic device, and medium Download PDF

Info

Publication number
WO2023143020A1
WO2023143020A1 PCT/CN2023/071367 CN2023071367W WO2023143020A1 WO 2023143020 A1 WO2023143020 A1 WO 2023143020A1 CN 2023071367 W CN2023071367 W CN 2023071367W WO 2023143020 A1 WO2023143020 A1 WO 2023143020A1
Authority
WO
WIPO (PCT)
Prior art keywords
osal
kernel
operating system
autosar
real
Prior art date
Application number
PCT/CN2023/071367
Other languages
French (fr)
Chinese (zh)
Inventor
王春锦
Original Assignee
宁德时代新能源科技股份有限公司
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 宁德时代新能源科技股份有限公司 filed Critical 宁德时代新能源科技股份有限公司
Publication of WO2023143020A1 publication Critical patent/WO2023143020A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Definitions

  • the present application relates to the technical field of battery management, and in particular to a method for generating a real-time operating system, a method for using it, a device for generating it, a device for using it, electronic equipment, and a computer-readable storage medium.
  • MICROSAR OS As a preemptive real-time multi-tasking operating system, which has been widely used in the field of automotive electronics.
  • MICROSAR OS needs to purchase the Davinci series tools and the static code package provided by Vector in the development of automotive electronics, resulting in very high development costs.
  • BMS Battery Management System
  • the present application provides a real-time operating system generation method, use method, generation device, use device, electronic equipment and computer-readable storage medium, which can not only reduce the development cost of BMS projects, but also realize rapid development of projects .
  • the embodiment of the present application provides a method for generating a real-time operating system
  • the generating method includes: generating an operating system abstraction layer (Operating System Abstraction Layer, OSAL) kernel based on the Automobile Open System Architecture (AUTomotive Open System Architecture, AUTOSAR) standard , the OSAL kernel is used to make a real-time operating system (Real Time Operating System, RTOS) run under the AUTOSAR standard; based on the OSAL kernel, the corresponding application program interface (Application Programming Interface, API) of the RTOS is encapsulated; obtain OSAL code generation tool, the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS; based on the OSAL kernel, encapsulation After the RTOS API and the OSAL code generation tool, generate an AUTOSAR-based real-time operating system.
  • OSAL operating system abstraction layer
  • AUTOSAR Automobile Open System Architecture
  • the AUTOSAR-based real-time operating system obtained at this time can run according to the AUTOSAR standard, that is, realize all or part of the functions in MICROSAR OS. In this way, it is not necessary to purchase MICROSAR OS, the Davinci series tools in MICROSAR OS and the static code package provided by Vector, and the development of BMS projects can also be realized, which saves the development cost of BMS projects. Moreover, since the OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
  • the generating the operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard includes: generating the OSAL kernel including multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
  • the OSAL kernel is generated based on the AUTOSAR standard, which can reduce the workload when generating the OSAL kernel based on the AUTOSAR standard, and then based on the OSAL kernel, it can more conveniently and comprehensively simulate various functions in the MICROSAR OS.
  • the generation of the OSAL kernel containing multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard includes: generating an operating system abstraction layer OSAL scheduler, and the OSAL scheduler is used for Manage kernel parameter initialization, kernel start and stop, current core acquisition, application initialization, interrupt initialization, clock initialization, and external interface calls; generate data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard; based on the OSAL scheduler and the data structures generated by the OSAL kernel.
  • the OSAL scheduler is generated to realize the management of multiple objects, and the data structure of multiple objects in the AUTOSAR OS is generated, and then combined with the OSAL scheduler to generate the OSAL kernel, the OSAL kernel can be scheduled by OSAL
  • the controller implements unified management of its various functions and strengthens the OSAL kernel.
  • the generating the data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard includes: when the multiple objects include applications, generating application stacks and task associations based on the AUTOSAR standard Property table, task handle table, clock-related property table, clock handle table, signal-related property table, event-related property table, event handle table, ISRs nested flags, computed property table, source property table, application static code and configuration Code architecture; when the multiple objects include a clock, generate an identifier, a clock name, a cycle running time, a timeout time, and a clock implementation interface based on the AUTOSAR standard.
  • different data structures can be configured to enable OSAL kernel to manage and configure related objects of AUTOSAR OS in RTOS, so as to ensure that RTOS can realize various functions based on AUTOSAR.
  • the acquisition of the OSAL code generation tool includes: generating a variety of link file generation templates, and different link file generation templates correspond to different compilers; based on the link file generation templates, static variables defined according to the code
  • the OSAL code generation tool is generated according to the rules consistent with the data structures in the OSAL kernel.
  • OSAL code generation tools Generate OSAL code generation tools through link file generation templates corresponding to different compilers. No matter what RTOS the developer chooses, the OSAL code generation tools can generate RTOS-compliant codes, which can improve the applicability of OSAL code generation tools for different RTOSs. sex.
  • the embodiment of the present application provides a method for using a real-time operating system, which is applied to the real-time operating system generated by the above-mentioned generation method, and the method for using includes: from the real-time operating system based on AUTOSAR Download the OSAL kernel, and download the target real-time operating system that matches the vehicle battery management development project from an open source website; obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project; The operating result in the target real-time operating system uses the OSAL code generation tool to generate the code files required by the vehicle battery management development project.
  • using the OSAL code generation tool to generate the code files required by the vehicle battery management development project includes: for different According to the configuration of the OSAL code generation tool, the macro loads the interface corresponding to the different configuration in the target real-time operating system; when loading the interface, the OSAL code generation tool is used to generate the vehicle Code files required for battery management development projects.
  • the macro generated by the OSAL code generation tool determines the interface of the current user's configuration in the RTOS, and then loads the interface to run the user's configuration, and then uses the OSAL code generation tool to process the running results to obtain the code files required by the current BMS project. Since the interface loaded in the RTOS is based on the configuration of the user, the generated code files can meet the needs of the BMS project development, thereby ensuring the normal and smooth development of the BMS project.
  • loading the interface corresponding to the different configurations in the target real-time operating system according to the macro generated by the OSAL code generation tool includes: when the configuration is a clock setting , determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load Clock_setTimeout, Clock_setPeriod, Clock_start in the FreeRTOS, and call xTimerStart; when the configuration is an application setting , determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in the FreeRTOS, and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and generate The macro determines whether the target real-time operating system is SYSbios; if so, loads BIOS_start() in the SYSbios.
  • the target RTOS is FreeRTOS, and then when the target RTOS is determined to be FreeRTOS, the specific call interface is given to avoid interface call errors, thereby improving the efficiency of code file generation Accuracy further ensures the normal and smooth development of BMS projects.
  • the embodiment of the present application provides a real-time operating system generating device, the generating device includes: a design module for generating an operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel uses To make the real-time operating system RTOS run under the AUTOSAR standard; the encapsulation module is used to encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel; the acquisition module is used to obtain an OSAL code generation tool, and the OSAL code The generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS; the generation module is used for the RTOS based on the OSAL kernel and encapsulated API And the OSAL code generation tool generates an AUTOSAR-based real-time operating system.
  • a design module for generating an operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel uses To make the real-time operating
  • an embodiment of the present application provides a device for using a real-time operating system, the device for using is applied to the real-time operating system generated by the above-mentioned generating device, and the device for using includes: a download module for downloading from the Download the OSAL kernel based on the AUTOSAR real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from the open source website; the configuration module is used to obtain the user based on the vehicle battery management development project.
  • the configuration in the OSAL kernel; the generation module is used to adopt the OSAL code generation tool to generate the required code files for the vehicle battery management development project based on the operation result of the configuration in the target real-time operating system.
  • the embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus; wherein, the processor and the memory complete mutual communication through the bus; the processor is used to call The program instructions in the memory are used to execute the generation method in the first aspect or the use method in the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium, including: a stored program; wherein, when the program is running, the device where the storage medium is located is controlled to execute the generation method in the first aspect or the second method used in the aspect.
  • FIG. 1 is a schematic flow diagram of a method for generating a real-time operating system in an embodiment of the present application
  • Fig. 2 is the structural representation of the real-time operating system based on AUTOSAR in the embodiment of the present application;
  • FIG. 3 is a schematic flowchart of a method for using a real-time operating system in an embodiment of the present application
  • Fig. 4 is a schematic diagram of the core processing flow of the OSAL scheduler in the embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a device for generating a real-time operating system in an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of a device for using a real-time operating system in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • an embodiment means that a particular feature or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application.
  • the occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
  • multiple refers to more than two (including two), similarly, “multiple groups” refers to more than two groups (including two), and “multiple pieces” refers to More than two pieces (including two pieces).
  • MICROSAR OS is a preemptive real-time multitasking operating system developed by Vector, which fully complies with the AUTOSAR standard. Its main idea is to make the software designer easier to manage, the software system easier to transplant, tailor, and better maintain and quality assurance. MICROSAR OS has been widely used in the field of automotive electronics. It has many advantages such as static operating system, complete preemption, event triggering, and configurable functions and sizes.
  • MICROSAR OS needs to purchase the Davinci series tools and the static code package provided by Vector in the development of automotive electronics. Additional purchases of system tools and code packages require a certain amount of money, resulting in very high BMS development costs. Moreover, the resources of the Micro Control Unit (MCU) of the existing technology platform are constantly changing, and the development of Vector is limited (for example: Vector has not yet developed a new generation of chip code packages and configuration tools), which leads to the development of new BMS projects. The MICROSAR OS provided by Vector cannot continue to be used in the middle, which seriously affects the development of the MBS project.
  • MCU Micro Control Unit
  • the embodiments of the present application provide a real-time operating system generation method, use method, generation device, use device, electronic equipment, and computer-readable storage medium.
  • RTOS based on The AUTOSAR standard generates the OSAL kernel that can simulate various functions in AUTOSAR, and then configures the OSAL kernel in the RTOS, combined with the corresponding code generation tools, can automatically generate the corresponding configuration file, and then simulates a real-time operating system similar to AUTOSAR.
  • Fig. 1 is a schematic flow chart of a method for generating a real-time operating system in an embodiment of the present application, as shown in Fig. 1, the method may include:
  • the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard.
  • the specific method of generating the OSAL kernel based on the AUTOSAR standard can use any existing method of generating the OSAL kernel, as long as the generated OSAL kernel can make the RTOS run under the AUTOSAR standard. That is to say, RTOS configured with OSAL kernel can simulate all or part of the functions in MICROSAR OS.
  • the specific generation method of the OSAL kernel is not limited here.
  • S2 Encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel.
  • the RTOS can simulate all or part of the functions in the MICROSAR OS through the OSAL kernel. Therefore, it is necessary to encapsulate the OSAL kernel and the corresponding API in the RTOS.
  • APIs in an RTOS there will be multiple APIs in an RTOS.
  • API is used to encapsulate the OSAL kernel, it can be determined according to the actual situation during configuration, and no specific limitation is made here.
  • the specific encapsulation method adopted during the encapsulation it may be any existing encapsulation method, which is not specifically limited here.
  • the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel from the user's configuration in the OSAL kernel and the call process to the RTOS.
  • the existing code generation tool can be improved so that it can generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS. It is also possible to custom generate an OSAL code generation tool.
  • the generation process of the OSAL code generation tool is similar to that of other code generation tools, as long as its final function can generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS.
  • the design methods adopted are the design methods of existing commonly used code generation tools. The specific method of obtaining the OSAL code generation tool is not limited here.
  • S4 Generate an AUTOSAR-based real-time operating system based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
  • the RTOS After obtaining the OSAL kernel, encapsulating the API of the OSAL kernel in the RTOS, and loading the OSAL code generation tool into the RTOS, the RTOS has the OSAL kernel and the OSAL code generation tool. At this time, the RTOS can run according to the AUTOSAR standard, that is, all or part of the functions in the MICROSAR OS are realized.
  • the method for generating a real-time operating system provided by the embodiment of the present application firstly generates an OSAL kernel based on the AUTOSAR standard; then, encapsulates the corresponding API of the RTOS based on the OSAL kernel; then obtains an OSAL code generation tool; finally, Generate an AUTOSAR-based real-time operating system based on the OSAL kernel, RTOS after encapsulating the API, and OSAL code generation tools.
  • the AUTOSAR-based real-time operating system obtained at this time can run according to the AUTOSAR standard, that is, realize all or part of the functions in MICROSAR OS.
  • step S1 in the method shown in Figure 1 in the process of generating the OSAL kernel based on the AUTOSAR standard, multiple objects in the AUTOSAR OS can also be referred to, thereby enabling more convenient and comprehensive generation of the OSAL kernel.
  • step S1 may specifically include:
  • S11 Generate an OSAL kernel containing multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
  • Each object in AUTOSAR OS can realize corresponding functions, and then, refer to each object in AUTOSAR OS to generate an OSAL kernel based on AUTOSAR standard, which can more conveniently and comprehensively simulate various functions in MICROSAR OS.
  • the objects in AUTOSAR OS can at least include: Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, IOC, etc. That is to say, in the design of the OSAL kernel, the output targets are to realize Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, and IOC.
  • the OSAL kernel is generated based on the AUTOSAR standard, which can reduce the workload when generating the OSAL kernel based on the AUTOSAR standard, and then based on the OSAL kernel, it can more conveniently and comprehensively simulate various objects in MICROSAR OS. item function.
  • the OSAL kernel needs a general control capable of scheduling its various functions during the running process, and this general control can be the operating system abstraction layer OSAL scheduler. Then combined with the data structure of multiple objects in AUTOSAR OS, an OSAL kernel that can run based on the AUTOSAR standard is obtained.
  • step S11 may specifically include:
  • S111 Generate an operating system abstraction layer OSAL scheduler.
  • the OSAL scheduler is used to manage kernel parameter initialization, kernel startup and shutdown, current kernel acquisition, application initialization, interrupt initialization, clock initialization, and external interface calls.
  • the OSAL scheduler designed in the OSAL kernel is actually used to manage OS kernel (Core) parameter initialization, kernel (Core) start and stop, current core (Core) acquisition, Application initialization, interrupt initialization, Alarm initialization, etc. At the same time, it can also manage OS services, provide an external call interface, and is compatible with the RTE module in AUTOSAR.
  • the OSAL scheduler is similar to the trap in AUTOSAR OS, but the processing process is completely different.
  • the key core processing lies in the judgment of different RTOS types, which will be explained in detail in the usage method of the real-time operating system later.
  • S112 Generate data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard.
  • S113 Generate an OSAL kernel based on the OSAL scheduler and data structure.
  • the OSAL scheduler is generated to realize the management of multiple objects, and the data structure of multiple objects in the AUTOSAR OS is generated, and then combined with the OSAL scheduler to generate the OSAL kernel, it can make
  • the OSAL kernel implements unified management of its various functions through the OSAL scheduler, which strengthens the OSAL kernel.
  • step S112 in order to enable the OSAL kernel to manage and configure the related objects of the AUTOSAR OS in the RTOS, and to adapt to the requirements of the OSAL code generation tool, according to the requirements of the AUTOSAR standard, it is necessary to Design the Application, Alarm, Interrupt, Counter, and Task data structures.
  • step S112 may specifically include:
  • S1121 When multiple objects include applications, generate an application stack, a task-related attribute table, a task handle table, a clock-related attribute table, a clock handle table, a signal-related attribute table, an event-related attribute table, an event handle table, based on the AUTOSAR standard, ISRs nest flags, computed property sheets, source property sheets, application static code, and configuration code architectures.
  • the Application structure needs to have the Application stack (dynamic state identification when creating the Application), task association attribute table, task handle table, Alarm association attribute table, Alarm handle table, signal association Attribute table, event association attribute table, event handle table, ISRs nested flag, Counters attribute table, Resources attribute table, etc.
  • Application stack dynamic state identification when creating the Application
  • task association attribute table task handle table
  • Alarm association attribute table Alarm handle table
  • signal association Attribute table event association attribute table
  • event handle table event handle table
  • ISRs nested flag Counters attribute table
  • Resources attribute table etc.
  • the static code of Application is responsible for the initialization of the corresponding resources in AUTOSAR, and completes the task list, alarm list, event list, and resource initialization of all rights according to the Applications configuration list.
  • the key to the design is to be able to judge different types of RTOS by reading the macro of the code generation tool to realize the function of RTE task activation in AUTOSAR OS.
  • the specific implementation manner will be described in detail later in the method of using the real-time operating system.
  • S1122 When multiple objects include a clock, generate an identifier, a clock name, a cycle running time, a timeout time, and a clock implementation interface based on the AUTOSAR standard.
  • the Alarm structure needs to have ID, Alarm name, cycle running time, timeout time, and Alarm implementation interface.
  • OSAL code generation tools when generating OSAL code generation tools by itself, OSAL code generation tools can be generated based on different compilers, thereby improving the OSAL code generation tools for different RTOSs. applicability.
  • step S3 may specifically include:
  • S32 Generate a template based on the link file, and generate an OSAL code generation tool according to the rule that the static variable defined by the code is consistent with the data structure in the OSAL kernel.
  • the OSAL code generation tool is generated through the link file generation template corresponding to different compilers. No matter which RTOS the developer chooses, the OSAL code generation tool can generate RTOS-compliant code, which can improve the OSAL code generation tool. Applicability of different RTOS.
  • the real-time operating system based on AUTOSAR After adopting the generation method of the above real-time operating system, the real-time operating system based on AUTOSAR can be obtained.
  • FIG. 2 is a schematic diagram of the architecture of the AUTOSAR-based real-time operating system in the embodiment of the present application.
  • the AUTOSAR-based real-time operating system includes: OSAL and EOS.
  • the EOS here is actually RTOS.
  • BMS APP/RTE is a BMS project, which does not belong to the AUTOSAR-based real-time operating system, but it is connected with the AUTOSAR-based real-time operating system to select and process each module in the AUTOSAR-based real-time operating system according to the specific content of the BMS project. Configuration, so that the rapid development of BMS projects is carried out based on the selected and configured AUTOSAR-based real-time operating system.
  • EOS In EOS, it includes: Semaphore, Event, Queue, Task, Timer, IPC, Interupt, Clock. These are all existing modules in EOS. Different EOSs have slightly different modules, but they are generally the same. Which EOS the user chooses, which EOS is configured here.
  • OSAL include: OSAL kernel, OS code generation tool, OS manager and system service.
  • OSAL is compatible with the Autoosar runtime environment.
  • OSAL kernel includes: APP management, Alarm management, OSAL scheduler, Memony management. Users can configure through APP management and Alarm management.
  • OSAL scheduler Memony management can be realized, the clock in EOS can be controlled, and the information interface can be interacted with EOS through OS manager and OS API to realize system services.
  • the OS code generation tool can also generate configuration codes during its operation, so as to realize the automatic configuration of the real-time operating system based on AUTOSAR.
  • the real-time operating system After obtaining the real-time operating system based on AUTOSAR, the real-time operating system can be used to realize the rapid development of the BMS project at a low development cost.
  • the real-time operating system is an AUTOSAR-based real-time operating system generated by using the method for generating a real-time operating system in the foregoing embodiments.
  • FIG. 3 is a schematic flowchart of a method for using a real-time operating system in an embodiment of the present application. Referring to FIG. 3, the method may include:
  • S5 Download the OSAL kernel from the AUTOSAR-based real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from the open source website.
  • the OSAL kernel In the real-time operating system based on AUTOSAR, there is a pre-designed OSAL kernel.
  • the OSAL kernel is capable of simulation according to the AUTOSAR standard. Therefore, when using the AUTOSAR-based real-time operating system for rapid development of the BMS project, the OSAL kernel needs to be downloaded first.
  • RTOS can be directly downloaded from open source websites.
  • the user's configuration can be obtained, so as to run the user's configuration in the target RTOS, and then use the OSAL code generation tool in the AUTOSAR-based real-time operating system to generate the corresponding code file, and then based on the code
  • the file realizes the rapid development of BMS projects.
  • the target RTOS After the user's configuration in the OSAL kernel is run in the target RTOS, the target RTOS will generate a running result after the running process is completed, and then convert the running result into code through the OSAL code generation tool in the AUTOSAR-based real-time operating system file, the code file is what the BMS project needs to achieve rapid development. Therefore, the rapid development of the BMS project can be realized based on the code file.
  • the OSAL code generation tool is used to convert the running result into the corresponding code file, so that the BMS project can be developed based on the code file.
  • MICROSAR OS the Davinci series tools in MICROSAR OS
  • static code package provided by Vector, which reduces the development cost of BMS projects.
  • OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
  • step S7 in the method shown in Figure 3 when generating the corresponding code file, different configurations and different interfaces are called, and the corresponding interface needs to be loaded to generate the code file, which can ensure that the code file is generated The accuracy, thus ensuring the normal and smooth development of the BMS project.
  • step S7 may specifically include:
  • the corresponding interfaces can be loaded according to the macro generated by the OSAL code generation tool.
  • the macro generated by the OSAL code generation tool can determine the specific type of the target RTOS, and then load the corresponding interface according to the different types of RTOS.
  • S711 When configured as the clock Alarm setting, determine whether the target RTOS is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load Clock_setTimeout, Clock_setPeriod, Clock_start in FreeRTOS, and call xTimerStart.
  • the function of Alarm can be realized by calling Clock_setTimeout, Clock_setPeriod, and Clock_start. And if you want to implement the SetRelAlarm function in AUTOSAR OS, then you need to call the xTimerStart interface API of FreeRTOS through the corresponding interface of the OSAL scheduler.
  • S712 When configured to apply Application settings, determine whether the target RTOS is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in FreeRTOS, and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and generate according to the OSAL code generation tool
  • the macro determines whether the target RTOS is SYSbios; if so, loads BIOS_start() in SYSbios.
  • the OSAL scheduler also has most of the functions of the Core module in AUTOSAR OS. For example: Os_Api_StartOS of the Core module in AUTOSAR OS.
  • the OSAL scheduler calls the internal Application module, which first determines whether the current macro is FreeRTOS, and if so, calls the FreeRTOS API interface vTaskStartScheduler to start the OS. If it is TI's SYSbios, call the API interface BIOS_start() of SYSbios to start the OS.
  • the OSAL scheduler can also implement the related interfaces called by the RTE module in AUTOSAR. For example: task activation (ActivateTask), alarm setting (SetRelAlarm), etc.
  • Fig. 4 is a schematic diagram of the core processing flow of the OSAL scheduler in the embodiment of the present application, as shown in Fig. 4, the flow may include:
  • the OS start-stop and OS kernel initialization in the OSAL kernel are controlled by the ECUM module, and the OS task activation and ALARM settings in the OSAL kernel are controlled by the RTE module.
  • OSAL kernel it is judged whether the supported RTOS type is satisfied. If the type of RTOS supports it, OSAL loads the corresponding RTOS-related API interface. If the type of RTOS does not support it, the process ends.
  • FIG. 5 is a schematic structural diagram of a device for generating a real-time operating system in an embodiment of the present application.
  • the device may include:
  • the design module 51 is used to generate the operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard;
  • An encapsulation module 52 configured to encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel;
  • the obtaining module 53 is used to obtain an OSAL code generation tool, and the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS;
  • the generating module 54 is configured to generate an AUTOSAR-based real-time operating system based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
  • the design module is specifically used to generate the OSAL kernel including multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
  • the design module is specifically used to generate an operating system abstraction layer OSAL scheduler, and the OSAL scheduler is used to manage kernel parameter initialization, kernel startup and shutdown, current kernel acquisition, application initialization, interrupt initialization, clock initialization, and external interfaces Call; Generate the data structure of multiple objects in the AUTOSAR OS based on the AUTOSAR standard; Generate the OSAL kernel based on the OSAL scheduler and the data structure.
  • OSAL scheduler is used to manage kernel parameter initialization, kernel startup and shutdown, current kernel acquisition, application initialization, interrupt initialization, clock initialization, and external interfaces Call
  • the design module is specifically configured to generate an application stack, task-associated attribute table, task handle table, clock-associated attribute table, clock handle table, signal Association attribute table, event association attribute table, event handle table, ISRs nested flag, calculation attribute table, source attribute table, application static code and configuration code architecture; when the multiple objects include a clock, based on the AUTOSAR standard generates identification, clock name, cycle running time, timeout time, and clock implementation interface.
  • the acquisition module is specifically used to generate multiple link file generation templates, and different link file generation templates correspond to different compilers; based on the link file generation templates, the static variables defined according to the code and the OSAL kernel Consistent rules in the data structure are generated by the OSAL code generation tool.
  • an embodiment of the present application also provides a device for using a real-time operating system.
  • the using device is applied to the real-time operating system generated by the above-mentioned generating device.
  • FIG. 6 is a schematic structural diagram of a device for using a real-time operating system in an embodiment of the present application. Referring to FIG. 6, the device may include:
  • the download module 61 is used for downloading the OSAL kernel from the real-time operating system based on AUTOSAR, and downloading the target real-time operating system matching the vehicle battery management development project from an open source website;
  • the configuration module 62 is used to obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project;
  • the generation module 63 is configured to use the OSAL code generation tool to generate code files required by the vehicle battery management development project based on the running results of the configuration in the target real-time operating system.
  • the generation module is specifically configured to load the interface corresponding to the different configuration in the target real-time operating system according to the macro generated by the OSAL code generation tool for different configurations; when loading the interface , using the OSAL code generation tool to generate the code files required by the vehicle battery management development project.
  • the generation module is specifically used to determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool when the configuration is clock setting; if so, load the Clock_setTimeout, Clock_setPeriod, Clock_start, and call xTimerStart; when the configuration is an application setting, determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in the FreeRTOS , and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and determine whether the target real-time operating system is SYSbios according to the macro generated by the OSAL code generation tool; if so, load BIOS_start() in the SYSbios.
  • Fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • the electronic device may include: a processor 71, a memory 72, and a bus 73; communication; the processor 71 is used to call the program instructions in the memory 72, so as to execute the generation method or the use method in one or more embodiments above.
  • the embodiment of the present application also provides a computer-readable storage medium, which may include: a stored program; wherein, when the program is running, the storage medium is controlled
  • the device where it is located executes the generating method or using method in one or more of the above embodiments.
  • the OSAL kernel is designed to realize related objects in AUTOSAR OS (Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, IOC) as the output target, and the module API interface provided by RTOS as the input object (such as TI's SYSbios, related Interfaces include Semaphores, MailBoxes, Queues, Clock, HWI/SWI, etc.), the OSAL kernel encapsulates and designs the corresponding API interfaces of the RTOS, and the designed OSAL kernel is compatible with the AUTOSAR runtime environment, and can be generated by combining the designed OS code The configuration code generated by the tool makes the RTOS completely consistent with the AUTOSAR OS in function.
  • the OS code generation tool can select the required RTOS (such as FreeRTOS) according to the needs of the chip, and then implement the relevant configuration of the AUTOSAR OS objects Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, and IOC for the selected RTOS to generate and OSAL Kernel matching configuration code, project construction configuration files and link files.
  • RTOS such as FreeRTOS
  • the traditional RTOS needs to implement the AUTOSAR OS, and the OSAL kernel design needs to do the following steps:
  • the OSAL kernel needs to design an OSAL scheduler to manage OS kernel (Core) parameter initialization, kernel (Core) start and stop, current core (Core) acquisition, Application initialization, interrupt initialization, Alarm initialization, etc. At the same time, it can manage OS services, provide an external call interface, and is compatible with the RTE module in AUTOSAR.
  • the OSAL scheduler is similar to the trap in AUTOSAR OS, but the processing process is completely different.
  • the key core processing lies in the judgment of different RTOS types, such as the setting of the Alarm.
  • the macro generated by the OS code tool must first be used to determine the current Whether the RTOS is FreeRTOS, if so, the OSAL kernel will load FreeRTOS related Clock_setTimeout, Clock_setPeriod, Clock_start to realize the function of Alarm.
  • the OSAL scheduler has most of the functions of the Core module in AUTOSAR OS. For example, in the Os_Api_StartOS of the Core module in AUTOSAR OS, the OSAL scheduler calls the internal Application module. This module first judges whether the current macro is FreeRTOS, and if so, calls the FreeRTOS API interface vTaskStartScheduler to start the OS.
  • the OSAL scheduler implements the relevant interfaces called by the RTE module in AUTOSAR, such as task activation (ActivateTask), alarm setting (SetRelAlarm), etc.
  • the Application structure needs to have the Application stack (dynamic state identification when creating the Application), task association attribute table, task handle table, Alarm association attribute table, Alarm handle table, signal association attribute table , event association attribute table, event handle table, ISRs nested flags, Counters attribute table, Resources attribute table, etc., at the same time, it is necessary to design the static code and configurable code architecture of Application.
  • the static code of Application is responsible for the initialization of corresponding resources in AUTOSAR, and completes the task list, alarm list, event list, and resource initialization of all rights according to the Applications configuration list.
  • the key to its design is that it can judge different types of RTOS by reading the macro of the code generation tool to realize the function of RTE task activation in AUTOSAR OS.
  • the RTOS currently configured by the code generation tool is FreeRTOS
  • the startup in FreeRTOS is called.
  • the Alarm structure needs to have ID, Alarm name, cycle running time, timeout time, and Alarm implementation interface.
  • the Alarm structure is defined.
  • the key to its design is to be able to judge different types of RTOS by reading the macros of the code generation tool to realize the start and stop function of the RTE Alarm in the AUTOSAR OS.
  • the RTOS currently configured by the code generation tool is FreeRTOS
  • the The SetRelAlarm function in AUTOSAR OS requires the corresponding interface of the OSAL scheduler to call the xTimerStart interface API of FreeRTOS.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

A generation method and apparatus for a real-time operating system (RTOS), a use method and apparatus for an RTOS, an electronic device, and a medium. The generation method comprises: generating an operating system abstraction layer (OSAL) kernel on the basis of an automotive open system architecture (AUTOSAR) standard, the OSAL kernel being used for enabling an RTOS to run under the AUTOSAR standard (S1); encapsulating a corresponding application programming interface (API) of the RTOS on the basis of the OSAL kernel (S2); obtaining an OSAL code generation tool, the OSAL code generation tool being used for generating a code file consistent with the OSAL kernel according to the configuration in the OSAL kernel by a user and a calling process of the RTOS by the user (S3); and generating an AUTOSAR-based RTOS on the basis of the OSAL kernel, the RTOS having the encapsulated API, and the OSAL code generation tool (S4). The development cost in a BMS project can be reduced, and rapid development of the project can also be implemented.

Description

实时操作系统的生成、使用方法及装置、电子设备、介质Generating and using method and device of real-time operating system, electronic equipment, medium
相关申请的交叉引用Cross References to Related Applications
本申请要求享有于2022年01月29日提交的名称为“实时操作系统的生成、使用方法及装置、电子设备、介质”的中国专利申请202210111217.4的优先权,该申请的全部内容通过引用并入本文中。This application claims the priority of the Chinese patent application 202210111217.4 entitled "Real-time operating system generation, use method and device, electronic equipment, medium" filed on January 29, 2022, the entire content of which is incorporated by reference In this article.
技术领域technical field
本申请涉及电池管理技术领域,尤其涉及一种实时操作系统的生成方法、使用方法、生成装置、使用装置、电子设备以及计算机可读存储介质。The present application relates to the technical field of battery management, and in particular to a method for generating a real-time operating system, a method for using it, a device for generating it, a device for using it, electronic equipment, and a computer-readable storage medium.
背景技术Background technique
车辆使用MICROSAR OS作为一种抢先式实时多任务操作系统,已经广泛应用于汽车电子领域。而MICROSAR OS在开发汽车电子领域需要购买Davinci系列工具和Vector提供的静态代码包,导致开发成本非常高。并且,一旦Davinci系列工具和Vector提供的静态代码包更新不及时,还会严重影响电池管理系统(Battery Management System,BMS)等项目的开发进度。Vehicles use MICROSAR OS as a preemptive real-time multi-tasking operating system, which has been widely used in the field of automotive electronics. However, MICROSAR OS needs to purchase the Davinci series tools and the static code package provided by Vector in the development of automotive electronics, resulting in very high development costs. Moreover, once the Davinci series tools and the static code package provided by Vector are not updated in time, it will seriously affect the development progress of projects such as the Battery Management System (BMS).
发明内容Contents of the invention
鉴于上述问题,本申请提供一种实时操作系统的生成方法、使用方法、生成装置、使用装置、电子设备以及计算机可读存储介质,既能够降低BMS项目的开发成本,又能够实现项目的快速开发。In view of the above problems, the present application provides a real-time operating system generation method, use method, generation device, use device, electronic equipment and computer-readable storage medium, which can not only reduce the development cost of BMS projects, but also realize rapid development of projects .
第一方面,本申请实施例提供了实时操作系统的生成方法,所述生成方法包括:基于汽车开放系统架构(AUTomotive Open SystemArchitecture,AUTOSAR)标准生成操作系统抽象层(Operating System Abstraction Layer,OSAL)内核,所述OSAL内核用于使得实时操作系统(Real Time Operating System,RTOS)在AUTOSAR标准下运行;基于所述OSAL内核对所述RTOS相应的应用程序接口(Application Programming Interface,API)进行封装;获取OSAL代码生成工具,所述OSAL代码生成工具用于将用户对所述OSAL内核中的配置以及对所述RTOS的调用过程生成与所述OSAL内核相一致的代码文件;基于所述OSAL内核、封装API后的RTOS以及所述OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。In the first aspect, the embodiment of the present application provides a method for generating a real-time operating system, and the generating method includes: generating an operating system abstraction layer (Operating System Abstraction Layer, OSAL) kernel based on the Automobile Open System Architecture (AUTomotive Open System Architecture, AUTOSAR) standard , the OSAL kernel is used to make a real-time operating system (Real Time Operating System, RTOS) run under the AUTOSAR standard; based on the OSAL kernel, the corresponding application program interface (Application Programming Interface, API) of the RTOS is encapsulated; obtain OSAL code generation tool, the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS; based on the OSAL kernel, encapsulation After the RTOS API and the OSAL code generation tool, generate an AUTOSAR-based real-time operating system.
此时得到的基于AUTOSAR的实时操作系统,能够按照AUTOSAR标准运行,即实现了MICROSAR OS中的全部或者部分功能。这样,无需再购买MICROSAR OS以及MICROSAR OS中的Davinci系列工具和Vector提供的静态代码包,也能够实现BMS项目的开发,节省了BMS项目的开发成本。并且,基于AUTOSAR的实时操作系统中由于配置了OSAL内核以及OSAL代码生成工具,进而在进行BMS项目开发时,也无需重新构建软件架构,也无需手动编写大量代码,从而实现BMS项目的快速开发。The AUTOSAR-based real-time operating system obtained at this time can run according to the AUTOSAR standard, that is, realize all or part of the functions in MICROSAR OS. In this way, it is not necessary to purchase MICROSAR OS, the Davinci series tools in MICROSAR OS and the static code package provided by Vector, and the development of BMS projects can also be realized, which saves the development cost of BMS projects. Moreover, since the OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
在一些实施例中,所述基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,包括:基于所述AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的所述OSAL内核。In some embodiments, the generating the operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard includes: generating the OSAL kernel including multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
通过AUTOSAR OS中的多个对象,基于AUTOSAR标准生成OSAL内核,能够减少基于AUTOSAR标准生成OSAL内核时的工作量,进而基于OSAL内核能够更加便捷以及全面的模拟MICROSAR OS中的各项功能。Through multiple objects in the AUTOSAR OS, the OSAL kernel is generated based on the AUTOSAR standard, which can reduce the workload when generating the OSAL kernel based on the AUTOSAR standard, and then based on the OSAL kernel, it can more conveniently and comprehensively simulate various functions in the MICROSAR OS.
在一些实施例中,所述基于所述AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的所述OSAL内核,包括:生成操作系统抽象层OSAL调度器,所述OSAL调度器用于管理内核参数初始化、内核启停、当前核获取、应用初始化、中断初始化、时钟初始化以及外部接口调用;基于所述AUTOSAR标准生成所述AUTOSAR OS中多个对象的数据结构;基于所述OSAL调度器和所述数据结构生成所述OSAL内核。In some embodiments, the generation of the OSAL kernel containing multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard includes: generating an operating system abstraction layer OSAL scheduler, and the OSAL scheduler is used for Manage kernel parameter initialization, kernel start and stop, current core acquisition, application initialization, interrupt initialization, clock initialization, and external interface calls; generate data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard; based on the OSAL scheduler and the data structures generated by the OSAL kernel.
在生成OSAL内核的过程中,通过生成OSAL调度器,以实现多个对象的管理,以及生成AUTOSAR OS中多个对象的数据结构,进而结合OSAL调度器生成OSAL内核,能够使得OSAL内核通过OSAL调度器对其各项功能实现统一管理,强化了OSAL内核。In the process of generating the OSAL kernel, the OSAL scheduler is generated to realize the management of multiple objects, and the data structure of multiple objects in the AUTOSAR OS is generated, and then combined with the OSAL scheduler to generate the OSAL kernel, the OSAL kernel can be scheduled by OSAL The controller implements unified management of its various functions and strengthens the OSAL kernel.
在一些实施例中,所述基于所述AUTOSAR标准生成所述AUTOSAR OS中多个对象的数据结构,包括:当所述多个对象中包括应用时,基于所述AUTOSAR标准生成应用堆栈、任务关联属性表、任务句柄表、时钟关联属性表、时钟句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、计算属性表、源属性表、应用的静态代码和配置化代码架构;当所述多个对象中包括时钟时,基于所述AUTOSAR标准生成标识、时钟名称、周期运行时间、超时时间、时钟实现接口。In some embodiments, the generating the data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard includes: when the multiple objects include applications, generating application stacks and task associations based on the AUTOSAR standard Property table, task handle table, clock-related property table, clock handle table, signal-related property table, event-related property table, event handle table, ISRs nested flags, computed property table, source property table, application static code and configuration Code architecture; when the multiple objects include a clock, generate an identifier, a clock name, a cycle running time, a timeout time, and a clock implementation interface based on the AUTOSAR standard.
根据AUTOSAR OS中不同对象的类型,配置不同的数据结构,能够使OSAL内核管理和配置RTOS中AUTOSAR OS的相关对象,从而确保RTOS能够基于AUTOSAR实现各项功能。According to the types of different objects in AUTOSAR OS, different data structures can be configured to enable OSAL kernel to manage and configure related objects of AUTOSAR OS in RTOS, so as to ensure that RTOS can realize various functions based on AUTOSAR.
在一些实施例中,所述获取OSAL代码生成工具,包括:生成多种链接文件生成模板,不同的链接文件生成模板对应不同的编译器;基于所述链接文件生成模板,按照代码定义的静态变量与所述OSAL内核中的数据结构一致的规则,生成所述OSAL代码生成工具。In some embodiments, the acquisition of the OSAL code generation tool includes: generating a variety of link file generation templates, and different link file generation templates correspond to different compilers; based on the link file generation templates, static variables defined according to the code The OSAL code generation tool is generated according to the rules consistent with the data structures in the OSAL kernel.
通过与不同编译器对应的链接文件生成模板生成OSAL代码生成工具,无论开发人员选择何种RTOS,通过OSAL代码生成工具都能够生成符合RTOS的代码,能够提高OSAL代码生成工具针对不同RTOS的可适用性。Generate OSAL code generation tools through link file generation templates corresponding to different compilers. No matter what RTOS the developer chooses, the OSAL code generation tools can generate RTOS-compliant codes, which can improve the applicability of OSAL code generation tools for different RTOSs. sex.
第二方面,本申请实施例提供了实时操作系统的使用方法,所述使用方法应用于上述的生成方法生成的实时操作系统中,所述使用方法包括:从所述基于AUTOSAR的实时操作系统中下载所述OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统;获取用户基于所述车辆电池管理开发项目在所述OSAL内核中的配置;基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。In the second aspect, the embodiment of the present application provides a method for using a real-time operating system, which is applied to the real-time operating system generated by the above-mentioned generation method, and the method for using includes: from the real-time operating system based on AUTOSAR Download the OSAL kernel, and download the target real-time operating system that matches the vehicle battery management development project from an open source website; obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project; The operating result in the target real-time operating system uses the OSAL code generation tool to generate the code files required by the vehicle battery management development project.
将用户在OSAL内核中的配置在目标RTOS中运行,进而使用OSAL代码生成工具将运行结果转换为相应的代码文件,从而使得BMS项目能够基于该代码文件进行相应的开发。在进行BMS项目开发的过程中,无需再购买MICROSAR OS以及MICROSAR OS中的Davinci系列工具和Vector提供的静态代码包,降低了BMS项目的开发成本。并且,基于AUTOSAR的实时操作系统中由于配置了OSAL内核以及OSAL代码生成工具,进而在进行BMS项目开发时,也无需重新构建软件架构,也无需手动编写大量代码,从而实现BMS项目的快速开发。Run the user's configuration in the OSAL kernel in the target RTOS, and then use the OSAL code generation tool to convert the running results into corresponding code files, so that the BMS project can be developed based on the code files. In the process of BMS project development, there is no need to purchase MICROSAR OS, the Davinci series tools in MICROSAR OS and the static code package provided by Vector, which reduces the development cost of BMS projects. Moreover, since the OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
在一些实施例中,所述基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件,包括:针对不同的配置,根据所述OSAL代码生成工具生成的宏加载所述目标实时操作系统中与所述不同的配置对应的接口;在加载所述接口时,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。In some embodiments, based on the running result of the configuration in the target real-time operating system, using the OSAL code generation tool to generate the code files required by the vehicle battery management development project includes: for different According to the configuration of the OSAL code generation tool, the macro loads the interface corresponding to the different configuration in the target real-time operating system; when loading the interface, the OSAL code generation tool is used to generate the vehicle Code files required for battery management development projects.
通过OSAL代码生成工具生成的宏确定当前用户的配置在RTOS中的接口,进而加载该接口运行用户的配置,再采用OSAL代码生成工具对运行结果进行处理,得到当前BMS项目所需的代码文件。由于RTOS中加载的接口是基于用户的配置进行的,因此,生成的代码文件能够满足BMS项目开发所需,进而确保BMS项目能够正常顺利的开发。The macro generated by the OSAL code generation tool determines the interface of the current user's configuration in the RTOS, and then loads the interface to run the user's configuration, and then uses the OSAL code generation tool to process the running results to obtain the code files required by the current BMS project. Since the interface loaded in the RTOS is based on the configuration of the user, the generated code files can meet the needs of the BMS project development, thereby ensuring the normal and smooth development of the BMS project.
在一些实施例中,所述针对不同的配置,根据所述OSAL代码生成工具生成的宏加载所述目标实时操作系统中与所述不同的配置对应的接口,包括:当所述配置为时钟设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的Clock_setTimeout、Clock_setPeriod、Clock_start,以及调用xTimerStart;当所述配置为应用设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的vTaskStartScheduler,以及调用xSemaphoreCreateMutex、xSemaphoreCreateMutex、Semaphore_post;以及根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为SYSbios;若是,则加载所述SYSbios中的BIOS_start()。In some embodiments, for different configurations, loading the interface corresponding to the different configurations in the target real-time operating system according to the macro generated by the OSAL code generation tool includes: when the configuration is a clock setting , determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load Clock_setTimeout, Clock_setPeriod, Clock_start in the FreeRTOS, and call xTimerStart; when the configuration is an application setting , determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in the FreeRTOS, and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and generate The macro determines whether the target real-time operating system is SYSbios; if so, loads BIOS_start() in the SYSbios.
针对Alarm配置和Application配置,根据OSAL代码生成工具生成的宏确定目标RTOS是否为FreeRTOS,进而在确定目标RTOS为FreeRTOS时,给出了具体调用的接口,避免接口调 用错误,进而提高代码文件生成的准确性,进一步确保BMS项目能够正常顺利的开发。For Alarm configuration and Application configuration, according to the macro generated by the OSAL code generation tool, it is determined whether the target RTOS is FreeRTOS, and then when the target RTOS is determined to be FreeRTOS, the specific call interface is given to avoid interface call errors, thereby improving the efficiency of code file generation Accuracy further ensures the normal and smooth development of BMS projects.
第三方面,本申请实施例提供了一种实时操作系统的生成装置,所述生成装置包括:设计模块,用于基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,所述OSAL内核用于使得实时操作系统RTOS在AUTOSAR标准下运行;封装模块,用于基于所述OSAL内核对所述RTOS相应的应用程序接口API进行封装;获取模块,用于获取OSAL代码生成工具,所述OSAL代码生成工具用于将用户对所述OSAL内核中的配置以及对所述RTOS的调用过程生成与所述OSAL内核相一致的代码文件;生成模块,用于基于所述OSAL内核、封装API后的RTOS以及所述OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。In a third aspect, the embodiment of the present application provides a real-time operating system generating device, the generating device includes: a design module for generating an operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel uses To make the real-time operating system RTOS run under the AUTOSAR standard; the encapsulation module is used to encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel; the acquisition module is used to obtain an OSAL code generation tool, and the OSAL code The generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS; the generation module is used for the RTOS based on the OSAL kernel and encapsulated API And the OSAL code generation tool generates an AUTOSAR-based real-time operating system.
第四方面,本申请实施例提供了一种实时操作系统的使用装置,所述使用装置应用于上述的生成装置生成的实时操作系统中,所述使用装置包括:下载模块,用于从所述基于AUTOSAR的实时操作系统中下载所述OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统;配置模块,用于获取用户基于所述车辆电池管理开发项目在所述OSAL内核中的配置;生成模块,用于基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。In a fourth aspect, an embodiment of the present application provides a device for using a real-time operating system, the device for using is applied to the real-time operating system generated by the above-mentioned generating device, and the device for using includes: a download module for downloading from the Download the OSAL kernel based on the AUTOSAR real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from the open source website; the configuration module is used to obtain the user based on the vehicle battery management development project. The configuration in the OSAL kernel; the generation module is used to adopt the OSAL code generation tool to generate the required code files for the vehicle battery management development project based on the operation result of the configuration in the target real-time operating system.
第五方面,本申请实施例提供了一种电子设备,包括:处理器、存储器、总线;其中,所述处理器、所述存储器通过所述总线完成相互间的通信;所述处理器用于调用所述存储器中的程序指令,以执行第一方面中的生成方法或者第二方面中的使用方法。In the fifth aspect, the embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus; wherein, the processor and the memory complete mutual communication through the bus; the processor is used to call The program instructions in the memory are used to execute the generation method in the first aspect or the use method in the second aspect.
第六方面,本申请实施例提供了一种计算机可读存储介质,包括:存储的程序;其中,在所述程序运行时控制所述存储介质所在设备执行第一方面中的生成方法或者第二方面中的使用方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including: a stored program; wherein, when the program is running, the device where the storage medium is located is controlled to execute the generation method in the first aspect or the second method used in the aspect.
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。The above description is only an overview of the technical solution of the present application. In order to better understand the technical means of the present application, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present application more obvious and understandable , the following specifically cites the specific implementation manner of the present application.
附图说明Description of drawings
通过阅读对下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在全部附图中,用相同的附图标号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the application. Also, the same reference numerals are used to denote the same components throughout the drawings. In the attached picture:
图1为本申请实施例中实时操作系统的生成方法的流程示意图;FIG. 1 is a schematic flow diagram of a method for generating a real-time operating system in an embodiment of the present application;
图2为本申请实施例中基于AUTOSAR的实时操作系统的架构示意图;Fig. 2 is the structural representation of the real-time operating system based on AUTOSAR in the embodiment of the present application;
图3为本申请实施例中实时操作系统的使用方法的流程示意图;FIG. 3 is a schematic flowchart of a method for using a real-time operating system in an embodiment of the present application;
图4为本申请实施例中OSAL调度器的核心处理流程的示意图;Fig. 4 is a schematic diagram of the core processing flow of the OSAL scheduler in the embodiment of the present application;
图5为本申请实施例中实时操作系统的生成装置的结构示意图;FIG. 5 is a schematic structural diagram of a device for generating a real-time operating system in an embodiment of the present application;
图6为本申请实施例中实时操作系统的使用装置的结构示意图;FIG. 6 is a schematic structural diagram of a device for using a real-time operating system in an embodiment of the present application;
图7为本申请实施例中电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请技术方案的实施例进行详细的描述。以下实施例仅用于更加清楚地说明本申请的技术方案,因此只作为示例,而不能以此来限制本申请的保护范围。Embodiments of the technical solutions of the present application will be described in detail below in conjunction with the accompanying drawings. The following examples are only used to illustrate the technical solution of the present application more clearly, and therefore are only examples, rather than limiting the protection scope of the present application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the application; the terms used herein are only for the purpose of describing specific embodiments, and are not intended to To limit this application; the terms "comprising" and "having" and any variations thereof in the specification and claims of this application and the description of the above drawings are intended to cover a non-exclusive inclusion.
在本申请实施例的描述中,技术术语“第一”“第二”等仅用于区别不同对象,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量、特定顺序或主次关系。在本申 请实施例的描述中,“多个”的含义是两个以上,除非另有明确具体的限定。In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects, and should not be understood as indicating or implying relative importance or implicitly indicating the number, specificity, or specificity of the indicated technical features. Sequence or primary-secondary relationship. In the description of the embodiments of the present application, "plurality" means two or more, unless otherwise specifically defined.
在本文中提及“实施例”意味着,结合实施例描述的特定特征或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
在本申请实施例的描述中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如A和/或B,可以表示:存在A,同时存在A和B,存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。In the description of the embodiment of the present application, the term "and/or" is only an association relationship describing associated objects, which means that there may be three relationships, such as A and/or B, which may mean: there is A, and there are A and B, there are three situations of B. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship.
在本申请实施例的描述中,术语“多个”指的是两个以上(包括两个),同理,“多组”指的是两组以上(包括两组),“多片”指的是两片以上(包括两片)。In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two), similarly, "multiple groups" refers to more than two groups (including two), and "multiple pieces" refers to More than two pieces (including two pieces).
在本申请实施例的描述中,技术术语“中心”“纵向”“横向”“长度”“宽度”“厚度”“上”“下”“前”“后”“左”“右”“竖直”“水平”“顶”“底”“内”“外”“顺时针”“逆时针”“轴向”“径向”“周向”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请实施例和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请实施例的限制。In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical" "Horizontal", "Top", "Bottom", "Inner", "Outer", "Clockwise", "Counterclockwise", "Axial", "Radial", "Circumferential", etc. indicate the orientation or positional relationship based on the drawings Orientation or positional relationship is only for the convenience of describing the embodiment of the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as an implementation of the present application. Example limitations.
在本申请实施例的描述中,除非另有明确的规定和限定,技术术语“安装”“相连”“连接”“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;也可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请实施例中的具体含义。In the description of the embodiments of this application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection" and "fixation" should be interpreted in a broad sense, for example, it can be a fixed connection or a fixed connection. Disassembled connection, or integration; it can also be a mechanical connection, or an electrical connection; it can be a direct connection, or an indirect connection through an intermediary, and it can be the internal communication of two components or the interaction relationship between two components. Those of ordinary skill in the art can understand the specific meanings of the above terms in the embodiments of the present application according to specific situations.
目前,为了实现BMS的快速开发,主要通过购买MICROSAR OS,进而通过MICROSAR OS实现BMS的快速开发。MICROSAR OS是Vector公司开发的一种抢先式实时多任务操作系统,完全符合AUTOSAR标准,其主体思想是使得软件设计方更易于管理,软件系统更易于移植、裁剪,更好的维护和质量保证。MICROSAR OS当前已经广泛应用于汽车电子领域,其具有静态操作系统、完全抢占、事件触发、功能和大小可配置等诸多优点。At present, in order to realize the rapid development of BMS, it is mainly through the purchase of MICROSAR OS, and then realize the rapid development of BMS through MICROSAR OS. MICROSAR OS is a preemptive real-time multitasking operating system developed by Vector, which fully complies with the AUTOSAR standard. Its main idea is to make the software designer easier to manage, the software system easier to transplant, tailor, and better maintain and quality assurance. MICROSAR OS has been widely used in the field of automotive electronics. It has many advantages such as static operating system, complete preemption, event triggering, and configurable functions and sizes.
然而,MICROSAR OS在开发汽车电子领域需要购买Davinci系列工具和Vector提供的静态代码包。额外购买系统工具和代码包,都需要一定的费用,进而导致BMS开发成本非常高。并且,现有技术平台的微控制单元(Micro Control Unit,MCU)资源不断变更,以及Vector开发受限(例如:Vector尚未开发新一代芯片代码包和配置工具),这就导致在新的BMS项目中无法继续采用Vector提供的MICROSAR OS,进而严重影响MBS项目的开发。However, MICROSAR OS needs to purchase the Davinci series tools and the static code package provided by Vector in the development of automotive electronics. Additional purchases of system tools and code packages require a certain amount of money, resulting in very high BMS development costs. Moreover, the resources of the Micro Control Unit (MCU) of the existing technology platform are constantly changing, and the development of Vector is limited (for example: Vector has not yet developed a new generation of chip code packages and configuration tools), which leads to the development of new BMS projects. The MICROSAR OS provided by Vector cannot continue to be used in the middle, which seriously affects the development of the MBS project.
而如果采用市面上开源或商用的RTOS开发BMS项目,需要大量手写代码,并且需要重新开发新的软件架构,这根本无法满足当前BMS项目快速开发的需求。However, if a BMS project is developed using an open source or commercial RTOS on the market, a large amount of handwritten code is required, and a new software architecture needs to be redeveloped, which simply cannot meet the needs of rapid development of current BMS projects.
发明人经过研究发现,MICROSAR OS导致的BMS项目发开成本高。以及条件受限,无法满足BMS项目快速开发需求的根本原因在于:使用MICROSAR OS进行BMS项目开发时,需要使用Davinci系列工具和静态代码包。而Davinci系列工具和静态代码包的价格和更新不受BMS项目开发人员的控制。RTOS导致的无法满足BMS项目快速开发需求的根本原因在于:需要BMS项目开发人员重新构建软件架构,以及手写大量代码。The inventor found through research that the BMS project development cost caused by MICROSAR OS is high. And the root cause of the limited conditions and the inability to meet the rapid development needs of BMS projects is that when using MICROSAR OS for BMS project development, it is necessary to use Davinci series tools and static code packages. The prices and updates of Davinci series tools and static code packages are not under the control of BMS project developers. The fundamental reason why RTOS cannot meet the rapid development needs of BMS projects is that BMS project developers need to rebuild the software architecture and write a lot of codes by hand.
有鉴于此,基于发明人的研究发现,本申请实施例提供一种实时操作系统的生成方法、使用方法、生成装置、使用装置、电子设备以及计算机可读存储介质,在RTOS的基础上,基于AUTOSAR标准生成能够模拟AUTOSAR中各功能的OSAL内核,进而将OSAL内核配置于RTOS中,并结合相应的代码生成工具,能够自动生成相应的配置文件,进而模拟出类似于AUTOSAR的实时操作系统。由于避免了使用MICROSAR OS时需要购买Davinci系列工具和静态代码包,能够节省BMS项目的开发成本,并且在RTOS的结构中实现BMS项目的快速开发,也无需重新构建软件架构,以及手写大量代码,因此,采用本申请实施例提供的实时操作系统的生成方法、使用方法、生成装置、使用装置、电子设备以及计算机可读存储介质,能够在缩减BMS项目开发成本的同时,仍然能够实现BMS项目的快速开发。In view of this, based on the research findings of the inventors, the embodiments of the present application provide a real-time operating system generation method, use method, generation device, use device, electronic equipment, and computer-readable storage medium. On the basis of RTOS, based on The AUTOSAR standard generates the OSAL kernel that can simulate various functions in AUTOSAR, and then configures the OSAL kernel in the RTOS, combined with the corresponding code generation tools, can automatically generate the corresponding configuration file, and then simulates a real-time operating system similar to AUTOSAR. Because it avoids the need to purchase Davinci series tools and static code packages when using MICROSAR OS, it can save the development cost of BMS projects, and realize the rapid development of BMS projects in the structure of RTOS without rebuilding the software architecture and writing a lot of codes by hand. Therefore, using the real-time operating system generation method, use method, generation device, use device, electronic equipment, and computer-readable storage medium provided by the embodiment of the present application can reduce the development cost of the BMS project while still realizing the implementation of the BMS project. Rapid development.
首先,针对本申请实施例提供的实时操作系统的生成方法进行详细说明。First, the method for generating the real-time operating system provided by the embodiment of the present application will be described in detail.
图1为本申请实施例中实时操作系统的生成方法的流程示意图,参见图1所示,该方法可以包括:Fig. 1 is a schematic flow chart of a method for generating a real-time operating system in an embodiment of the present application, as shown in Fig. 1, the method may include:
S1:基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核。S1: Generate the operating system abstraction layer OSAL kernel based on the AUTOSAR standard of the automotive open system architecture.
其中,OSAL内核用于使得实时操作系统RTOS在AUTOSAR标准下运行。Among them, the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard.
在进行BMS项目开发时,需要遵循AUTOSAR标准。若想在RTOS的基础上,无需重新构建软件架构,以及无需大量手写代码,还能够实现BMS项目的快速开发,可以通过在RTOS中配置一个OSAL内核,使得该OSAL内核能够在AUTOSAR标准下模拟MICROSAR OS中的全部或者部分功能。这样,采用加入OSAL内核后的RTOS无需重新搭建软件架构,也无需大量手写代码,就能够实现MICROSAR OS中的全部或者部分功能。When developing BMS projects, it is necessary to follow the AUTOSAR standard. If you want to realize the rapid development of BMS projects on the basis of RTOS without rebuilding the software architecture and without a lot of handwritten code, you can configure an OSAL kernel in the RTOS so that the OSAL kernel can simulate MICROSAR under the AUTOSAR standard All or part of the functions in the OS. In this way, the RTOS with the OSAL kernel can realize all or part of the functions in MICROSAR OS without rebuilding the software architecture and without a lot of handwriting codes.
而基于AUTOSAR标准生成OSAL内核的具体方式,可以采用现有的任何一种生成OSAL内核的方式,只需要生成的OSAL内核能够使RTOS在AUTOSAR标准下运行即可。也就是说,配置有OSAL内核的RTOS能够模拟MICROSAR OS中的全部或者部分功能。对于OSAL内核的具体生成方式,此处不做限定。The specific method of generating the OSAL kernel based on the AUTOSAR standard can use any existing method of generating the OSAL kernel, as long as the generated OSAL kernel can make the RTOS run under the AUTOSAR standard. That is to say, RTOS configured with OSAL kernel can simulate all or part of the functions in MICROSAR OS. The specific generation method of the OSAL kernel is not limited here.
S2:基于OSAL内核对RTOS相应的应用程序接口API进行封装。S2: Encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel.
由于需要将OSAL内核配置于RTOS中,使得RTOS通过OSAL内核能够模拟MICROSAR OS中的全部或者部分功能,因此,需要将OSAL内核与在RTOS中相应的API处进行封装。Since the OSAL kernel needs to be configured in the RTOS, the RTOS can simulate all or part of the functions in the MICROSAR OS through the OSAL kernel. Therefore, it is necessary to encapsulate the OSAL kernel and the corresponding API in the RTOS.
一般来说,在RTOS中会存在多个API。至于采用哪个API对OSAL内核进行封装,可以根据配置时的实际情况确定,此处不做具体限定。以及进行封装时所采用的具体封装方式,可以是现有的任何一种封装方式,此处也不做具体限定。In general, there will be multiple APIs in an RTOS. As for which API is used to encapsulate the OSAL kernel, it can be determined according to the actual situation during configuration, and no specific limitation is made here. As well as the specific encapsulation method adopted during the encapsulation, it may be any existing encapsulation method, which is not specifically limited here.
S3:获取OSAL代码生成工具。S3: Get the OSAL code generation tool.
其中,OSAL代码生成工具用于将用户对OSAL内核中的配置以及对RTOS的调用过程生成与OSAL内核相一致的代码文件。Among them, the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel from the user's configuration in the OSAL kernel and the call process to the RTOS.
在将OSAL内核配置于RTOS中后,若想要RTOS能够按照AUTOSAR标准正常运行,还需要用户对RTOS中与OSAL内核的相关内容进行配置。而用户的配置一般与OSAL内核所使用的代码有所差异,因此,还需要一个代码生成工具将用户的配置以及基于用户的配置在RTOS中产生的调用过程转换为与OSAL内核相一致的代码文件,这个代码生成工具就是OSAL代码生成工具。After configuring the OSAL kernel in the RTOS, if you want the RTOS to run normally according to the AUTOSAR standard, you need to configure the RTOS related content with the OSAL kernel. The user's configuration is generally different from the code used by the OSAL kernel. Therefore, a code generation tool is needed to convert the user's configuration and the calling process generated in the RTOS based on the user's configuration into a code file consistent with the OSAL kernel. , this code generation tool is the OSAL code generation tool.
在实际应用中,可以将现有的代码生成工具进行改进,使其能够将用户对OSAL内核中的配置以及对RTOS的调用过程生成与OSAL内核相一致的代码文件。也可以自定义生成一个OSAL代码生成工具。OSAL代码生成工具的生成过程与其它代码生成工具的过程类似,只需其最终的功能能够将用户对OSAL内核中的配置以及对RTOS的调用过程生成与OSAL内核相一致的代码文件即可,其中所采用的设计手段都是现有常用的代码生成工具的设计方式。对于OSAL代码生成工具的具体获取方式,此处不做限定。In practical application, the existing code generation tool can be improved so that it can generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS. It is also possible to custom generate an OSAL code generation tool. The generation process of the OSAL code generation tool is similar to that of other code generation tools, as long as its final function can generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the calling process of the RTOS. The design methods adopted are the design methods of existing commonly used code generation tools. The specific method of obtaining the OSAL code generation tool is not limited here.
S4:基于OSAL内核、封装API后的RTOS以及OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。S4: Generate an AUTOSAR-based real-time operating system based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
在获得OSAL内核,并将OSAL内核在RTOS中的API进行封装,以及将OSAL代码生成工具载入到RTOS中之后,RTOS中就具有了OSAL内核和OSAL代码生成工具。此时的RTOS就能够按照AUTOSAR标准运行,即实现了MICROSAR OS中的全部或者部分功能。After obtaining the OSAL kernel, encapsulating the API of the OSAL kernel in the RTOS, and loading the OSAL code generation tool into the RTOS, the RTOS has the OSAL kernel and the OSAL code generation tool. At this time, the RTOS can run according to the AUTOSAR standard, that is, all or part of the functions in the MICROSAR OS are realized.
由上述内容可知,本申请实施例提供的实时操作系统的生成方法,首先,基于AUTOSAR标准生成OSAL内核;然后,基于OSAL内核对RTOS相应的API进行封装;接着,获取OSAL代码生成工具;最后,基于OSAL内核、封装API后的RTOS以及OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。此时得到的基于AUTOSAR的实时操作系统,能够按照AUTOSAR标准运行,即实现了MICROSAR OS中的全部或者部分功能。这样,无需再购买MICROSAR OS以及MICROSAR OS中的 Davinci系列工具和Vector提供的静态代码包,也能够实现BMS项目的开发,节省了BMS项目的开发成本。并且,基于AUTOSAR的实时操作系统中由于配置了OSAL内核以及OSAL代码生成工具,进而在进行BMS项目开发时,也无需重新构建软件架构,也无需手动编写大量代码,从而实现BMS项目的快速开发。As can be seen from the above, the method for generating a real-time operating system provided by the embodiment of the present application firstly generates an OSAL kernel based on the AUTOSAR standard; then, encapsulates the corresponding API of the RTOS based on the OSAL kernel; then obtains an OSAL code generation tool; finally, Generate an AUTOSAR-based real-time operating system based on the OSAL kernel, RTOS after encapsulating the API, and OSAL code generation tools. The AUTOSAR-based real-time operating system obtained at this time can run according to the AUTOSAR standard, that is, realize all or part of the functions in MICROSAR OS. In this way, it is not necessary to purchase MICROSAR OS, the Davinci series tools in MICROSAR OS, and the static code package provided by Vector, and the development of BMS projects can also be realized, saving the development cost of BMS projects. Moreover, since the OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
进一步地,作为对图1所示方法中步骤S1的细化和扩展,在基于AUTOSAR标准生成OSAL内核的过程中,还可以参照AUTOSAR OS中的多个对象,进而能够更加便捷以及全面的生成用于模拟MICROSAR OS中各项功能的OSAL内核。Further, as a refinement and extension of step S1 in the method shown in Figure 1, in the process of generating the OSAL kernel based on the AUTOSAR standard, multiple objects in the AUTOSAR OS can also be referred to, thereby enabling more convenient and comprehensive generation of the OSAL kernel. OSAL kernel for simulating various functions in MICROSAR OS.
具体来说,上述步骤S1具体可以包括:Specifically, the above step S1 may specifically include:
S11:基于AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的OSAL内核。S11: Generate an OSAL kernel containing multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
AUTOSAR OS中的每个对象都能够实现相应的功能,进而,参照AUTOSAR OS中的各个对象,生成基于AUTOSAR标准的OSAL内核,能够更加便捷以及全面的模拟MICROSAR OS中的各项功能。Each object in AUTOSAR OS can realize corresponding functions, and then, refer to each object in AUTOSAR OS to generate an OSAL kernel based on AUTOSAR standard, which can more conveniently and comprehensively simulate various functions in MICROSAR OS.
具体来说,AUTOSAR OS中的对象至少可以包括:Core、Application、Task、Interrupt Service、Alarm、Counter、Resource、IOC等等。也就是说,在OSAL内核的设计中,以实现Core、Application、Task、Interrupt Service、Alarm、Counter、Resource、IOC为输出目标。Specifically, the objects in AUTOSAR OS can at least include: Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, IOC, etc. That is to say, in the design of the OSAL kernel, the output targets are to realize Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, and IOC.
当然,如果AUTOSAR OS中还存在其它对象,在OSAL内核的设计中,还可以以实现其它对象为输出目标。对于AUTOSAR OS中对象的具体内容,此处不做限定。Of course, if there are other objects in the AUTOSAR OS, in the design of the OSAL kernel, it can also take the realization of other objects as the output goal. For the specific content of the object in AUTOSAR OS, there is no limitation here.
由上述内容可知,通过AUTOSAR OS中的多个对象,基于AUTOSAR标准生成OSAL内核,能够减少基于AUTOSAR标准生成OSAL内核时的工作量,进而基于OSAL内核能够更加便捷以及全面的模拟MICROSAR OS中的各项功能。From the above content, we can see that through multiple objects in AUTOSAR OS, the OSAL kernel is generated based on the AUTOSAR standard, which can reduce the workload when generating the OSAL kernel based on the AUTOSAR standard, and then based on the OSAL kernel, it can more conveniently and comprehensively simulate various objects in MICROSAR OS. item function.
进一步地,作为对上述步骤S11的细化和扩展,OSAL内核在运行的过程中,需要一个能够对其各项功能进行调度的总控制,这个总控制就可以是操作系统抽象层OSAL调度器。进而再结合AUTOSAR OS中多个对象的数据结构,就得到了能够基于AUTOSAR标准运行的OSAL内核。Furthermore, as a refinement and extension of the above step S11, the OSAL kernel needs a general control capable of scheduling its various functions during the running process, and this general control can be the operating system abstraction layer OSAL scheduler. Then combined with the data structure of multiple objects in AUTOSAR OS, an OSAL kernel that can run based on the AUTOSAR standard is obtained.
具体来说,上述步骤S11具体可以包括:Specifically, the above step S11 may specifically include:
S111:生成操作系统抽象层OSAL调度器。S111: Generate an operating system abstraction layer OSAL scheduler.
其中,OSAL调度器用于管理内核参数初始化、内核启停、当前核获取、应用初始化、中断初始化、时钟初始化以及外部接口调用。Among them, the OSAL scheduler is used to manage kernel parameter initialization, kernel startup and shutdown, current kernel acquisition, application initialization, interrupt initialization, clock initialization, and external interface calls.
OSAL内核中设计的OSAL调度器,其实是用来管理OS内核(Core)参数初始化、内核(Core)启停、当前核(Core)获取、Application初始化、中断初始化,Alarm初始化等。同时,还能够管理OS服务,提供外部调用接口,可兼容AUTOSAR中的RTE模块。实际上,OSAL调度器与AUTOSAR OS中的Trap类似,但是处理过程又完全不同,其关键核心处理在于不同的RTOS类型判断,这将在后文实时操作系统的使用方法中进行详细阐述。The OSAL scheduler designed in the OSAL kernel is actually used to manage OS kernel (Core) parameter initialization, kernel (Core) start and stop, current core (Core) acquisition, Application initialization, interrupt initialization, Alarm initialization, etc. At the same time, it can also manage OS services, provide an external call interface, and is compatible with the RTE module in AUTOSAR. In fact, the OSAL scheduler is similar to the trap in AUTOSAR OS, but the processing process is completely different. The key core processing lies in the judgment of different RTOS types, which will be explained in detail in the usage method of the real-time operating system later.
S112:基于AUTOSAR标准生成AUTOSAR OS中多个对象的数据结构。S112: Generate data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard.
在参照AUTOSAR OS中多个对象生成满足AUTOSAR标准的OSAL内核的过程中,并不是直接将AUTOSAR OS中的多个对象直接搬入OSAL内核,而是在OSAL内核中构建AUTOSAR OS中多个对象的数据结构,因此,需要基于AUTOSAR标准生成AUTOSAR OS中多个对象的数据结构。In the process of generating an OSAL kernel that meets the AUTOSAR standard with reference to multiple objects in the AUTOSAR OS, the multiple objects in the AUTOSAR OS are not directly moved into the OSAL kernel, but the data of multiple objects in the AUTOSAR OS is constructed in the OSAL kernel structure, therefore, it is necessary to generate the data structure of multiple objects in AUTOSAR OS based on the AUTOSAR standard.
S113:基于OSAL调度器和数据结构生成OSAL内核。S113: Generate an OSAL kernel based on the OSAL scheduler and data structure.
在获得了OSAL调度器以及AUTOSAR OS中多个对象的数据结构后,将OSAL调度器以及AUTOSAR OS中多个对象的数据结构进行结合,就得到了OSAL内核。进而在OSAL内核中,通过OSAL调度器,就能够实现符合AUTOSAR标准的各项功能。After obtaining the OSAL scheduler and the data structures of multiple objects in AUTOSAR OS, combine the OSAL scheduler and the data structures of multiple objects in AUTOSAR OS to obtain the OSAL kernel. Furthermore, in the OSAL kernel, through the OSAL scheduler, various functions conforming to the AUTOSAR standard can be realized.
由上述内容可知,在生成OSAL内核的过程中,通过生成OSAL调度器,以实现多个对象的管理,以及生成AUTOSAR OS中多个对象的数据结构,进而结合OSAL调度器生成OSAL内核,能够 使得OSAL内核通过OSAL调度器对其各项功能实现统一管理,强化了OSAL内核。It can be seen from the above that in the process of generating the OSAL kernel, the OSAL scheduler is generated to realize the management of multiple objects, and the data structure of multiple objects in the AUTOSAR OS is generated, and then combined with the OSAL scheduler to generate the OSAL kernel, it can make The OSAL kernel implements unified management of its various functions through the OSAL scheduler, which strengthens the OSAL kernel.
进一步地,作为对上述步骤S112的细化和扩展,为了能够使OSAL内核管理和配置RTOS中AUTOSAR OS的相关对象,同时可以适配OSAL代码生成工具要求,按照AUTOSAR标准要求,需要对在OSAL内核中设计Application、Alarm、Interrupt、Counter、Task数据结构。Further, as a refinement and extension of the above step S112, in order to enable the OSAL kernel to manage and configure the related objects of the AUTOSAR OS in the RTOS, and to adapt to the requirements of the OSAL code generation tool, according to the requirements of the AUTOSAR standard, it is necessary to Design the Application, Alarm, Interrupt, Counter, and Task data structures.
在生成AUTOSAR OS中多个对象的数据结构时,不同的对象类型,对应的数据结构也不同,因此,需要针对不同对象的具体类型,生成相应的数据结构。When generating data structures of multiple objects in AUTOSAR OS, different object types have different corresponding data structures. Therefore, it is necessary to generate corresponding data structures for specific types of different objects.
具体来说,上述步骤S112具体可以包括:Specifically, the above step S112 may specifically include:
S1121:当多个对象中包括应用时,基于AUTOSAR标准生成应用堆栈、任务关联属性表、任务句柄表、时钟关联属性表、时钟句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、计算属性表、源属性表、应用的静态代码和配置化代码架构。S1121: When multiple objects include applications, generate an application stack, a task-related attribute table, a task handle table, a clock-related attribute table, a clock handle table, a signal-related attribute table, an event-related attribute table, an event handle table, based on the AUTOSAR standard, ISRs nest flags, computed property sheets, source property sheets, application static code, and configuration code architectures.
也就是说,当对Application进行配置时,其Application的结构体中需要具备Application堆栈(创建Application时动态状态标识)、任务关联属性表、任务句柄表、Alarm关联属性表、Alarm句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、Counters属性表、Resources属性表等。That is to say, when configuring the Application, the Application structure needs to have the Application stack (dynamic state identification when creating the Application), task association attribute table, task handle table, Alarm association attribute table, Alarm handle table, signal association Attribute table, event association attribute table, event handle table, ISRs nested flag, Counters attribute table, Resources attribute table, etc.
同时,还需要设计Application的静态代码和配置化代码架构。按照AUTOSAR标准,Application的静态代码负责AUTOSAR中相应资源初始化,根据Applications配置列表,完成权利所有任务列表、Alarm列表、事件列表、资源初始化。At the same time, it is also necessary to design the application's static code and configuration code architecture. According to the AUTOSAR standard, the static code of Application is responsible for the initialization of the corresponding resources in AUTOSAR, and completes the task list, alarm list, event list, and resource initialization of all rights according to the Applications configuration list.
这其中的设计关键在于能够通过读取代码生成工具的宏来判断不同类型的RTOS来实现AUTOSAR OS中RTE任务激活的功能。具体的实施方式将在后文实时操作系统的使用方法中进行详细阐述。The key to the design is to be able to judge different types of RTOS by reading the macro of the code generation tool to realize the function of RTE task activation in AUTOSAR OS. The specific implementation manner will be described in detail later in the method of using the real-time operating system.
S1122:当多个对象中包括时钟时,基于AUTOSAR标准生成标识、时钟名称、周期运行时间、超时时间、时钟实现接口。S1122: When multiple objects include a clock, generate an identifier, a clock name, a cycle running time, a timeout time, and a clock implementation interface based on the AUTOSAR standard.
具体来说,当对Alarm进行配置时,其Alarm的结构体中需要具备ID、Alarm名称、周期运行时间、超时时间、Alarm实现接口。Specifically, when configuring the Alarm, the Alarm structure needs to have ID, Alarm name, cycle running time, timeout time, and Alarm implementation interface.
也就是说,按照AUTOSAR标准要求,定义Alarm结构。这其中的设计关键在于能够通过读取代码生成工具的宏来判断不同类型的RTOS来实现AUTOSAR OS中RTE Alarm启停的功能。具体的实施方式将在后文实时操作系统的使用方法中进行详细阐述。That is to say, define the Alarm structure according to the requirements of the AUTOSAR standard. The key to the design is to be able to judge different types of RTOS by reading the macro of the code generation tool to realize the start and stop function of RTE Alarm in AUTOSAR OS. The specific implementation manner will be described in detail later in the method of using the real-time operating system.
这里需要说明的是,上述步骤S1121、S1122并无执行上的先后顺序,而是配置数据结构时的两种情况。What needs to be explained here is that the above steps S1121 and S1122 do not have a sequence of execution, but are two situations when configuring the data structure.
由上述内容可知,根据AUTOSAR OS中不同对象的类型,配置不同的数据结构,能够使OSAL内核管理和配置RTOS中AUTOSAR OS的相关对象,从而确保RTOS能够基于AUTOSAR实现各项功能。It can be seen from the above that, according to the types of different objects in AUTOSAR OS, different data structures can be configured to enable OSAL kernel to manage and configure related objects of AUTOSAR OS in RTOS, so as to ensure that RTOS can realize various functions based on AUTOSAR.
进一步地,作为对图1所示方法中步骤S3的细化和扩展,在自行生成OSAL代码生成工具时,可以基于不同的编译器生成OSAL代码生成工具,进而提高OSAL代码生成工具针对不同RTOS的可适用性。Further, as a refinement and extension of step S3 in the method shown in Figure 1, when generating OSAL code generation tools by itself, OSAL code generation tools can be generated based on different compilers, thereby improving the OSAL code generation tools for different RTOSs. applicability.
具体来说,上述步骤S3具体可以包括:Specifically, the above step S3 may specifically include:
S31:生成多种链接文件生成模板。S31: Generate various link file generation templates.
其中,不同的链接文件生成模板对应不同的编译器。Wherein, different link file generation templates correspond to different compilers.
按照AUTOSAR标准,要求RTOS中的软件模块化和可配置性,因此,需要设计一套OSAL代码生成工具,其代码可以根据开发人员所选的RTOS去生成。与此同时,还需要生成与编译器关联的链接文件和构建文件,该文件用于工程开发构建所用。因此,要求OSAL代码生成工具设计中有一套其与不同编译器的链接文件生成模板。进而通过不同的链接文件生成模板连接不同的编译器,进而实现代码的编译。According to the AUTOSAR standard, software modularization and configurability in RTOS are required. Therefore, a set of OSAL code generation tools needs to be designed, and its code can be generated according to the RTOS selected by the developer. At the same time, it is also necessary to generate link files and build files associated with the compiler, which are used for engineering development and construction. Therefore, it is required to have a set of link file generation templates for different compilers in the OSAL code generation tool design. Furthermore, different compilers are connected to generate templates through different link files, and then code compilation is realized.
S32:基于链接文件生成模板,按照代码定义的静态变量与OSAL内核中的数据结构一致的规则,生成OSAL代码生成工具。S32: Generate a template based on the link file, and generate an OSAL code generation tool according to the rule that the static variable defined by the code is consistent with the data structure in the OSAL kernel.
在得到不同编译器对应的链接文件生成模板后,由于需要OSAL代码生成工具生成的代码定义的静态变量与OSAL内核中设计的结构保持一致,因此,基于链接文件生成模板,需要按照代码定义的静态变量与OSAL内核中的数据结构一致的规则,生成OSAL代码生成工具。After obtaining the link file generation templates corresponding to different compilers, since the static variables defined by the code generated by the OSAL code generation tool need to be consistent with the structure designed in the OSAL kernel, therefore, to generate templates based on the link files, it is necessary to follow the static variables defined by the code Rules for variables to be consistent with data structures in the OSAL kernel, generated by OSAL code generation tools.
由上述内容可知,通过与不同编译器对应的链接文件生成模板生成OSAL代码生成工具,无论开发人员选择何种RTOS,通过OSAL代码生成工具都能够生成符合RTOS的代码,能够提高OSAL代码生成工具针对不同RTOS的可适用性。From the above content, we can see that the OSAL code generation tool is generated through the link file generation template corresponding to different compilers. No matter which RTOS the developer chooses, the OSAL code generation tool can generate RTOS-compliant code, which can improve the OSAL code generation tool. Applicability of different RTOS.
在采用以上实时操作系统的生成方法后,就能够获得基于AUTOSAR的实时操作系统了。After adopting the generation method of the above real-time operating system, the real-time operating system based on AUTOSAR can be obtained.
图2为本申请实施例中基于AUTOSAR的实时操作系统的架构示意图,参见图2所示,在基于AUTOSAR的实时操作系统中,包括:OSAL和EOS。这里的EOS其实就是RTOS。FIG. 2 is a schematic diagram of the architecture of the AUTOSAR-based real-time operating system in the embodiment of the present application. Referring to FIG. 2 , the AUTOSAR-based real-time operating system includes: OSAL and EOS. The EOS here is actually RTOS.
BMS APP/RTE为BMS项目,这不属于基于AUTOSAR的实时操作系统,但其与基于AUTOSAR的实时操作系统连接,以根据BMS项目的具体内容对基于AUTOSAR的实时操作系统中的各个模块进行选择和配置,从而基于选择和配置完成的基于AUTOSAR的实时操作系统进行BMS项目的快速开发。BMS APP/RTE is a BMS project, which does not belong to the AUTOSAR-based real-time operating system, but it is connected with the AUTOSAR-based real-time operating system to select and process each module in the AUTOSAR-based real-time operating system according to the specific content of the BMS project. Configuration, so that the rapid development of BMS projects is carried out based on the selected and configured AUTOSAR-based real-time operating system.
在EOS中,包括有:Semaphore、Event、Queue、Task、Timer、IPC、Interupt、、Clock。这些都属于EOS中的现有模块。不同的EOS,其中的模块稍有不同,但大致都是相同的。用户选择了哪种EOS,此处就配置何种EOS。In EOS, it includes: Semaphore, Event, Queue, Task, Timer, IPC, Interupt, Clock. These are all existing modules in EOS. Different EOSs have slightly different modules, but they are generally the same. Which EOS the user chooses, which EOS is configured here.
在OSAL中,包括有:OSAL内核、OS代码生成工具、OS manager和系统服务。其中,OSAL能够兼容Autoosar运行时环境。OSAL内核包括有:APP管理、Alarm管理、OSAL调度器、Memony管理。用户能够通过APP管理和Alarm管理进行配置。通过OSAL调度器,能够实现Memony管理,控制EOS中的Clock,通过OS manager以及OS API与EOS进行信息Interface交互,从而实现系统服务。OSAL调度器在调度的过程中,OS代码生成工具还能够将其运行过程生成配置代码,从而实现基于AUTOSAR的实时操作系统的自动化配置。In OSAL, include: OSAL kernel, OS code generation tool, OS manager and system service. Among them, OSAL is compatible with the Autoosar runtime environment. OSAL kernel includes: APP management, Alarm management, OSAL scheduler, Memony management. Users can configure through APP management and Alarm management. Through the OSAL scheduler, Memony management can be realized, the clock in EOS can be controlled, and the information interface can be interacted with EOS through OS manager and OS API to realize system services. During the scheduling process of the OSAL scheduler, the OS code generation tool can also generate configuration codes during its operation, so as to realize the automatic configuration of the real-time operating system based on AUTOSAR.
得到了基于AUTOSAR的实时操作系统,接下来,就能够使用该实时操作系统在低开发成本下,实现BMS项目的快速开发了。After obtaining the real-time operating system based on AUTOSAR, the real-time operating system can be used to realize the rapid development of the BMS project at a low development cost.
接下来,针对本申请实施例提供的实时操作系统的使用方法进行详细说明。该实时操作系统,就是采用前述实施例中实时操作系统的生成方法生成的基于AUTOSAR的实时操作系统。Next, the usage method of the real-time operating system provided by the embodiment of the present application will be described in detail. The real-time operating system is an AUTOSAR-based real-time operating system generated by using the method for generating a real-time operating system in the foregoing embodiments.
图3为本申请实施例中实时操作系统的使用方法的流程示意图,参见图3所示,该方法可以包括:FIG. 3 is a schematic flowchart of a method for using a real-time operating system in an embodiment of the present application. Referring to FIG. 3, the method may include:
S5:从基于AUTOSAR的实时操作系统中下载OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统。S5: Download the OSAL kernel from the AUTOSAR-based real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from the open source website.
在基于AUTOSAR的实时操作系统中,存在有预先设计好的OSAL内核。该OSAL内核能够按照AUTOSAR标准进行仿真。因此,在使用基于AUTOSAR的实时操作系统进行BMS项目的快速开发时,需要先将OSAL内核下载下来。In the real-time operating system based on AUTOSAR, there is a pre-designed OSAL kernel. The OSAL kernel is capable of simulation according to the AUTOSAR standard. Therefore, when using the AUTOSAR-based real-time operating system for rapid development of the BMS project, the OSAL kernel needs to be downloaded first.
不同的BMS开发项目,其所适用的RTOS不同,因此,需要根据当前开发的BMS项目,选择其需要的RTOS。一般来说,RTOS可以从开源网站中直接下载获得。Different BMS development projects have different applicable RTOS. Therefore, it is necessary to select the required RTOS according to the currently developed BMS project. In general, RTOS can be directly downloaded from open source websites.
S6:获取用户基于车辆电池管理开发项目在OSAL内核中的配置。S6: Obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project.
在OSAL内核下载完成后,由于OSAL内核中包含有各种功能模块,以及具有各种功能模块的配置功能,用户可以通过OSAL内核进行相应的配置,使得基于AUTOSAR的实时操作系统能够符合当前BMS项目的开发需求。After the OSAL kernel is downloaded, since the OSAL kernel contains various functional modules and configuration functions of various functional modules, the user can perform corresponding configuration through the OSAL kernel, so that the real-time operating system based on AUTOSAR can meet the current BMS project development needs.
用户在OSAL内核中配置完成后,就可以获取用户的配置,从而在目标RTOS中运行用户的配置,进而使用基于AUTOSAR的实时操作系统中的OSAL代码生成工具生成相应的代码文件,进而 基于该代码文件实现BMS项目的快速开发。After the user completes the configuration in the OSAL kernel, the user's configuration can be obtained, so as to run the user's configuration in the target RTOS, and then use the OSAL code generation tool in the AUTOSAR-based real-time operating system to generate the corresponding code file, and then based on the code The file realizes the rapid development of BMS projects.
S7:基于配置在目标实时操作系统中的运行结果,采用OSAL代码生成工具,生成车辆电池管理开发项目所需的代码文件。S7: Based on the running results configured in the target real-time operating system, use the OSAL code generation tool to generate the code files required for the vehicle battery management development project.
在将用户在OSAL内核中的配置在目标RTOS中运行后,目标RTOS在运行过程完成后就会产生运行结果,进而通过基于AUTOSAR的实时操作系统中的OSAL代码生成工具将该运行结果转换为代码文件,该代码文件就是BMS项目实现快速开发所需要的内容。从而就可以基于该代码文件实现BMS项目的快速开发。After the user's configuration in the OSAL kernel is run in the target RTOS, the target RTOS will generate a running result after the running process is completed, and then convert the running result into code through the OSAL code generation tool in the AUTOSAR-based real-time operating system file, the code file is what the BMS project needs to achieve rapid development. Therefore, the rapid development of the BMS project can be realized based on the code file.
由上述内容可知,将用户在OSAL内核中的配置在目标RTOS中运行,进而使用OSAL代码生成工具将运行结果转换为相应的代码文件,从而使得BMS项目能够基于该代码文件进行相应的开发。在进行BMS项目开发的过程中,无需再购买MICROSAR OS以及MICROSAR OS中的Davinci系列工具和Vector提供的静态代码包,降低了BMS项目的开发成本。并且,基于AUTOSAR的实时操作系统中由于配置了OSAL内核以及OSAL代码生成工具,进而在进行BMS项目开发时,也无需重新构建软件架构,也无需手动编写大量代码,从而实现BMS项目的快速开发。It can be seen from the above content that the user's configuration in the OSAL kernel is run in the target RTOS, and then the OSAL code generation tool is used to convert the running result into the corresponding code file, so that the BMS project can be developed based on the code file. In the process of BMS project development, there is no need to purchase MICROSAR OS, the Davinci series tools in MICROSAR OS and the static code package provided by Vector, which reduces the development cost of BMS projects. Moreover, since the OSAL kernel and OSAL code generation tools are configured in the AUTOSAR-based real-time operating system, there is no need to rebuild the software architecture or manually write a large number of codes during the development of the BMS project, so as to realize the rapid development of the BMS project.
进一步地,作为对图3所示方法中步骤S7的细化和扩展,在生成相应的代码文件时,不同的配置,调用的接口不同,需要加载相应的接口生成代码文件,能够确保代码文件生成的准确性,进而确保BMS项目能够正常顺利的开发。Further, as a refinement and extension of step S7 in the method shown in Figure 3, when generating the corresponding code file, different configurations and different interfaces are called, and the corresponding interface needs to be loaded to generate the code file, which can ensure that the code file is generated The accuracy, thus ensuring the normal and smooth development of the BMS project.
具体来说,上述步骤S7具体可以包括:Specifically, the above step S7 may specifically include:
S71:针对不同的配置,根据OSAL代码生成工具生成的宏加载目标实时操作系统中与不同的配置对应的接口。S71: For different configurations, load interfaces corresponding to different configurations in the target real-time operating system according to the macro generated by the OSAL code generation tool.
为了确定不同的配置对应的接口,可以根据OSAL代码生成工具生成的宏进行相应接口的加载。通过OSAL代码生成工具生成的宏,能够确定目标RTOS具体为何种类型,进而根据不同类型的RTOS加载相应的接口。In order to determine the interfaces corresponding to different configurations, the corresponding interfaces can be loaded according to the macro generated by the OSAL code generation tool. The macro generated by the OSAL code generation tool can determine the specific type of the target RTOS, and then load the corresponding interface according to the different types of RTOS.
S72:在加载接口时,采用OSAL代码生成工具,生成车辆电池管理开发项目所需的代码文件。S72: When loading the interface, use the OSAL code generation tool to generate the code file required by the vehicle battery management development project.
在基于OSAL代码生成工具生成的宏确定当前配置对应的接口后,就可以继续加载该接口,进而在RTOS中运行该配置,再采用OSAL代码生成工具对运行结果进行处理,就能够得到当前BMS项目所需的代码文件。After determining the interface corresponding to the current configuration based on the macro generated by the OSAL code generation tool, you can continue to load the interface, and then run the configuration in the RTOS, and then use the OSAL code generation tool to process the running results to obtain the current BMS project required code files.
由上述内容可知,通过OSAL代码生成工具生成的宏确定当前用户的配置在RTOS中的接口,进而加载该接口运行用户的配置,再采用OSAL代码生成工具对运行结果进行处理,得到当前BMS项目所需的代码文件。由于RTOS中加载的接口是基于用户的配置进行的,因此,生成的代码文件能够满足BMS项目开发所需,进而确保BMS项目能够正常顺利的开发。It can be known from the above that the macro generated by the OSAL code generation tool determines the interface of the current user's configuration in the RTOS, and then loads the interface to run the user's configuration, and then uses the OSAL code generation tool to process the running results to obtain the current BMS project. required code files. Since the interface loaded in the RTOS is based on the configuration of the user, the generated code files can meet the needs of the BMS project development, thereby ensuring the normal and smooth development of the BMS project.
进一步地,作为对上述步骤S71的细化和扩展,不同的配置,具体调用的接口也有所不同,下面分别从Alarm配置和Application配置这两大方面对其调用的具体接口进行说明。Further, as a refinement and extension of the above step S71, different configurations have different interfaces for specific calls. The specific interfaces for calls are described below from the two aspects of Alarm configuration and Application configuration.
具体来说,上述步骤S71具体可以包括:Specifically, the above step S71 may specifically include:
S711:当配置为时钟Alarm设置时,根据OSAL代码生成工具生成的宏确定目标RTOS是否为FreeRTOS;若是,则加载FreeRTOS中的Clock_setTimeout、Clock_setPeriod、Clock_start,以及调用xTimerStart。S711: When configured as the clock Alarm setting, determine whether the target RTOS is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load Clock_setTimeout, Clock_setPeriod, Clock_start in FreeRTOS, and call xTimerStart.
通过调用Clock_setTimeout、Clock_setPeriod、Clock_start,能够实现Alarm的功能。而如果要实现AUTOSAR OS中的SetRelAlarm功能,那么就需要OSAL调度器对应接口调用FreeRTOS的xTimerStart接口API。The function of Alarm can be realized by calling Clock_setTimeout, Clock_setPeriod, and Clock_start. And if you want to implement the SetRelAlarm function in AUTOSAR OS, then you need to call the xTimerStart interface API of FreeRTOS through the corresponding interface of the OSAL scheduler.
S712:当配置为应用Application设置时,根据OSAL代码生成工具生成的宏确定目标RTOS是否为FreeRTOS;若是,则加载FreeRTOS中的vTaskStartScheduler,以及调用xSemaphoreCreateMutex、xSemaphoreCreateMutex、Semaphore_post;以及根据OSAL代码生成工 具生成的宏确定目标RTOS是否为SYSbios;若是,则加载SYSbios中的BIOS_start()。S712: When configured to apply Application settings, determine whether the target RTOS is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in FreeRTOS, and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and generate according to the OSAL code generation tool The macro determines whether the target RTOS is SYSbios; if so, loads BIOS_start() in SYSbios.
OSAL调度器还具备AUTOSAR OS中Core模块的大部分功能。例如:AUTOSAR OS中Core模块的Os_Api_StartOS。OSAL调度器通过调用内部的Application模块,该模块首先也是判断当前宏是否是FreeRTOS,如果是则调用FreeRTOS的API接口vTaskStartScheduler来启动OS。如果是TI的SYSbios,则调用SYSbios的API接口BIOS_start()来启动OS。最后,OSAL调度器还能够实现AUTOSAR中RTE模块调用的相关接口。例如:任务激活(ActivateTask)、告警器设置(SetRelAlarm)等。The OSAL scheduler also has most of the functions of the Core module in AUTOSAR OS. For example: Os_Api_StartOS of the Core module in AUTOSAR OS. The OSAL scheduler calls the internal Application module, which first determines whether the current macro is FreeRTOS, and if so, calls the FreeRTOS API interface vTaskStartScheduler to start the OS. If it is TI's SYSbios, call the API interface BIOS_start() of SYSbios to start the OS. Finally, the OSAL scheduler can also implement the related interfaces called by the RTE module in AUTOSAR. For example: task activation (ActivateTask), alarm setting (SetRelAlarm), etc.
至此,再针对OSAL调度器的核心处理流程进行说明。So far, the core processing flow of the OSAL scheduler will be described.
图4为本申请实施例中OSAL调度器的核心处理流程的示意图,参见图4所示,该流程可以包括:Fig. 4 is a schematic diagram of the core processing flow of the OSAL scheduler in the embodiment of the present application, as shown in Fig. 4, the flow may include:
首先,通过ECUM模块控制OSAL内核中OS启停和OS内核初始,以及通过RTE模块控制OSAL内核中OS任务激活和ALARM设置。First, the OS start-stop and OS kernel initialization in the OSAL kernel are controlled by the ECUM module, and the OS task activation and ALARM settings in the OSAL kernel are controlled by the RTE module.
然后,在OSAL内核中,判断是否满足支持的RTOS类型。若RTOS的类型支持,则OSAL加载对应的RTOS相关API接口。若RTOS的类型不支持,则结束流程。Then, in the OSAL kernel, it is judged whether the supported RTOS type is satisfied. If the type of RTOS supports it, OSAL loads the corresponding RTOS-related API interface. If the type of RTOS does not support it, the process ends.
接着,调用RTOS接口进行处理,即运行用户的配置,进而生成相应的代码文件。Then, call the RTOS interface for processing, that is, run the user's configuration, and then generate the corresponding code file.
最后,结束整个流程。Finally, end the whole process.
如果当前通过代码生成工具配置的RTOS是FreeRTOS时,需要调用xSemaphoreCreateMutex创建任务激活的信号标志,调用xSemaphoreCreateMutex接口来实现运行时环境RTE的启动中任务激活接口(ActivateTask),调用FreeRTOS的Semaphore_post信号量接口来实现。If the RTOS currently configured by the code generation tool is FreeRTOS, you need to call xSemaphoreCreateMutex to create a signal flag for task activation, call the xSemaphoreCreateMutex interface to implement the startup task activation interface (ActivateTask) of the runtime environment RTE, and call the Semaphore_post semaphore interface of FreeRTOS to accomplish.
而在RTE启动前由于OS已进行了初始化,调用了FreeRTOS中的启动调度,即任务都在运行中,显然不符合AUTOSAR规范。因此,需要引入FreeRTOS的信号量,让任务在RTE启动前都为挂起状态,再根据RTE的配置要求,通过提交信号量来激活任务。Before RTE starts, because the OS has been initialized, the startup scheduling in FreeRTOS is called, that is, the tasks are all running, which obviously does not conform to the AUTOSAR specification. Therefore, it is necessary to introduce the semaphore of FreeRTOS, so that the task is suspended before RTE starts, and then activate the task by submitting the semaphore according to the configuration requirements of RTE.
由上述内容可知,针对Alarm配置和Application配置,根据OSAL代码生成工具生成的宏确定目标RTOS是否为FreeRTOS,进而在确定目标RTOS为FreeRTOS时,给出了具体调用的接口,避免接口调用错误,进而提高代码文件生成的准确性,进一步确保BMS项目能够正常顺利的开发。It can be seen from the above that for the Alarm configuration and Application configuration, according to the macro generated by the OSAL code generation tool, it is determined whether the target RTOS is FreeRTOS, and then when the target RTOS is determined to be FreeRTOS, the specific call interface is given to avoid interface call errors, and then Improve the accuracy of code file generation to further ensure the normal and smooth development of BMS projects.
基于同一发明构思,作为对上述生成方法的实现,本申请实施例还提供了一种实时操作系统的生成装置。图5为本申请实施例中实时操作系统的生成装置的结构示意图,参见图5所示,该装置可以包括:Based on the same inventive concept, as an implementation of the above generation method, an embodiment of the present application further provides a real-time operating system generation device. FIG. 5 is a schematic structural diagram of a device for generating a real-time operating system in an embodiment of the present application. Referring to FIG. 5, the device may include:
设计模块51,用于基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,所述OSAL内核用于使得实时操作系统RTOS在AUTOSAR标准下运行;The design module 51 is used to generate the operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard;
封装模块52,用于基于所述OSAL内核对所述RTOS相应的应用程序接口API进行封装;An encapsulation module 52, configured to encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel;
获取模块53,用于获取OSAL代码生成工具,所述OSAL代码生成工具用于将用户对所述OSAL内核中的配置以及对所述RTOS的调用过程生成与所述OSAL内核相一致的代码文件;The obtaining module 53 is used to obtain an OSAL code generation tool, and the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS;
生成模块54,用于基于所述OSAL内核、封装API后的RTOS以及所述OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。The generating module 54 is configured to generate an AUTOSAR-based real-time operating system based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
进一步地,所述设计模块,具体用于基于所述AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的所述OSAL内核。Further, the design module is specifically used to generate the OSAL kernel including multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
进一步地,所述设计模块,具体用于生成操作系统抽象层OSAL调度器,所述OSAL调度器用于管理内核参数初始化、内核启停、当前核获取、应用初始化、中断初始化、时钟初始化以及外部接口调用;基于所述AUTOSAR标准生成所述AUTOSAR OS中多个对象的数据结构;基于所述OSAL调度器和所述数据结构生成所述OSAL内核。Further, the design module is specifically used to generate an operating system abstraction layer OSAL scheduler, and the OSAL scheduler is used to manage kernel parameter initialization, kernel startup and shutdown, current kernel acquisition, application initialization, interrupt initialization, clock initialization, and external interfaces Call; Generate the data structure of multiple objects in the AUTOSAR OS based on the AUTOSAR standard; Generate the OSAL kernel based on the OSAL scheduler and the data structure.
进一步地,所述设计模块,具体用于当所述多个对象中包括应用时,基于所述AUTOSAR标准生成应用堆栈、任务关联属性表、任务句柄表、时钟关联属性表、时钟句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、计算属性表、源属性表、应用的静态代码和配置化代码架构;当所述多个对象中包括时钟时,基于所述AUTOSAR标准生成标识、时钟名称、周期运行时间、超时时间、时钟实现接口。Further, the design module is specifically configured to generate an application stack, task-associated attribute table, task handle table, clock-associated attribute table, clock handle table, signal Association attribute table, event association attribute table, event handle table, ISRs nested flag, calculation attribute table, source attribute table, application static code and configuration code architecture; when the multiple objects include a clock, based on the AUTOSAR standard generates identification, clock name, cycle running time, timeout time, and clock implementation interface.
进一步地,所述获取模块,具体用于生成多种链接文件生成模板,不同的链接文件生成模板对应不同的编译器;基于所述链接文件生成模板,按照代码定义的静态变量与所述OSAL内核中的数据结构一致的规则,生成所述OSAL代码生成工具。Further, the acquisition module is specifically used to generate multiple link file generation templates, and different link file generation templates correspond to different compilers; based on the link file generation templates, the static variables defined according to the code and the OSAL kernel Consistent rules in the data structure are generated by the OSAL code generation tool.
这里需要指出的是,以上生成装置实施例的描述,与上述生成方法实施例的描述是类似的,具有同生成方法实施例相似的有益效果。对于本申请生成装置实施例中未披露的技术细节,请参照本申请生成方法实施例的描述而理解。It should be pointed out here that the description of the above embodiment of the generation device is similar to the description of the above embodiment of the generation method, and has similar beneficial effects as the embodiment of the generation method. For the technical details not disclosed in the embodiment of the generation device of this application, please refer to the description of the embodiment of the generation method of this application for understanding.
基于同一发明构思,作为对上述使用方法的实现,本申请实施例还提供了一种实时操作系统的使用装置。该使用装置应用于采用上述生成装置生成的实时操作系统中。图6为本申请实施例中实时操作系统的使用装置的结构示意图,参见图6所示,该装置可以包括:Based on the same inventive concept, as an implementation of the above using method, an embodiment of the present application also provides a device for using a real-time operating system. The using device is applied to the real-time operating system generated by the above-mentioned generating device. FIG. 6 is a schematic structural diagram of a device for using a real-time operating system in an embodiment of the present application. Referring to FIG. 6, the device may include:
下载模块61,用于从所述基于AUTOSAR的实时操作系统中下载所述OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统;The download module 61 is used for downloading the OSAL kernel from the real-time operating system based on AUTOSAR, and downloading the target real-time operating system matching the vehicle battery management development project from an open source website;
配置模块62,用于获取用户基于所述车辆电池管理开发项目在所述OSAL内核中的配置;The configuration module 62 is used to obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project;
生成模块63,用于基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。The generation module 63 is configured to use the OSAL code generation tool to generate code files required by the vehicle battery management development project based on the running results of the configuration in the target real-time operating system.
进一步地,所述生成模块,具体用于针对不同的配置,根据所述OSAL代码生成工具生成的宏加载所述目标实时操作系统中与所述不同的配置对应的接口;在加载所述接口时,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。Further, the generation module is specifically configured to load the interface corresponding to the different configuration in the target real-time operating system according to the macro generated by the OSAL code generation tool for different configurations; when loading the interface , using the OSAL code generation tool to generate the code files required by the vehicle battery management development project.
进一步地,所述生成模块,具体用于当所述配置为时钟设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的Clock_setTimeout、Clock_setPeriod、Clock_start,以及调用xTimerStart;当所述配置为应用设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的vTaskStartScheduler,以及调用xSemaphoreCreateMutex、xSemaphoreCreateMutex、Semaphore_post;以及根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为SYSbios;若是,则加载所述SYSbios中的BIOS_start()。Further, the generation module is specifically used to determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool when the configuration is clock setting; if so, load the Clock_setTimeout, Clock_setPeriod, Clock_start, and call xTimerStart; when the configuration is an application setting, determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in the FreeRTOS , and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and determine whether the target real-time operating system is SYSbios according to the macro generated by the OSAL code generation tool; if so, load BIOS_start() in the SYSbios.
这里需要指出的是,以上使用装置实施例的描述,与上述使用方法实施例的描述是类似的,具有同使用方法实施例相似的有益效果。对于本申请使用装置实施例中未披露的技术细节,请参照本申请使用方法实施例的描述而理解。It should be pointed out here that the description of the above embodiment of the use device is similar to the description of the above embodiment of the use method, and has similar beneficial effects as the embodiment of the use method. For the technical details not disclosed in the embodiment of the device used in this application, please refer to the description of the embodiment of the method used in this application for understanding.
基于同一发明构思,作为对上述生成方法以及使用方法的实现,本申请实施例还提供了一种电子设备。图7为本申请实施例中电子设备的结构示意图,参见图7所示,该电子设备可以包括:处理器71、存储器72、总线73;其中,处理器71、存储器72通过总线73完成相互间的通信;处理器71用于调用存储器72中的程序指令,以执行上述一个或多个实施例中的生成方法或使用方法。Based on the same inventive concept, as an implementation of the above generating method and using method, an embodiment of the present application also provides an electronic device. Fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application. Referring to Fig. 7, the electronic device may include: a processor 71, a memory 72, and a bus 73; communication; the processor 71 is used to call the program instructions in the memory 72, so as to execute the generation method or the use method in one or more embodiments above.
这里需要指出的是,以上电子设备实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请电子设备实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。It should be pointed out here that the description of the above electronic device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the electronic device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
基于同一发明构思,作为对上述生成方法以及使用方法的实现,本申请实施例还提供了一种计算机可读存储介质,该存储介质可以包括:存储的程序;其中,在程序运行时控制存储介质所在设备执行上述一个或多个实施例中的生成方法或使用方法。Based on the same inventive concept, as an implementation of the above generating method and using method, the embodiment of the present application also provides a computer-readable storage medium, which may include: a stored program; wherein, when the program is running, the storage medium is controlled The device where it is located executes the generating method or using method in one or more of the above embodiments.
这里需要指出的是,以上存储介质实施例的描述,与上述方法实施例的描述是类似的,具 有同方法实施例相似的有益效果。对于本申请存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。It should be pointed out here that the description of the above storage medium embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the storage medium embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
最后,再次对本申请实施例中基于AUTOSAR仿真的实时操作系统设计的过程进行说明。Finally, the process of real-time operating system design based on AUTOSAR simulation in the embodiment of the present application is described again.
通过设计AUTOSAR仿真的内核(OSAL)使得主流的实时操作系统都得快速的以AUTOSAR的标准去开发车载应用软件。以及使开发的软件有完整的内核标准和统一的程序接口,软件的复用性得到了很大提高。By designing the core of AUTOSAR simulation (OSAL), mainstream real-time operating systems have to quickly develop vehicle application software with AUTOSAR standards. And the developed software has a complete kernel standard and a unified program interface, and the reusability of the software has been greatly improved.
基于AUTOSAR仿真的实时操作系统的设计,按AUTOSAR OS标准要求,通过设计OSAL内核(对RTOS进行封装调用)及OS代码生成工具,使当前流行的实时操作系统(RTOS)达到AUTOSAR OS要求。The design of the real-time operating system based on AUTOSAR simulation, according to the requirements of the AUTOSAR OS standard, through the design of the OSAL kernel (encapsulating and calling the RTOS) and OS code generation tools, so that the current popular real-time operating system (RTOS) meets the requirements of the AUTOSAR OS.
OSAL内核设计以实现AUTOSAR OS中相关对象(Core、Application、Task、Interrupt Service、Alarm、Counter、Resource、IOC)为输出目标,以RTOS提供的模块API接口为输入对象(如TI公司的SYSbios,相关接口有Semaphores、MailBoxs、Queues、Clock,HWI/SWI等),OSAL内核对RTOS相应的API接口进行封装设计,同时设计后的OSAL内核可兼容AUTOSAR运行时环境,并可结合通过设计的OS代码生成工具生成的配置代码,使得RTOS在功能上与AUTOSAR OS完全保持一致。The OSAL kernel is designed to realize related objects in AUTOSAR OS (Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, IOC) as the output target, and the module API interface provided by RTOS as the input object (such as TI's SYSbios, related Interfaces include Semaphores, MailBoxes, Queues, Clock, HWI/SWI, etc.), the OSAL kernel encapsulates and designs the corresponding API interfaces of the RTOS, and the designed OSAL kernel is compatible with the AUTOSAR runtime environment, and can be generated by combining the designed OS code The configuration code generated by the tool makes the RTOS completely consistent with the AUTOSAR OS in function.
OS代码生成工具可以根据芯片需要,选择需要的RTOS(如FreeRTOS),然后对选择的RTOS实现AUTOSAR OS对象Core、Application、Task、Interrupt Service、Alarm、Counter、Resource、IOC的相关配置来生成与OSAL内核匹配的配置代码、工程构建配置文件及链接文件。The OS code generation tool can select the required RTOS (such as FreeRTOS) according to the needs of the chip, and then implement the relevant configuration of the AUTOSAR OS objects Core, Application, Task, Interrupt Service, Alarm, Counter, Resource, and IOC for the selected RTOS to generate and OSAL Kernel matching configuration code, project construction configuration files and link files.
详细设计如下:The detailed design is as follows:
按AUTOSAR标准,传统的RTOS要实现AUTOSAR OS,OSAL内核设计需要做到如下步骤:According to the AUTOSAR standard, the traditional RTOS needs to implement the AUTOSAR OS, and the OSAL kernel design needs to do the following steps:
1、OSAL内核需要设计一个OSAL调度器,用来管理OS内核(Core)参数初始化,内核(Core)启停、当前核(Core)获取、Application初始化、中断初始化,Alarm初始化等。同时能管理OS服务,提供外部调用接口,可兼容AUTOSAR中RTE模块。OSAL调度器与AUTOSAR OS中的Trap类似,但是处理过程完全不同,其关键核心处理在于不同的RTOS类型判断,如对Alarm的设置,在OSAL内核中首先要通过OS代码工具生成的宏来确定当前RTOS是否是FreeRTOS,如果是则OSAL内核会加载FreeRTOS相关的Clock_setTimeout、Clock_setPeriod、Clock_start来实现对Alarm的功能实现。同时OSAL调度器又具备AUTOSAR OS中Core模块的大部分功能。如AUTOSAR OS中Core模块的Os_Api_StartOS,OSAL调度器通过调用内部的Application模块,该模块首先也是判断当前宏是否是FreeRTOS,如果是则调用FreeRTOS的API接口vTaskStartScheduler来启动OS。如果是TI的SYSbios,则调用SYSbios的API接口BIOS_start()来启动OS。最好OSAL调度器实现了AUTOSAR中RTE模块调用的相关接口,如任务激活(ActivateTask)、告警器设置(SetRelAlarm)等。1. The OSAL kernel needs to design an OSAL scheduler to manage OS kernel (Core) parameter initialization, kernel (Core) start and stop, current core (Core) acquisition, Application initialization, interrupt initialization, Alarm initialization, etc. At the same time, it can manage OS services, provide an external call interface, and is compatible with the RTE module in AUTOSAR. The OSAL scheduler is similar to the trap in AUTOSAR OS, but the processing process is completely different. The key core processing lies in the judgment of different RTOS types, such as the setting of the Alarm. In the OSAL kernel, the macro generated by the OS code tool must first be used to determine the current Whether the RTOS is FreeRTOS, if so, the OSAL kernel will load FreeRTOS related Clock_setTimeout, Clock_setPeriod, Clock_start to realize the function of Alarm. At the same time, the OSAL scheduler has most of the functions of the Core module in AUTOSAR OS. For example, in the Os_Api_StartOS of the Core module in AUTOSAR OS, the OSAL scheduler calls the internal Application module. This module first judges whether the current macro is FreeRTOS, and if so, calls the FreeRTOS API interface vTaskStartScheduler to start the OS. If it is TI's SYSbios, call the API interface BIOS_start() of SYSbios to start the OS. Preferably, the OSAL scheduler implements the relevant interfaces called by the RTE module in AUTOSAR, such as task activation (ActivateTask), alarm setting (SetRelAlarm), etc.
2、为了能使OSAL内核管理和配置RTOS中AUTOSAR OS相关对象,同时可以适配OSAL代码生成工具要求,按照AUTOSAR标准要求,需要对在OSAL内核中设计Application、Alarm、Interrupt、Counter、Task数据结构。2. In order to enable the OSAL kernel to manage and configure AUTOSAR OS-related objects in the RTOS, and at the same time adapt to the requirements of the OSAL code generation tool, in accordance with the requirements of the AUTOSAR standard, it is necessary to design the Application, Alarm, Interrupt, Counter, and Task data structures in the OSAL kernel .
a)如对Application配置化要求,其Application的结构体中需要具备Application堆栈(创建Application时动态状态标识)、任务关联属性表、任务句柄表、Alarm关联属性表、Alarm句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、Counters属性表、Resources属性表等,同时需要设计Application的静态代码和配置化代码架构。按AUTOSAR标准,Application的静态代码负责AUTOSAR中相应资源初始化,根据Applications配置列表,完成权利所有任务列表、Alarm列表、事件列表、资源初始化。其设计关键在于能通过读取代码生成工具的宏来判断不同类型的RTOS来实现AUTOSAR OS中RTE任务激活的功能,如当前通过代码生成工具配置的RTOS是FreeRTOS时,需要调用xSemaphoreCreateMutex创建任务激活的信号标志,调用xSemaphoreCreateMutex接口来实现运行时环境RTE的启动中任务激活接口(ActivateTask),需要调用FreeRTOS的Semaphore_post信号量接口来实现,在RTE启动前由于OS已进行了初始化,调用了FreeRTOS中的启动调度,即任务都在运行中,显然不符合AUTOSAR规 范,因此需要引入FreeRTOS的信号量,让任务在RTE启动前都为挂起状态,再根据RTE的配置要求,通过提交信号量来激活任务。a) If the application configuration is required, the Application structure needs to have the Application stack (dynamic state identification when creating the Application), task association attribute table, task handle table, Alarm association attribute table, Alarm handle table, signal association attribute table , event association attribute table, event handle table, ISRs nested flags, Counters attribute table, Resources attribute table, etc., at the same time, it is necessary to design the static code and configurable code architecture of Application. According to the AUTOSAR standard, the static code of Application is responsible for the initialization of corresponding resources in AUTOSAR, and completes the task list, alarm list, event list, and resource initialization of all rights according to the Applications configuration list. The key to its design is that it can judge different types of RTOS by reading the macro of the code generation tool to realize the function of RTE task activation in AUTOSAR OS. For example, when the RTOS currently configured by the code generation tool is FreeRTOS, it is necessary to call xSemaphoreCreateMutex to create the task activation Signal flag, call the xSemaphoreCreateMutex interface to implement the startup task activation interface (ActivateTask) of the runtime environment RTE, which needs to be implemented by calling the Semaphore_post semaphore interface of FreeRTOS. Because the OS has been initialized before the RTE startup, the startup in FreeRTOS is called. Scheduling, that is, tasks are running, obviously does not comply with the AUTOSAR specification, so it is necessary to introduce FreeRTOS semaphores, so that tasks are suspended before RTE starts, and then activate tasks by submitting semaphores according to RTE configuration requirements.
b)如对Alarm配置化要求,其Alarm的结构体中需要具备ID、Alarm名称、周期运行时间、超时时间、Alarm实现接口,按照AUTOSAR标准要求,定义Alarm结构。按AUTOSAR标准,其设计关键在于能通过读取代码生成工具的宏来判断不同类型的RTOS来实现AUTOSAR OS中RTE Alarm启停的功能,如当前通过代码生成工具配置的RTOS是FreeRTOS时,要实现AUTOSAR OS中的SetRelAlarm功能,需要OSAL调度器对应接口调用FreeRTOS的xTimerStart接口API。b) If the Alarm configuration is required, the Alarm structure needs to have ID, Alarm name, cycle running time, timeout time, and Alarm implementation interface. According to the requirements of the AUTOSAR standard, the Alarm structure is defined. According to the AUTOSAR standard, the key to its design is to be able to judge different types of RTOS by reading the macros of the code generation tool to realize the start and stop function of the RTE Alarm in the AUTOSAR OS. For example, when the RTOS currently configured by the code generation tool is FreeRTOS, the The SetRelAlarm function in AUTOSAR OS requires the corresponding interface of the OSAL scheduler to call the xTimerStart interface API of FreeRTOS.
3、按AUTOSAR标准,要求软件模块化和可配置性,通过设计一套OSAL代码生成工具,其代码可以根据开发人员所选的RTOS去生成,同时生成与编译器关联的链接文件和构建文件,该文件用于工程开发构建所用。因此要求OSAL代码生成工具设计中有一套其于不同编译器的链接文件生成模板。另外OSAL代码生成工具生成的代码定义的静态变量与OSAL内核中设计的结构保持一致。3. According to the AUTOSAR standard, software modularization and configurability are required. By designing a set of OSAL code generation tools, the code can be generated according to the RTOS selected by the developer, and the link file and build file associated with the compiler will be generated at the same time. This file is used for engineering development and construction. Therefore, it is required to have a set of link file generation templates for different compilers in the design of the OSAL code generation tool. In addition, the static variables defined by the code generated by the OSAL code generation tool are consistent with the structure designed in the OSAL kernel.
最后应说明的是,以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围,其均应涵盖在本申请的权利要求和说明书的范围当中。尤其是,只要不存在结构冲突,各个实施例中所提到的各项技术特征均可以任意方式组合起来。本申请并不局限于文中公开的特定实施例,而是包括落入权利要求的范围内的所有技术方案。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present application. All of them should be covered by the scope of the claims and description of the present application. In particular, as long as there is no structural conflict, the technical features mentioned in the various embodiments can be combined in any manner. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims (12)

  1. 一种实时操作系统的生成方法,其特征在于,所述生成方法包括:A method for generating a real-time operating system, characterized in that the method for generating includes:
    基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,所述OSAL内核用于使得实时操作系统RTOS在AUTOSAR标准下运行;Generate an operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard;
    基于所述OSAL内核对所述RTOS相应的应用程序接口API进行封装;Encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel;
    获取OSAL代码生成工具,所述OSAL代码生成工具用于将用户对所述OSAL内核中的配置以及对所述RTOS的调用过程生成与所述OSAL内核相一致的代码文件;Obtain an OSAL code generation tool, and the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS;
    基于所述OSAL内核、封装API后的RTOS以及所述OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。A real-time operating system based on AUTOSAR is generated based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
  2. 根据权利要求1所述的生成方法,其特征在于,所述基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,包括:The generating method according to claim 1, wherein the operating system abstraction layer OSAL kernel is generated based on the Automobile Open System Architecture AUTOSAR standard, comprising:
    基于所述AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的所述OSAL内核。Generate the OSAL kernel including multiple objects in the automotive open system architecture operating system AUTOSAR OS based on the AUTOSAR standard.
  3. 根据权利要求2所述的生成方法,其特征在于,所述基于所述AUTOSAR标准生成包含汽车开放系统架构操作系统AUTOSAR OS中多个对象的所述OSAL内核,包括:The generation method according to claim 2, wherein, the described OSAL kernel comprising multiple objects in the automotive open system architecture operating system AUTOSAR OS is generated based on the AUTOSAR standard, comprising:
    生成操作系统抽象层OSAL调度器,所述OSAL调度器用于管理内核参数初始化、内核启停、当前核获取、应用初始化、中断初始化、时钟初始化以及外部接口调用;Generate an operating system abstraction layer OSAL scheduler, the OSAL scheduler is used to manage kernel parameter initialization, kernel start and stop, current core acquisition, application initialization, interrupt initialization, clock initialization and external interface calls;
    基于所述AUTOSAR标准生成所述AUTOSAR OS中多个对象的数据结构;Generate data structures of multiple objects in the AUTOSAR OS based on the AUTOSAR standard;
    基于所述OSAL调度器和所述数据结构生成所述OSAL内核。The OSAL kernel is generated based on the OSAL scheduler and the data structure.
  4. 根据权利要求3所述的生成方法,其特征在于,所述基于所述AUTOSAR标准生成所述AUTOSAR OS中多个对象的数据结构,包括:The generation method according to claim 3, wherein the data structure of generating multiple objects in the AUTOSAR OS based on the AUTOSAR standard includes:
    当所述多个对象中包括应用时,基于所述AUTOSAR标准生成应用堆栈、任务关联属性表、任务句柄表、时钟关联属性表、时钟句柄表、信号关联属性表、事件关联属性表、事件句柄表、ISRs嵌套标志、计算属性表、源属性表、应用的静态代码和配置化代码架构;When the multiple objects include an application, generate an application stack, a task-related attribute table, a task handle table, a clock-related attribute table, a clock handle table, a signal-related attribute table, an event-related attribute table, and an event handle based on the AUTOSAR standard Tables, nested flags for ISRs, computed property tables, source property tables, application static code and configurable code architecture;
    当所述多个对象中包括时钟时,基于所述AUTOSAR标准生成标识、时钟名称、周期运行时间、超时时间、时钟实现接口。When the plurality of objects includes a clock, an identifier, a clock name, a cycle running time, a timeout time, and a clock implementation interface are generated based on the AUTOSAR standard.
  5. 根据权利要求1所述的生成方法,其特征在于,所述获取OSAL代码生成工具,包括:The generation method according to claim 1, wherein said obtaining the OSAL code generation tool comprises:
    生成多种链接文件生成模板,不同的链接文件生成模板对应不同的编译器;Generate a variety of link file generation templates, and different link file generation templates correspond to different compilers;
    基于所述链接文件生成模板,按照代码定义的静态变量与所述OSAL内核中的数据结构一致的规则,生成所述OSAL代码生成工具。Generate the template based on the link file, and generate the OSAL code generation tool according to the rule that the static variable defined by the code is consistent with the data structure in the OSAL kernel.
  6. 一种实时操作系统的使用方法,其特征在于,所述使用方法应用于采用权利要求1至5中任一项所述的生成方法生成的实时操作系统中,所述使用方法包括:A method for using a real-time operating system, characterized in that the method for using is applied to a real-time operating system generated by the generating method according to any one of claims 1 to 5, and the method for using includes:
    从所述基于AUTOSAR的实时操作系统中下载所述OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统;Download the OSAL kernel from the AUTOSAR-based real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from an open source website;
    获取用户基于所述车辆电池管理开发项目在所述OSAL内核中的配置;Obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project;
    基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。Based on the operation result configured in the target real-time operating system, the OSAL code generation tool is used to generate the code files required by the vehicle battery management development project.
  7. 根据权利要求6所述的使用方法,其特征在于,所述基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件,包括:The method according to claim 6, characterized in that, based on the operation result configured in the target real-time operating system, the OSAL code generation tool is used to generate the required code for the vehicle battery management development project. code files, including:
    针对不同的配置,根据所述OSAL代码生成工具生成的宏加载所述目标实时操作系统中与所述不同的配置对应的接口;For different configurations, load the interface corresponding to the different configurations in the target real-time operating system according to the macro generated by the OSAL code generation tool;
    在加载所述接口时,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。When loading the interface, the OSAL code generation tool is used to generate the code files required by the vehicle battery management development project.
  8. 根据权利要求7所述的使用方法,其特征在于,所述针对不同的配置,根据所述OSAL代码生成工具生成的宏加载所述目标实时操作系统中与所述不同的配置对应的接口,包括:The method according to claim 7, characterized in that, for different configurations, according to the macros generated by the OSAL code generation tool, the interfaces corresponding to the different configurations in the target real-time operating system are loaded, including :
    当所述配置为时钟设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的Clock_setTimeout、Clock_setPeriod、 Clock_start,以及调用xTimerStart;When the configuration is clock setting, determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load Clock_setTimeout, Clock_setPeriod, Clock_start in the FreeRTOS, and call xTimerStart;
    当所述配置为应用设置时,根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为FreeRTOS;若是,则加载所述FreeRTOS中的vTaskStartScheduler,以及调用xSemaphoreCreateMutex、xSemaphoreCreateMutex、Semaphore_post;以及根据所述OSAL代码生成工具生成的宏确定所述目标实时操作系统是否为SYSbios;若是,则加载所述SYSbios中的BIOS_start()。When the configuration is an application setting, determine whether the target real-time operating system is FreeRTOS according to the macro generated by the OSAL code generation tool; if so, load the vTaskStartScheduler in the FreeRTOS, and call xSemaphoreCreateMutex, xSemaphoreCreateMutex, Semaphore_post; and Determine whether the target real-time operating system is SYSbios according to the macro generated by the OSAL code generation tool; if so, load BIOS_start() in the SYSbios.
  9. 一种实时操作系统的生成装置,其特征在于,所述生成装置包括:A generating device for a real-time operating system, characterized in that the generating device includes:
    设计模块,用于基于汽车开放系统架构AUTOSAR标准生成操作系统抽象层OSAL内核,所述OSAL内核用于使得实时操作系统RTOS在AUTOSAR标准下运行;A design module for generating an operating system abstraction layer OSAL kernel based on the automotive open system architecture AUTOSAR standard, and the OSAL kernel is used to make the real-time operating system RTOS run under the AUTOSAR standard;
    封装模块,用于基于所述OSAL内核对所述RTOS相应的应用程序接口API进行封装;An encapsulation module, configured to encapsulate the corresponding application program interface API of the RTOS based on the OSAL kernel;
    获取模块,用于获取OSAL代码生成工具,所述OSAL代码生成工具用于将用户对所述OSAL内核中的配置以及对所述RTOS的调用过程生成与所述OSAL内核相一致的代码文件;The obtaining module is used to obtain an OSAL code generation tool, and the OSAL code generation tool is used to generate a code file consistent with the OSAL kernel for the user's configuration in the OSAL kernel and the call process to the RTOS;
    生成模块,用于基于所述OSAL内核、封装API后的RTOS以及所述OSAL代码生成工具,生成基于AUTOSAR的实时操作系统。The generation module is used to generate an AUTOSAR-based real-time operating system based on the OSAL kernel, the RTOS after encapsulating the API, and the OSAL code generation tool.
  10. 一种实时操作系统的使用装置,其特征在于,所述使用装置应用于采用权利要求9所述的生成装置生成的实时操作系统中,所述使用装置包括:A device for using a real-time operating system, characterized in that the device for using is applied to a real-time operating system generated by the generating device according to claim 9, and the device for using includes:
    下载模块,用于从所述基于AUTOSAR的实时操作系统中下载所述OSAL内核,以及从开源网站中下载与车辆电池管理开发项目相匹配的目标实时操作系统;A download module, used to download the OSAL kernel from the AUTOSAR-based real-time operating system, and download the target real-time operating system that matches the vehicle battery management development project from an open source website;
    配置模块,用于获取用户基于所述车辆电池管理开发项目在所述OSAL内核中的配置;The configuration module is used to obtain the user's configuration in the OSAL kernel based on the vehicle battery management development project;
    生成模块,用于基于所述配置在所述目标实时操作系统中的运行结果,采用所述OSAL代码生成工具,生成所述车辆电池管理开发项目所需的代码文件。A generating module, configured to generate code files required by the vehicle battery management development project by using the OSAL code generation tool based on the running result of the configuration in the target real-time operating system.
  11. 一种电子设备,其特征在于,包括:处理器、存储器、总线;An electronic device, characterized in that it includes: a processor, a memory, and a bus;
    其中,所述处理器、所述存储器通过所述总线完成相互间的通信;所述处理器用于调用所述存储器中的程序指令,以执行如权利要求1至5中任一项所述的生成方法或者权利要求6至8中任一项所述的使用方法。Wherein, the processor and the memory complete mutual communication through the bus; the processor is used to invoke program instructions in the memory to execute the generating method described in any one of claims 1 to 5 method or the method of use described in any one of claims 6 to 8.
  12. 一种计算机可读存储介质,其特征在于,包括:存储的程序;A computer-readable storage medium, characterized by comprising: a stored program;
    其中,在所述程序运行时控制所述存储介质所在设备执行如权利要求1至5中任一项所述的生成方法或者权利要求6至8中任一项所述的使用方法。Wherein, when the program is running, the device where the storage medium is located is controlled to execute the generation method described in any one of claims 1 to 5 or the use method described in any one of claims 6 to 8.
PCT/CN2023/071367 2022-01-29 2023-01-09 Generation method and apparatus for real-time operating system, use method and apparatus for real-time operating system, electronic device, and medium WO2023143020A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210111217.4A CN115826938B (en) 2022-01-29 2022-01-29 Method and device for generating and using real-time operating system, electronic equipment and medium
CN202210111217.4 2022-01-29

Publications (1)

Publication Number Publication Date
WO2023143020A1 true WO2023143020A1 (en) 2023-08-03

Family

ID=85522409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/071367 WO2023143020A1 (en) 2022-01-29 2023-01-09 Generation method and apparatus for real-time operating system, use method and apparatus for real-time operating system, electronic device, and medium

Country Status (2)

Country Link
CN (1) CN115826938B (en)
WO (1) WO2023143020A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117555553B (en) * 2023-12-18 2024-05-28 上海烜翊科技有限公司 Method and system for generating universal software protocol interface based on autosar modeling
CN117931483A (en) * 2024-03-21 2024-04-26 宁德时代新能源科技股份有限公司 Operating system, generating method, electronic device, storage medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385530A (en) * 2011-08-11 2012-03-21 浙江大学 Operating system (OS) resource distribution conflict solution applied to run-time environment (RTE) code generation
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method
CN102681898A (en) * 2012-03-13 2012-09-19 浙江大学 Method for increasing transportability of AUTOSAR (AUTomotive Open System Architecture) OS MCAL driving code
US20170104631A1 (en) * 2015-10-12 2017-04-13 Hyundai Motor Company Operation methods of communication node in network
CN111752550A (en) * 2020-06-28 2020-10-09 吉林大学 Embedded real-time Linux and AUTOSAR OS cross-platform development implementation system
CN112622574A (en) * 2019-10-08 2021-04-09 佛吉亚(中国)投资有限公司 Driving system and driving method for air outlet motor of automobile air conditioner

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080065814A (en) * 2007-01-10 2008-07-15 재단법인서울대학교산학협력재단 Device for automatic creating an embedded software for realtime operating system, and method for the same
DE102007062114A1 (en) * 2007-12-21 2009-07-23 Opensynergy Gmbh Motor vehicle control device
FR3045870B1 (en) * 2015-12-21 2018-08-31 Valeo Equipements Electriques Moteur OFF-LINE ALLOCATION METHOD OF REAL-TIME ONBOARD SOFTWARE ON MULTICONTROLLER MULTICOARGER ARCHITECTURE, AND USE THEREOF FOR ON-ROAD APPLICATIONS IN A MOTOR VEHICLE
CN105912334A (en) * 2016-04-08 2016-08-31 浙江大学 Internal behavior object code generation method of AUTOSAR software assembly
CN106325970A (en) * 2016-10-17 2017-01-11 宁德时代新能源科技股份有限公司 Compiling method and compiling system
CN109491806A (en) * 2018-11-01 2019-03-19 郑州云海信息技术有限公司 Adaptation method and device between a kind of kernel and third-party application
CN109895656A (en) * 2019-01-22 2019-06-18 合肥中科昂辉科技有限公司 A kind of vehicle-mounted management system based on AUTOSAR
CN109976737B (en) * 2019-03-27 2022-09-20 北京经纬恒润科技股份有限公司 RTE code generation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385530A (en) * 2011-08-11 2012-03-21 浙江大学 Operating system (OS) resource distribution conflict solution applied to run-time environment (RTE) code generation
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method
CN102681898A (en) * 2012-03-13 2012-09-19 浙江大学 Method for increasing transportability of AUTOSAR (AUTomotive Open System Architecture) OS MCAL driving code
US20170104631A1 (en) * 2015-10-12 2017-04-13 Hyundai Motor Company Operation methods of communication node in network
CN112622574A (en) * 2019-10-08 2021-04-09 佛吉亚(中国)投资有限公司 Driving system and driving method for air outlet motor of automobile air conditioner
CN111752550A (en) * 2020-06-28 2020-10-09 吉林大学 Embedded real-time Linux and AUTOSAR OS cross-platform development implementation system

Also Published As

Publication number Publication date
CN115826938B (en) 2023-11-17
CN115826938A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
WO2023143020A1 (en) Generation method and apparatus for real-time operating system, use method and apparatus for real-time operating system, electronic device, and medium
US8516508B1 (en) Automated application programming interface (API) generation
EP2062136B1 (en) System and method for using stream objects to perform stream processing in a text-based computing environment
CN109358839B (en) Method for developing embedded single-chip microcomputer software and storage medium
JP2010015534A (en) Method and apparatus for simulating multicore microcomputer-based system
EP3207453B1 (en) Api versioning independent of product releases
TW202403541A (en) System, method and device for introducing applet into third-party APP and medium
EP3633507B1 (en) Technologies for secure and efficient native code invocation for firmware services
CN111507676A (en) Method, device, storage medium and system for establishing and implementing business order flow
CN115373720A (en) Method and device for starting and online upgrading of multiple C2000 DSPs
Szabó et al. Real-time rendering with OpenGL and Vulkan in C#
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function
Viarheichyk Embedded Programming with Modern C++ Cookbook: Practical recipes to help you build robust and secure embedded applications on Linux
Roop et al. A new reactive processor with architectural support for control dominated embedded systems
US20230376289A1 (en) Method and apparatus for implementing batch system call
Thompson et al. Introducing the .NET Micro Framework
RU2718235C1 (en) Operating system architecture for supporting generations of microkernel
CN115373747A (en) Instruction expansion method, system and computer readable storage medium
Sinkkonen Asymmetric multiprocessing of Linux and hard real-time systems
Qiu et al. Research on Real-Time Software Development Approach.
CN116700709A (en) Key response method, key response device, electronic equipment and medium
WO2020215425A1 (en) Software operating method and system, computing device and storage medium
Liles Asynchronous Android
TW554288B (en) Method of single CPU simulator kernel frame technique and its device thereof
Hintermann Operating system components for an embedded linux system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23745903

Country of ref document: EP

Kind code of ref document: A1