System memory cleaning method, device, equipment, storage medium and program product

By obtaining the number of hot starts in the sleep state of the embedded heterogeneous chip system and controlling the processor to restart, the long cold start time and memory fragmentation problems are solved, and the memory fragmentation and dirty data are quickly cleaned up, satisfying startup time-sensitive applications need.

CN118295603BActive Publication Date: 2024-12-10XIAOMI EV TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410725461.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-12-10
Estimated Expiration
2044-06-05

AI Technical Summary

Technical Problem

Embedded heterogeneous chip systems need to initialize the storage space and hardware during cold startup, resulting in a long startup time, which is difficult to meet the application scenarios that are sensitive to startup time, and the hot startup method will cause memory fragmentation and dirty data problems.

Method used

When the target system is in sleep, get the number of hot starts and control the target processor to restart when preset conditions are met to clear memory fragmentation and dirty data, including restarting or forced cold starts within the shutdown time window.

Benefits of technology

Without affecting user usage, memory fragments and dirty data caused by hot boot are promptly cleared, greatly improving the system's memory cleaning effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118295603B_ABST
    Figure CN118295603B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a system memory cleaning method, device, equipment, storage medium and program product, and relates to the field of data cleaning technology. The method includes: when the target system is in a dormant state, the number of hot starts of the target system is obtained, and when the number of hot starts meets a first preset condition, the target processor of the target system is controlled to restart within the shutdown time window. When the target system is in a dormant state and within the shutdown time window, it can be executed without affecting the user's use as much as possible, and whether the operation data corresponding to the target system is cleared based on the number of hot starts can be determined, and the memory fragments and dirty data caused by the hot start of the target system can be cleared in a relatively timely manner, and by controlling the target processor of the target system to restart, the memory fragments and dirty data stored due to the hot start of the target system can be greatly cleared.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data cleaning, and in particular to a system memory cleaning method, device, equipment, storage medium and program product. Background Art

[0002] In embedded heterogeneous chip systems, since the storage space and necessary hardware need to be initialized during the system cold start process, this process often takes several seconds to several minutes, making it difficult to meet application scenarios where the startup time is sensitive.

[0003] In related technologies, in order to meet the needs of fast startup of embedded systems, some hot startup methods are used in system design to save startup time, such as STR (Suspend-to-RAM). When executing software suspension, the current state of the system will be saved to RAM (Random Access Memory) and most hardware devices will be turned off to minimize power consumption. During the recovery process, the state saved in RAM will be restored to return the system to the state before suspension. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a system memory cleaning method, device, equipment, storage medium and program product, which obtain the number of hot start times of the target system when the target system is in a dormant state, and control the target processor of the target system to restart when the number of hot start times meets a first preset condition. Therefore, the target system can be cleaned up by controlling the target processor of the target system to restart without affecting the user's use, thereby clearing the memory fragments and dirty data caused by the hot start of the target system.

[0005] According to a first aspect of an embodiment of the present disclosure, a system memory cleaning method is provided, comprising:

[0006] When the target system is in a dormant state, obtaining the number of hot starts of the target system;

[0007] When the number of hot starts meets a first preset condition, the target processor of the target system is controlled to restart within a shutdown time window.

[0008] Optionally, the method further comprises:

[0009] When the number of hot starts meets a second preset condition, the target system is controlled to be forced to cold start.

[0010] Optionally, when the number of hot starts meets a first preset condition, controlling the target processor of the target system to restart within a shutdown time window includes:

[0011] When the number of hot starts is greater than the first target number and less than the second target number, determining a shutdown delay corresponding to the target timer according to the shutdown time window and the sleep time;

[0012] When the timing duration of the target timer is equal to the shutdown delay, the target processor of the target system is controlled to restart within the shutdown time window.

[0013] Optionally, determining a shutdown delay corresponding to a target timer according to the shutdown time window and the sleep time includes:

[0014] In the case that the sleep time is before the start time of the closest first shutdown time window, the time difference between the sleep time and the start time of the first shutdown time window is determined as the shutdown delay corresponding to the target timer.

[0015] Optionally, determining a shutdown delay corresponding to a target timer according to the shutdown time window and the sleep time includes:

