Basic software state management method of motor controller after starting of operating system
By implementing basic software state management methods in the motor controller operating system, the flexibility and response speed problems of software state management in new energy motors are solved, and the alternating operation of rapid start and shutdown is realized, which improves the adaptability and ability of the system Maintenance.
Patent Information
- Application Number
- CN202410903919.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-12-06
AI Technical Summary
In new energy motor technology, how to effectively manage the basic software status of the motor controller to ensure that it can respond quickly when the vehicle operating system is started and shut down, adapt to different driving conditions, and software version information is maintained in R&D, production and after-sales service Consistent, there are challenges.
By using asynchronous data reading and network communication, the basic software state management method after the motor controller operating system is started, including initialization, startup waiting, application software initialization, periodic task operation, condition detection and status jump, the use of asynchronous data reading and network communication, the Flexible state management of basic software improves the flexibility and maintainability of software.
Improves the flexibility and maintainability of the software, significantly improves the alternating operation response time of fast start and fast shutdown, ensuring that the system can adapt quickly under different conditions.
Smart Images

Figure CN119088466A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of new energy motors, and in particular to a method for managing a basic software state of a motor controller after an operating system is started. Background Art
[0002] With the continuous advancement of automobile technology, the automobile industry is rapidly developing in the direction of electronic intelligence, networking, deep electronics, and integration. Intelligent driving has become the trend of industry development. From the history of automobile development, automotive electronics has become the most important supporting foundation in automobile control systems, and automobile electrification has become a symbol of the automobile industry revolution. With the increasing maturity of new energy vehicles, unmanned driving, and in-vehicle information system technologies.
[0003] In the new round of automotive electronic technology revolution, the automotive market has higher and higher requirements for diversified functions, the application of automotive electronic controllers in automobiles is becoming more and more extensive, and the demand for software and configuration upgrades is becoming more and more frequent. Therefore, in the design and development, production and manufacturing, after-sales service and other links of the whole vehicle, how to effectively manage the software and hardware of the electronic controller, how to keep the software version information consistent from R&D design to production and manufacturing, and how to quickly and accurately view and flash the software version information are crucial. For example, how to manage the status of the basic software, control the startup and shutdown of the basic software, so that the vehicle can adapt to the road conditions during driving, and improve the response speed of the system are the current problems. Summary of the invention
[0004] The present invention provides a basic software state management method for a motor controller after the operating system is started. The present invention improves the flexibility and maintainability of the software and can improve the response time of the alternating operations of fast startup and fast shutdown.
[0005] The technical solutions to the above technical problems are as follows: The basic software state management method of the motor controller after the operating system is started includes the following steps: Step 1, basic software initialization phase: after the operating system of the motor controller is started, the basic software is initialized; Step 2, startup waiting phase: In this phase, the basic software status management waits for the startup or shutdown request of the application software; Step 3, application software initialization: After the operating system of the motor controller is started, step 1 is executed first in the timing sequence. After step 1 is executed, the operating system schedules the application software to initialize and run, initializes the necessary functions and signals of the application software, and reads the data in the NVM in an asynchronous manner; Step 4, application software periodic task running: After the application software is initialized, the operating system schedules the application software periodic task running, including the task of the application software periodically detecting the startup and shutdown conditions; Step 5, the application software periodically detects the start and shutdown conditions: the motor controller operating system periodically schedules the task function to implement the application software periodically detecting the start and shutdown conditions, and transmits the detection results to the basic software status management; Step 6, judging the state transition condition in the startup waiting phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or the startup completion phase or continues to remain in the startup waiting phase; Step 7, startup completion phase: the basic software turns on the network communication function and periodically receives the application software's detection startup and shutdown condition recognition results; Step 8, judging the state transition condition in the startup completion phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or continues to remain in the startup completion phase; Step 9: In the reversible shutdown phase, the basic software shuts down the network communication function and writes data to the NVM.
[0006] Furthermore, the method further comprises the following steps: Step 10, judging the state transition condition of the reversible stage of closing: judging according to the set conditions, determining whether the basic software state management should enter the startup waiting stage or the irreversible stage of closing or continue to remain in the reversible stage of closing; Step 11, the irreversible shutdown phase: At this stage, the basic software will be deinitialized and the OS will be shut down, and then the system will be completely shut down.
[0007] Furthermore, the starting condition in step 5 is one of the following: (1) When the basic software status management is in the startup waiting stage, within the set time in the startup waiting stage, it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the startup condition is met; (2) When the basic software state management is in the reversible stage of shutdown, after a period of time in the reversible stage of shutdown, as long as it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the start condition is met.
[0008] Furthermore, the closing condition in step 5 is one of the following: (1) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, if it is detected that the wake-up source of the main control chip does not belong to any of the pre-configured wake-up sources, the shutdown condition is met; (2) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, when it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the CAN chip transceiver is not in the activated state, the shutdown condition is met; (3) When the basic software status management is in the startup completion stage, when the motor controller has the ignition switch signal wake-up function, it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the vehicle requests the motor controller to sleep and the vehicle is in a stationary state, and it can be maintained for a period of time, the shutdown condition is met; (4) When the basic software status management is in the startup completion stage, when the motor controller does not have the ignition switch signal wake-up function, it is detected that the main control chip receives the vehicle's request for the motor controller to sleep and the vehicle is in a stationary state, and after a period of time, the shutdown condition is met.
[0009] When the basic software state management is in the reversible stage of shutdown, as long as the startup condition is met, the shutdown condition is considered to be met.
[0010] Furthermore, in step 6, the start-up and shutdown condition detection results identified in step 5 are first received, and if the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; If the startup condition is met, a judgment is made as to whether the startup is completed. If the startup waiting is completed, the state of the basic software jumps to the startup completion stage. If the startup waiting is not completed, the state of the basic software jumps back to the startup waiting stage. When all basic software is initialized successfully, all application software is initialized successfully, and NVM data reading is completed, the startup waiting is completed, otherwise the startup waiting is not completed.
[0011] Furthermore, in step 7, the basic software will turn on all network communication functions, and periodically receive the application software detection startup and shutdown condition identification results, and then receive the startup and shutdown condition detection results identified in step 5 in step 8. If the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; if the startup condition is met, it continues to remain in the startup completion stage.
[0012] Further, after executing step 9, the start-up and shutdown condition detection results identified in step 5 are received in step 10. If the start-up condition is met, the state of the basic software jumps to the start-up waiting stage; if the shutdown condition is met, the completion judgment of the reversible stage of shutdown is performed. If the judgment is completed, the irreversible stage of shutdown is entered, otherwise the reversible stage of shutdown is returned; When the network communication function has been completely shut down and the NVM asynchronous data write operation is completed, or when the time of the reversible phase of shutdown exceeds the maximum allowed running time, the reversible phase of shutdown is completed, otherwise it is not completed.
[0013] In the present invention, the basic software state management mainly performs the state identification of the basic software, the simple state jump condition identification and the operation of the basic software. The complex condition judgment is completed by the application software and then transmitted to the basic software state management for use. When matching different projects or vehicle models, it is basically only necessary to maintain the application software, thereby improving the flexibility and maintainability of the software. In addition, by using this basic software state management, the startup and shutdown processes can be flexibly jumped, which greatly improves the response time of the alternating operations of fast startup and fast shutdown.
[0014] In summary, the present invention improves the flexibility and maintainability of the software through reasonable state transition conditions and execution in basic software state management and reasonable use of application software calculations, and can improve the response time of alternating operations of fast startup and fast shutdown. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0016] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0017] like Figure 1 The basic software state management method of the motor controller after the operating system is started includes the following steps: Step 1, basic software initialization phase: After the operating system of the motor controller is started, the basic software is initialized, including the system service stack, communication stack, storage stack, complex driver (hardware interaction or functional requirements that cannot be directly supported by the AUTOSAR standard basic software module, AUTOSAR is a global automotive open system architecture) and other related software initialization, and then the basic software status management (basic software refers to the basic functions and services required by the embedded system. It is an abstraction and encapsulation of the underlying hardware. The basic software enables application software to use hardware resources more conveniently and efficiently. At the same time, the basic software also provides key components such as operating systems and middleware. The basic software status management is to manage the running status of these basic functions and services) enters the startup waiting phase.
[0018] Step 2, startup waiting phase: In this phase, the basic software status management waits for the startup or shutdown request of the application software.
[0019] Step 3, application software initialization: After the operating system of the motor controller is started, step 1 is executed first in the timing. After step 1 is executed, the operating system schedules the application software to initialize and run, initializes the necessary functions and signals of the application software, and uses an asynchronous method to read the data in the NVM (non-volatile memory).
[0020] The functions and signals that need to be initialized are different due to the different functions of the system and application software. It is mainly to initialize some application layer software that affects the function of the startup process, such as the signal processing of CAN communication.
[0021] There are two ways to read data from NVM: synchronous and asynchronous. The synchronous way is: after the program issues a request to read NVM data, it must wait for the request to get a response result (that is, data reading is completed) before the program can continue to execute. The asynchronous way is: after the program issues a request to read NVM data, the request will enter the NVM queue, and the program does not need to wait for the result of the request to continue to execute subsequent operations.
[0022] Step 4, application software periodic task execution: After the application software is initialized, the operating system schedules the application software periodic task execution, including the task of the application software periodically detecting startup and shutdown conditions.
[0023] Step 5, the application software periodically detects the start and shutdown conditions: the motor controller operating system periodically schedules the task function to implement the application software periodically detecting the start and shutdown conditions, and transmits the detection results to the basic software status management; The start condition in step 5 is one of the following: (1) When the basic software status management is in the startup waiting stage, within the set time in the startup waiting stage, it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the startup condition is met.
[0024] In the EcuM module (Ecu mode management) of AUTOSAR, the wake-up source can be pre-configured. The pre-configuration includes all possible wake-up sources for this project, such as ignition signal wake-up, CAN wake-up, etc.
[0025] (2) When the basic software state management is in the reversible stage of shutdown, after a period of time in the reversible stage of shutdown, as long as it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the start condition is met.
[0026] The closing condition in step 5 is one of the following: (1) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, if it is detected that the wake-up source of the main control chip does not belong to any of the pre-configured wake-up sources, the shutdown condition is met; (2) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, when it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the CAN chip transceiver is not in the activated state, the shutdown condition is met; (3) When the basic software status management is in the startup completion stage, when the motor controller has the ignition switch signal wake-up function, it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the vehicle requests the motor controller to sleep and the vehicle is in a stationary state, and it can be maintained for a period of time, the shutdown condition is met; (4) When the basic software status management is in the startup completion stage, when the motor controller does not have the ignition switch signal wake-up function, it is detected that the main control chip receives the vehicle's request for the motor controller to sleep and the vehicle is in a stationary state, and after a period of time, the shutdown condition is met.
[0027] When the basic software state management is in the reversible stage of shutdown, as long as the startup condition is met, the shutdown condition is considered to be met.
[0028] Step 6, judging the state transition condition in the startup waiting phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or the startup completion phase or continues to remain in the startup waiting phase.
[0029] In step 6, the startup and shutdown condition detection results identified in step 5 are first received. If the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage.
[0030] If the startup condition is met, a judgment is made as to whether the startup is completed. If the startup waiting is completed, the state of the basic software jumps to the startup completion stage. If the startup waiting is not completed, the state of the basic software jumps back to the startup waiting stage.
[0031] When all basic software is initialized successfully, all application software is initialized successfully, and NVM data reading is completed, the startup waiting is completed, otherwise the startup waiting is not completed.
[0032] Step 7, startup completion phase: the basic software turns on the network communication function and periodically receives the application software's detection startup and shutdown condition recognition results.
[0033] In step 7, the basic software will turn on all network communication functions and periodically receive the application software's detection results of startup and shutdown conditions, and then receive the startup and shutdown condition detection results identified in step 5 in step 8. If the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; if the startup condition is met, it continues to remain in the startup completion stage.
[0034] Step 8, judging the state transition condition in the startup completion phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or continues to remain in the startup completion phase.
[0035] First, the startup and shutdown condition detection results identified in step 5 are received. If the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; if the startup condition is met, it continues to remain in the startup completion stage.
[0036] Step 9: In the reversible shutdown phase, the basic software shuts down the network communication function and writes data to the NVM.
[0037] Step 10, judging the state transition condition of the reversible stage of closing: judging according to the set conditions, determining whether the basic software state management should enter the startup waiting stage or the irreversible stage of closing or continue to remain in the reversible stage of closing.
[0038] After executing step 9, in step 10, the start and shutdown condition detection results identified in step 5 are received. If the start condition is met, the state of the basic software jumps to the start waiting stage; if the shutdown condition is met, the completion judgment of the reversible stage of shutdown is performed. If the judgment is completed, the irreversible stage of shutdown is entered, otherwise it returns to the reversible stage of shutdown; When the network communication function has been completely shut down and the NVM asynchronous data write operation is completed, or when the time of the reversible phase of the shutdown exceeds the maximum allowed running time, the reversible phase of the shutdown is completed, otherwise it is not completed. At this time, the maximum time is related to the time it takes for the NVM to write asynchronous data, and is generally set to be several milliseconds higher than this time (for example, it can be set to be 5ms higher than this time, which can be set according to the project).
[0039] Step 11, the irreversible shutdown phase: At this stage, the basic software will be deinitialized and the OS will be shut down, and then the system will be completely shut down.
Claims
1. A basic software state management method for a motor controller after the operating system is started, characterized in that: The following steps are involved: Step 1, basic software initialization phase: after the operating system of the motor controller is started, the basic software is initialized; Step 2, startup waiting phase: In this phase, the basic software status management waits for the startup or shutdown request of the application software; Step 3, application software initialization: After the operating system of the motor controller is started, step 1 is executed first in the timing sequence. After step 1 is executed, the operating system schedules the application software to initialize and run, initializes the necessary functions and signals of the application software, and reads the data in the NVM in an asynchronous manner; Step 4, application software periodic task running: After the application software is initialized, the operating system schedules the application software periodic task running, including the task of the application software periodically detecting the startup and shutdown conditions; Step 5, the application software periodically detects the start and shutdown conditions: the motor controller operating system periodically schedules the task function to implement the application software periodically detecting the start and shutdown conditions, and transmits the detection results to the basic software status management; Step 6, judging the state transition condition in the startup waiting phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or the startup completion phase or continues to remain in the startup waiting phase; Step 7, startup completion phase: the basic software turns on the network communication function and periodically receives the application software's detection startup and shutdown condition recognition results; Step 8, judging the state transition condition in the startup completion phase: judging according to the set condition, determining whether the basic software state management enters the reversible shutdown phase or continues to remain in the startup completion phase; Step 9: In the reversible shutdown phase, the basic software shuts down the network communication function and writes data to the NVM.
2. The basic software state management method of the motor controller after the operating system is started according to claim 1, characterized in that: The following steps are also included: Step 10, judging the state transition condition of the reversible stage of closing: judging according to the set conditions, determining whether the basic software state management should enter the startup waiting stage or the irreversible stage of closing or continue to remain in the reversible stage of closing; Step 11, the irreversible shutdown phase: At this stage, the basic software will be deinitialized and the OS will be shut down, and then the system will be completely shut down.
3. The basic software state management method of the motor controller after the operating system is started according to claim 1, characterized in that: The starting condition in step 5 is one of the following: (1) When the basic software status management is in the startup waiting stage, within the set time in the startup waiting stage, it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the startup condition is met; (2) When the basic software state management is in the reversible stage of shutdown, after a period of time in the reversible stage of shutdown, as long as it is detected that the wake-up source of the main control chip belongs to any of the pre-configured wake-up sources, and then the main control chip receives the ignition switch signal in the trigger state or the CAN chip transceiver is in the activated state, the start condition is met.
4. The basic software state management method of the motor controller after the operating system is started according to claim 1, characterized in that: The closing condition in step 5 is one of the following: (1) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, if it is detected that the wake-up source of the main control chip does not belong to any of the pre-configured wake-up sources, the shutdown condition is met; (2) When the basic software state management is in the startup waiting stage, after a period of time in the startup waiting stage, when it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the CAN chip transceiver is not in the activated state, the shutdown condition is met; (3) When the basic software status management is in the startup completion stage, when the motor controller has the ignition switch signal wake-up function, it is detected that the ignition switch signal received by the main control chip is not in the trigger state and the vehicle requests the motor controller to sleep and the vehicle is in a stationary state, and it can be maintained for a period of time, the shutdown condition is met; (4) When the basic software status management is in the startup completion stage, when the motor controller does not have the ignition switch signal wake-up function, it is detected that the main control chip receives the vehicle's request for the motor controller to sleep and the vehicle is in a stationary state, and after a period of time, the shutdown condition is met; When the basic software state management is in the reversible stage of shutdown, as long as the startup condition is met, the shutdown condition is considered to be met.
5. The basic software state management method of the motor controller after the operating system is started according to claim 1, characterized in that: In step 6, firstly, the start-up and shutdown condition detection results identified in step 5 are received, and if the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; If the startup condition is met, a judgment is made as to whether the startup is completed. If the startup waiting is completed, the state of the basic software jumps to the startup completion stage. If the startup waiting is not completed, the state of the basic software jumps back to the startup waiting stage. When all basic software is initialized successfully, all application software is initialized successfully, and NVM data reading is completed, the startup waiting is completed, otherwise the startup waiting is not completed.
6. The basic software state management method of the motor controller after the operating system is started according to claim 1, characterized in that: In step 7, the basic software will turn on all network communication functions and periodically receive the application software's detection results of startup and shutdown conditions, and then receive the startup and shutdown condition detection results identified in step 5 in step 8. If the shutdown condition is met, the state of the basic software jumps to the reversible shutdown stage; if the startup condition is met, it continues to remain in the startup completion stage.
7. The basic software state management method of the motor controller after the operating system is started according to claim 2, characterized in that: After executing step 9, in step 10, the start and shutdown condition detection results identified in step 5 are received. If the start condition is met, the state of the basic software jumps to the start waiting stage; if the shutdown condition is met, the completion judgment of the reversible stage of shutdown is performed. If the judgment is completed, the irreversible stage of shutdown is entered, otherwise it returns to the reversible stage of shutdown; When the network communication function has been completely shut down and the NVM asynchronous data write operation is completed, or when the time of the reversible phase of shutdown exceeds the maximum allowed running time, the reversible phase of shutdown is completed, otherwise it is not completed.
