Control Method, Device, Medium and Equipment for Embedded System

By controlling the number of hot start targets and shutdown methods of the embedded system, the problems of slow cold start speed and useless data generated by hot start of the embedded system are solved, and the balance of startup speed and operating performance is achieved.

CN117971330BActive Publication Date: 2025-07-08XIAOMI EV TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410175715.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2025-07-08
Estimated Expiration
2044-02-07

AI Technical Summary

Technical Problem

The cold start process of embedded systems is slow, while hot start will generate useless data, affecting system performance.

Method used

By determining the target number of hot-starts of embedded system, when the preset shutdown conditions are met, the shutdown method of embedded system is controlled according to the relationship between the target number and the preset number of times, including power-off of some hardware, saving operation data or performing reset operations to balance the startup speed and operation performance.

Benefits of technology

It realizes the selection of the appropriate shutdown method based on the target number of hot start mode, ensuring that the shutdown method of the embedded system is more in line with the current state, and improves the startup speed and operating performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117971330B_ABST
    Figure CN117971330B_ABST
Patent Text Reader

Abstract

The present disclosure provides a control method, device, medium and equipment for an embedded system, relating to the field of computer technology. The method includes: determining a target number of warm boots of the embedded system; when a preset shutdown condition is satisfied, controlling the shutdown mode of the embedded system according to the relationship between the target number and a preset number. The present disclosure can select a suitable shutdown mode for the embedded system according to the target number of warm boot modes, and further ensure that the shutdown mode of the embedded system this time is more in line with the current state of the embedded system, which is beneficial to balancing the startup speed and operating performance of the embedded system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a control method, apparatus, medium, and device for an embedded system. Background Art

[0002] The cold start process of an embedded system is slow and can clear useless data of the system, while the warm start can quickly restore the system to the state when the system was running last time, but it will generate useless data. Summary of the Invention

[0003] The present disclosure provides a control method, apparatus, medium, and device for an embedded system to reasonably control the shutdown mode of the embedded system.

[0004] According to a first aspect of an embodiment of the present disclosure, a control method for an embedded system is provided. The method includes:

[0005] Determine the target number of warm starts of the embedded system;

[0006] When a preset shutdown condition is satisfied, control the shutdown mode of the embedded system according to the relationship between the target number and a preset number.

[0007] Optionally, controlling the shutdown mode of the embedded system according to the relationship between the target number and the preset number includes:

[0008] When the target number exceeds the preset number, control some hardware of the embedded system to power off and save the running data of the embedded system, and control the embedded system to perform a reset operation. The running data is used for the embedded system to restore the state before shutdown at the next startup.

[0009] Optionally, controlling the embedded system to perform a reset operation includes:

[0010] Control the embedded system to power on in a warm start manner;

[0011] Control all hardware of the embedded system to power off to clear the running data of the embedded system.

[0012] Optionally, controlling the embedded system to perform a reset operation includes:

[0013] Control the embedded system to power on in a warm start manner;

[0014] Control all hardware of the embedded system to power off to clear the running data of the embedded system;

[0015] Control the embedded system to power on in a cold start manner to initialize the running data of the embedded system.

[0016] Control part of the hardware of the embedded system to power off and save the initialized operation data.

[0017] Optionally, control the embedded system to perform a reset operation, including:

[0018] Control the embedded system to perform the reset operation within a target time period after a preset duration.

[0019] Optionally, control the embedded system to perform a reset operation within a target time period after a preset duration, including:

[0020] Estimate a first time to start performing the reset operation according to the current time satisfying the preset shutdown condition and the preset duration;

[0021] Estimate a second time to complete performing the reset operation according to the first time;

[0022] When both the first time and the second time are within the target time period, control the embedded system to start performing the reset operation after the preset duration at the current time;

[0023] When any one of the first time and the second time is not within the target time period, control the embedded system to start performing the reset operation within the target time period.

[0024] Optionally, control the shutdown method of the embedded system according to the relationship between the target number of times and the preset number of times, including:

[0025] When the target number of times does not exceed the preset number of times, control part of the hardware of the embedded system to power off and save the operation data of the embedded system, and the operation data is used for the embedded system to restore the state before this shutdown after the next startup.

[0026] Optionally, the preset shutdown condition includes: receiving an instruction for instructing the embedded system to shut down.