[0016] When the sleep time is within the closest first shutdown time window, the shutdown delay corresponding to the target timer is set to 0.

[0017] Optionally, determining a shutdown delay corresponding to a target timer according to the shutdown time window and the sleep time includes:

[0018] When the sleep time is after the end time of the closest first shutdown time window, the time difference between the sleep time and the start time of the second shutdown time window is determined as the shutdown delay corresponding to the target timer, and the second shutdown time window is the next shutdown time window of the first shutdown time window.

[0019] Optionally, when the number of hot starts meets a second preset condition, controlling the target system to force a cold start includes:

[0020] When the number of hot starts is greater than the second target number, the target system is controlled to be forced to cold start after a preset time.

[0021] Optionally, when the target system is in a dormant state, before obtaining the number of hot boots of the target system, the method further includes:

[0022] When the target system is in an awake state, the number of hot starts of the target system is determined according to the type of the awake source.

[0023] Optionally, determining the number of hot restarts of the target system according to the type of the wake-up source includes:

[0024] When the type of the wakeup source is target timer wakeup, the number of hot boot times of the target system is cleared.

[0025] Optionally, determining the number of hot restarts of the target system according to the type of the wake-up source includes:

[0026] When the startup mode is a cold startup, and the type of the wakeup source is a non-target timer wakeup and a non-network message wakeup, the number of hot startup times of the target system is cleared.

[0027] Optionally, determining the number of hot restarts of the target system according to the type of the wake-up source includes:

[0028] When the startup mode is a cold startup and the type of the wakeup source is a network message wakeup, it is determined that the number of hot startups of the target system is 1.

[0029] Optionally, determining the number of hot restarts of the target system according to the type of the wake-up source includes:

[0030] When the startup mode is hot startup, and the type of the wakeup source is non-target timer wakeup and non-network message wakeup, the number of hot startup times of the target system remains unchanged.

[0031] Optionally, determining the number of hot restarts of the target system according to the type of the wake-up source includes:

[0032] When the startup mode is hot startup and the type of the wakeup source is network message wakeup, the hot startup times of the target system are increased by 1.

[0033] According to a second aspect of an embodiment of the present disclosure, a system memory cleaning device is provided, comprising:

[0034] An acquisition module is configured to acquire the number of hot starts of the target system when the target system is in a dormant state;

[0035] The first control module is configured to control the target processor of the target system to restart within a shutdown time window when the number of hot starts meets a first preset condition.

[0036] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0037] processor;

[0038] a memory for storing processor-executable instructions;

[0039] The processor is configured to implement the steps of the system memory cleaning method provided in the first aspect of the present disclosure when executing.

[0040] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the system memory cleaning method provided in the first aspect of the present disclosure are implemented.

[0041] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the system memory cleaning method provided in the first aspect of the present disclosure.

[0042] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0043] By obtaining the number of hot starts of the target system when the target system is in a dormant state, and controlling the target processor of the target system to restart within the shutdown time window when the number of hot starts meets the first preset condition. When the target system is in a dormant state and executed within the shutdown time window, user use can be affected as little as possible. And based on the number of hot starts, it is determined whether the operating data corresponding to the target system is clear, and the memory fragments and dirty data caused by the hot start of the target system can be cleared in a relatively timely manner. Moreover, most of the large amount of storage data caused by the hot start is dynamic storage data. By controlling the target processor of the target system to restart, the dynamic storage data corresponding to the target system is cleared, which can greatly clear the memory fragments and dirty data stored due to the hot start of the target system.

[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0046] Figure 1 The present invention is a flowchart of a method for cleaning system memory according to an exemplary embodiment.

[0047] Figure 2 The invention is a flowchart showing a method for restarting a target processor according to an exemplary embodiment.

[0048] Figure 3 The figure is a schematic diagram of shutdown delay according to an exemplary embodiment.

[0049] Figure 4The figure is another schematic diagram of shutdown delay according to an exemplary embodiment.

[0050] Figure 5 The present invention is a flowchart of another method for cleaning system memory according to an exemplary embodiment.

[0051] Figure 6 The present invention is a block diagram of a system memory cleaning device according to an exemplary embodiment.

[0052] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

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

[0054] The embodiments described in some embodiments of the present disclosure below do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0055] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0056] In embedded heterogeneous chip systems, since the storage space and necessary hardware need to be initialized during the system cold start process, this process often takes several seconds to several minutes, making it difficult to meet application scenarios where the startup time is sensitive.

[0057] In related technologies, in order to meet the needs of fast startup of embedded systems, some hot startup methods are used in system design to save boot time. For example, STR (Suspend-to-RAM, software suspend / hibernate wakeup), when executing software suspension, the current state of the system will be saved to RAM (Random Access Memory), and most hardware devices will be turned off to minimize power consumption. During the recovery process, the state saved in RAM will be restored to return the system to the state before suspension. Compared with the cold start method, the main advantage of hot start is fast startup speed, which can shorten the startup speed by about 90% while only keeping RAM power supply, but it will also bring some memory fragmentation and dirty data problems.

[0058] In view of the above technical problems, the embodiments of the present disclosure provide a system memory cleaning method, device, equipment, storage medium and program product, which obtain the number of hot start times of the target system when the target system is in a dormant state, and control the target processor of the target system to restart within the shutdown time window when the number of hot start times meets a first preset condition. Thus, the target system's corresponding running data can be cleared by controlling the target processor of the target system to restart without affecting user use, thereby clearing memory fragments and dirty data caused by the hot start of the target system.

[0059] Figure 1 is a flowchart of a system memory cleaning method according to an exemplary embodiment. Figure 1 As shown, the method can be used in a terminal and may include the following steps.

[0060] In step S101 , when the target system is in a dormant state, the number of hot boots of the target system is obtained.

[0061] In this embodiment, the target system may be an embedded heterogeneous chip system, which may be applied to automotive controllers or industrial and medical-related embedded systems. After the target system is awakened, if no wake-up source is received within a preset time, it may enter a dormant state. Among them, the range of the preset time can be set according to the specific situation, for example, the preset time may be 5 minutes to 10 minutes. When the target system is in a dormant state, the number of hot starts of the target system is obtained, which can minimize the impact on user use. Among them, the hot start may be STR, and when the execution software is suspended, the current state of the system will be saved in RAM, and most of the hardware devices will be turned off to minimize power consumption. During the recovery process, the state saved in RAM will be restored to return the system to the state before the suspension. The hot start counter can be used to count the number of hot starts of the target system to obtain the number of hot starts of the target system.

[0062] In step S102, when the number of hot starts meets a first preset condition, the target processor of the target system is controlled to restart within the shutdown time window.

[0063] In this embodiment, the first preset condition is used to determine whether it is necessary to control the target processor of the target system to restart, and the first preset condition may be a hot start number threshold or a hot start number interval. Hot start will cause memory fragmentation and dirty data. Through repeated hot starts, a large amount of storage data will be accumulated, and most of the large amount of storage data caused by hot starts are dynamic storage data. Based on the number of hot starts, it is determined whether the operating data corresponding to the target system is clear, and the memory fragmentation and dirty data caused by the hot start of the target system can be cleared in a timely manner. And by controlling the target processor of the target system to restart, the dynamic storage data corresponding to the target system can be cleared, which can greatly clear the memory fragmentation and dirty data stored due to the hot start of the target system. Among them, the target processor may be an A core. Among them, the shutdown time window is a preset time period, which can be determined based on the car usage time data of a large number of users, and the preset time period can be the time period when users use the car the least. For example, the preset time period may be from 2 am to 5 am.

[0064] In a possible implementation, the method may further include:

[0065] When the number of hot starts meets the second preset condition, the target system is controlled to be forced to cold start.

[0066] In this embodiment, the second preset condition is used to determine whether to control the target system to force a cold start. The second preset condition may be a hot start number threshold. The cold start may be to restart both the A core and the M core of the target system to clear the dynamic storage data and static storage data corresponding to the target system, so that the dynamic storage data stored in the running storage of the A core and the static storage data stored in the running storage of the M core can be cleared, so that the memory cleaning of the system is more thorough.

[0067] Figure 2 is a flowchart of a method for restarting a target processor according to an exemplary embodiment. Figure 2 As shown, in a possible implementation manner, when the number of hot starts meets the first preset condition, the method for controlling the target processor of the target system to restart may include the following steps:

[0068] In step S201, when the number of hot starts is greater than the first target number and less than the second target number, a shutdown delay corresponding to the target timer is determined according to the shutdown time window and the sleep time.

[0069] In step S202, when the timing duration of the target timer is equal to the shutdown delay, the target processor of the target system is controlled to restart.

[0070] In this embodiment, the first preset condition may be that the number of hot starts is greater than the first target number and less than the second target number. The first target number and the second target number may be set according to actual conditions. For example, the first target number may be 40 times, and the second target number may be 60 times. In the case where the number of hot starts is greater than the first target number and less than the second target number, although the stored data is large, it does not affect the normal use of the user, and the target processor can be restarted at an appropriate time that does not affect the use of the user. For example, the shutdown delay corresponding to the target timer can be determined according to the shutdown time window and the sleep time. The sleep time is the time corresponding to the system entering sleep. The shutdown delay is the delay time for restarting the target processor, which can be timed by the target timer. When the timing time of the target timer is equal to the shutdown delay, the restart can be triggered to control the restart of the target processor of the target system. The shutdown delay is used to control the restart time of the target processor within the shutdown time window.

[0071] Figure 3 is a schematic diagram of a shutdown delay according to an exemplary embodiment. Figure 3 As shown, in a possible implementation manner, according to the shutdown time window and the sleep time, the method for determining the shutdown delay corresponding to the target timer may be:

[0072] When the sleep time is before the start time of the closest first shutdown time window, the time difference between the sleep time and the start time of the first shutdown time window is determined as the shutdown delay corresponding to the target timer.

[0073] In this embodiment, the first shutdown time window is a shutdown time window closest to the sleep time, and the first shutdown time window may include a start time and an end time. For example, if the first shutdown time window is from 2 a.m. to 5 a.m., the start time of the first shutdown time window is 2 a.m. and the end time is 5 a.m. In the case where the sleep time is before the start time of the closest first shutdown time window, a shutdown delay needs to be set so that the restart time of the target processor is controlled within the shutdown time window. In order to shorten the shutdown delay as much as possible, the time difference between the sleep time and the start time of the first shutdown time window can be determined as the shutdown delay corresponding to the target timer.

[0074] In a possible implementation, according to the shutdown time window and the sleep time, a method for determining the shutdown delay corresponding to the target timer may be:

[0075] When the sleep time is within the closest first shutdown time window, the shutdown delay corresponding to the target timer is set to 0.

[0076] In this embodiment, when the sleep time is within the closest first shutdown time window, the target processor can be directly restarted. In order to shorten the shutdown delay as much as possible, the shutdown delay corresponding to the target timer can be set to 0, that is, the restart of the target processor is triggered immediately.

[0077] Figure 4 is another shutdown delay schematic diagram according to an exemplary embodiment. Figure 4 As shown, in a possible implementation manner, according to the shutdown time window and the sleep time, the method for determining the shutdown delay corresponding to the target timer may be:

[0078] When the sleep time is after the end time of the closest first shutdown time window, the time difference between the sleep time and the start time of the second shutdown time window is determined as the shutdown delay corresponding to the target timer, and the second shutdown time window is the next shutdown time window of the first shutdown time window.

[0079] In this embodiment, the second shutdown time window is the next shutdown time window of the first shutdown time window. One shutdown time window may be set every day, or multiple shutdown time windows may be set every day. In the case where the sleep time is after the end time of the closest first shutdown time window, the restart of the target processor cannot be controlled within the first shutdown time window. In order to shorten the shutdown delay as much as possible and reduce the data storage pressure, the time difference between the sleep time and the start time of the second shutdown time window may be determined as the shutdown delay corresponding to the target timer.

[0080] In a possible implementation manner, when the number of hot starts meets the second preset condition, the method for controlling the target system to force a cold start may be:

[0081] When the number of hot starts is greater than the second target number, the target system is controlled to be forced to cold start after a preset time.