[0027] Optionally, determine the target number of times of hot start of the embedded system, including:

[0028] Determine the current startup method of the embedded system;

[0029] When the current startup method is a cold start method, determine the target number of times of hot start of the embedded system to be zero;

[0030] When the current startup method is a hot start method, add 1 to the number of times that the historical startup method of the embedded system is a hot start method to obtain the target number of times of hot start of the embedded system.

[0031] Optionally, when a preset shutdown condition is satisfied, according to the relationship between the target number of times and the preset number of times, control the shutdown mode of the embedded system, including:

[0032] Set a shutdown flag bit according to the relationship between the target number of times and the preset number of times, where the shutdown flag bit is used to indicate the shutdown mode of the embedded system this time;

[0033] When the preset shutdown condition is satisfied, control the shutdown mode of the embedded system according to the shutdown flag bit.

[0034] According to a second aspect of the embodiments of the present disclosure, there is provided a control device for an embedded system, the device including:

[0035] A determination module configured to determine the target number of times of warm start of the embedded system;

[0036] A control module configured to, when a preset shutdown condition is satisfied, control the shutdown mode of the embedded system according to the relationship between the target number of times and the preset number of times.

[0037] According to a third aspect of the embodiments of the present disclosure, there is provided a computer storage medium, on which a computer program is stored, and when the program is executed by a processing device, the method provided in the first aspect of the embodiments of the present disclosure is implemented.

[0038] According to a fourth aspect of the embodiments of the present disclosure, there is provided a device, including:

[0039] A storage device, on which a computer program is stored;

[0040] A processing device for executing the computer program in the storage device to implement the method provided in the first aspect of the embodiments of the present disclosure.

[0041] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0042] Through the above technical solutions, the target number of times of warm start of the embedded system is determined. When a preset shutdown condition is satisfied, according to the relationship between the target number of times and the preset number of times, the shutdown mode of the embedded system is controlled. In this way, it is possible to select a suitable shutdown mode for the embedded system according to the target number of times of the warm start mode, and further ensure that the shutdown mode of the embedded system this time is more in line with the current state of the embedded system, which is beneficial to balancing the startup speed and operation performance of the embedded system.

[0043] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Brief Description of the Drawings

[0044] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0045] Figure 1 It is a flowchart of a control method for an embedded system shown according to an exemplary embodiment.

[0046] Figure 2 It is a block diagram of power supply control for a heterogeneous chip control system shown according to an exemplary embodiment.

[0047] Figure 3 It is a flowchart of another control method for an embedded system shown according to an exemplary embodiment.

[0048] Figure 4 It is a schematic diagram of setting a timer shown according to an exemplary embodiment.

[0049] Figure 5 It is a block diagram of a control device for an embedded system shown according to an exemplary embodiment.

[0050] Figure 6 It is a block diagram of a device shown according to an exemplary embodiment. Detailed Description of the Embodiments

[0051] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0052] In an embedded heterogeneous chip system, the cold start process needs to initialize the storage space and necessary hardware. Therefore, the cold start process takes a relatively long time and may be difficult to meet the requirements of application scenarios that are sensitive to the startup time. To achieve a fast startup of the embedded system and save the boot time, a warm start method can be adopted during the design of the embedded system. For example, STR (Suspend to RAM) is a suspension method. When software suspension is executed, the current running data of the embedded system will be saved to the RAM (Random Access Memory), and most hardware devices will be turned off to minimize the power consumption of the system. During the recovery process, the running data saved in the RAM will be restored, enabling the embedded system to resume the state before suspension. Compared with the cold start method, the advantage of the warm start method is its fast startup speed. It can shorten the startup speed by about 90% when only power is supplied to the RAM.

[0053] See Figure 1 , Figure 1 is a flowchart of a control method for an embedded system shown according to an exemplary embodiment. As Figure 1 shown, the control method of the embedded system can be applied to, for example, automotive controllers or embedded systems related to industrial and medical fields, and includes the following steps.

[0054] In step S101, determine the target number of warm starts of the embedded system.