[0082] In this embodiment, the second preset condition may be that the number of hot starts is greater than the second target number, and the second target number may be set according to actual conditions, for example, the second target number may be 60. When the number of hot starts is greater than the first target number, the user may be using the target system during the shutdown time window every day. This causes the target system to be in a dormant state that cannot be within the shutdown time window, and the target system cannot restart the target processor within the shutdown time window. The number of hot starts will exceed the first target number and continue to increase, causing greater data storage pressure and affecting the user's experience of the target system. When the number of hot starts is greater than the second target number, the data storage pressure is greater. In order to avoid affecting the user's experience, the target system can be controlled to force a cold start after a preset time. That is, as long as the target system is in a dormant state for a certain period of time, a forced cold start can be performed, and no restart is sought within the shutdown time window. Among them, the preset time can be set according to actual conditions, for example, 15 minutes. The preset time is used to avoid a forced cold start when the user actively wakes up the target system again within the preset time. For example, when a user parks a vehicle, the target system is in a dormant state, but the user forgets to take something and returns to the vehicle, which will cause the vehicle system to be re-awakened. To avoid the situation where the target system is forced to restart and the user cannot wake up the vehicle, a preset time is set to control the target system to force a cold start after the preset time.

[0083] In a possible implementation, when the target system is in a dormant state, before obtaining the number of hot boots of the target system, a method for determining the number of hot boots of the target system may be:

[0084] When the target system is in an awake state, the number of hot restarts of the target system is determined according to the type of the awake source.

[0085] In this embodiment, different wake-up sources correspond to different startup modes and data processing modes of the target system. When the target system is in the wake-up state, the number of hot startup times of the target system can be determined according to the type of the wake-up source.

[0086] In a possible implementation, according to the type of the wake-up source, a method for determining the number of hot boots of the target system may be:

[0087] When the wakeup source type is target timer wakeup, the number of hot boot times of the target system is cleared to zero.

[0088] In this embodiment, the type of wake-up source is target timer wake-up, which indicates triggering the restart of the target processor. At this time, the restart of the target processor can clear the dynamic storage data corresponding to the target system, thereby clearing the number of hot start times of the target system and restarting the hot start count.

[0089] In a possible implementation, according to the type of the wake-up source, a method for determining the number of hot boots of the target system may be:

[0090] When the startup mode is cold startup and the wakeup source type is non-target timer wakeup and non-network message wakeup, the number of hot startup times of the target system is cleared.

[0091] In this embodiment, when the startup mode is a cold start, and the type of the wake-up source is a non-target timer wake-up and a non-network message wake-up, it is characterized as a forced cold start of the target system automatically triggered by the target system. At this time, the forced cold start of the target system can clear the dynamic storage data and static storage data corresponding to the target system, so that the number of hot starts of the target system can be reset to zero and the hot start count can be restarted. If it is automatically triggered by the target system, it is not used by the user and does not generate storage data, then there is no need to add 1 to the number of hot starts.

[0092] In a possible implementation, according to the type of the wake-up source, a method for determining the number of hot boots of the target system may be:

[0093] When the startup mode is cold startup and the type of the wakeup source is network message wakeup, it is determined that the number of hot startup times of the target system is 1.

[0094] In this embodiment, when the startup mode is cold start and the type of wake-up source is network message wake-up, it is characterized as a forced cold start of the target system that is not automatically triggered by the target system, that is, a forced cold start initiated by the user. At this time, the forced cold start of the target system can clear the dynamic storage data and static storage data corresponding to the target system, so that the number of hot starts of the target system can be reset to zero and the hot start count can be restarted. In addition, for user use, storage data will be generated, and the number of hot starts needs to be increased by 1, that is, the number of hot starts of the target system at this time is 1.

[0095] In a possible implementation, according to the type of the wake-up source, a method for determining the number of hot boots of the target system may be:

[0096] When the startup mode is hot startup and the wakeup source type is non-target timer wakeup and non-network message wakeup, the number of hot startup times of the target system remains unchanged.

[0097] In this embodiment, although the startup mode is hot start, the type of wake-up source is non-target timer wake-up and non-network message wake-up, which is characterized as non-user use. At this time, no storage data will be generated, and the number of hot start times of the target system can be kept unchanged.

[0098] In a possible implementation, according to the type of the wake-up source, a method for determining the number of hot boots of the target system may be:

[0099] When the startup mode is hot startup and the wakeup source type is network message wakeup, the hot startup times of the target system are increased by 1.

[0100] In this embodiment, the startup mode is hot startup, and the type of wakeup source is network message wakeup, which is characterized as a hot startup used by the user, and storage data will be generated, and the hot startup count of the target system can be increased by 1.

[0101] Figure 5 is a flowchart of another system memory cleaning method according to an exemplary embodiment. Figure 5 As shown, the following steps may be included.

[0102] In step S501, it is determined whether the wakeup source is only the target timer. If the wakeup source is not only the target timer, step S502 is executed. If the wakeup source is only the target timer, step S506 is executed.

[0103] In step S502, it is determined whether it is a cold start. If it is not a cold start, step S503 is executed. If it is a cold start, step S505 is executed.

[0104] In step S503, if the system wakes up normally and is not awakened by a network message, the number of hot starts remains unchanged; if the system wakes up by a network message, the number of hot starts increases by 1.

[0105] In step S504, there is no wake-up source, the system enters the sleep state, and executes step S507.

[0106] In step S505, the number of hot starts is reset to zero, and step S503 is executed.

[0107] In step S506, the target processor is restarted, the number of hot starts is cleared, and step S504 is executed.

[0108] In step S507, it is determined whether the number of hot starts is greater than the first target number and less than the second target number. If so, step S508 is executed; if not, step S509 is executed.

[0109] In step S508, the shutdown delay is determined, and the process returns to step S501.

[0110] In step S509, it is determined whether the number of hot starts is greater than the second target number, and the process returns to step S501.

[0111] Figure 6 is a block diagram of a system memory cleaning device according to an exemplary embodiment. Figure 6 The system memory cleaning device 600 includes an acquisition module 601 and a first control module 602.

[0112] The acquisition module 601 is configured to acquire the number of hot starts of the target system when the target system is in a dormant state;

[0113] The first control module 602 is configured to control the target processor of the target system to restart within a shutdown time window when the number of hot starts meets a first preset condition.

[0114] Optionally, the system memory cleaning device 600 further includes:

[0115] The second control module is configured to control the target system to force a cold start when the number of hot starts meets a second preset condition.

[0116] Optionally, the first control module 602 includes:

[0117] A first determining submodule is configured to determine a shutdown delay corresponding to a target timer according to the shutdown time window and the sleep time when the number of hot starts is greater than a first target number and less than a second target number;

[0118] The first control submodule is configured to control the target processor of the target system to restart within the shutdown time window when the timing duration of the target timer is equal to the shutdown delay.

[0119] Optionally, the first determining submodule includes:

[0120] The first determining unit is configured to determine, when the sleep time is before the start time of the closest first shutdown time window, a time difference between the sleep time and the start time of the first shutdown time window as a shutdown delay corresponding to the target timer.

[0121] Optionally, the first determining submodule includes:

[0122] The second determining unit is configured to set the shutdown delay corresponding to the target timer to 0 when the sleep time is within the closest first shutdown time window.

[0123] Optionally, the first determining submodule includes:

[0124] The third determination unit is configured to determine the time difference between the sleep time and the start time of the second shutdown time window as the shutdown delay corresponding to the target timer when the sleep time is after the end time of the closest first shutdown time window, and the second shutdown time window is the next shutdown time window of the first shutdown time window.

[0125] Optionally, the second control module includes:

[0126] The second control submodule is configured to control the target system to force a cold start after a preset time period when the number of hot starts is greater than a second target number.

[0127] Optionally, the system memory cleaning device 600 further includes:

[0128] The determination module is configured to determine the number of hot starts of the target system according to the type of the wake-up source when the target system is in the wake-up state.

[0129] Optionally, the determining module includes:

[0130] The second determining submodule is configured to clear the number of hot boot times of the target system to zero when the type of the wakeup source is target timer wakeup.

[0131] Optionally, the determining module includes:

[0132] The third determining submodule is configured to clear the number of hot starts of the target system to zero when the startup mode is a cold start and the type of the wakeup source is a non-target timer wakeup and a non-network message wakeup.

[0133] Optionally, the determining module includes:

[0134] The fourth determining submodule is configured to determine that the number of hot starts of the target system is 1 when the startup mode is a cold start and the type of the wakeup source is a network message wakeup.

[0135] Optionally, the determining module includes:

[0136] The fifth determining submodule is configured to keep the number of hot start times of the target system unchanged when the startup mode is hot start and the type of the wakeup source is non-target timer wakeup and non-network message wakeup.

[0137] Optionally, the determining module includes:

[0138] The sixth determining submodule is configured to increase the number of hot boot times of the target system by 1 when the startup mode is hot boot and the type of the wakeup source is network message wakeup.

[0139] Regarding the system memory cleaning device 600 in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0140] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and when the program instructions are executed by a processor, the steps of the system memory cleaning method provided by the present disclosure are implemented.

[0141] Figure 7 700 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 700 may be a vehicle controller, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0142] Reference Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output interface 712 , a sensor component 714 , and a communication component 716 .

[0143] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more first processors 720 to execute instructions to complete all or part of the steps of the above-mentioned system memory cleaning method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0144] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0145] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0146] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0147] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0148] The input / output interface 712 provides an interface between the processing component 702 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0149] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0150] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0151] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-mentioned system memory cleaning method.

[0152] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by the first processor 720 of the electronic device 700 to complete the above-mentioned system memory cleaning method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0153] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the above system memory cleaning method when executed by the programmable device.

[0154] Those skilled in the art may also understand that the various illustrative logical blocks and steps listed in the embodiments of the present application may be implemented by electronic hardware, computer software, or a combination of the two. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the functions described for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present application.

[0155] In the above detailed description, terms such as "center", "upper", "lower", "left", "right", etc. indicate directions or represent positional relationships. Since the components of the described device can be positioned in a plurality of different orientations, the directional terms can be used for illustrative purposes rather than limiting. It should be understood that other aspects can be utilized and structural or logical changes can be made without departing from the concepts of the present disclosure. Therefore, the following detailed description should not be viewed in a limiting sense.

[0156] It should be understood that the features of some embodiments of the various present disclosures described herein may be combined with each other, unless specifically stated otherwise.

[0157] Although terms such as "first", "second" and "third" can be used herein to describe various components, parts, regions, layers or sections, these components, parts, regions, layers or sections are not limited to these terms. On the contrary, these terms are only used to distinguish one component, component, region, layer or section from another component, component, region, layer or section. Therefore, without departing from the teachings of each example, the first component, component, region, layer or section mentioned in the examples described herein may also be referred to as the second component, component, region, layer or section. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may expressly or implicitly include at least one of the features. In the description herein, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0158] In addition, the word "exemplary" is used herein to indicate serving as an example, instance, or diagram. Any aspect or design described as "exemplary" in this article is not necessarily understood to be advantageous compared to other aspects or designs. On the contrary, the use of the word exemplary is intended to present concepts in a specific way. As used herein, the term "or" is intended to represent an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X applies A or B" is intended to represent any one of the natural inclusive arrangements. That is, if X applies A; X applies B; or X applies both A and B, "X applies A or B" is satisfied under any of the aforementioned examples. In addition, unless otherwise specified or clearly pointed to a singular form from the context, the articles "one" and "an" as used in this application and the appended claims are generally understood to mean "one or more".

[0159] Likewise, although the present disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art after reading and understanding the specification and drawings. The present disclosure includes all such modifications and variations and is limited only by the scope of the claims. In particular, with respect to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise indicated, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if the structure is not equivalent to the disclosed structure. In addition, although specific features of the present disclosure may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and beneficial to any given or specific application. In addition, with respect to "including", "having", "having", "having", or variations thereof used in a specific embodiment or claim, such terms are intended to be inclusive in a manner similar to the term "comprising".

[0160] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

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

Claims