[0055] Exemplarily, the embedded system consists of hardware and software and is a device capable of independent operation. Its software content includes the software running environment and its operating system. The hardware content includes multiple aspects such as signal processors, memories, communication modules, etc. The historical startup methods of the embedded system include warm start and cold start. During the cold start process, it is necessary to initialize the storage space and necessary hardware, and the initialization process generally takes several seconds to several minutes, resulting in a long boot time. During the warm start process, the execution software can be suspended, and the running data such as the data and execution progress during the execution of the embedded system can be saved to the RAM. Most hardware devices can be powered off, and only the RAM is powered. In this way, the embedded system can be quickly restored to the state before software suspension using the running data saved in the RAM, and the startup speed is relatively fast.

[0056] Exemplarily, the target number can be obtained through a counter. For example, it includes the number of times the historical startup method of the embedded system is the warm start method and the current startup method. Each time the embedded system performs a warm start to power on, a signal can be sent to the counter to enable the counter to accumulate the target number of warm starts.

[0057] In step S102, when the preset shutdown condition is satisfied, the shutdown method of the embedded system is controlled according to the relationship between the target number of times and the preset number of times.

[0058] Exemplarily, the satisfaction of the preset shutdown condition may be, for example, receiving an instruction for instructing the shutdown of the embedded system. Further, the preset shutdown condition may be, for example, receiving a shutdown signal transmitted through a bus, or a shutdown signal for a timer to wake up the embedded system to execute clearing of running data and then shutdown. The preset number of times is a threshold value. According to the relationship between the target number of times of cumulative warm starts and the preset number of times, the shutdown method of the embedded system can be controlled for this time.

[0059] Exemplarily, when the embedded system shuts down, if all hardware is powered off and the running data saved by the embedded system is cleared, initialization of the storage space and hardware is required for the next startup. The startup method corresponding to this shutdown method is the cold startup method; if the execution software is suspended and part of the hardware is powered off, for example, only the RAM is powered, and the RAM saves the running data of the embedded system for this operation, then for the next startup, there is no need to initialize the storage space and hardware, and the embedded system can be restored to the suspended state through the running data saved in the RAM. The startup method corresponding to this shutdown method is the warm startup method. The warm startup method may bring some memory fragments and dirty data, affecting the running performance of the system, while the cold startup method can clear this part of memory fragments and dirty data through the initialization operation. Different shutdown methods can respectively affect the startup speed and running performance of the embedded system for the next startup.

[0060] Through the above technical solution, the target number of times of warm starts of the embedded system is determined. When the preset shutdown condition is satisfied, the shutdown method of the embedded system is controlled according to the relationship between the target number of times and the preset number of times. In this way, it is possible to select a suitable shutdown method for the embedded system according to the target number of times of the warm startup method, and further ensure that the shutdown method of the embedded system for this time is more in line with the current state of the embedded system, which is beneficial to balancing the startup speed and running performance of the embedded system.

[0061] As an alternative embodiment, controlling the shutdown method of the embedded system according to the relationship between the target number of times and the preset number of times includes:

[0062] When the target number of times exceeds the preset number of times, control part of the hardware of the embedded system to be powered off and save the running data of the embedded system, and control the embedded system to perform a reset operation. The running data is used for the embedded system to restore the state before this shutdown after the next power-on.

[0063] Exemplarily, the preset number of times can be set according to the actual situation or customized by the user. For example, the preset number of times can be 10 - 50 times, and further 30 times. The reset operation can clear the memory fragments and dirty data in the embedded system. In some other cases, after clearing the memory fragments and dirty data, the embedded system can be initialized and the initialized running data can be saved. The initialized running data can be used for the embedded system to restore the state before shutdown after the next startup, that is, the state after initialization is completed, without the user having to wait for the system to initialize.

[0064] Exemplarily, when the number of times of hot start exceeds the preset number of times, the number of times of starting the embedded system in the hot start mode is relatively large, and the memory fragments and dirty data retained in the embedded system in the hot start mode are also relatively large, which may seriously affect the running performance of the embedded system. Here, when the target number of times exceeds the preset number of times, by controlling some hardware of the embedded system to power off and saving the running data of the embedded system, and controlling the embedded system to perform a reset operation, the memory fragments and dirty data generated in the historical hot start situation can be cleared, ensuring the running performance of the system.

[0065] It should be noted that after controlling some hardware of the embedded system to power off here, saving the running data of the embedded system is used for the embedded system to start and run quickly during the reset operation, and the process of shutting down all and clearing the system running data can be executed.

[0066] As an optional implementation manner, controlling the embedded system to perform a reset operation includes:

[0067] Controlling the embedded system to power on in the hot start mode;

[0068] Controlling all hardware of the embedded system to power off to clear the running data of the embedded system.

[0069] Exemplarily, the purpose of the embedded system performing a reset operation is to clear the memory fragments and dirty data generated by the hot start of the embedded system. When the shutdown condition is met, first controlling the embedded system to perform a shutdown method of powering off some hardware and saving the running data of the embedded system can control the embedded system to perform a shutdown of all hardware and clear the running data of the embedded system after hot start. Although this method can clear the memory fragments and dirty data of the embedded system, the embedded system will start in the cold start mode next time, still making the user wait for a period of time to use the device, which cannot meet the scenario where the user has a high requirement for the device startup time.

[0070] Here, another optional implementation manner is also provided. Controlling the embedded system to perform a reset operation includes:

[0071] Controlling the embedded system to power on in the hot start mode;

[0072] Control all the hardware of the embedded system to power off to clear the running data of the embedded system;

[0073] Control the embedded system to power on in a cold start manner to initialize the running data of the embedded system;

[0074] Control part of the hardware of the embedded system to power off and save the initialized running data.

[0075] Exemplarily, when the embedded system meets the shutdown condition, control the embedded system to perform a shutdown method of powering off part of the hardware and saving the running data of the embedded system, and within the target period after a preset duration, control the embedded system to perform a warm start, and then perform a full hardware power off to clear the running data of the embedded system. After that, the embedded system can be woken up again to power on in a cold start manner. The embedded system can initialize the memory space and hardware to obtain the initialized running data of the embedded system, and control part of the hardware of the embedded system to power off and save the initialized running data. In this way, when the user turns on the device next time, the embedded system can quickly restore to the initialized state based on the saved initialized running data. This reset process is not easily perceptible to the user within the target period, greatly improving the user experience.

[0076] As an alternative embodiment, controlling the embedded system to perform a reset operation includes:

[0077] Control the embedded system to perform a reset operation within the target period after a preset duration.

[0078] Exemplarily, the preset duration can be, for example, 20 - 60 minutes, specifically 30 minutes. The target period can be a user-defined period or a period pre-set by the designer as a period when the user generally does not use the device, such as from 2 am to 5 am. Controlling the embedded system to perform a reset operation after a preset duration can avoid repeated power on and off operations during normal user use, which affects the user experience. Further, controlling the embedded system to perform a reset operation within the target period after a preset duration can automatically complete the reset operation without being easily perceptible to the user. When the user controls the embedded system to power on next time, the memory fragmentation and dirty data of the embedded system have been cleared, which will not affect the operation of the system, improving the running performance of the embedded system and greatly improving the user experience.

[0079] As an alternative embodiment, controlling the embedded system to perform a reset operation within the target period after a preset duration includes:

[0080] Estimate the first moment to start performing the reset operation according to the current moment satisfying the preset shutdown condition and the preset duration;

[0081] Estimate a second moment when the reset operation is expected to be completed based on the first moment;

[0082] When both the first moment and the second moment are within the target time period, control the embedded system to start executing the reset operation after a preset duration at the current moment;

[0083] When any one of the first moment and the second moment is not within the target time period, control the embedded system to start executing the reset operation within the target time period.

[0084] Exemplarily, the first moment is the estimated time to start executing the reset operation, for example, the moment after a preset duration from the current moment, and the second moment is the estimated time to end executing the reset operation. It can be estimated that the second moment is the moment after the maximum reset operation duration from the first moment, and the maximum reset operation duration can be determined according to the actual situation of the embedded system executing the reset operation. When both the first moment and the second moment are within the target time period, the embedded system can be controlled to start executing the reset operation after a preset duration at the current moment; when any one of the first moment and the second moment is not within the target time period, control the embedded system to start executing the reset operation within the target time period.