1. A system memory cleaning method, It is characterized in that include: When the target system is in an awake state, determining the number of hot starts of the target system according to the type of the awake source; When the target system is in a dormant state, obtaining a number of hot starts of the target system; When the number of hot starts is greater than the first target number and less than the second target number, determining a shutdown delay corresponding to the target timer according to the shutdown time window and the sleep time; When the timing duration of the target timer is equal to the shutdown delay, controlling the target processor of the target system to restart within the shutdown time window; The step of determining the shutdown delay corresponding to the target timer according to the shutdown time window and the sleep time includes: In the case that the sleep time is before the start time of the closest first shutdown time window, determining the time difference between the sleep time and the start time of the first shutdown time window as the shutdown delay corresponding to the target timer; When the sleep time is within the closest first shutdown time window, setting the shutdown delay corresponding to the target timer to 0; When the sleep time is after the end time of the closest first shutdown time window, the time difference between the sleep time and the start time of the second shutdown time window is determined as the shutdown delay corresponding to the target timer, and the second shutdown time window is the next shutdown time window of the first shutdown time window.

2. The system memory cleaning method according to claim 1, It is characterized in that The method further comprises: When the number of hot starts meets a second preset condition, the target system is controlled to be forced to cold start.

3. The system memory cleaning method according to claim 2, It is characterized in that When the number of hot starts meets a second preset condition, controlling the target system to force a cold start includes: When the number of hot starts is greater than the second target number, the target system is controlled to be forced to cold start after a preset time.

4. The system memory cleaning method according to claim 1, It is characterized in that The step of determining the number of hot restarts of the target system according to the type of the wake-up source includes: When the type of the wakeup source is target timer wakeup, the number of hot boot times of the target system is cleared.

5. The system memory cleaning method according to claim 1, It is characterized in that The step of determining the number of hot restarts of the target system according to the type of the wake-up source includes: When the startup mode is a cold startup, and the type of the wakeup source is a non-target timer wakeup and a non-network message wakeup, the number of hot startup times of the target system is cleared.

6. The system memory cleaning method according to claim 1, It is characterized in that The step of determining the number of hot restarts of the target system according to the type of the wake-up source includes: When the startup mode is a cold startup and the type of the wakeup source is a network message wakeup, it is determined that the number of hot startup times of the target system is 1.

7. The system memory cleaning method according to claim 1, It is characterized in that The step of determining the number of hot restarts of the target system according to the type of the wake-up source includes: When the startup mode is hot startup, and the type of the wakeup source is non-target timer wakeup and non-network message wakeup, the number of hot startup times of the target system remains unchanged.

8. The system memory cleaning method according to claim 1, It is characterized in that The step of determining the number of hot restarts of the target system according to the type of the wake-up source includes: When the startup mode is hot startup and the type of the wakeup source is network message wakeup, the hot startup times of the target system are increased by 1.

9. A system memory cleaning device, It is characterized in that include: a determination module configured to determine the number of hot starts of the target system according to the type of the wake-up source when the target system is in the wake-up state; an acquisition module, configured to acquire the number of hot starts of the target system when the target system is in a dormant state; A first determining submodule is configured to determine a shutdown delay corresponding to a target timer according to a shutdown time window and a sleep time when the number of hot starts is greater than a first target number and less than a second target number; A first control submodule is configured to control the target processor of the target system to restart within the shutdown time window when the timing duration of the target timer is equal to the shutdown delay; Wherein, the first determining submodule includes: A first determining unit is configured to determine, when the sleep time is before the start time of the closest first shutdown time window, a time difference between the sleep time and the start time of the first shutdown time window as a shutdown delay corresponding to the target timer; A second determining unit is configured to set the shutdown delay corresponding to the target timer to 0 when the sleep time is within the closest first shutdown time window; The third determination unit is configured to determine the time difference between the sleep time and the start time of the second shutdown time window as the shutdown delay corresponding to the target timer when the sleep time is after the end time of the closest first shutdown time window, and the second shutdown time window is the next shutdown time window of the first shutdown time window.

10. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the steps of the system memory cleaning method described in any one of claims 1 to 8 when executed.

11. A computer readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the steps of the system memory cleaning method described in any one of claims 1 to 8 are implemented.

12. A computer program product, It is characterized in that It includes a computer program, which, when executed by a processor, implements the steps of the system memory cleaning method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Network management anomaly monitoring method and system, vehicle and readable storage medium

    CN112558590A

  • Vehicle-mounted equipment system hot start method, equipment, storage medium and device

    CN115617408A