[0085] As an example, for instance, the upper limit of the hot start target number is 30 times, the preset duration is 30 minutes, and the target time period is from 2 am to 5 am. When the hot start target number reaches 30 times during the current startup of the embedded system, and the user controls the device to shut down at 17:00, then the corresponding moment 17:30 after a 30 - minute delay is not within the target time period, so the embedded system can be set to be woken up at 2 am the next day to execute the reset operation. Another example, when the hot start target number reaches 30 times during the current startup of the embedded system, and the user controls the device to shut down at 3 am, then the embedded system can be set to be woken up at 3:30 am to execute the reset operation. Another example, when the hot start target number reaches 30 times during the current startup of the embedded system, and the user controls the device to shut down at 4:50 am, then the corresponding moment 5:20 after a 30 - minute delay is also not within the target time period, so the embedded system can be set to be woken up at 2 am the next day to execute the reset operation.

[0086] Exemplarily, in order to avoid the situation where when the embedded system of the device meets the hot start target number, the device shuts down and then immediately restarts to perform the reset operation, that is, to avoid the process of the device repeatedly powering on and off in a short period. Additionally, it can also avoid the problem that the user performs the reset operation during the period when the device is frequently used, which may result in the loss of operation data during user use or the user waiting for a long time for the reset, resulting in a poor user experience. Here, by setting a delay of a preset duration before executing the reset operation and only allowing the reset operation to be executed within the target time period, the user experience is greatly improved.

[0087] As an alternative embodiment, controlling the shutdown mode of the embedded system according to the relationship between the target number of times and the preset number of times includes:

[0088] When the target number of times does not exceed the preset number of times, control some hardware of the embedded system to power off and save the running data of the embedded system. The running data is used for the embedded system to restore the state before this shutdown after the next startup.

[0089] Exemplarily, when the target number of times does not exceed the preset number of times, the embedded system may not be controlled to perform a reset operation, and the embedded system can still be started in a warm start mode next time. Correspondingly, the shutdown mode also adopts the method of powering off some hardware and saving the running data of the embedded system, so that the embedded system can quickly restore the state before this shutdown when starting up next time.

[0090] As an alternative embodiment, the preset shutdown conditions include: receiving an instruction for instructing the embedded system to shut down, receiving a shutdown signal from a timer to wake up the embedded system to execute clearing of running data and then shut down, and so on.

[0091] As an alternative embodiment, determining the target number of times for warm start of the embedded system includes:

[0092] Determining the current startup mode of the embedded system;

[0093] When the current startup mode is a cold start mode, determine the target number of times for warm start of the embedded system as zero;

[0094] When the current startup mode is a warm start mode, add 1 to the number of times the historical startup mode of the embedded system is a warm start mode to obtain the target number of times for warm start of the embedded system.

[0095] Exemplarily, a counter can be used to accumulate the target number of times for warm start of the embedded system. When the current startup mode is a warm start mode, the target number of times for warm start can continue to be accumulated or updated, that is, add 1 to the number of times the historical startup mode is a warm start mode. The updated target number of times can also be used to control the embedded system subsequently. When the current startup mode is a cold start mode, the cold start mode can initialize the hardware and memory space, clear memory fragments and dirty data. Therefore, the target number of times for warm start can be re-accumulated, that is, the target number of times can be cleared.

[0096] As an alternative embodiment, when the preset shutdown conditions are met, controlling the shutdown mode of the embedded system according to the relationship between the target number of times and the preset number of times includes:

[0097] Set a shutdown flag bit according to the relationship between the target number of times and the preset number of times. The shutdown flag bit is used to indicate the shutdown mode of the embedded system this time;

[0098] When the preset shutdown condition is satisfied, control the shutdown method of the embedded system according to the shutdown flag bit.

[0099] Exemplarily, the embedded system of the present disclosure can be controlled by a shutdown flag bit. The shutdown flag bit is used to indicate the shutdown method of the embedded system this time. After determining the target number of warm boots of the embedded system, the shutdown flag bit can be set according to the relationship between the target number and the preset number, and when the preset shutdown condition is satisfied, control the shutdown method of the embedded system according to the shutdown flag bit.

[0100] As an exemplary implementation manner, refer to Figure 2 , a block diagram of power control of a heterogeneous chip embedded system is provided. Among them, the embedded system includes an MPU (Micro Processor Unit) system and an MCU (Microcontroller Unit) system. The MPU system includes an operating system and software modules related to its functions, and can perform related operations and calculation processes. The MCU system can be configured to control the shutdown method and startup method of the MPU system. The MCU system includes a shutdown method switching module, a system power control module, a timing module, and a persistent storage module RAM.

[0101] Exemplarily, the system power control module of the MCU system is connected to the power supply of the MPU system through a control interface. The shutdown method switching module provides a first interface for sending the power-down method of the MPU system this time to the system power control module and a second interface for obtaining the power-up method of the MPU system this time from the system power control module. The shutdown method switching module is connected to the system power control module through the first interface and the second interface. The shutdown method switching module provides a third interface for obtaining the current time and obtaining the timer wake-up state from the timing module and a fourth interface for setting the wake-up time of the timing module. The shutdown method switching module is connected to the timing module through the third interface and the fourth interface. The shutdown method switching module also provides a fifth interface for reading data from the persistent storage module RAM and a sixth interface for writing data into the persistent storage module RAM. The shutdown method switching module is connected to the persistent storage module RAM through the fifth interface and the sixth interface.

[0102] As an exemplary implementation manner, refer to Figure 3 , Figure 3 Combined with Figure 2 and the shutdown flag bit, another control method for the embedded system is provided, including the following steps:

[0103] S301. Check the startup condition of the embedded system.

[0104] Among them, when the embedded system is in the cold start mode or the warm start mode, check whether the target number of warm starts in the counter exceeds the preset number; if so, set the shutdown flag bit to delayed cold shutdown, and if so, set the shutdown flag bit to warm shutdown; when the embedded system is in warm start and is awakened by a timer, set the shutdown flag bit to cold shutdown.

[0105] S302. The embedded system runs normally.

[0106] S303. When it is detected that the embedded system meets the shutdown condition, check the shutdown flag bit.

[0107] When the shutdown flag bit is warm shutdown, the shutdown mode switching module sends a request instruction to the system power control module to control the MPU system to execute the warm shutdown mode in step S304;

[0108] When the shutdown flag bit is delayed cold shutdown, the shutdown mode switching module sends a request instruction to the system power control module to control the MPU system to execute the warm shutdown mode in S304, and at the same time set a timer; after the timer wakes up the MPU system, and then sequentially execute steps S305, S301, S302, S303, S306, S307, S301, S302, S303, S304;

[0109] When the shutdown flag bit is cold shutdown, the shutdown mode switching module sends a request instruction to the system power control module to control the MPU system to execute the cold shutdown mode in step S306.

[0110] S304. Control some hardware of the MPU system to power off and save the running data of the MPU system.

[0111] S305. When the boot condition is met, perform a warm start and increment the counter by 1; at the same time, return to step S301.

[0112] S306. Control all hardware of the MPU system to power off and clear the running data of the MPU system.

[0113] S307. When the boot condition is met, perform a cold start and clear the counter; at the same time, return to step S301.

[0114] See Figure 4 , Figure 4A schematic diagram of setting a timer is provided. Among them, the cold shutdown time window is the target period. The cold shutdown time window can be set from 2:00 am to 5:00 am. At this time, the cold shutdown start time is 2:00 am, and the cold shutdown end time is 5:00 am. During the target period, the reset operation is performed and it is not easily perceptible to the user and does not affect the normal use of the user. When setting the timer, for example, the current moment when the shutdown condition is met is the t0 moment. At the t0 moment, the hot shutdown process is immediately executed, that is, some hardware of the MPU system is powered off, and the running data of the MPU system is saved. If the first moment after the preset duration is the t1 moment, the reset operation starts at the t1 moment and the reset operation can be completed at the t21 moment. Both the t1 moment and the t21 moment are within the cold shutdown time window, then the timer can be set to start the reset operation at the t1 moment; if the reset operation starts at the t1 moment and the reset operation can be completed at the t22 moment, but the t22 moment is not within the cold shutdown time window, the timer can be set to wake up the MPU system at the cold shutdown start time of the next day to start the reset operation. If the reset operation starts at the t22 moment and the reset operation can be completed at the t3 moment, and both the t22 moment and the t3 moment are not within the cold shutdown time window, the timer can be set to wake up the MPU system at the cold shutdown start time of the next day to start the reset operation. The timer wake-up method here can be RTC timing wake-up.

[0115] Figure 5 is a block diagram of a control device for an embedded system shown according to an exemplary embodiment. Referring to Figure 5 this, the control device of the embedded system includes a determination module 501 and a control module 502.

[0116] The determination module 501 is configured to determine the target number of times of hot start of the embedded system;

[0117] The control module 502 is configured to, when the preset shutdown condition is met, control the shutdown method of the embedded system according to the relationship between the target number of times and the preset number of times.

[0118] As an optional embodiment, the control module 502 includes:

[0119] The first control sub-module is configured to, when the target number of times exceeds the preset number of times, control some hardware of the embedded system to power off and save the running data of the embedded system, and, within the target period after the preset duration, control the embedded system to perform a reset operation. The running data is used for the embedded system to restore the state before this shutdown after the next power-on.

[0120] As an optional embodiment, the first control sub-module is specifically configured to:

[0121] Control the embedded system to power on in a hot start manner;

[0122] Control all the hardware of the embedded system to power off, so as to clear the running data of the embedded system.

[0123] As an optional embodiment, the first control sub-module is specifically configured to:

[0124] Control the embedded system to power on in a warm start mode;

[0125] Control all the hardware of the embedded system to power off, so as to clear the running data of the embedded system;

[0126] Control the embedded system to power on in a cold start mode, so as to initialize the running data of the embedded system;

[0127] Control some of the hardware of the embedded system to power off and save the initialized running data.

[0128] As an optional embodiment, the first control sub-module is specifically configured to:

[0129] Estimate the first moment to start executing the reset operation according to the current moment and the preset duration that meet the preset shutdown condition;

[0130] Estimate the second moment to complete executing the reset operation according to the first moment;

[0131] When both the first moment and the second moment are within the target time period, control the embedded system to start executing the reset operation after the preset duration at the current moment;

[0132] When any one of the first moment and the second moment is not within the target time period, control the embedded system to start executing the reset operation within the target time period;

[0133] As an optional embodiment, the control module 502 includes:

[0134] A second control sub-module, configured to control some of the hardware of the embedded system to power off and save the running data of the embedded system when the target number of times does not exceed the preset number of times, and the running data is used for the embedded system to restore the state before this shutdown after the next power-on.

[0135] As an optional embodiment, the determination module 501 is further specifically configured to:

[0136] Determine the current startup mode of the embedded system;

[0137] When the current startup mode is the cold start mode, determine the target number of warm starts of the embedded system to be zero;

[0138] When the current startup mode is the warm start mode, add 1 to the number of times the historical startup mode of the embedded system is the warm start mode to obtain the target number of warm starts of the embedded system.

[0139] As an alternative embodiment, the control module 502 is further specifically configured to:

[0140] Set a shutdown flag bit according to the relationship between the target number of times and the preset number of times, where the shutdown flag bit is used to indicate the shutdown method of the embedded system this time;

[0141] When the preset shutdown condition is satisfied, control the shutdown method of the embedded system according to the shutdown flag bit.

[0142] Regarding the control device of the embedded system in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments of the control method of the embedded system, and will not be elaborated herein.

[0143] The present disclosure also provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processing device, it is the control method of the embedded system provided by the present disclosure.

[0144] The present disclosure also provides a device, including:

[0145] A storage device, on which a computer program is stored;

[0146] A processing device, configured to execute the computer program in the storage device to implement the control method of the embedded system provided by the present disclosure.

[0147] Exemplarily, the device includes an embedded system, such as an automotive controller or an embedded system related to industry or medical treatment. Therefore, the device can be a vehicle controller, a vehicle, a medical device, an industrial device, or a medical device, etc. Among them, the embedded system supports two startup methods: cold startup method and warm startup method. In addition, the embedded system supports timer wake-up after hibernation or shutdown, such as the PTC timer wake-up method.

[0148] Figure 6 It is a block diagram of a device 600 shown according to an exemplary embodiment. Referring to Figure 6 , the device 600 includes a processing component 622, which further includes one or more processors, and memory resources represented by a memory 632 for storing instructions executable by the processing component 622, such as application programs, and for storing video data transmitted by the vehicle. The application programs stored in the memory 632 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the control method of the embedded system described above.

[0149] Device 600 may also include a power supply component 626 configured to perform power management of device 600, a wired or wireless network interface 650 configured to connect device 600 to a network, and an input / output interface 658. Device 600 may operate based on an operating system stored in memory 632, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

[0150] In another exemplary embodiment, a computer program product is also provided, which includes a computer program capable of being executed by a programmable device, and the computer program has a code portion for performing the control method of the above-described embedded system when executed by the programmable device.

[0151] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0152] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A control method for an embedded system, characterized in that The method includes: Determining the target number of times for warm start of the embedded system; When a preset shutdown condition is satisfied, controlling the shutdown method of the embedded system according to the relationship between the target number and the preset number; Controlling the shutdown method of the embedded system according to the relationship between the target number and the preset number includes: When the target number exceeds the preset number, controlling some hardware of the embedded system to power off and saving the running data of the embedded system, and controlling the embedded system to perform a reset operation, where the running data is used for the embedded system to resume the state before this shutdown after the next power-on; When the target number does not exceed the preset number, controlling some hardware of the embedded system to power off and saving the running data of the embedded system, where the running data is used for the embedded system to resume the state before this shutdown after the next power-on.

2. The method according to claim 1, characterized in that, Controlling the embedded system to perform a reset operation includes: Controlling the embedded system to power on in a warm start manner; Controlling all hardware of the embedded system to power off to clear the running data of the embedded system.

3. The method according to claim 1, wherein Controlling the embedded system to perform a reset operation includes: Controlling the embedded system to power on in a warm start manner; Controlling all hardware of the embedded system to power off to clear the running data of the embedded system; Controlling the embedded system to power on in a cold start manner to initialize the running data of the embedded system; Controlling some hardware of the embedded system to power off and saving the initialized running data.

4. The method according to claim 1, wherein Controlling the embedded system to perform a reset operation includes: Controlling the embedded system to perform the reset operation within a target time period after a preset duration.

5. The method according to claim 4, wherein Controlling the embedded system to perform a reset operation within a target time period after a preset duration includes: Estimating a first time to start performing the reset operation according to the current time when the preset shutdown condition is satisfied and the preset duration; Estimating a second time to complete performing the reset operation according to the first time; When both the first time and the second time are within the target time period, controlling the embedded system to start performing the reset operation after the preset duration at the current time; When either the first time or the second time is not within the target time period, controlling the embedded system to start performing the reset operation within the target time period.

6. The method according to claim 1, wherein The preset shutdown condition includes: receiving an instruction for instructing the embedded system to shut down.

7. According to the method according to any one of claims 1-6, characterized in that, Determining the target number of times for warm start of the embedded system includes: Determining the current start method of the embedded system; When the current start method is a cold start method, determining the target number of times for warm start of the embedded system as zero; When the current start method is a warm start method, adding 1 to the number of times the historical start method of the embedded system is a warm start method to obtain the target number of times for warm start of the embedded system.

8. The method according to any one of claims 1-6, characterized in that, When a preset shutdown condition is satisfied, controlling the shutdown method of the embedded system according to the relationship between the target number and the preset number includes: Set a shutdown flag bit according to the relationship between the target number of times and the preset number of times, where the shutdown flag bit is used to indicate the shutdown method of the embedded system this time; When a preset shutdown condition is met, control the shutdown method of the embedded system according to the shutdown flag bit.

9. A control device for an embedded system, characterized in that, The device includes: A determination module configured to determine the target number of times of a warm start of the embedded system; A control module configured to control the shutdown method of the embedded system according to the relationship between the target number of times and the preset number of times when a preset shutdown condition is met; The control module includes: A first control sub-module configured to, when the target number of times exceeds the preset number of times, control some hardware of the embedded system to power off and save the operation data of the embedded system, and control the embedded system to perform a reset operation, where the operation data is used for the embedded system to resume the state before this shutdown after the next power-on; A second control sub-module configured to, when the target number of times does not exceed the preset number of times, control some hardware of the embedded system to power off and save the operation data of the embedded system, where the operation data is used for the embedded system to resume the state before this shutdown after the next power-on.

10. A computer storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processing device, it implements the method according to any one of claims 1-8.

11. A device, characterized in that, Including: A storage device storing a computer program thereon; A processing device for executing the computer program in the storage device to implement the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Application operating method and device and computer readable storage medium

    CN108255543A