WO2021077261A1 - Application program management method and apparatus, electronic device, and storage medium - Google Patents

Application program management method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2021077261A1
WO2021077261A1 PCT/CN2019/112319 CN2019112319W WO2021077261A1 WO 2021077261 A1 WO2021077261 A1 WO 2021077261A1 CN 2019112319 W CN2019112319 W CN 2019112319W WO 2021077261 A1 WO2021077261 A1 WO 2021077261A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
application
electronic device
application program
memory
Prior art date
Application number
PCT/CN2019/112319
Other languages
French (fr)
Chinese (zh)
Inventor
王艳明
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201980098911.3A priority Critical patent/CN114174987A/en
Priority to PCT/CN2019/112319 priority patent/WO2021077261A1/en
Publication of WO2021077261A1 publication Critical patent/WO2021077261A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • This application relates to the field of electronic communication technology, and in particular to an application management method and device, electronic equipment, and storage medium.
  • each application When the application is running, each application will occupy a certain amount of memory and store its own data in the memory. With the operation of electronic devices, more and more applications are running, which will occupy more and more memory, and less and less free memory. When the free memory of electronic devices does not meet the memory requirements, the application needs to be The memory occupied by the program is recycled to ensure that the free memory of the electronic device meets the memory requirements.
  • the traditional memory reclamation scheme is to keep the memory occupied by the application currently running in the foreground from being reclaimed, while releasing the memory occupied by other applications. However, such a recycling scheme empties the data loaded by the application in the memory. When the application is opened next time, the data needs to be reloaded, which makes the opening speed of the application slower.
  • the embodiments of the present application provide an application program management method and device, electronic equipment, and storage medium.
  • an embodiment of the present application provides an application management method, which is applied to an electronic device, and the electronic device is configured with multiple application programs.
  • the method includes: obtaining the current environment data of the environment where the electronic device is currently located; obtaining user preference data of each application program.
  • the user preference data is used to indicate the probability that the application program is invoked in the corresponding environment; according to the current environment data and the user
  • the preference data is to determine the application program to be preloaded among multiple applications; and load the startup data of the application program to be preloaded into the memory of the electronic device.
  • an embodiment of the present application provides an application program management apparatus, which is applied to an electronic device, and the electronic device is configured with multiple application programs.
  • the application management device includes an environment data acquisition module, a preference data acquisition module, a preload determination module, and a loading module.
  • the environmental data acquisition module is used to acquire the current environmental data of the current environment of the electronic device;
  • the preference data acquisition module is used to acquire the user preference data of each application, and the user preference data is used to indicate the possibility of the application being called in the corresponding environment
  • the preload determination module is used to determine the application program to be preloaded among multiple applications according to the current environment data and user preference data;
  • the loading module is used to load the startup data of the application program to be preloaded to the electronic device Memory.
  • embodiments of the present application provide an electronic device, including one or more processors, a memory, and one or more application programs, where one or more application programs are stored in the memory and configured to be operated by one or more Multiple processors are executed, and one or more programs are configured to execute the above-mentioned application management method.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores program code, and the program code can be invoked by a processor to execute the above-mentioned application management method.
  • the application management method provided in the embodiments of the present application can flexibly determine the pre-loaded application according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground and is used more frequently. In high environments, it is pre-started in the background, so when a user opens a pre-loaded application, it is not necessary to reload the startup data, which makes the application start relatively fast.
  • FIG. 1 is a schematic diagram of an application scenario of the application management method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of an application management method provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of another application scenario of the application management method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another application management method provided by an embodiment of the present application.
  • Fig. 5 is a schematic diagram of functional modules of an application management apparatus provided by an embodiment of the present application.
  • Fig. 6 is a functional block diagram of an electronic device provided by an embodiment of the present application for executing the application management method of the embodiment of the present application.
  • Fig. 7 is a storage unit provided by an embodiment of the present application for storing or carrying program code for implementing the application management method of the embodiment of the present application.
  • a communication terminal set to communicate through a wireless interface may be referred to as a "wireless communication terminal", a “wireless terminal” and/or an “electronic device”.
  • Examples of electronic equipment and terminals include, but are not limited to, satellites or cellular phones; personal communication system (PCS) terminals that can combine cellular radio phones with data processing, fax, and data communication capabilities; can include radio phones, pagers, and Internet/Intranet PDA with access, web browser, memo pad, calendar, and/or GPS receiver; and conventional laptop and/or handheld receivers, game consoles, or other electronic devices including radio telephone transceivers .
  • PCS personal communication system
  • each application When the application is running, each application will occupy a certain amount of memory and store its own data in the memory. With the operation of electronic devices, there are more and more running applications, which will occupy more and more memory and less and less free memory. When the free memory of the electronic device does not meet the memory requirements, it is necessary to correct The memory occupied by the application program is recycled to ensure that the free memory of the electronic device meets the memory demand.
  • the inventor has conducted a lot of repeated research and found that the protected application can be set by improving the memory recovery rules to ensure that the memory occupied by the protected application is not recovered when the memory is recovered, and the unprotected application is recovered. Occupied memory, which can free up memory, and the protected application will load faster the next time it starts.
  • the inventor further discovered that based on the fixed memory recovery rules, the protected applications are very limited.
  • the above-mentioned memory recovery solution cannot significantly improve the startup speed of the application.
  • many of the multiple applications of electronic devices have been used by users only once or twice before they have never used them again.
  • There are only a few types of programs, and the types of applications most commonly used by different groups of people and the time of use are also different. For example, girls use social applications and shopping applications very frequently every night, while boys use games, The frequency of using news applications in the morning is very high, so every electronic device user will have his or her most frequently used applications and are different from others.
  • the inventor is committed to studying how to manage applications and memory allocation schemes according to the user's use of the application, and based on this, proposes the application management method provided by the embodiments of the present application.
  • the electronic device is preset There are user preference data corresponding to each application.
  • the user preference data reflects the user's usage habits of the application, for example, reflects the distribution of the application frequency over time, or/and, reflects the application frequency in the scene
  • the electronic device can obtain the current environment data of the current environment, and according to the current environment data and user preference data, determine the application that needs to be preloaded among multiple applications, and start the application that needs to be preloaded The data is loaded into the memory of the electronic device.
  • the application management method provided by the embodiments of the present application can flexibly determine the pre-loaded application according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground, but is used frequently In higher scenarios, it is pre-launched in the background, so when the user opens the pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased.
  • FIG. 1 shows a schematic diagram of one of the application scenarios of the application management method provided by an embodiment of the present application.
  • the application management method is applied to the electronic device 100, and the electronic device 100 may be It is not limited to electronic devices such as mobile phones, tablet computers, and game consoles.
  • the electronic device 100 of this embodiment is described by taking a mobile phone as an example.
  • the electronic device 100 is configured with a plurality of application programs.
  • the electronic device 100 is running the application program A in the foreground, and the application program is not running in the background, so as to ensure that the electronic device 100 has sufficient memory resources to maintain the normal operation of the application program A.
  • the environmental data of the electronic device 100 meets the predetermined environmental conditions, the startup data of the application B and the application C are loaded into the memory, that is, the electronic device 100 starts the application B and the application C in the background.
  • the aforementioned predetermined environmental conditions may include environmental factors such as time conditions and scene conditions.
  • the electronic device 100 is preset with user preference data of each application program, and the user preference data is used to indicate the probability that the application program is invoked in the corresponding environment, and the electronic device 100 can be based on the current The environment data and user preference data are determined in the current environment, application B and application C are more likely to be called, and the startup data of application B and application C are loaded into the memory.
  • application A is in the foreground, it is more likely to start application B or application C.
  • application B or application C since both have been started in the background in advance, application B or application C
  • the opening speed is faster.
  • the electronic device 100 can run the application A in the foreground, or it does not need to run any application in the foreground, and is not limited to this embodiment. description.
  • the application management method provided by the embodiment of the present application determines the pre-loaded application according to the current environment of the electronic device and user preference data. Therefore, when the user opens the pre-loaded application, it is not necessary to restart the application. Load the startup data, so that the startup speed of the application can be significantly increased.
  • the process of the method in the embodiment can be automatically run by the electronic device, wherein each step can be performed sequentially in the sequence as in the flowchart when running, or Multiple steps are carried out at the same time according to the actual situation, which is not limited here.
  • the application management method may include steps S101 to S107.
  • Step S101 Acquire current environment data of the environment where the electronic device is currently located.
  • the environmental data may include at least one of time data and scene data.
  • the current point in time of the electronic device can be acquired, and the current point in time can be used as the current environmental data of the environment in which the electronic device is currently located.
  • the time period to which the current time point belongs can also be used as the current environment data to improve the adaptability and fault tolerance of the method, where the time period is a plurality of sections divided according to the time of day.
  • the current scene of the electronic device can be acquired, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located.
  • the environment image and the sound of the current environment determine the current scene of the electronic device.
  • Step S103 Obtain user preference data of each application program.
  • the electronic device is preset with user preference data corresponding to each application.
  • the user preference data reflects the user’s usage habits of the application, for example, reflects the distribution of the application’s frequency of use over time, or/and, reflects the application’s The distribution of frequency of use on the scene. Therefore, the user preference data is used to indicate the probability of the application being invoked in the corresponding environment, which can be expressed as the user preference.
  • the application can be invoked by the user or other applications. The higher the user preference, the greater the possibility of indicating that the application is invoked, the lower the user preference, the less likely the indicating application is invoked, and the user preference can characterize the user’s preference. The degree of preference of the application.
  • the user preference of the application in the current environment is determined according to the active duration of the application in the historical operation of the environment. For example, suppose the current environment data includes time data and the current time point is 9: 10. When the time period is 9:00-10:00, the user preference of the application is determined according to the active duration of the time period of 9:00-10:00 in the historical operation, for example, according to the application’s activity in the last week The active duration of the time period from 9:00 to 10:00 is determined, or according to the active duration of the application from 9:00 to 10:00 in the previous month, etc.
  • Step S105 According to the current environment data and the user preference data, determine the application program that needs to be preloaded among the multiple application programs.
  • the electronic device predicts the application program that the user is most likely to use in the next based on the user preference data determined in step S103. For example, according to the usage frequency and usage time of each application, generally speaking, after the electronic device has finished running the application, the usage time or exit time is recorded in the background file, and each application can be obtained by calling the relevant data through the program. usage time.
  • the above-mentioned applications that need to be pre-loaded are the applications that the electronic device predicts that the user is most likely to use next. In a specific implementation, these applications that need to be pre-loaded can be one or more applications with a frequency of high to low.
  • the application programs that need to be preloaded are comprehensively determined by combining the frequency of use and the time of use, which is not limited in the embodiment of the present application.
  • the electronic device can also estimate the application that the user will use next based on the use time of each application and the current time. For example, the user often uses a game from 7 to 9 in the evening. Software, use a certain video software after nine o'clock, based on this, you can also predict the application that the user may use in a certain period of time.
  • Step S107 Load the startup data of the application program that needs to be preloaded into the memory of the electronic device.
  • the electronic device Based on the application program that needs to be preloaded determined in step S105, the electronic device obtains the startup data of the application program that needs to be preloaded through the network, and loads the startup data into the memory. For example, when the network performance of the electronic device is higher than the preset performance, the startup data of at least one application that needs to be preloaded is obtained from the network side.
  • the electronic device sends a startup data acquisition request to the server corresponding to each application program that needs to be preloaded, and receives startup data returned by the server corresponding to each application program that needs to be preloaded.
  • the pre-loaded application can be flexibly determined according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground, but is used frequently In a higher environment, it is pre-started in the background, so when a user opens a pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased.
  • this embodiment of the present application also provides another application management method.
  • the electronic device is preset with user preference data corresponding to each application, and the user preference data reflects the user’s preference for the application.
  • the usage habits of the program for example, reflect the distribution of the frequency of use of the application over time, or/and, reflect the distribution of the frequency of use of the application in the scene; the electronic device can obtain the current environmental data of the current environment, and according to Current environmental data and user preference data, determine the applications that need to be protected when reclaiming memory and the applications that need to be pre-loaded among multiple applications, and perform the memory recovery operation, and load the startup data of the applications that need to be pre-loaded to The memory of the electronic device.
  • the application management method provided by the embodiments of the present application can flexibly determine the pre-loaded application and the protected application according to the current environment of the electronic device and user preference data, and ensure the protected application when reclaiming the memory.
  • the memory occupied by the application program is not recycled, which ensures that the electronic device has a large free memory while preventing the application program from being stuck; further, by pre-starting the application program that needs to be pre-loaded, the user is opening the pre-loaded application program It is not necessary to reload the startup data, so that the startup speed of the application program can be significantly increased, and therefore, the operating speed of the electronic device is generally improved.
  • the aforementioned another application management method is applied to the scenario shown in FIG. 3.
  • the electronic device 100 is running application A in the foreground, and applications B, C, D, and E are running in the background.
  • the memory utilization rate of the electronic device 100 is relatively high, which may be Will affect the fluency of its system operation.
  • the electronic device 100 can determine that in the current environment, the protected applications are application A and application B according to the current environment data and user preference data, and determine the application F is more likely to be called, then the electronic device 100 performs a memory recovery operation to protect the memory occupied by application A and application B, and recover the memory occupied by other applications, and the electronic device 100 stores the application
  • the startup data of F is loaded into the memory, that is, the electronic device 100 starts the application B and the application F in the background at this time.
  • the electronic device 100 can run the application A in the foreground, or it does not need to run any application in the foreground, and is not limited to this embodiment. description.
  • FIG. 4 another application management method provided by the embodiment of the present application, according to the environment in which the electronic device is located and user preference data, determines the applications that need to be protected and the applications that need to be preloaded when reclaiming the memory, and executes A memory recycling operation is performed, and the startup data of the application program to be preloaded is loaded into the memory of the electronic device. Therefore, when the user opens the pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased.
  • the steps of the application management method in the embodiments of the present application can be executed in a computer system such as a set of computer-executable instructions, and although the logical sequence is shown in the specification, in some cases, Perform the steps shown or described in a different order than here.
  • the application management method may include steps S201 to S211.
  • Step S201 Determine user preference data corresponding to each application program according to the historical running data of each application program.
  • step S201 may include step S2011 to step S2015:
  • Step S2011 Obtain historical operation data of each application program when the electronic device is running.
  • the historical operation data includes active duration and runtime environmental data.
  • the environmental data may include at least one of time data and scene data.
  • the environmental data includes time data
  • the current time point of the electronic device can be obtained, and the time period to which the time point belongs can be determined, and the time period can be used as the current environmental data of the environment where the electronic device is currently located.
  • the time period can be divided into one day in advance.
  • the time period may include a time period corresponding to the morning, a time period corresponding to noon, or a time period corresponding to the evening, and the duration of each time period may be 8 hours.
  • the time period can be determined according to the user's physiological work and rest. The time period during which a certain physiological work and rest behavior occurs can be taken as the time period.
  • the lunch time period can be taken as a time period
  • the dinner time period can be taken as a time period.
  • the sleeping time period as a time period, etc., by this way of determining the time period, the timeliness of the user preference data can be improved. Therefore, the electronic device can have multiple time periods determined according to the rules.
  • the current scene of the electronic device can be acquired, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located.
  • the environment image and the sound of the current environment determine the current scene of the electronic device.
  • Specific scenes can include: public transportation scenes (such as subway, bus, high-speed rail, airplane, etc. scenes), leisure scenes (such as bedroom, living room, garden, etc. scenes), work scenes (such as library, study, office, etc. scenes) Therefore, the electronic device can be built with multiple scenes determined according to the rules.
  • the time period and the scene together define the use environment of the electronic device. For example, if the electronic device is in a bedroom scene in the night time period, it is considered that the bedroom scene in the night time period jointly defines the sleeping environment of the electronic device, so that the subsequent user preference data corresponding to the sleeping environment can be used to determine what needs to be preloaded. Apps and protected apps.
  • the active duration reflects the degree of activity of the application in the environment in the historical operation.
  • the active duration can be understood as the duration of the application running in the foreground.
  • the electronic device can record the active duration: when the application starts to run in the foreground, the electronic device can record the current time point as the start time point of the active duration.
  • the electronic device can record the current time point as the end time point of the active duration, calculate the time difference between the end time point and the start time point, and obtain the active duration of the application running in the foreground this time. For example, when the application starts to run in the foreground at 9:00 and ends at 9:10, the active duration of the recording is 10 minutes.
  • the specific method of counting the active time includes: whenever the electronic device starts to enter any time period, that is, when the current time point is the starting point of the time period, accumulate the active time length of each application from zero, and when leaving the time period, That is, when the current time point is the end point of the time period, the accumulated active duration of each application in the time period is ended, the accumulated active time length of each application in the time period is stored, and the next statistical process is started. Accumulate from scratch, and so on. Among them, for the process of accumulating active duration in each time period, each application can be active one or more times in each time period.
  • the application When the application is active for the first time in each time period, it can start from zero Record the active duration of the application until the application is suspended, and when the application is active for the second time to the Nth time, this time can be increased on the basis of the active duration of the application in the recorded time period Active active duration.
  • the active duration of application A at this time is 5 minutes
  • the electronic device can acquire the time period and the current date to which the current point of time belongs as the recording date, and acquire the application identifier and current scene of the application , Record the corresponding relationship between the active duration, time period, recording date, current scene, and application identifier, so that the active duration can be obtained subsequently according to the corresponding relationship.
  • the electronic device may record "00:00-08:00 (time period), bedroom (scene) December 7th (recording date), APP1 (application program identifier), 50 minutes (active duration)".
  • this step 201 may be executed by the activity management service (Activity Manager Service, AMS) of the electronic device.
  • AMS is the core service of the Android operating system.
  • the program code of AMS can be improved, and program code that counts the active duration of each application running in the foreground can be added to the program code of AMS so that AMS can load and When running the program code, the function of counting the active time can be realized.
  • the electronic device generates operating data of the application program according to the active duration and the current use environment. Each time the application runs, the corresponding running data is generated and saved. Therefore, the historical operating data of the application can be continuously updated during the continuous use of the user, which can facilitate the application management method provided by the embodiment of the present application to obtain the user preference data of the application in a dynamic self-learning manner, even if the user’s The method is still applicable if the behavior changes.
  • Step S2013 When the storage period of the historical operation data of the application program exceeds the predetermined period of time, analyze the historical operation data.
  • the historical data of the application can be obtained.
  • the historical data is stored for a long time (for example, greater than or equal to one week), it can be considered that the user has formed a relatively stable operating habit. Analyze historical operating data to facilitate the acquisition of the user’s operating habits of the application.
  • Step S2014 Determine the user preference data of each application program according to the historical operation data.
  • the user preference data reflects the user's usage habits of the application, for example, reflects the distribution of the frequency of use of the application over time, or/and reflects the distribution of the frequency of use of the application on the scene. Therefore, the user preference data is used to indicate the probability of the application being invoked in the corresponding environment, which can be expressed as the user preference.
  • the application can be invoked by the user or other applications. The higher the user preference, the greater the possibility of indicating that the application is invoked, the lower the user preference, the less likely the indicating application is invoked, and the user preference can characterize the user’s preference.
  • the degree of preference of the application For any application, the user preference of the application in the current environment is determined according to the active duration of the application in the environment in the historical operation.
  • the active duration of a certain application in the current environment as the user preference data of the application (that is, the preference in the environment), or /
  • the ratio between the active duration of the application and the total active duration is used as user preference data, where the total active duration refers to the sum of the active durations of multiple applications corresponding to the environment in the historical operation, thus
  • the accuracy of user preference data statistics can be improved, so that the accuracy of subsequent applications that need to be preloaded based on user preference data can be guaranteed.
  • the historical environment data of the environment in which the electronic device is located during the historical operation of each application, and each The active time of the application in the historical environment data is determined, and the user preference data of each application in the corresponding historical environment can be determined, which can more accurately count the user's personal operating habits, so as to facilitate the subsequent pre-loading of the application according to the user's personal operating habits .
  • step S201 may include: when one of the multiple applications is started and is running When the foreground is running, use it as the foreground application; obtain the environmental data of the environment in which the electronic device is located when the foreground application is running; obtain the active duration of the foreground application corresponding to the environmental data; and determine whether the foreground application is in the corresponding User preference data for historical environments.
  • Step S203 Acquire current environment data of the environment where the electronic device is currently located.
  • the environmental data may include at least one of time data and scene data.
  • For the execution steps of obtaining the current environment data please refer to the data and obtaining means described above.
  • step S203 may include: acquiring the current time point of the electronic device when the electronic device is running; and using the time period to which the current time point belongs as the current environment data of the environment where the electronic device is currently located.
  • the current environment data includes scene data
  • the current scene of the electronic device can be obtained, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located.
  • the environment image and the sound of the current environment determine the current scene of the electronic device.
  • the electronic device may also be equipped with a voice collection device, which is used to collect voice information in the surrounding environment and send the collected voice information to the electronic device.
  • the electronic device can perform feature extraction on the collected voice information, and input the extracted feature information into a pre-trained scene recognition model to obtain a recognition result, where the recognition result may include that the voice information was collected in a certain predetermined scene Probability. Then, the electronic device can compare the probability with the probability threshold to determine whether the probability is greater than the probability threshold. In response to the electronic device determining that the probability is greater than the probability threshold, the electronic device may determine that the current usage scenario of the navigation application is the predetermined scenario.
  • specific predetermined scenes can include: public transportation scenes (such as subway, bus, high-speed rail, airplane, etc. scenes), leisure scenes (such as bedroom, living room, garden, etc. scenes), work scenes (such as library, study, office, etc.) Waiting for the scene).
  • the electronic device can determine the scene in which it is located through the collection of environmental voice and feature recognition.
  • the location information of the electronic device and the environmental voice information, or the location information of the electronic device and the environmental image information may be combined to determine the scene where the electronic device is located.
  • the electronic device is also equipped with a locator and an image acquisition device.
  • the locator is used to locate the electronic device to reduce the scope of subsequent scene determination, thereby improving the accuracy of scene determination.
  • the image collection device can be used to collect image information in the surrounding environment and send the collected image information to the electronic device.
  • the electronic device can perform feature extraction on the collected image information, and input the extracted feature information into a pre-trained scene recognition model to obtain a recognition result, where the recognition result may include that the image information was collected in a certain predetermined scene Probability.
  • the electronic device can compare the probability with the probability threshold to determine whether the probability is greater than the probability threshold.
  • the electronic device may determine that the current usage scenario of the navigation application is the predetermined scenario. Based on this, the electronic device can determine the scene in which it is located by collecting and identifying features of the environment, combined with positioning information.
  • step S203 may include: when the electronic device is running, acquiring the current location information of the electronic device, acquiring the environment image of the environment where the electronic device is currently located through the camera of the electronic device; determining the scene data of the electronic device according to the location information and the environment image ; And according to the scene data, determine the current environment data.
  • Step S205 Obtain user preference data of each application.
  • the electronic device may obtain user preference data corresponding to the current environment data for each application program according to the current environment data. Further, if the current environment changes, for example, the current time period has changed (for example, from the time period of 8:00 to 10:00 to the time period of 10:00 to 12:00), another example is the current time period. If the scene of the application changes (for example, from a leisure scene to a work scene), the user preference data of the application program is obtained again according to the changed current environment data, so that the method of this application can be based on the actual operating state of the electronic device. Changes and user habits are implemented to adapt to different application environments.
  • Step S207 According to the current environment data and the user preference data, determine the application program that needs to be preloaded among the multiple application programs.
  • the electronic device predicts which application the user is most likely to use in the next based on the user's preference data.
  • the above-mentioned applications that need to be pre-loaded are the applications that the electronic device predicts that the user is most likely to use next.
  • these applications that need to be pre-loaded can be one or more applications with a frequency of high to low. It can also be one or more applications whose use time is closest to the current time, that is, the last used application, or one or more applications whose use scene is closest to the current scene.
  • you can The first application programs are comprehensively determined by combining the frequency of use and the time of use, and there is no restriction on this solution.
  • Electronic devices can also estimate the next application that the user will use based on the usage time of each application and the current time. For example, users often use a certain game software from 7 to 9 in the evening, and use a certain game software after 9 o’clock in the evening. Video software can also predict the pre-loaded applications that users may use in a certain period of time.
  • Step S209 Load the startup data of the application program that needs to be preloaded into the memory of the electronic device.
  • step S209 before or after loading the startup data of the application program, the memory of the electronic device may also be recycled to ensure that the electronic device has more free memory, thereby ensuring smoother system operation.
  • step S209 may include: determining applications that do not need to be loaded among multiple applications according to the applications that need to be loaded, and reclaiming the memory occupied by the applications that do not need to be loaded; determining the number of applications that need to be preloaded Boot data; and load the boot data to the memory of the electronic device. Identify the applications that do not need to be loaded among multiple applications; and reclaim the memory occupied by the applications that do not need to be loaded.
  • the application that does not need to be loaded among multiple applications can be determined according to the user preference of the application. For example, an application whose corresponding application preference in the current environment is less than the first preference threshold is determined to be unnecessary. Loaded application.
  • the electronic device can load the startup data of the application program that needs to be preloaded into the memory of the electronic device according to the current environment data (for example, time data, location information, scene information, etc.).
  • the current environment data for example, time data, location information, scene information, etc.
  • the electronic device determines the startup data of the application to be preloaded according to the startup time data and the advance time.
  • the advance time represents the difference between the time point when the startup data is loaded and the startup time data of the application that needs to be preloaded, and it can be any value between 1-10 minutes, such as 5 minutes;
  • the startup data of the application program that needs to be preloaded is loaded into the memory of the electronic device.
  • user preference data shows that a news application is launched more frequently at the time of 19:00, and the start time data of the news application is 19:00, and the advance time is five minutes, then the news application is determined
  • the loading time of the program is 18:55. If the electronic device obtains that the current time is 18:30, and the current time has not arrived, the startup data of the news application will not be loaded, and the startup data of the news application will be loaded until 18:55; if the current time has expired Enter between 18:55 and 19:00, then directly load the startup data of the news application.
  • the electronic device determines the need according to the start location and the distance threshold in the historical operation.
  • the loading geofence of the startup data of the preloaded application wherein, the distance threshold represents the distance between the startup location data and the boundary of the loading geofence, and it can be any value between 1 and 1 km, such as 200 meters;
  • user preference data shows that a certain online car-hailing application is launched more frequently at the exit of a certain subway station, then the starting location data of the online car-hailing application is the exit of the subway station, and the distance threshold is 100 meters, then It is determined that the loaded geofence of the ride-hailing application is a geofence defined by a radius of 100 meters from the exit of the subway station.
  • the electronic device obtains that the current location does not fall into the loading geofence, it does not load the startup data of the ride-hailing application, and waits until the previous location falls into the loading geofence to load the startup data of the ride-hailing application; if it is currently If the location has fallen into the loading geofence, the startup data of the online car-hailing application will be loaded directly.
  • Step S211 Determine a control scheme for multiple application programs according to the free memory of the electronic device.
  • the free memory is determined according to the preset cycle, and the control plan for multiple applications is determined according to the free memory, so as to reclaim the memory according to the preset rules to ensure that the electronic device has sufficient remaining memory to run the application .
  • step S211 may include: when determining the control scheme for multiple applications according to the free memory, when it is detected that the free memory is less than the memory threshold, determining the application running in the background; Determine the application program to be recycled in the application program; and reclaim the memory occupied by the application program to be recycled.
  • the application program to be recycled can be determined according to the user preference of the application program. For example, the application program whose corresponding application preference degree in the current environment is less than the first preference threshold is determined as the application program to be recycled application. In this embodiment, this step can be performed through a direct memory recovery mechanism.
  • the electronic device determines the user preference of each application running in the background, and then determines the application to be recycled, and the application to be recycled Provided to the process requesting the memory, the process requesting the memory transfers the data in the memory of the application to be reclaimed to a preset storage space, so as to reclaim the memory occupied by the application.
  • step S211 may include: when it is detected that the free memory is less than the memory threshold, determining the protected application among multiple applications according to user preference data; Memory is released, and the system resources of the electronic device are preferentially allocated to protected applications.
  • the application to be protected among multiple applications can be determined according to the user preference of the application. For example, an application whose corresponding application preference in the current environment is greater than the second preference threshold is determined to be protected application.
  • the protected application program does not conflict with the above-mentioned application program that needs to be preloaded and the application program running in the foreground, and the application programs contained in the three may overlap.
  • the electronic device after releasing the memory, grants the protected application the privilege of using system resources, and after selecting the protected application information from the application list, the system resource is allocated to the protected application first, thereby It can ensure the fast startup and smooth running of the application programs commonly used by the user in the current environment, and improve the user's experience of using the electronic device.
  • the priority allocation of system resources for the application program may specifically include at least one of the following operations: 1) Priority allocation of the CUP resources of the electronic device to the protected application program, so as to ensure the running speed and stability of the protected application program 2) Prioritize the allocation of continuous free memory to protected applications, reduce the memory recycling and memory swapping when the protected applications apply for memory, improve the efficiency of the application’s use of memory, and ensure the application 3) Keep the pre-loaded items of the application in the memory all the time, including when releasing the memory, the memory resources occupied by the application are not completely released immediately, but the pre-loaded items of the application are saved In the cache, in this way, when the application applies for memory resources next time, it can directly obtain the load data from the cache; 4) Prioritize input/output (IO) resources to the application to reduce the IO waiting time of the application. Reduce the slowness, jams, and pauses in the application.
  • IO input/output
  • the pre-loaded application and the protected application can be flexibly determined according to the current environment of the electronic device and user preference data, and the protected application can be ensured when reclaiming the memory.
  • the memory occupied by the application program is not recycled, which ensures that the electronic device has a large free memory while preventing the application program from being stuck; further, by pre-starting the application program that needs to be pre-loaded, the user is opening the pre-loaded application program It is not necessary to reload the startup data, so that the startup speed of the application program can be significantly increased, and therefore, the operating speed of the electronic device is generally improved.
  • the application management method of the present application may further include: obtaining current environmental data of the environment in which the electronic device is currently located according to a preset period; determining the data change amount of the current environmental data; When the amount is greater than the change threshold, according to the changed current environment data and user preference data, the application program to be preloaded is re-determined, and the re-determined application program to be pre-loaded is loaded. For example, if the current environment data includes location data, when the position change of the electronic device is greater than the change threshold, the application program that needs to be preloaded is determined according to the changed location again, and the newly determined application program that needs to be preloaded is loaded.
  • FIG. 5 shows a structural block diagram of the application management apparatus 200.
  • the application management apparatus 200 runs in the electronic device 100 as shown in FIG. 1 and is used to execute the above-mentioned application management method.
  • the application management apparatus 200 is stored in the memory of the electronic device 100 and is configured to be executed by one or more processors of the electronic device 100.
  • the application management apparatus 200 includes an environment data acquisition module 210, a preference data acquisition module 220, a preload determination module 230, and a loading module 240.
  • each of the above-mentioned modules may be a program module running in a computer-readable storage medium, and the purpose and work of each of the above-mentioned modules are as follows:
  • the environmental data obtaining module 210 is used to obtain current environmental data of the environment where the electronic device is currently located; the preference data obtaining module 220 is used to obtain user preference data of each application program, and the user preference data is used to indicate that the application program is called in the corresponding environment
  • the preload determination module 230 is used to determine the application program that needs to be preloaded among multiple applications according to the current environment data and user preference data; the loading module 240 is used to set the startup data of the application program that needs to be preloaded Loaded into the memory of the electronic device.
  • the application management apparatus 200 further includes a user preference data establishment module 250.
  • the user preference data establishment module 250 is used to determine the user preference data corresponding to each application program according to the historical running data of each application program.
  • the user preference data establishment module 250 is used to obtain historical operating data of each application when the electronic device is running.
  • the historical operating data includes active duration and runtime environmental data; the historical operating data of the application is saved for the duration When the predetermined time period is exceeded, the historical operating data is analyzed; and the user preference data of each application is determined according to the historical operating data.
  • the user preference data establishment module 250 is used to determine each application according to historical environmental data of the environment in which the electronic device is located when each application is historically running, and the active duration of each application in the historical environmental data. User preference data in the corresponding historical environment.
  • the user preference data establishment module 250 is used to use one of the multiple applications as the foreground application when it is started and running in the foreground; to obtain environmental data of the environment in which the electronic device is located when the foreground application is running; Acquire the active duration of the foreground application corresponding to the environmental data; and determine the user preference data of the foreground application in the corresponding historical environment according to the active duration.
  • the user preference data establishing module 250 is used to use the active duration of the foreground application as user preference data; or, to combine the active duration with the active duration
  • the ratio between the sums is used as user preference data, where the sum of active duration refers to the sum of the active durations of multiple applications corresponding to the current environment in the historical operation.
  • the environmental data acquisition module 210 is further configured to acquire the current point in time of the electronic device when the electronic device is running, and use the current point in time as the current environmental data of the environment in which the electronic device is currently located.
  • the loading module 240 is also used to determine the loading time point of the startup data of the application program to be preloaded according to the startup time data and the advance time; wherein the advance time represents the time point of loading the startup data and the application program that needs to be preloaded The difference between the startup time data of the device; and is used to load the application startup data that needs to be preloaded into the memory of the electronic device at the loading time point.
  • the environmental data acquisition module 210 is also used to acquire the current location information of the electronic device when the electronic device is running.
  • the camera of the electronic device obtains the environment image of the environment where the electronic device is currently located, and determines the scene data of the electronic device according to the location information and the environment image; and is used to determine the current environment data according to the scene data.
  • the loading module 240 is further configured to determine the loading geofence of the startup data of the application to be preloaded according to the start location data of the electronic device and the distance threshold, where the distance threshold represents the boundary between the start location data and the loading geofence. When the electronic device enters the geofence, the application startup data that needs to be preloaded is loaded into the memory of the electronic device.
  • the environmental data obtaining module 210 is also configured to obtain current environmental data of the environment where the electronic device is currently located according to a preset period, and determine the data change amount of the current environmental data.
  • the preload determination module 230 is also configured to re-determine the application program to be preloaded according to the changed current environment data and user preference data when the amount of data change is greater than the change threshold.
  • the loading module 240 includes a recycling program determining unit 241, a recycling unit 243, a startup data obtaining unit 245, and a loading unit 247.
  • the recycling program determining unit 241 is used for determining the application programs that do not need to be loaded among multiple applications according to the application programs that need to be loaded; the recycling unit 243 is used for recycling the memory occupied by the application programs that do not need to be loaded; and starting the data acquisition unit 245 is used to determine the startup data of the application program to be preloaded; the loading unit 247 is used to load the startup data into the memory of the electronic device.
  • the application management apparatus 200 further includes a memory management module 250.
  • the memory management module 250 is further configured to determine the free memory of the electronic device according to a preset period, and determine the control of multiple applications according to the free memory. Program.
  • the memory management module 250 when determining a control scheme for multiple applications, is configured to determine the application running in the background when it is detected that the free memory is less than the memory threshold; according to user preference data , Determine the application program to be recycled among multiple applications; and reclaim the memory occupied by the application program to be recycled.
  • the memory management module 250 when determining the control scheme for multiple application programs, is configured to determine that the free memory is less than the memory threshold according to user preference data in multiple application programs.
  • Protected applications release the memory other than the memory occupied by the protected applications; and prioritize the allocation of the system resources of the electronic device to the protected applications.
  • the coupling or direct coupling or communication connection between the displayed or discussed modules may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be electrical, Mechanical or other forms.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • the electronic device 100 can be used as a smart phone terminal.
  • the electronic device 100 usually also includes one or more (only one is shown in FIG. 6) the following components: a processor 102, The memory 104, the shooting module 108, the audio circuit 110, the input module 118, the power module 122, and one or more application programs, of which one or more application programs may be stored in the memory 104 and configured to be composed of one or more
  • the processor 102 executes, and one or more programs are configured to execute the method described in the foregoing method embodiment.
  • the photographing module 108 may include the above-mentioned main control chip 40.
  • the structure shown in FIG. 6 is only for illustration, and does not limit the structure of the electronic device 100.
  • the electronic device 100 may also include more or fewer components than those shown in FIG. 6 or have a different configuration from that shown in FIG. 6.
  • the processor 102 may include one or more processing cores.
  • the processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104.
  • the processor 102 may use at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 102 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs;
  • the GPU is used for rendering and drawing of display content;
  • the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
  • the memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 104 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 104 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the electronic device 100 during use.
  • the photographing module 108 is used to perform photographing tasks, for example, for taking photos, videos, or making video phone calls.
  • the audio circuit 110, the speaker 101, the sound jack 103, and the microphone 105 jointly provide an audio interface between the user and the electronic device 100. Specifically, the audio circuit 110 receives sound data from the processor 102, converts the sound data into electrical signals, and transmits the electrical signals to the speaker 101.
  • the speaker 101 converts electrical signals into sound waves that can be heard by human ears.
  • the audio circuit 110 also receives electrical signals from the microphone 105, converts the electrical signals into sound data, and transmits the sound data to the processor 102 for further processing.
  • the input module 118 may include a touch screen 109 provided on the touch screen 30, and the touch screen 109 may collect user touch operations on or near it (for example, the user uses a finger, a stylus, or any other suitable object or accessory on the touch screen 109). Operation on or near the touch screen 109), and drive the corresponding connection device according to a preset program.
  • the input module 118 may also include other input devices, such as a button 107 or a microphone 105.
  • the keys 107 may include, for example, character keys for inputting characters and control keys for triggering control functions. Examples of control buttons include a "back to main screen" button, a power-on/off button, and so on.
  • the microphone 105 can be used to receive voice commands from the user.
  • the touch screen 30 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device 100. These graphical user interfaces can be composed of graphics, text, icons, numbers, videos, and any combination thereof.
  • the touch screen 109 may be disposed on the touch screen 30 so as to form an integral body with the touch screen 30.
  • the power supply module 122 is used to provide power supply to the processor 102 and other components.
  • the power module 122 may include a power management device, one or more power sources (such as batteries or alternating current), a charging circuit, a power failure detection circuit, an inverter, a power status indicator, and any other electronic components or touch screen 30 Components related to the generation, management and distribution of electricity.
  • the aforementioned electronic device 100 is not limited to a smart phone terminal, and should refer to a computer device that can be used on the move. Specifically, the electronic device 100 refers to a mobile computer device equipped with a smart operating device.
  • the electronic device 100 includes, but is not limited to, a smart phone, a smart watch, a notebook, a tablet computer, a POS machine, and even a vehicle-mounted computer, and so on.
  • FIG. 7 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 800 stores program codes, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium).
  • the computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in a suitable form, for example.
  • a "computer-readable storage medium” can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution device, device, or device or in combination with these instruction execution devices, devices, or devices. .
  • computer-readable storage media include the following: electrical connections (electronic equipment) with one or more wiring, portable computer disk cases (magnetic devices), random access memory (RAM) , Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read-only memory (CDROM)
  • the computer-readable storage medium can even be paper or other suitable media on which the program can be printed, because it can be done, for example, by optically scanning the paper or other media, and then editing, interpreting, or other suitable methods when necessary. Processing is performed to obtain the program electronically and then store it in the computer memory.
  • each part of this application can be implemented by hardware, software, firmware, or a combination thereof.
  • multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device.
  • a suitable instruction execution device For example, if it is implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: Discrete logic circuits, application-specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
  • a person of ordinary skill in the art can understand that all or part of the steps carried in the method of the foregoing embodiments can be implemented by a program instructing relevant hardware to complete.
  • the program can be stored in a computer-readable storage medium, and the program can be executed when the program is executed. , Including one of the steps of the method embodiment or a combination thereof.
  • each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Abstract

The present application relates to an application program management method and apparatus, an electronic device, and a storage medium. The method is applied to an electronic device, and the electronic device is configured with multiple application programs. The method comprises: obtaining current environment data of the environment in which an electronic device is currently located; obtaining user preference data of each application program, the user preference data being used to indicate the magnitude of the possibility of an application program being called in a corresponding environment; according to the current environment data and the user preference data, determining among multiple application programs an application program that requires pre-loading; and loading into a memory of the electronic device start-up data of the application program that requires pre-loading. In the described method, a pre-loaded application program can be flexibly determined according to the environment in which an electronic device is currently located and user preference data such that the pre-loaded application program starts up in the background in advance. Therefore, when a user opens the pre-loaded application program, start-up data does not need to be reloaded, and start-up speed is relatively fast.

Description

应用程序管理方法及装置、电子设备以及存储介质Application program management method and device, electronic equipment and storage medium 技术领域Technical field
本申请涉及电子通信技术领域,具体涉及一种应用程序管理方法及装置、电子设备以及存储介质。This application relates to the field of electronic communication technology, and in particular to an application management method and device, electronic equipment, and storage medium.
背景技术Background technique
随着科技的发展,手机、平板电脑等电子设备在生活中应用的越来越普遍。如今电子设备如手机等的内存和运存的容量越来越大,并且电子设备可以安装的应用程序也越来越多,各种不同类型的应用程序可供不同需求的用户安装在电子设备中并使用。With the development of science and technology, electronic devices such as mobile phones and tablet computers are becoming more and more common in daily life. Nowadays, the memory and storage capacity of electronic devices such as mobile phones are getting larger and larger, and there are more and more applications that can be installed on electronic devices. Various types of applications can be installed in electronic devices for users with different needs. And use.
在应用程序运行时,每个应用程序会占用一定的内存,并在内存中存储自身的数据。随着电子设备的运行,运行中的应用程序越来越多,占用的内存会越来越多,空闲内存会越来越少,当电子设备空闲内存不满足内存需求的情况时,需要对应用程序占用的内存进行回收,以保证电子设备的空闲内存满足内存需求。传统的内存回收方案,是保留当前前台运行的应用程序所占用的内存不被回收,而释放其他应用程序占用的内存。然而,这样的回收方案,清空了应用程序加载在内存中的数据,应用程序在下一次打开时,需要重新加载数据,这就使得应用程序的打开速度较慢。When the application is running, each application will occupy a certain amount of memory and store its own data in the memory. With the operation of electronic devices, more and more applications are running, which will occupy more and more memory, and less and less free memory. When the free memory of electronic devices does not meet the memory requirements, the application needs to be The memory occupied by the program is recycled to ensure that the free memory of the electronic device meets the memory requirements. The traditional memory reclamation scheme is to keep the memory occupied by the application currently running in the foreground from being reclaimed, while releasing the memory occupied by other applications. However, such a recycling scheme empties the data loaded by the application in the memory. When the application is opened next time, the data needs to be reloaded, which makes the opening speed of the application slower.
发明内容Summary of the invention
本申请实施例提供一种应用程序管理方法及装置、电子设备以及存储介质。The embodiments of the present application provide an application program management method and device, electronic equipment, and storage medium.
第一方面,本申请实施例提供一种应用程序管理方法,应用于电子设备,电子设备配置有多个应用程序。方法包括:获取电子设备当前所处环境的当前环境数据;获取每个应用程序的用户偏好数据,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小;根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序;以及将需预加载的应用程序的启动数据加载至电子设备的内存。In the first aspect, an embodiment of the present application provides an application management method, which is applied to an electronic device, and the electronic device is configured with multiple application programs. The method includes: obtaining the current environment data of the environment where the electronic device is currently located; obtaining user preference data of each application program. The user preference data is used to indicate the probability that the application program is invoked in the corresponding environment; according to the current environment data and the user The preference data is to determine the application program to be preloaded among multiple applications; and load the startup data of the application program to be preloaded into the memory of the electronic device.
第二方面,本申请实施例提供一种应用程序管理装置,应用于电子设备,电子设备配置有多个应用程序。应用程序管理装置包括环境数据获取模块、偏好数据获取模块、预加载确定模块以及加载模块。环境数据获取模块用于获取电子设备当前所处环境的当前环境数据;偏好数据获取模块用于获取每个应用程序的用户偏好数据,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小;预加载确定模块用于根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序;加载模块用于将需预加载的应用程序的启动数据加载至电子设备的内存。In the second aspect, an embodiment of the present application provides an application program management apparatus, which is applied to an electronic device, and the electronic device is configured with multiple application programs. The application management device includes an environment data acquisition module, a preference data acquisition module, a preload determination module, and a loading module. The environmental data acquisition module is used to acquire the current environmental data of the current environment of the electronic device; the preference data acquisition module is used to acquire the user preference data of each application, and the user preference data is used to indicate the possibility of the application being called in the corresponding environment The preload determination module is used to determine the application program to be preloaded among multiple applications according to the current environment data and user preference data; the loading module is used to load the startup data of the application program to be preloaded to the electronic device Memory.
第三方面,本申请实施例提供一种电子设备,包括一个或多个处理器、存储器以及一个或多个应用程序,其中一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个程序配置用于执行上述的应用程序管理方法。In a third aspect, embodiments of the present application provide an electronic device, including one or more processors, a memory, and one or more application programs, where one or more application programs are stored in the memory and configured to be operated by one or more Multiple processors are executed, and one or more programs are configured to execute the above-mentioned application management method.
第四方面,本申请实施例提供一种计算机可读存储介质,其特征在于,计算机可读存储介质中存储有程序代码,程序代码可被处理器调用执行上述的应用程序管理方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores program code, and the program code can be invoked by a processor to execute the above-mentioned application management method.
在本申请实施例提供的应用程序管理方法,能够灵活地根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序,即使该应用程序并未在前台执行,而在使用频率较高的环境中预先在后台 启动,因此用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度相对较快。The application management method provided in the embodiments of the present application can flexibly determine the pre-loaded application according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground and is used more frequently. In high environments, it is pre-started in the background, so when a user opens a pre-loaded application, it is not necessary to reload the startup data, which makes the application start relatively fast.
附图说明Description of the drawings
为了更清楚地说明申请的技术方案,下面将对实施方式中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solution of the application more clearly, the following will briefly introduce the drawings that need to be used in the embodiments. Obviously, the drawings in the following description are only some of the embodiments of the application. For those of ordinary skill in the art In other words, other drawings can be obtained based on these drawings without creative work.
图1是本申请实施例提供的应用程序管理方法的一种应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of the application management method provided by an embodiment of the present application.
图2是本申请实施例提供的应用程序管理方法的一种流程示意图。FIG. 2 is a schematic flowchart of an application management method provided by an embodiment of the present application.
图3是本申请实施例提供的应用程序管理方法的另一种应用场景示意图。Fig. 3 is a schematic diagram of another application scenario of the application management method provided by an embodiment of the present application.
图4是本申请实施例提供的应用程序管理方法的另一种流程示意图。FIG. 4 is a schematic flowchart of another application management method provided by an embodiment of the present application.
图5是本申请实施例提供的应用程序管理装置的功能模块示意图。Fig. 5 is a schematic diagram of functional modules of an application management apparatus provided by an embodiment of the present application.
图6是本申请实施例提供的用于执行本申请实施例的应用程序管理方法的电子设备的功能框图。Fig. 6 is a functional block diagram of an electronic device provided by an embodiment of the present application for executing the application management method of the embodiment of the present application.
图7是本申请实施例提供的用于保存或者携带实现本申请实施例的应用程序管理方法的程序代码的存储单元。Fig. 7 is a storage unit provided by an embodiment of the present application for storing or carrying program code for implementing the application management method of the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of this application.
作为在本申请实施例中使用的“通信终端”(或简称为“终端”)、“电子设备”包括,但不限于被设置成经由有线线路连接(如经由公共交换电话网络(PSTN)、数字用户线路(DSL)、数字电缆、直接电缆连接,以及/或另一数据连接/网络)和/或经由(例如,针对蜂窝网络、无线局域网(WLAN)、诸如DVB-H网络的数字电视网络、卫星网络、AM-FM广播发送器,以及/或另一通信终端的)无线接口接收/发送通信信号的装置。被设置成通过无线接口通信的通信终端可以被称为“无线通信终端”、“无线终端”以及/或“电子设备”。电子设备、终端的示例包括但不限于包括卫星或蜂窝电话;可以组合蜂窝无线电电话与数据处理、传真以及数据通信能力的个人通信系统(PCS)终端;可以包括无线电电话、寻呼机、因特网/内联网接入、Web浏览器、记事簿、日历以及/或全球定位系统(GPS)接收器的PDA;以及常规膝上型和/或掌上型接收器、游戏机或包括无线电电话收发器的其它电子装置。下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。As the "communication terminal" (or simply "terminal") and "electronic equipment" used in the embodiments of this application, include, but are not limited to, set to be connected via wired lines (such as via the public switched telephone network (PSTN), digital Subscriber line (DSL), digital cable, direct cable connection, and/or another data connection/network) and/or via (for example, for cellular networks, wireless local area networks (WLAN), digital television networks such as DVB-H networks, Satellite network, AM-FM broadcast transmitter, and/or another communication terminal's wireless interface to receive/transmit communication signals. A communication terminal set to communicate through a wireless interface may be referred to as a "wireless communication terminal", a "wireless terminal" and/or an "electronic device". Examples of electronic equipment and terminals include, but are not limited to, satellites or cellular phones; personal communication system (PCS) terminals that can combine cellular radio phones with data processing, fax, and data communication capabilities; can include radio phones, pagers, and Internet/Intranet PDA with access, web browser, memo pad, calendar, and/or GPS receiver; and conventional laptop and/or handheld receivers, game consoles, or other electronic devices including radio telephone transceivers . The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
如今电子设备如手机等的内存和运存的容量越来越大,并且电子设备可以安装的应用程序也越来越多,各种不同类型的应用程序可供不同需求的用户安装在电子设备中并使用。Nowadays, the memory and storage capacity of electronic devices such as mobile phones are getting larger and larger, and there are more and more applications that can be installed on electronic devices. Various types of applications can be installed in electronic devices for users with different needs. And use.
在应用程序运行时,每个应用程序会占用一定的内存,并在内存中存储自身的数据。随着电子设备的运行,运行中的应用程序越来越多,占用的内存会越来越多,空闲内存会越来越少,当终电子设备空闲内存不满足内存需求的情况时,需要对应用程序占用的内存进行回收,以保证电子设备的空闲内存满足内存需求。When the application is running, each application will occupy a certain amount of memory and store its own data in the memory. With the operation of electronic devices, there are more and more running applications, which will occupy more and more memory and less and less free memory. When the free memory of the electronic device does not meet the memory requirements, it is necessary to correct The memory occupied by the application program is recycled to ensure that the free memory of the electronic device meets the memory demand.
很多电子设备用户可能在电子设备上安装了几十个甚至上百个应用程序,这么多应用程序,,传统的 内存回收方案,是保留当前前台运行的应用程序所占用的内存不被回收,而释放其他应用程序占用的内存,如此能够保证前台应用程序的流畅运行。然而,发明人发现,这样的回收方案清空了应用程序加载在内存中的数据,其他的应用程序在下一次打开时,需要重新加载数据,这就使得应用程序的打开速度较慢。Many users of electronic devices may have installed dozens or even hundreds of applications on their electronic devices. With so many applications, the traditional memory recycling scheme keeps the memory occupied by the applications currently running in the foreground from being recycled. Releasing the memory occupied by other applications, so as to ensure the smooth running of foreground applications. However, the inventor found that such a recycling scheme emptied the data loaded in the memory by the application, and other applications need to reload the data the next time they are opened, which makes the opening speed of the application slower.
发明人基于该问题进行大量反复的研究,发现可以通过改进内存回收规则设置受保护的应用程序,确保回收内存时受保护的应用程序占用的内存不被回收,而回收不被保护的应用程序所占用的内存,这样能够释放内存,且受保护的应用程序在下一次启动时加载速度较快。Based on this problem, the inventor has conducted a lot of repeated research and found that the protected application can be set by improving the memory recovery rules to ensure that the memory occupied by the protected application is not recovered when the memory is recovered, and the unprotected application is recovered. Occupied memory, which can free up memory, and the protected application will load faster the next time it starts.
然而,发明人进一步地发现,基于固定的内存回收规则,受保护的应用程序非常有限,当用户习惯操作发生变化时,上述的内存回收方案无法显著提高应用程序的启动速度。例如,电子设备的多个应用程序中很多应用程序用户只是使用了一、两次就再也没有使用过了,其实用户每天最常使用的应用程序也只有很少一部分,并且最常使用的应用程序种类也只有几类,而且不同人群最常使用的应用程序类型、使用时间也不同,例如女生每天晚上使用社交类应用程序和购物类应用程序的频率非常高,而男生每天晚上使用游戏类、早上使用新闻类应用程序的频率非常高,所以每个电子设备用户都会有自己最常使用的应用程序并且与其他人的不尽相同。However, the inventor further discovered that based on the fixed memory recovery rules, the protected applications are very limited. When the user's habitual operation changes, the above-mentioned memory recovery solution cannot significantly improve the startup speed of the application. For example, many of the multiple applications of electronic devices have been used by users only once or twice before they have never used them again. In fact, there are only a few applications that users use most often every day, and they are the most frequently used applications. There are only a few types of programs, and the types of applications most commonly used by different groups of people and the time of use are also different. For example, girls use social applications and shopping applications very frequently every night, while boys use games, The frequency of using news applications in the morning is very high, so every electronic device user will have his or her most frequently used applications and are different from others.
既然每个用户都有自己最常使用的应用程序,那么用户一定很关心这些常用应用程序的使用体验,尤其希望这些应用程序的启动时间非常短。因此发明人致力于研究如何根据用户对应用程序的使用状况来管理应用程序以及内存分配方案,并基于此提出了本申请实施例所提供的应用程序管理方法,在该方法中,电子设备预置有每个应用程序对应的用户偏好数据,用户偏好数据反应了用户对应用程序的使用习惯,比如,反应应用程序的使用频率在时间上的分布,或/及,反应应用程序的使用频率在场景上的分布;电子设备能够获取当前所处环境的当前环境数据,并根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序,将需预加载的应用程序的启动数据加载至电子设备的内存。因此,本申请实施例提供的应用程序管理方法,能够灵活地根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序,即使该应用程序并未在前台执行,而在使用频率较高的场景中预先在后台启动,因此用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快。Since each user has his or her most frequently used application, the user must be very concerned about the experience of these commonly used applications, and especially hope that the startup time of these applications is very short. Therefore, the inventor is committed to studying how to manage applications and memory allocation schemes according to the user's use of the application, and based on this, proposes the application management method provided by the embodiments of the present application. In this method, the electronic device is preset There are user preference data corresponding to each application. The user preference data reflects the user's usage habits of the application, for example, reflects the distribution of the application frequency over time, or/and, reflects the application frequency in the scene The electronic device can obtain the current environment data of the current environment, and according to the current environment data and user preference data, determine the application that needs to be preloaded among multiple applications, and start the application that needs to be preloaded The data is loaded into the memory of the electronic device. Therefore, the application management method provided by the embodiments of the present application can flexibly determine the pre-loaded application according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground, but is used frequently In higher scenarios, it is pre-launched in the background, so when the user opens the pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased.
在具体的应用中,请参阅图1,图1示出了本申请实施例提供的应用程序管理方法的其中一个应用场景示意图,该应用程序管理方法应用于电子设备100,电子设备100可以为但不限于为手机、平板电脑、游戏机等电子装置。本实施方式的电子设备100以手机为例进行说明。In a specific application, please refer to FIG. 1. FIG. 1 shows a schematic diagram of one of the application scenarios of the application management method provided by an embodiment of the present application. The application management method is applied to the electronic device 100, and the electronic device 100 may be It is not limited to electronic devices such as mobile phones, tablet computers, and game consoles. The electronic device 100 of this embodiment is described by taking a mobile phone as an example.
电子设备100配置有多个应用程序。在图1中所示的应用场景中,电子设备100正在前台运行应用程序A,在后台并未运行应用程序,以保证电子设备100具有足够的内存资源维持应用程序A的正常运行。当电子设备100所处的环境数据满足预定的环境条件时,应用程序B以及应用程序C的启动数据被加载至内存中,也即,电子设备100在后台启动应用程序B以及应用程序C。上述预定的环境条件可以包括时间条件、场景条件等环境因素。The electronic device 100 is configured with a plurality of application programs. In the application scenario shown in FIG. 1, the electronic device 100 is running the application program A in the foreground, and the application program is not running in the background, so as to ensure that the electronic device 100 has sufficient memory resources to maintain the normal operation of the application program A. When the environmental data of the electronic device 100 meets the predetermined environmental conditions, the startup data of the application B and the application C are loaded into the memory, that is, the electronic device 100 starts the application B and the application C in the background. The aforementioned predetermined environmental conditions may include environmental factors such as time conditions and scene conditions.
例如,在一些实施例中,电子设备100内预置有每个应用程序的用户偏好数据,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小,则电子设备100能够根据当前的环境数据以及用户偏好数据,确定在当前环境下,应用程序B以及应用程序C被调用的可能性较大,并将应用程序B以及应用程序C的启动数据加载至内存中,当用户在退出前台应用程序A时,有较大可能性去启动应用程序B或应用程序C,那么用户启动应用程序B或应用程序C时,由于二者已经被预先在后台启动,应用程序B或 应用程序C打开的速度较快。根据上述的应用场景可以理解的是,上述的应用程序管理方法在执行时,电子设备100可以于前台运行应用程序A,也可以不必在前台运行任何应用程序,并不受限于本实施例所描述。For example, in some embodiments, the electronic device 100 is preset with user preference data of each application program, and the user preference data is used to indicate the probability that the application program is invoked in the corresponding environment, and the electronic device 100 can be based on the current The environment data and user preference data are determined in the current environment, application B and application C are more likely to be called, and the startup data of application B and application C are loaded into the memory. When the user exits When application A is in the foreground, it is more likely to start application B or application C. Then when the user starts application B or application C, since both have been started in the background in advance, application B or application C The opening speed is faster. According to the above application scenario, it can be understood that when the above application management method is executed, the electronic device 100 can run the application A in the foreground, or it does not need to run any application in the foreground, and is not limited to this embodiment. description.
请参阅图2,本申请实施例提供的应用程序管理方法,根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序,因此用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快。本申请实施例提供的应用程序管理方法一旦被触发,则实施例中方法的流程可以通过电子设备自动运行,其中,各个步骤在运行的时候可以是按照如流程图中的顺序先后进行,也可以是根据实际情况多个步骤同时进行,在此并不做限定。该应用程序管理方法可以包括步骤S101~S107。Please refer to FIG. 2. The application management method provided by the embodiment of the present application determines the pre-loaded application according to the current environment of the electronic device and user preference data. Therefore, when the user opens the pre-loaded application, it is not necessary to restart the application. Load the startup data, so that the startup speed of the application can be significantly increased. Once the application management method provided in the embodiment of the present application is triggered, the process of the method in the embodiment can be automatically run by the electronic device, wherein each step can be performed sequentially in the sequence as in the flowchart when running, or Multiple steps are carried out at the same time according to the actual situation, which is not limited here. The application management method may include steps S101 to S107.
步骤S101:获取电子设备当前所处环境的当前环境数据。Step S101: Acquire current environment data of the environment where the electronic device is currently located.
环境数据可以包括时间数据、场景数据中的至少一种。The environmental data may include at least one of time data and scene data.
例如,环境数据包括时间数据,则可以获取电子设备的当前时间点,并将该当前时间点作为所述电子设备当前所处环境的当前环境数据。可选地,也可以将当前时间点所属的时间段作为当前环境数据,以提高该方法的是适配性和容错率,其中,时间段为根据一天时间划分出的多个区段。For example, if the environmental data includes time data, the current point in time of the electronic device can be acquired, and the current point in time can be used as the current environmental data of the environment in which the electronic device is currently located. Optionally, the time period to which the current time point belongs can also be used as the current environment data to improve the adaptability and fault tolerance of the method, where the time period is a plurality of sections divided according to the time of day.
又如,环境数据包括场景数据,则可以获取电子设备的当前场景,并将该当前场景作为电子设备当前所处环境的当前环境数据,其中,可以根据电子设备当前的位置信息、当前所处环境的环境图像以及当前所处环境的声音确定电子设备的当前场景。For another example, if the environment data includes scene data, the current scene of the electronic device can be acquired, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located. The environment image and the sound of the current environment determine the current scene of the electronic device.
步骤S103:获取每个应用程序的用户偏好数据。Step S103: Obtain user preference data of each application program.
电子设备预置有每个应用程序对应的用户偏好数据,用户偏好数据反应了用户对应用程序的使用习惯,比如,反应应用程序的使用频率在时间上的分布,或/及,反应应用程序的使用频率在场景上的分布。因此,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小,其可以表现为用户偏好度。应用程序可以由用户或者其他应用程序调用,用户偏好度越高,指示应用被调用的可能性越大,用户偏好度越低,指示应用被调用的可能性越小,用户偏好度能够表征用户对应用程序的偏好程度。对于任一应用程序来说,该应用程序在当前环境的用户偏好度根据应用程序在历史运行中该环境下的活跃时长确定,例如,假设当前环境数据包括时间数据,且当前时间点为9:10,所属的时间段为9:00-10:00,则应用程序的用户偏好度根据历史运行中9:00-10:00这一时间段的活跃时长确定,例如根据应用程序在上周的9:00-10:00这一时间段的活跃时长确定,或者根据应用程序在上个月9:00-10:00的活跃时长确定等。The electronic device is preset with user preference data corresponding to each application. The user preference data reflects the user’s usage habits of the application, for example, reflects the distribution of the application’s frequency of use over time, or/and, reflects the application’s The distribution of frequency of use on the scene. Therefore, the user preference data is used to indicate the probability of the application being invoked in the corresponding environment, which can be expressed as the user preference. The application can be invoked by the user or other applications. The higher the user preference, the greater the possibility of indicating that the application is invoked, the lower the user preference, the less likely the indicating application is invoked, and the user preference can characterize the user’s preference. The degree of preference of the application. For any application, the user preference of the application in the current environment is determined according to the active duration of the application in the historical operation of the environment. For example, suppose the current environment data includes time data and the current time point is 9: 10. When the time period is 9:00-10:00, the user preference of the application is determined according to the active duration of the time period of 9:00-10:00 in the historical operation, for example, according to the application’s activity in the last week The active duration of the time period from 9:00 to 10:00 is determined, or according to the active duration of the application from 9:00 to 10:00 in the previous month, etc.
步骤S105:根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序。Step S105: According to the current environment data and the user preference data, determine the application program that needs to be preloaded among the multiple application programs.
在本步骤中,电子设备根据步骤S103中确定的用户偏好数据,预测出用户在接下来最有可能使用的应用程序。例如,根据每个应用程序的使用频率和使用时间,一般来说电子设备在运行完应用程序后,后台文件中均记录了使用时间或者退出时间,通过程序调用相关数据即可得到每个应用程序使用时间。上述的需预加载的应用程序为电子设备预测的接下来用户最有可能使用的应用程序,一种具体实现方式中,这些需预加载的应用程序可以是使用频率从高到低的一个或多个应用程序,也可以是使用时间最接近当前时间的一个或几个应用程序,即上次使用的应用程序,也可以是使用场景最接近当前场景的一个或多个应用程序,此外,还可以结合使用频率和使用时间综合确定得到该些需预加载应用程序,本申请实施例对此不做限制。In this step, the electronic device predicts the application program that the user is most likely to use in the next based on the user preference data determined in step S103. For example, according to the usage frequency and usage time of each application, generally speaking, after the electronic device has finished running the application, the usage time or exit time is recorded in the background file, and each application can be obtained by calling the relevant data through the program. usage time. The above-mentioned applications that need to be pre-loaded are the applications that the electronic device predicts that the user is most likely to use next. In a specific implementation, these applications that need to be pre-loaded can be one or more applications with a frequency of high to low. It can also be one or more applications whose use time is closest to the current time, that is, the last used application, or one or more applications whose use scene is closest to the current scene. In addition, you can The application programs that need to be preloaded are comprehensively determined by combining the frequency of use and the time of use, which is not limited in the embodiment of the present application.
可选地,除了上述方式,电子设备也可以根据每个应用程序的使用时间,以及当前时间,预估用户接下来要使用的应用程序,例如:用户经常在晚上七点到九点使用某游戏软件,在九点之后使用某视频软件,据此也可以预测用户在某段时间可能使用的应用程序。Optionally, in addition to the above method, the electronic device can also estimate the application that the user will use next based on the use time of each application and the current time. For example, the user often uses a game from 7 to 9 in the evening. Software, use a certain video software after nine o'clock, based on this, you can also predict the application that the user may use in a certain period of time.
步骤S107:将需预加载的应用程序的启动数据加载至电子设备的内存。Step S107: Load the startup data of the application program that needs to be preloaded into the memory of the electronic device.
基于步骤S105确定的需预加载的应用程序,电子设备通过网络获取需预加载的应用程序的启动数据,并将该启动数据加载至内存中。例如,在电子设备的网络性能高于预设性能时,从网络侧获取至少一个需预加载应用程序的启动数据。其中,电子设备向每个需预加载的应用程序对应的服务器发送启动数据获取请求,并接收每个需预加载的用程序对应的服务器返回的启动数据。Based on the application program that needs to be preloaded determined in step S105, the electronic device obtains the startup data of the application program that needs to be preloaded through the network, and loads the startup data into the memory. For example, when the network performance of the electronic device is higher than the preset performance, the startup data of at least one application that needs to be preloaded is obtained from the network side. The electronic device sends a startup data acquisition request to the server corresponding to each application program that needs to be preloaded, and receives startup data returned by the server corresponding to each application program that needs to be preloaded.
在本申请实施例提供的应用程序管理方法中,能够灵活地根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序,即使该应用程序并未在前台执行,而在使用频率较高的环境中预先在后台启动,因此用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快。In the application management method provided by the embodiments of the present application, the pre-loaded application can be flexibly determined according to the current environment of the electronic device and user preference data, even if the application is not executed in the foreground, but is used frequently In a higher environment, it is pre-started in the background, so when a user opens a pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased.
基于上述的应用程序管理方法,本申请实施例还提供另一种应用程序管理方法,在该方法中,电子设备预置有每个应用程序对应的用户偏好数据,用户偏好数据反应了用户对应用程序的使用习惯,比如,反应应用程序的使用频率在时间上的分布,或/及,反应应用程序的使用频率在场景上的分布;电子设备能够获取当前所处环境的当前环境数据,并根据当前环境数据以及用户偏好数据,在多个应用程序中确定回收内存时需保护的应用程序以及需预加载的应用程序,并执行内存回收操作,且将需预加载的应用程序的启动数据加载至电子设备的内存。因此,本申请实施例提供的应用程序管理方法,能够灵活地根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序和受保护的应用程序,在回收内存时确保受保护的应用程序占用的内存不被回收,保证了电子设备有较大的空闲内存的同时,避免应用程序发生卡顿;进一步地,通过预先启动需预加载的应用程序,用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快,因此从总体上提高了电子设备运行的速度。Based on the above-mentioned application management method, this embodiment of the present application also provides another application management method. In this method, the electronic device is preset with user preference data corresponding to each application, and the user preference data reflects the user’s preference for the application. The usage habits of the program, for example, reflect the distribution of the frequency of use of the application over time, or/and, reflect the distribution of the frequency of use of the application in the scene; the electronic device can obtain the current environmental data of the current environment, and according to Current environmental data and user preference data, determine the applications that need to be protected when reclaiming memory and the applications that need to be pre-loaded among multiple applications, and perform the memory recovery operation, and load the startup data of the applications that need to be pre-loaded to The memory of the electronic device. Therefore, the application management method provided by the embodiments of the present application can flexibly determine the pre-loaded application and the protected application according to the current environment of the electronic device and user preference data, and ensure the protected application when reclaiming the memory. The memory occupied by the application program is not recycled, which ensures that the electronic device has a large free memory while preventing the application program from being stuck; further, by pre-starting the application program that needs to be pre-loaded, the user is opening the pre-loaded application program It is not necessary to reload the startup data, so that the startup speed of the application program can be significantly increased, and therefore, the operating speed of the electronic device is generally improved.
请参阅图3,在具体的应用中,前述的另一种应用程序管理方法应用于图3所示的场景中。在图3中所示的应用场景中,电子设备100正在前台运行应用程序A,在后台运行了应用程序B、C、D、E,此时,电子设备100的内存利用率较大,有可能会影响其系统运行的流畅性。当电子设备100的空余内存小于内存阈值时,电子设备100能够根据当前的环境数据以及用户偏好数据,确定在当前环境下,受保护的应用程序为应用程序A以及应用程序B,并确定应用程序F被调用的可能性较大,则电子设备100执行内存回收操作,将应用程序A以及应用程序B占用的内存保护起来,并回收其他应用程序所占用的内存,且在电子设备100将应用程序F的启动数据被加载至内存中,也即,电子设备100此时在后台启动应用程序B以及应用程序F。根据上述的应用场景可以理解的是,上述的应用程序管理方法在执行时,电子设备100可以于前台运行应用程序A,也可以不必在前台运行任何应用程序,并不受限于本实施例所描述。Referring to FIG. 3, in a specific application, the aforementioned another application management method is applied to the scenario shown in FIG. 3. In the application scenario shown in FIG. 3, the electronic device 100 is running application A in the foreground, and applications B, C, D, and E are running in the background. At this time, the memory utilization rate of the electronic device 100 is relatively high, which may be Will affect the fluency of its system operation. When the free memory of the electronic device 100 is less than the memory threshold, the electronic device 100 can determine that in the current environment, the protected applications are application A and application B according to the current environment data and user preference data, and determine the application F is more likely to be called, then the electronic device 100 performs a memory recovery operation to protect the memory occupied by application A and application B, and recover the memory occupied by other applications, and the electronic device 100 stores the application The startup data of F is loaded into the memory, that is, the electronic device 100 starts the application B and the application F in the background at this time. According to the above application scenario, it can be understood that when the above application management method is executed, the electronic device 100 can run the application A in the foreground, or it does not need to run any application in the foreground, and is not limited to this embodiment. description.
请参阅图4,本申请实施例提供的另一种应用程序管理方法,根据电子设备所处的环境以及用户偏好数据,确定回收内存时需保护的应用程序以及需预加载的应用程序,并执行内存回收操作,且将需预加载的应用程序的启动数据加载至电子设备的内存。因此用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快。需要说明的是,本申请实施例的应用程序管理方法步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在说明书中示出了逻辑顺序,但是在 某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。在本实施例中,应用程序管理方法可以包括步骤S201~S211。Please refer to FIG. 4, another application management method provided by the embodiment of the present application, according to the environment in which the electronic device is located and user preference data, determines the applications that need to be protected and the applications that need to be preloaded when reclaiming the memory, and executes A memory recycling operation is performed, and the startup data of the application program to be preloaded is loaded into the memory of the electronic device. Therefore, when the user opens the pre-loaded application, it is not necessary to reload the startup data, so that the startup speed of the application can be significantly increased. It should be noted that the steps of the application management method in the embodiments of the present application can be executed in a computer system such as a set of computer-executable instructions, and although the logical sequence is shown in the specification, in some cases, Perform the steps shown or described in a different order than here. In this embodiment, the application management method may include steps S201 to S211.
步骤S201:根据每个应用程序的历史运行数据,确定每个应用程序对应的用户偏好数据。Step S201: Determine user preference data corresponding to each application program according to the historical running data of each application program.
电子设备可以基于每个应用程序的运行状态,生成其运行数据,并根据应用程序的多次运行数据,确定每个应用程序对应的用户偏好数据,以便于学习、总结、归纳用户的行为习惯。在一些实施例中,步骤S201可以包括步骤S2011~步骤S2015:The electronic device can generate operating data for each application based on its operating status, and determine the user preference data corresponding to each application based on the multiple operating data of the application, so as to facilitate learning, summarizing, and summarizing the user's behavior habits. In some embodiments, step S201 may include step S2011 to step S2015:
步骤S2011:在电子设备运行时,获取每个应用程序的历史运行数据,历史运行数据包括活跃时长以及运行时的环境数据。Step S2011: Obtain historical operation data of each application program when the electronic device is running. The historical operation data includes active duration and runtime environmental data.
环境数据可以包括时间数据、场景数据中的至少一种。The environmental data may include at least one of time data and scene data.
例如,环境数据包括时间数据,则可以获取电子设备的当前时间点,并确定该时间点所属的时间段,并将该时间段作为电子设备当前所处环境的当前环境数据。其中,时间段可以预先对一天划分得到,例如时间段可以包括早上对应的时间段、中午对应的时间段或晚上对应的时间段,每个时间段的时长可以为8小时。可选地,时间段可以根据用户的生理作息确定,可以将发生某一生理作息行为的时间段作为时间段,例如,可以将午饭时间段作为一个时间段,将晚饭时间段作为一个时间段,将临睡时间段作为一个时间段等等,通过这种确定时间段的方式,可以提高用户偏好数据的时效性。因此电子设备可以内置有根据规则所确定的多个时间段。For example, if the environmental data includes time data, the current time point of the electronic device can be obtained, and the time period to which the time point belongs can be determined, and the time period can be used as the current environmental data of the environment where the electronic device is currently located. The time period can be divided into one day in advance. For example, the time period may include a time period corresponding to the morning, a time period corresponding to noon, or a time period corresponding to the evening, and the duration of each time period may be 8 hours. Optionally, the time period can be determined according to the user's physiological work and rest. The time period during which a certain physiological work and rest behavior occurs can be taken as the time period. For example, the lunch time period can be taken as a time period, and the dinner time period can be taken as a time period. Regarding the sleeping time period as a time period, etc., by this way of determining the time period, the timeliness of the user preference data can be improved. Therefore, the electronic device can have multiple time periods determined according to the rules.
又如,环境数据包括场景数据,则可以获取电子设备的当前场景,并将该当前场景作为电子设备当前所处环境的当前环境数据,其中,可以根据电子设备当前的位置信息、当前所处环境的环境图像以及当前所处环境的声音确定电子设备的当前场景。具体的场景可以包括:公共交通场景(如乘坐地铁、公交车、高铁、飞机等场景)、休闲场景(如卧室、客厅、花园等场景)、工作场景(如图书馆、书房、办公室等场景),因此,电子设备可以内置有根据规则所确定的多个场景。For another example, if the environment data includes scene data, the current scene of the electronic device can be acquired, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located. The environment image and the sound of the current environment determine the current scene of the electronic device. Specific scenes can include: public transportation scenes (such as subway, bus, high-speed rail, airplane, etc. scenes), leisure scenes (such as bedroom, living room, garden, etc. scenes), work scenes (such as library, study, office, etc. scenes) Therefore, the electronic device can be built with multiple scenes determined according to the rules.
在一些实施例中,时间段和场景共同定义了电子设备的使用环境。例如,电子设备处于晚上时间段的卧室场景中,则认为晚上时间段的卧室场景共同定义了电子设备的临睡环境,以便后续根据该临睡环境时对应的用户偏好数据,确定需预加载的应用程序和受保护的应用程序。In some embodiments, the time period and the scene together define the use environment of the electronic device. For example, if the electronic device is in a bedroom scene in the night time period, it is considered that the bedroom scene in the night time period jointly defines the sleeping environment of the electronic device, so that the subsequent user preference data corresponding to the sleeping environment can be used to determine what needs to be preloaded. Apps and protected apps.
该活跃时长反映了应用程序在历史运行中该环境下的活跃程度。在本申请实施例中,活跃时长可以理解为应用程序处于前台运行的时长。每当某一应用程序某次处于前台运行时,电子设备可以记录活跃时长:当应用程序开始处于前台运行时,电子设备可以记录当前时间点,作为活跃时长的开始时间点,当应用程序结束处于前台运行时,电子设备可以记录当前时间点,作为活跃时长的结束时间点,计算该结束时间点和开始时间点之间的时间差,得到该应用程序本次处于前台运行的活跃时长。例如当应用程序9:00开始在前台运行,9:10时结束在前台运行时,记录活跃时长为10min。The active duration reflects the degree of activity of the application in the environment in the historical operation. In the embodiment of the present application, the active duration can be understood as the duration of the application running in the foreground. Whenever an application is running in the foreground for a certain time, the electronic device can record the active duration: when the application starts to run in the foreground, the electronic device can record the current time point as the start time point of the active duration. When the foreground is running, the electronic device can record the current time point as the end time point of the active duration, calculate the time difference between the end time point and the start time point, and obtain the active duration of the application running in the foreground this time. For example, when the application starts to run in the foreground at 9:00 and ends at 9:10, the active duration of the recording is 10 minutes.
统计活跃时长的具体方式包括:电子设备可以每当开始进入任一时间段,即当前时间点为时间段的起始点时,从零开始累计每个应用程序的活跃时长,当离开该时间段,即当前时间点为该时间段的结束点时,结束累计每个应用程序在该时间段的活跃时长,存储该时间段内每个应用程序累计的活跃时长,并开始下一次的统计过程,再次从零开始累计,依次类推。其中,针对每个时间段内累计活跃时长的过程,在每个时间段内每个应用程序可以活跃一次或多次,当应用程序在每个时间段内第一次活跃时,可以从零开始记录该应用程序的活跃时长,直至应用程序暂停活跃,而当应用程序第二次活跃至第N次活跃时,可以在已 记录的该时间段内该应用程序的活跃时长的基础上增加本次活跃的活跃时长。The specific method of counting the active time includes: whenever the electronic device starts to enter any time period, that is, when the current time point is the starting point of the time period, accumulate the active time length of each application from zero, and when leaving the time period, That is, when the current time point is the end point of the time period, the accumulated active duration of each application in the time period is ended, the accumulated active time length of each application in the time period is stored, and the next statistical process is started. Accumulate from scratch, and so on. Among them, for the process of accumulating active duration in each time period, each application can be active one or more times in each time period. When the application is active for the first time in each time period, it can start from zero Record the active duration of the application until the application is suspended, and when the application is active for the second time to the Nth time, this time can be increased on the basis of the active duration of the application in the recorded time period Active active duration.
示例性地,假设当前时间点落入时间段8:00-10:00,若应用程序A在该时间段第一次活跃,活跃了5分钟,则此时应用程序A的活跃时长为5分钟,若应用程序A进行第二次活跃,活跃了10分钟,则此时应用程序A的活跃时长为5+10=15分钟,若应用程序A进行第三次活跃,活跃了8分钟,则此时应用程序A的活跃时长为15+8=23分钟,而在当前时间点达到10:00,则在时间段8:00-10:00内,应用程序的活跃总时长为23分钟;进入下一时间段10:00-13:00时,应用程序A的活跃时长会重新从0开始统计。Illustratively, assuming that the current time point falls into the time period 8:00-10:00, if application A is active for the first time in this time period and has been active for 5 minutes, then the active duration of application A at this time is 5 minutes If application A is active for the second time and is active for 10 minutes, then the active duration of application A is 5+10=15 minutes. If application A is active for the third time and is active for 8 minutes, then When the active duration of application A is 15+8=23 minutes, and when it reaches 10:00 at the current time point, the total active duration of the application is 23 minutes during the time period from 8:00 to 10:00; enter the next During a period of time from 10:00 to 13:00, the active duration of application A will be counted from 0 again.
可选地,每当电子设备获取某应用程序某次处于前台运行的活跃时长时,可以获取当前时间点所属的时间段、当前日期以作为记录日期,并获取应用程序的应用程序标识以及当前场景,记录活跃时长、时间段、记录日期、当前场景、应用程序标识之间的对应关系,以便后续可以根据该对应关系获取到活跃时长。示例性地,电子设备可以记录“00:00-08:00(时间段),卧室(场景)12月7日(记录日期)、APP1(应用程序标识),50分钟(活跃时长)”。Optionally, whenever the electronic device acquires the active duration of a certain application running in the foreground at a certain time, it can acquire the time period and the current date to which the current point of time belongs as the recording date, and acquire the application identifier and current scene of the application , Record the corresponding relationship between the active duration, time period, recording date, current scene, and application identifier, so that the active duration can be obtained subsequently according to the corresponding relationship. Exemplarily, the electronic device may record "00:00-08:00 (time period), bedroom (scene) December 7th (recording date), APP1 (application program identifier), 50 minutes (active duration)".
需要说明的是,本步骤201可以由电子设备的活动管理服务(Act ivity Manager Service,AMS)执行。AMS是Android操作系统的核心服务,在实施中,可以对AMS的程序代码进行改进,向AMS的程序代码中添加统计每个处于前台运行的应用程序的活跃时长的程序代码,以便AMS在加载并运行程序代码时,可以实现统计活跃时长的功能。It should be noted that this step 201 may be executed by the activity management service (Activity Manager Service, AMS) of the electronic device. AMS is the core service of the Android operating system. In the implementation, the program code of AMS can be improved, and program code that counts the active duration of each application running in the foreground can be added to the program code of AMS so that AMS can load and When running the program code, the function of counting the active time can be realized.
电子设备根据活跃时长和当前使用环境,生成应用程序的运行数据。在应用程序每次运行时,均生成对应的运行数据,并保存该运行数据。因此,可以在用户不断使用的过程中,持续更新应用程序的历史运行数据,能够有利于本申请实施例提供的应用程序管理方法以动态自学习的方式获取应用程序的用户偏好数据,即使用户的行为习惯发生改变,该方法依然适用。The electronic device generates operating data of the application program according to the active duration and the current use environment. Each time the application runs, the corresponding running data is generated and saved. Therefore, the historical operating data of the application can be continuously updated during the continuous use of the user, which can facilitate the application management method provided by the embodiment of the present application to obtain the user preference data of the application in a dynamic self-learning manner, even if the user’s The method is still applicable if the behavior changes.
步骤S2013:在应用程序的历史运行数据保存时长超过预定时长时,分析历史运行数据。Step S2013: When the storage period of the historical operation data of the application program exceeds the predetermined period of time, analyze the historical operation data.
基于步骤S2011生成的运行数据可以获知应用程序的历史数据,则当历史数据的保存时间较长(例如,大于或等于一周时),可以认为用户形成了较为稳定的操作习惯,则可以在此基础上分析历史运行数据,以便于获取用户对应用程序的操作习惯。Based on the operating data generated in step S2011, the historical data of the application can be obtained. When the historical data is stored for a long time (for example, greater than or equal to one week), it can be considered that the user has formed a relatively stable operating habit. Analyze historical operating data to facilitate the acquisition of the user’s operating habits of the application.
步骤S2014:根据历史运行数据,确定每个应用程序的用户偏好数据。Step S2014: Determine the user preference data of each application program according to the historical operation data.
用户偏好数据反应了用户对应用程序的使用习惯,比如,反应应用程序的使用频率在时间上的分布,或/及,反应应用程序的使用频率在场景上的分布。因此,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小,其可以表现为用户偏好度。应用程序可以由用户或者其他应用程序调用,用户偏好度越高,指示应用被调用的可能性越大,用户偏好度越低,指示应用被调用的可能性越小,用户偏好度能够表征用户对应用程序的偏好程度。对于任一应用程序来说,该应用程序在当前环境的用户偏好度根据应用程序在历史运行中该环境下的活跃时长确定。The user preference data reflects the user's usage habits of the application, for example, reflects the distribution of the frequency of use of the application over time, or/and reflects the distribution of the frequency of use of the application on the scene. Therefore, the user preference data is used to indicate the probability of the application being invoked in the corresponding environment, which can be expressed as the user preference. The application can be invoked by the user or other applications. The higher the user preference, the greater the possibility of indicating that the application is invoked, the lower the user preference, the less likely the indicating application is invoked, and the user preference can characterize the user’s preference. The degree of preference of the application. For any application, the user preference of the application in the current environment is determined according to the active duration of the application in the environment in the historical operation.
根据活跃时长确定前台应用程序在对应的历史环境的用户偏好数据时,将当前环境下的某一应用程序活跃时长作为该应用程序的用户偏好数据(也即在该环境下的偏好度),或/及,将该应用程序的活跃时长与活跃时长总和之间的比值作为用户偏好数据,其中,活跃时长总和是指多个应用程序在历史运行中对应于该环境的活跃时长的和,由此可以提高用户偏好数据统计的准确度,那么后续基于用户偏好数据确定需预加载的应用程序时,能够保证其准确性。When determining the user preference data of the foreground application in the corresponding historical environment according to the active duration, use the active duration of a certain application in the current environment as the user preference data of the application (that is, the preference in the environment), or / And, the ratio between the active duration of the application and the total active duration is used as user preference data, where the total active duration refers to the sum of the active durations of multiple applications corresponding to the environment in the historical operation, thus The accuracy of user preference data statistics can be improved, so that the accuracy of subsequent applications that need to be preloaded based on user preference data can be guaranteed.
在本实施例中,根据每个应用程序的历史运行数据,确定每个应用程序对应的用户偏好数据时,根据每个应用程序在历史运行中电子设备所处环境的历史环境数据,以及每个应用程序在历史环境数据中的活跃时长,确定每个应用程序在对应的历史环境的用户偏好数据,可以更准确地统计用户的个人操作习惯,以利于后续根据用户的个人操作习惯预先加载应用程序。应当理解的是,在每一个应用程序在前台运行时,均将其运行数据以及对应的当前环境数据写入历史运行数据中,则步骤S201可以包括:当多个应用程序中的一个启动并在前台运行时,将其作为前台应用程序;获取前台应用程序运行时,电子设备所处环境的环境数据;获取前台应用程序对应于环境数据的活跃时长;以及根据活跃时长确定前台应用程序在对应的历史环境的用户偏好数据。In this embodiment, when determining the user preference data corresponding to each application according to the historical operating data of each application, the historical environment data of the environment in which the electronic device is located during the historical operation of each application, and each The active time of the application in the historical environment data is determined, and the user preference data of each application in the corresponding historical environment can be determined, which can more accurately count the user's personal operating habits, so as to facilitate the subsequent pre-loading of the application according to the user's personal operating habits . It should be understood that, when each application is running in the foreground, its operating data and corresponding current environment data are written into the historical operating data, then step S201 may include: when one of the multiple applications is started and is running When the foreground is running, use it as the foreground application; obtain the environmental data of the environment in which the electronic device is located when the foreground application is running; obtain the active duration of the foreground application corresponding to the environmental data; and determine whether the foreground application is in the corresponding User preference data for historical environments.
步骤S203:获取电子设备当前所处环境的当前环境数据。Step S203: Acquire current environment data of the environment where the electronic device is currently located.
环境数据可以包括时间数据、场景数据中的至少一种。获取当前环境数据的执行步骤,可以参考上文所描述的数据及其获取手段。The environmental data may include at least one of time data and scene data. For the execution steps of obtaining the current environment data, please refer to the data and obtaining means described above.
若当前环境数据包括时间数据,则步骤S203可以包括:电子设备运行时,获取电子设备当前的时间点;以及将该当前时间点所属的时间段作为电子设备当前所处环境的当前环境数据。If the current environment data includes time data, step S203 may include: acquiring the current time point of the electronic device when the electronic device is running; and using the time period to which the current time point belongs as the current environment data of the environment where the electronic device is currently located.
若当前环境数据包括场景数据,则可以获取电子设备的当前场景,并将该当前场景作为电子设备当前所处环境的当前环境数据,其中,可以根据电子设备当前的位置信息、当前所处环境的环境图像以及当前所处环境的声音确定电子设备的当前场景。If the current environment data includes scene data, the current scene of the electronic device can be obtained, and the current scene can be used as the current environment data of the environment in which the electronic device is currently located. The environment image and the sound of the current environment determine the current scene of the electronic device.
在一些实施方式中,电子设备还可以配置有语音采集装置,语音采集装置用于对周围环境中的语音信息进行采集,并将采集到的语音信息发送给电子设备。电子设备可以对采集到的语音信息进行特征提取,将提取出的特征信息输入预先训练的场景识别模型,得到识别结果,其中,该识别结果可以包括该语音信息是在某一个预定场景下采集的概率。然后,电子设备可以将该概率与概率阈值进行比较,确定该概率是否大于该概率阈值。响应于电子设备确定该概率大于该概率阈值,电子设备可以确定导航应用当前的使用场景是该预定场景。例如,具体的预定场景可以包括:公共交通场景(如乘坐地铁、公交车、高铁、飞机等场景)、休闲场景(如卧室、客厅、花园等场景)、工作场景(如图书馆、书房、办公室等场景)。电子设备通过对环境语音采集以及特征识别,能够确定其所处的场景。In some embodiments, the electronic device may also be equipped with a voice collection device, which is used to collect voice information in the surrounding environment and send the collected voice information to the electronic device. The electronic device can perform feature extraction on the collected voice information, and input the extracted feature information into a pre-trained scene recognition model to obtain a recognition result, where the recognition result may include that the voice information was collected in a certain predetermined scene Probability. Then, the electronic device can compare the probability with the probability threshold to determine whether the probability is greater than the probability threshold. In response to the electronic device determining that the probability is greater than the probability threshold, the electronic device may determine that the current usage scenario of the navigation application is the predetermined scenario. For example, specific predetermined scenes can include: public transportation scenes (such as subway, bus, high-speed rail, airplane, etc. scenes), leisure scenes (such as bedroom, living room, garden, etc. scenes), work scenes (such as library, study, office, etc.) Waiting for the scene). The electronic device can determine the scene in which it is located through the collection of environmental voice and feature recognition.
在其他的一些实施方式中,可以结合电子设备的定位信息以及环境语音信息,或者结合电子设备的定位信息以及环境图像信息,来确定电子设备所处的场景。例如,电子设备还配置有定位器以及图像采集装置,定位器用于对电子设备进行定位,以缩小后续的场景确定的范围,从而提高场景确定的精确度。图像采集装置可以用于对周围环境中的图像信息进行采集,并将采集到的图像信息发送给电子设备。电子设备可以对采集到的图像信息进行特征提取,将提取出的特征信息输入预先训练的场景识别模型,得到识别结果,其中,该识别结果可以包括该图像信息是在某一个预定场景下采集的概率。然后,电子设备可以将该概率与概率阈值进行比较,确定该概率是否大于该概率阈值。响应于电子设备确定该概率大于该概率阈值,电子设备可以确定导航应用当前的使用场景是该预定场景。基于此,电子设备通过对环境图像采集以及特征识别,结合定位信息,能够确定其所处的场景。In some other embodiments, the location information of the electronic device and the environmental voice information, or the location information of the electronic device and the environmental image information may be combined to determine the scene where the electronic device is located. For example, the electronic device is also equipped with a locator and an image acquisition device. The locator is used to locate the electronic device to reduce the scope of subsequent scene determination, thereby improving the accuracy of scene determination. The image collection device can be used to collect image information in the surrounding environment and send the collected image information to the electronic device. The electronic device can perform feature extraction on the collected image information, and input the extracted feature information into a pre-trained scene recognition model to obtain a recognition result, where the recognition result may include that the image information was collected in a certain predetermined scene Probability. Then, the electronic device can compare the probability with the probability threshold to determine whether the probability is greater than the probability threshold. In response to the electronic device determining that the probability is greater than the probability threshold, the electronic device may determine that the current usage scenario of the navigation application is the predetermined scenario. Based on this, the electronic device can determine the scene in which it is located by collecting and identifying features of the environment, combined with positioning information.
基于此,步骤S203可以包括:电子设备运行时,获取电子设备当前的位置信息,通过电子设备的摄像头获取电子设备当前所处环境的环境图像;根据位置信息以及环境图像,确定电子设备的场景数据;以及根据场景数据,确定当前环境数据。Based on this, step S203 may include: when the electronic device is running, acquiring the current location information of the electronic device, acquiring the environment image of the environment where the electronic device is currently located through the camera of the electronic device; determining the scene data of the electronic device according to the location information and the environment image ; And according to the scene data, determine the current environment data.
步骤S205:获取每个应用程序的用户偏好数据。Step S205: Obtain user preference data of each application.
在一些实施方式中,电子设备可以根据当前的环境数据,获取每个应用程序对应于当前环境数据的用户偏好数据。进一步地,若当前环境发生改变,例如,当前的时间段发生了变化(如从8:00~10:00这一时间段进入10:00~12:00这一时间段),又如,当前的场景发生了变化(例如,从休闲场景转换为工作场景),则根据变化后的当前环境数据,再次获取应用程序的用户偏好数据,以便本申请的方法能够根据电子设备的实际运行状态的该改变以及用户习惯来执行,从而适应不同的应用环境。In some embodiments, the electronic device may obtain user preference data corresponding to the current environment data for each application program according to the current environment data. Further, if the current environment changes, for example, the current time period has changed (for example, from the time period of 8:00 to 10:00 to the time period of 10:00 to 12:00), another example is the current time period. If the scene of the application changes (for example, from a leisure scene to a work scene), the user preference data of the application program is obtained again according to the changed current environment data, so that the method of this application can be based on the actual operating state of the electronic device. Changes and user habits are implemented to adapt to different application environments.
步骤S207:根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序。Step S207: According to the current environment data and the user preference data, determine the application program that needs to be preloaded among the multiple application programs.
在本步骤中,电子设备根据用户偏好数据,预测出用户在接下来最有可能使用的应用程序。上述的需预加载的应用程序为电子设备预测的接下来用户最有可能使用的应用程序,一种具体实现方式中,这些需预加载的应用程序可以是使用频率从高到低的一个或多个应用程序,也可以是使用时间最接近当前时间的一个或几个应用程序,即上次使用的应用程序,也可以是使用场景最接近当前场景的一个或多个应用程序,此外,还可以结合使用频率和使用时间综合确定得到该些第一应用程序,对此本方案不做限制。In this step, the electronic device predicts which application the user is most likely to use in the next based on the user's preference data. The above-mentioned applications that need to be pre-loaded are the applications that the electronic device predicts that the user is most likely to use next. In a specific implementation, these applications that need to be pre-loaded can be one or more applications with a frequency of high to low. It can also be one or more applications whose use time is closest to the current time, that is, the last used application, or one or more applications whose use scene is closest to the current scene. In addition, you can The first application programs are comprehensively determined by combining the frequency of use and the time of use, and there is no restriction on this solution.
电子设备也可以根据每个应用程序的使用时间,以及当前时间,预估用户接下来要使用的应用程序,例如:用户经常在晚上七点到九点使用某游戏软件,在九点之后使用某视频软件,据此也可以预测用户在某段时间可能使用的需预加载的应用程序。Electronic devices can also estimate the next application that the user will use based on the usage time of each application and the current time. For example, users often use a certain game software from 7 to 9 in the evening, and use a certain game software after 9 o’clock in the evening. Video software can also predict the pre-loaded applications that users may use in a certain period of time.
步骤S209:将需预加载的应用程序的启动数据加载至电子设备的内存。Step S209: Load the startup data of the application program that needs to be preloaded into the memory of the electronic device.
可选地,在步骤S209中,加载应用程序的启动数据之前或之后,还可以回收电子设备的内存,以保证电子设备的具有较多的空余内存,从而保证其系统运行较为流畅。基于此,步骤S209可以包括:根据需加载的应用程序,在多个应用程序中确定不需加载的应用程序,将不需加载的应用程序所占用的内存回收;确定需预加载的应用程序的启动数据;以及将启动数据加载至电子设备的内存。在多个应用程序中确定不需加载的应用程序;以及将不需加载的应用程序占用的内存回收。其中,在多个应用程序中确定不需加载的应用程序,可以根据应用程序的用户偏好度来确定,例如,将当前环境下对应的应用偏好度小于第一偏好阈值的应用程序确定为不需加载的应用程序。Optionally, in step S209, before or after loading the startup data of the application program, the memory of the electronic device may also be recycled to ensure that the electronic device has more free memory, thereby ensuring smoother system operation. Based on this, step S209 may include: determining applications that do not need to be loaded among multiple applications according to the applications that need to be loaded, and reclaiming the memory occupied by the applications that do not need to be loaded; determining the number of applications that need to be preloaded Boot data; and load the boot data to the memory of the electronic device. Identify the applications that do not need to be loaded among multiple applications; and reclaim the memory occupied by the applications that do not need to be loaded. Among them, it is determined that the application that does not need to be loaded among multiple applications can be determined according to the user preference of the application. For example, an application whose corresponding application preference in the current environment is less than the first preference threshold is determined to be unnecessary. Loaded application.
电子设备可以根据当前环境数据(例如时间数据、位置信息、场景信息等),将需预加载的应用程序的启动数据加载至电子设备的内存。The electronic device can load the startup data of the application program that needs to be preloaded into the memory of the electronic device according to the current environment data (for example, time data, location information, scene information, etc.).
在一些实施方式中,若当前环境数据包括时间数据,用户偏好数据包括应用程序在历史运行中的启动时间数据;则电子设备根据启动时间数据以及提前时长,确定需预加载的应用程序的启动数据的加载时间点;其中,提前时长表征加载启动数据的时间点与需预加载的应用程序的启动时间数据之间的差值,其可以为1~10分钟之间的任意数值,例如5分钟;在加载时间点将需预加载的应用程序的启动数据加载至电子设备的内存。In some embodiments, if the current environment data includes time data, and the user preference data includes the startup time data of the application in historical operation; the electronic device determines the startup data of the application to be preloaded according to the startup time data and the advance time. Wherein, the advance time represents the difference between the time point when the startup data is loaded and the startup time data of the application that needs to be preloaded, and it can be any value between 1-10 minutes, such as 5 minutes; At the loading time point, the startup data of the application program that needs to be preloaded is loaded into the memory of the electronic device.
例如,用户偏好数据显示,某新闻应用程序在19:00这一时间点启动的频率较高,则该新闻应用程序的启动时间数据为19:00,提前时长为五分钟,则确定该新闻应用程序的加载时间点为18:55。若电子设备获取到当前时间为18:30,此时当前时间未到,则不加载该新闻应用程序的启动数据,并等到18:55时加载该新闻应用程序的启动数据;若当前时间已落入18:55~19:00之间,则直接加载该新闻应用程序的启动数据。For example, user preference data shows that a news application is launched more frequently at the time of 19:00, and the start time data of the news application is 19:00, and the advance time is five minutes, then the news application is determined The loading time of the program is 18:55. If the electronic device obtains that the current time is 18:30, and the current time has not arrived, the startup data of the news application will not be loaded, and the startup data of the news application will be loaded until 18:55; if the current time has expired Enter between 18:55 and 19:00, then directly load the startup data of the news application.
在另一些实施方式中,若当前环境数据包括场景数据(例如位置信息),用户偏好数据包括应用程序 在历史运行中的启动地点;则电子设备根据历史运行中的启动地点以及距离阈值,确定需预加载的应用程序的启动数据的加载地理围栏;其中,距离阈值表征启动地点数据与加载地理围栏的边界之间的距离,其可以为1~1千米之间的任意数值,例如200米;当电子设备进入地理围栏时,将需预加载的应用程序启动数据加载至电子设备的内存。In other embodiments, if the current environment data includes scene data (such as location information), and the user preference data includes the start location of the application in the historical operation; the electronic device determines the need according to the start location and the distance threshold in the historical operation. The loading geofence of the startup data of the preloaded application; wherein, the distance threshold represents the distance between the startup location data and the boundary of the loading geofence, and it can be any value between 1 and 1 km, such as 200 meters; When the electronic device enters the geofence, the application startup data to be preloaded is loaded into the memory of the electronic device.
例如,用户偏好数据显示,某网约车应用程序在某确定的地铁站出口启动的频率较高,则该网约车应用程序的启动地点数据为该地铁站出口,距离阈值为100米,则确定该网约车应用程序的加载地理围栏为该地铁站出口方圆100米所界定的地理围栏。若电子设备获取到当前地点未落入加载地理围栏,则不加载该网约车应用程序的启动数据,并等到前地点落入加载地理围栏时加载该网约车应用程序的启动数据;若当前地点已落入加载地理围栏内,则直接加载该网约车应用程序的启动数据。For example, user preference data shows that a certain online car-hailing application is launched more frequently at the exit of a certain subway station, then the starting location data of the online car-hailing application is the exit of the subway station, and the distance threshold is 100 meters, then It is determined that the loaded geofence of the ride-hailing application is a geofence defined by a radius of 100 meters from the exit of the subway station. If the electronic device obtains that the current location does not fall into the loading geofence, it does not load the startup data of the ride-hailing application, and waits until the previous location falls into the loading geofence to load the startup data of the ride-hailing application; if it is currently If the location has fallen into the loading geofence, the startup data of the online car-hailing application will be loaded directly.
步骤S211:根据电子设备的空闲内存,确定对多个应用程序的控制方案。Step S211: Determine a control scheme for multiple application programs according to the free memory of the electronic device.
电子设备运行时,根据预设的周期确定空闲内存,根据空闲内存,确定对多个应用程序的控制方案,以根据预设的规则来回收内存,保证电子设备具有充足的剩余内存来运行应用程序。When the electronic device is running, the free memory is determined according to the preset cycle, and the control plan for multiple applications is determined according to the free memory, so as to reclaim the memory according to the preset rules to ensure that the electronic device has sufficient remaining memory to run the application .
可选地,步骤S211可以包括:根据空闲内存,确定对多个应用程序的控制方案时,在检测到空闲内存小于内存阈值时,确定处于后台运行的应用程序;根据用户偏好数据,在多个应用程序中确定待回收的应用程序;以及将待回收的应用程序占用的内存回收。其中,在多个应用程序中确定待回收的应用程序,可以根据应用程序的用户偏好度来确定,例如,将当前环境下对应的应用偏好度小于第一偏好阈值的应用程序确定为待回收的应用程序。本实施例中,可以通过内存直接回收机制来执行这一步骤。当任一进程向电子设备请求内存,而请求的内存超过空闲内存时,电子设备确定每个处于后台运行的应用程序的用户偏好度,进而确定出待回收的应用程序,将待回收的应用程序提供给该请求内存的进程,该请求内存的进程会将待回收的应用程序在内存中的数据转移至预设存储空间中,以回收应用程序占用的内存。Optionally, step S211 may include: when determining the control scheme for multiple applications according to the free memory, when it is detected that the free memory is less than the memory threshold, determining the application running in the background; Determine the application program to be recycled in the application program; and reclaim the memory occupied by the application program to be recycled. Among them, the application program to be recycled can be determined according to the user preference of the application program. For example, the application program whose corresponding application preference degree in the current environment is less than the first preference threshold is determined as the application program to be recycled application. In this embodiment, this step can be performed through a direct memory recovery mechanism. When any process requests memory from the electronic device, and the requested memory exceeds the free memory, the electronic device determines the user preference of each application running in the background, and then determines the application to be recycled, and the application to be recycled Provided to the process requesting the memory, the process requesting the memory transfers the data in the memory of the application to be reclaimed to a preset storage space, so as to reclaim the memory occupied by the application.
可选地,步骤S211可以包括:在检测到空闲内存小于内存阈值时,根据用户偏好数据,在多个应用程序中确定受保护的应用程序;将受保护的应用程序所占用的内存之外的内存释放,以及将电子设备的系统资源优先分配给受保护的应用程序。其中,在多个应用程序中确定受保护的应用程序,可以根据应用程序的用户偏好度来确定,例如,将当前环境下对应的应用偏好度大于第二偏好阈值的应用程序确定为受保护的应用程序。其中,受保护的应用程序,与上述的需预加载的应用程序、前台运行的应用程序均不冲突,三者所包含的应用程序可以出现交集。Optionally, step S211 may include: when it is detected that the free memory is less than the memory threshold, determining the protected application among multiple applications according to user preference data; Memory is released, and the system resources of the electronic device are preferentially allocated to protected applications. Among them, the application to be protected among multiple applications can be determined according to the user preference of the application. For example, an application whose corresponding application preference in the current environment is greater than the second preference threshold is determined to be protected application. Among them, the protected application program does not conflict with the above-mentioned application program that needs to be preloaded and the application program running in the foreground, and the application programs contained in the three may overlap.
本实施例中,在释放内存后,电子设备赋予受保护的应用程序使用系统资源的特权,在从应用列表中选择受保护的应用程序信息之后,为受保护的应用程序优先分配系统资源,从而可确保在当前环境下用户常用的应用程序的快速启动以及运行的平稳性,提升用户对于电子设备的使用体验。其中,为应用程序优先分配系统资源具体可以包括以下操作中的至少一种:1)将电子设备的CUP资源优先分配给受保护的应用程序,从而可确保受保护的应用程序的运行速度和平稳性;2)将连续的空闲内存优先分配给受保护的应用程序,减少受保护的应用程序申请内存时的内存回收以及内存的换入换出,提高应用程序对于内存的使用效率,确保应用程序的运行速度和平稳性;3)将应用程序的预加载项一直保存在内存中,包括在释放内存时,不立即完全释放应用程序所占的内存资源,而是将应用程序的预加载项保存到缓存中,如此,当应用程序下一次申请内存资源时,可以直接从缓存中取得加载数据;4)将输入\输出(IO)资源优先分配给应用程序,以减少应用程序的IO等待时间,减少应用程序出现的慢、卡、顿情况。In this embodiment, after releasing the memory, the electronic device grants the protected application the privilege of using system resources, and after selecting the protected application information from the application list, the system resource is allocated to the protected application first, thereby It can ensure the fast startup and smooth running of the application programs commonly used by the user in the current environment, and improve the user's experience of using the electronic device. Wherein, the priority allocation of system resources for the application program may specifically include at least one of the following operations: 1) Priority allocation of the CUP resources of the electronic device to the protected application program, so as to ensure the running speed and stability of the protected application program 2) Prioritize the allocation of continuous free memory to protected applications, reduce the memory recycling and memory swapping when the protected applications apply for memory, improve the efficiency of the application’s use of memory, and ensure the application 3) Keep the pre-loaded items of the application in the memory all the time, including when releasing the memory, the memory resources occupied by the application are not completely released immediately, but the pre-loaded items of the application are saved In the cache, in this way, when the application applies for memory resources next time, it can directly obtain the load data from the cache; 4) Prioritize input/output (IO) resources to the application to reduce the IO waiting time of the application. Reduce the slowness, jams, and pauses in the application.
在本申请实施例提供的应用程序管理方法中,能够灵活地根据电子设备当前所处的环境以及用户偏好数据来确定预先加载的应用程序和受保护的应用程序,在回收内存时确保受保护的应用程序占用的内存不被回收,保证了电子设备有较大的空闲内存的同时,避免应用程序发生卡顿;进一步地,通过预先启动需预加载的应用程序,用户在打开预先加载的应用程序时,不必要重新加载启动数据,使应用程序的启动速度能够显著增快,因此从总体上提高了电子设备运行的速度。In the application management method provided by the embodiments of the present application, the pre-loaded application and the protected application can be flexibly determined according to the current environment of the electronic device and user preference data, and the protected application can be ensured when reclaiming the memory. The memory occupied by the application program is not recycled, which ensures that the electronic device has a large free memory while preventing the application program from being stuck; further, by pre-starting the application program that needs to be pre-loaded, the user is opening the pre-loaded application program It is not necessary to reload the startup data, so that the startup speed of the application program can be significantly increased, and therefore, the operating speed of the electronic device is generally improved.
由于电子设备处于不断变化的环境中,有必要根据其动态变化确定需预加载的应用程序,以利于上述方法的动态执行。所以,在一些实施方式中,本申请的应用程序管理方法还可以包括:根据预设的周期,获取电子设备当前所处环境的当前环境数据;确定当前环境数据的数据变化量;以及在数据变化量大于变化阈值时,根据变化后的当前环境数据以及用户偏好数据,重新确定需预加载的应用程序,并加载重新确定的需预加载的应用程序。例如,当前环境数据包括位置数据,则在电子设备的位置变化量大于变化阈值时,重新根据变化后的位置,确定需预加载的应用程序,并加载重新确定的需预加载的应用程序。Since the electronic device is in a constantly changing environment, it is necessary to determine the application program to be preloaded according to its dynamic change, so as to facilitate the dynamic execution of the above method. Therefore, in some embodiments, the application management method of the present application may further include: obtaining current environmental data of the environment in which the electronic device is currently located according to a preset period; determining the data change amount of the current environmental data; When the amount is greater than the change threshold, according to the changed current environment data and user preference data, the application program to be preloaded is re-determined, and the re-determined application program to be pre-loaded is loaded. For example, if the current environment data includes location data, when the position change of the electronic device is greater than the change threshold, the application program that needs to be preloaded is determined according to the changed location again, and the newly determined application program that needs to be preloaded is loaded.
请参阅图5,基于上述的应用程序管理方法,本申请实施方式还提供一种应用程序管理装置200,图5示出了应用程序管理装置200的结构框图。应用程序管理装置200运行于如图1所示的电子设备100中,其用于执行上述的应用程序管理方法。在本申请实施方式中,应用程序管理装置200被存储在电子设备100的存储器中,并被配置为由电子设备100的一个或多个处理器执行。Referring to FIG. 5, based on the above application management method, an embodiment of the present application also provides an application management apparatus 200. FIG. 5 shows a structural block diagram of the application management apparatus 200. The application management apparatus 200 runs in the electronic device 100 as shown in FIG. 1 and is used to execute the above-mentioned application management method. In the embodiment of the present application, the application management apparatus 200 is stored in the memory of the electronic device 100 and is configured to be executed by one or more processors of the electronic device 100.
具体在图5所示的实施例中,应用程序管理装置200包括环境数据获取模块210、偏好数据获取模块220、预加载确定模块230以及加载模块240。可以理解的是,上述各模块可以为运行于计算机可读存储介质中的程序模块,上述各个模块的用途及工作具体如下:Specifically, in the embodiment shown in FIG. 5, the application management apparatus 200 includes an environment data acquisition module 210, a preference data acquisition module 220, a preload determination module 230, and a loading module 240. It can be understood that each of the above-mentioned modules may be a program module running in a computer-readable storage medium, and the purpose and work of each of the above-mentioned modules are as follows:
环境数据获取模块210用于获取电子设备当前所处环境的当前环境数据;偏好数据获取模块220用于获取每个应用程序的用户偏好数据,用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小;预加载确定模块230用于根据当前环境数据以及用户偏好数据,在多个应用程序中确定需预加载的应用程序;加载模块240用于将需预加载的应用程序的启动数据加载至电子设备的内存。The environmental data obtaining module 210 is used to obtain current environmental data of the environment where the electronic device is currently located; the preference data obtaining module 220 is used to obtain user preference data of each application program, and the user preference data is used to indicate that the application program is called in the corresponding environment The preload determination module 230 is used to determine the application program that needs to be preloaded among multiple applications according to the current environment data and user preference data; the loading module 240 is used to set the startup data of the application program that needs to be preloaded Loaded into the memory of the electronic device.
在一些实施方式中,应用程序管理装置200还包括用户偏好数据建立模块250。用户偏好数据建立模块250用于根据每个应用程序的历史运行数据,确定每个应用程序对应的用户偏好数据。可选地,用户偏好数据建立模块250用于在电子设备运行时,获取每个应用程序的历史运行数据,历史运行数据包括活跃时长以及运行时的环境数据;在应用程序的历史运行数据保存时长超过预定时长时,分析历史运行数据;以及根据历史运行数据,确定每个应用程序的用户偏好数据。In some embodiments, the application management apparatus 200 further includes a user preference data establishment module 250. The user preference data establishment module 250 is used to determine the user preference data corresponding to each application program according to the historical running data of each application program. Optionally, the user preference data establishment module 250 is used to obtain historical operating data of each application when the electronic device is running. The historical operating data includes active duration and runtime environmental data; the historical operating data of the application is saved for the duration When the predetermined time period is exceeded, the historical operating data is analyzed; and the user preference data of each application is determined according to the historical operating data.
可选地,用户偏好数据建立模块250用于根据每个应用程序在历史运行时,电子设备所处环境的历史环境数据以及每个应用程序在历史环境数据中的活跃时长,确定每个应用程序在对应的历史环境的用户偏好数据。进步一地,用户偏好数据建立模块250用于当多个应用程序中的一个启动并在前台运行时,将其作为前台应用程序;获取前台应用程序运行时,电子设备所处环境的环境数据;获取前台应用程序对应于环境数据的活跃时长;以及根据活跃时长确定前台应用程序在对应的历史环境的用户偏好数据。其中,根据活跃时长确定前台应用程序在对应的历史环境的用户偏好数据时,用户偏好数据建立模块250用于将前台应用程序的活跃时长作为用户偏好数据;或,用于将活跃时长与活跃时长总和之间的比值作为用户偏好数据,其中,活跃时长总和是指多个应用程序在历史运行中对应于当前环境的活跃时长的和。Optionally, the user preference data establishment module 250 is used to determine each application according to historical environmental data of the environment in which the electronic device is located when each application is historically running, and the active duration of each application in the historical environmental data. User preference data in the corresponding historical environment. In a further step, the user preference data establishment module 250 is used to use one of the multiple applications as the foreground application when it is started and running in the foreground; to obtain environmental data of the environment in which the electronic device is located when the foreground application is running; Acquire the active duration of the foreground application corresponding to the environmental data; and determine the user preference data of the foreground application in the corresponding historical environment according to the active duration. Wherein, when the user preference data of the foreground application in the corresponding historical environment is determined according to the active duration, the user preference data establishing module 250 is used to use the active duration of the foreground application as user preference data; or, to combine the active duration with the active duration The ratio between the sums is used as user preference data, where the sum of active duration refers to the sum of the active durations of multiple applications corresponding to the current environment in the historical operation.
在一些实施方式中,环境数据获取模块210还用于在电子设备运行时,获取电子设备当前的时间点, 将该当前时间点作为电子设备当前所处环境的当前环境数据。In some embodiments, the environmental data acquisition module 210 is further configured to acquire the current point in time of the electronic device when the electronic device is running, and use the current point in time as the current environmental data of the environment in which the electronic device is currently located.
进一步地,加载模块240还用于根据启动时间数据以及提前时长,确定需预加载的应用程序的启动数据的加载时间点;其中,提前时长表征加载启动数据的时间点与需预加载的应用程序的启动时间数据之间的差值;以及用于在加载时间点将需预加载的应用程序启动数据加载至电子设备的内存。Further, the loading module 240 is also used to determine the loading time point of the startup data of the application program to be preloaded according to the startup time data and the advance time; wherein the advance time represents the time point of loading the startup data and the application program that needs to be preloaded The difference between the startup time data of the device; and is used to load the application startup data that needs to be preloaded into the memory of the electronic device at the loading time point.
进一步地,环境数据获取模块210还用于在电子设备运行时,获取电子设备当前的位置信息。通过电子设备的摄像头获取电子设备当前所处环境的环境图像,根据位置信息以及环境图像,确定电子设备的场景数据;以及用于根据场景数据,确定当前环境数据。可选地,加载模块240还用于根据电子设备启动地点数据以及距离阈值,确定需预加载的应用程序的启动数据的加载地理围栏,其中,距离阈值表征启动地点数据与加载地理围栏的边界之间的距离,当电子设备进入地理围栏时,将需预加载的应用程序启动数据加载至电子设备的内存。Further, the environmental data acquisition module 210 is also used to acquire the current location information of the electronic device when the electronic device is running. The camera of the electronic device obtains the environment image of the environment where the electronic device is currently located, and determines the scene data of the electronic device according to the location information and the environment image; and is used to determine the current environment data according to the scene data. Optionally, the loading module 240 is further configured to determine the loading geofence of the startup data of the application to be preloaded according to the start location data of the electronic device and the distance threshold, where the distance threshold represents the boundary between the start location data and the loading geofence. When the electronic device enters the geofence, the application startup data that needs to be preloaded is loaded into the memory of the electronic device.
进一步地,环境数据获取模块210还用于根据预设的周期,获取电子设备当前所处环境的当前环境数据,确定当前环境数据的数据变化量。预加载确定模块230还用于在数据变化量大于变化阈值时,根据变化后的当前环境数据以及用户偏好数据,重新确定需预加载的应用程序。Further, the environmental data obtaining module 210 is also configured to obtain current environmental data of the environment where the electronic device is currently located according to a preset period, and determine the data change amount of the current environmental data. The preload determination module 230 is also configured to re-determine the application program to be preloaded according to the changed current environment data and user preference data when the amount of data change is greater than the change threshold.
在一些实施方式中,加载模块240包括回收程序确定单元241、回收单元243、启动数据获取单元245以及加载单元247。回收程序确定单元241用于根据需加载的应用程序,在多个应用程序中确定不需加载的应用程序;回收单元243用于将不需加载的应用程序所占用的内存回收;启动数据获取单元245用于确定需预加载的应用程序的启动数据;加载单元247用于将启动数据加载至电子设备的内存。In some embodiments, the loading module 240 includes a recycling program determining unit 241, a recycling unit 243, a startup data obtaining unit 245, and a loading unit 247. The recycling program determining unit 241 is used for determining the application programs that do not need to be loaded among multiple applications according to the application programs that need to be loaded; the recycling unit 243 is used for recycling the memory occupied by the application programs that do not need to be loaded; and starting the data acquisition unit 245 is used to determine the startup data of the application program to be preloaded; the loading unit 247 is used to load the startup data into the memory of the electronic device.
在一些实施方式中,应用程序管理装置200还包括内存管理模块250,内存管理模块250还用于根据预设的周期确定电子设备的空闲内存,并根据空闲内存,确定对多个应用程序的控制方案。可选地,具体在一些实施例中,确定对多个应用程序的控制方案时,内存管理模块250用于在检测到空闲内存小于内存阈值时,确定处于后台运行的应用程序;根据用户偏好数据,在多个应用程序中确定待回收的应用程序;以及将待回收的应用程序占用的内存回收。可选地,在一些实施例中,确定对多个应用程序的控制方案时,内存管理模块250用于在检测到空闲内存小于内存阈值时,根据用户偏好数据,在多个应用程序中确定受保护的应用程序;将受保护的应用程序所占用的内存之外的内存释放;以及将电子设备的系统资源优先分配给受保护的应用程序。In some embodiments, the application management apparatus 200 further includes a memory management module 250. The memory management module 250 is further configured to determine the free memory of the electronic device according to a preset period, and determine the control of multiple applications according to the free memory. Program. Optionally, in some embodiments, when determining a control scheme for multiple applications, the memory management module 250 is configured to determine the application running in the background when it is detected that the free memory is less than the memory threshold; according to user preference data , Determine the application program to be recycled among multiple applications; and reclaim the memory occupied by the application program to be recycled. Optionally, in some embodiments, when determining the control scheme for multiple application programs, the memory management module 250 is configured to determine that the free memory is less than the memory threshold according to user preference data in multiple application programs. Protected applications; release the memory other than the memory occupied by the protected applications; and prioritize the allocation of the system resources of the electronic device to the protected applications.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本申请所提供的几个实施例中,所显示或讨论的模块相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the device and module described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. In the several embodiments provided in this application, the coupling or direct coupling or communication connection between the displayed or discussed modules may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be electrical, Mechanical or other forms.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
在实际的应用场景中,电子设备100可作为智能手机终端进行使用,在这种情况下,电子设备100通常还包括一个或多个(图6中仅示出一个)如下部件:处理器102、存储器104、拍摄模块108、音频电路110、输入模块118、电源模块122、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器104中并被配置为由一个或多个处理器102执行,一个或多个程序配置用于执行如前述方法实施例 所描述的方法。拍摄模块108可以包括上述的主控芯片40。本领域普通技术人员可以理解,图6所示的结构仅为示意,其并不对电子设备100的结构造成限定。例如,电子设备100还可包括比图6中所示更多或者更少的组件,或者具有与图6所示不同的配置。In actual application scenarios, the electronic device 100 can be used as a smart phone terminal. In this case, the electronic device 100 usually also includes one or more (only one is shown in FIG. 6) the following components: a processor 102, The memory 104, the shooting module 108, the audio circuit 110, the input module 118, the power module 122, and one or more application programs, of which one or more application programs may be stored in the memory 104 and configured to be composed of one or more The processor 102 executes, and one or more programs are configured to execute the method described in the foregoing method embodiment. The photographing module 108 may include the above-mentioned main control chip 40. Those of ordinary skill in the art can understand that the structure shown in FIG. 6 is only for illustration, and does not limit the structure of the electronic device 100. For example, the electronic device 100 may also include more or fewer components than those shown in FIG. 6 or have a different configuration from that shown in FIG. 6.
处理器102可以包括一个或者多个处理核。处理器102利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。The processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104. Various functions and processing data of the electronic device 100. Optionally, the processor 102 may use at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). A kind of hardware form to realize. The processor 102 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc. The data storage area can also store data (such as phone book, audio and video data, chat record data) created by the electronic device 100 during use.
拍摄模块108用于执行拍摄任务,例如,用于拍摄照片、视频或者进行可视电话通话等。音频电路110、扬声器101、声音插孔103、麦克风105共同提供用户与电子设备100之间的音频接口。具体地,音频电路110从处理器102处接收声音数据,将声音数据转换为电信号,将电信号传输至扬声器101。扬声器101将电信号转换为人耳能听到的声波。音频电路110还从麦克风105处接收电信号,将电信号转换为声音数据,并将声音数据传输给处理器102以进行进一步的处理。The photographing module 108 is used to perform photographing tasks, for example, for taking photos, videos, or making video phone calls. The audio circuit 110, the speaker 101, the sound jack 103, and the microphone 105 jointly provide an audio interface between the user and the electronic device 100. Specifically, the audio circuit 110 receives sound data from the processor 102, converts the sound data into electrical signals, and transmits the electrical signals to the speaker 101. The speaker 101 converts electrical signals into sound waves that can be heard by human ears. The audio circuit 110 also receives electrical signals from the microphone 105, converts the electrical signals into sound data, and transmits the sound data to the processor 102 for further processing.
本实施例中,输入模块118可包括设置在触摸屏30上的触摸屏109,触摸屏109可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触摸屏109上或在触摸屏109附近的操作),并根据预先设定的程序驱动相应的连接装置。除了触摸屏109,在其它变更实施方式中,输入模块118还可以包括其他输入设备,如按键107或麦克风105。按键107例如可包括用于输入字符的字符按键,以及用于触发控制功能的控制按键。控制按键的实例包括“返回主屏”按键、开机/关机按键等等。麦克风105可以用于接收用户的语音命令。In this embodiment, the input module 118 may include a touch screen 109 provided on the touch screen 30, and the touch screen 109 may collect user touch operations on or near it (for example, the user uses a finger, a stylus, or any other suitable object or accessory on the touch screen 109). Operation on or near the touch screen 109), and drive the corresponding connection device according to a preset program. In addition to the touch screen 109, in other modified embodiments, the input module 118 may also include other input devices, such as a button 107 or a microphone 105. The keys 107 may include, for example, character keys for inputting characters and control keys for triggering control functions. Examples of control buttons include a "back to main screen" button, a power-on/off button, and so on. The microphone 105 can be used to receive voice commands from the user.
触摸屏30用于显示由用户输入的信息、提供给用户的信息以及电子设备100的各种图形用户界面,这些图形用户界面可以由图形、文本、图标、数字、视频和其任意组合来构成,在一个实例中,触摸屏109可设置于触摸屏30上从而与触摸屏30构成一个整体。The touch screen 30 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device 100. These graphical user interfaces can be composed of graphics, text, icons, numbers, videos, and any combination thereof. In an example, the touch screen 109 may be disposed on the touch screen 30 so as to form an integral body with the touch screen 30.
电源模块122用于向处理器102以及其他各组件提供电力供应。具体地,电源模块122可包括电源管理装置、一个或多个电源(如电池或者交流电)、充电电路、电源失效检测电路、逆变器、电源状态指示灯以及其他任意与电子组件或触摸屏30内电力的生成、管理及分布相关的组件。The power supply module 122 is used to provide power supply to the processor 102 and other components. Specifically, the power module 122 may include a power management device, one or more power sources (such as batteries or alternating current), a charging circuit, a power failure detection circuit, an inverter, a power status indicator, and any other electronic components or touch screen 30 Components related to the generation, management and distribution of electricity.
应当理解的是,上述的电子设备100并不局限于智能手机终端,其应当指可以在移动中使用的计算机设备。具体而言,电子设备100,是指搭载了智能操作装置的移动计算机设备,电子设备100包括但不限 于智能手机、智能手表、笔记本、平板电脑、POS机甚至包括车载电脑,等等。It should be understood that the aforementioned electronic device 100 is not limited to a smart phone terminal, and should refer to a computer device that can be used on the move. Specifically, the electronic device 100 refers to a mobile computer device equipped with a smart operating device. The electronic device 100 includes, but is not limited to, a smart phone, a smart watch, a notebook, a tablet computer, a POS machine, and even a vehicle-mounted computer, and so on.
请参考图7,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读存储介质800中存储有程序代码,程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 7, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable storage medium 800 stores program codes, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非瞬时性计算机可读存储介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products. The program code 810 may be compressed in a suitable form, for example.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,描述的具体特征或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, descriptions with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean specific features described in conjunction with the embodiment or example Or the feature is included in at least one embodiment or example of the present application. In this specification, the specific features or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples and the features of the different embodiments or examples described in this specification without contradicting each other.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读存储介质中,以供指令执行装置、装置或设备(如基于计算机的装置、包括处理器的装置或其他可以从指令执行装置、装置或设备取指令并执行指令的装置)使用,或结合这些指令执行装置、装置或设备而使用。就本说明书而言,"计算机可读存储介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行装置、装置或设备或结合这些指令执行装置、装置或设备而使用的装置。计算机可读存储介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子设备),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读存储介质甚至可以是可在其上打印程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logic functions, and can be embodied in any computer-readable storage medium , For use by instruction execution devices, devices, or equipment (such as computer-based devices, devices including processors, or other devices that can fetch instructions from and execute instructions from instruction execution devices, devices, or equipment), or combine these instruction execution devices, Device or equipment. For the purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution device, device, or device or in combination with these instruction execution devices, devices, or devices. . More specific examples (non-exhaustive list) of computer-readable storage media include the following: electrical connections (electronic equipment) with one or more wiring, portable computer disk cases (magnetic devices), random access memory (RAM) , Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read-only memory (CDROM) In addition, the computer-readable storage medium can even be paper or other suitable media on which the program can be printed, because it can be done, for example, by optically scanning the paper or other media, and then editing, interpreting, or other suitable methods when necessary. Processing is performed to obtain the program electronically and then store it in the computer memory.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行装置执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that each part of this application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if it is implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: Discrete logic circuits, application-specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读存储介质中。A person of ordinary skill in the art can understand that all or part of the steps carried in the method of the foregoing embodiments can be implemented by a program instructing relevant hardware to complete. The program can be stored in a computer-readable storage medium, and the program can be executed when the program is executed. , Including one of the steps of the method embodiment or a combination thereof. In addition, each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例, 可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。The aforementioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present application. A person of ordinary skill in the art can comment on the above-mentioned embodiments within the scope of the present application. The embodiment undergoes changes, modifications, substitutions, and modifications.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application, not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features thereof are equivalently replaced; these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种应用程序管理方法,应用于电子设备,所述电子设备配置有多个应用程序,其特征在于,所述方法包括:An application program management method applied to an electronic device configured with multiple application programs, characterized in that the method includes:
    获取所述电子设备当前所处环境的当前环境数据;Acquiring current environmental data of the environment where the electronic device is currently located;
    获取每个所述应用程序的用户偏好数据,所述用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小;Acquiring user preference data of each application program, where the user preference data is used to indicate the probability that the application program is invoked in the corresponding environment;
    根据所述当前环境数据以及所述用户偏好数据,在多个所述应用程序中确定需预加载的应用程序;以及According to the current environment data and the user preference data, determine the application program that needs to be preloaded among a plurality of the application programs; and
    将需预加载的应用程序的启动数据加载至所述电子设备的内存。Loading the startup data of the application program that needs to be preloaded into the memory of the electronic device.
  2. 如权利要求1所述的方法,其特征在于,在获取每个所述应用程序的用户偏好数据之前,所述方法还包括:The method according to claim 1, wherein before obtaining user preference data of each of the application programs, the method further comprises:
    根据每个所述应用程序的历史运行数据,确定每个所述应用程序对应的用户偏好数据。According to the historical running data of each application, user preference data corresponding to each application is determined.
  3. 如权利要求2所述的方法,其特征在于,所述根据每个所述应用程序的历史运行数据,确定每个所述应用程序对应的用户偏好数据,包括:3. The method of claim 2, wherein the determining user preference data corresponding to each application program according to the historical operating data of each application program comprises:
    在电子设备运行时,获取每个应用程序的历史运行数据,所述历史运行数据包括活跃时长以及运行时的环境数据;When the electronic device is running, acquiring historical operating data of each application program, the historical operating data including active duration and runtime environmental data;
    在所述应用程序的历史运行数据保存时长超过预定时长时,分析所述历史运行数据;以及When the storage period of the historical operation data of the application program exceeds a predetermined period of time, analyze the historical operation data; and
    根据所述历史运行数据,确定每个应用程序的用户偏好数据。According to the historical operation data, user preference data of each application program is determined.
  4. 如权利要求2~3中任一项所述的方法,其特征在于,所述根据每个所述应用程序的历史运行数据,确定每个所述应用程序对应的用户偏好数据,包括:The method according to any one of claims 2 to 3, wherein the determining user preference data corresponding to each application program according to the historical operating data of each application program comprises:
    根据每个所述应用程序在历史运行时,所述电子设备所处环境的历史环境数据以及每个所述应用程序在所述历史环境数据中的活跃时长,确定每个所述应用程序在对应的历史环境的用户偏好数据。According to the historical environment data of the environment in which the electronic device is located when each application program is running in history, and the active duration of each application program in the historical environment data, it is determined that each application program is in the corresponding User preference data for the historical environment.
  5. 如权利要求4所述的方法,其特征在于,所述根据每个所述应用程序在历史运行时,所述电子设备所处环境的历史环境数据以及每个所述应用程序在所述历史环境数据中的活跃时长,确定每个所述应用程序在当前环境的用户偏好数据,包括:The method according to claim 4, characterized in that, according to the historical environment data of the environment in which the electronic device is located when each of the applications is running in history, and the historical environment data of each of the applications in the historical environment The active duration in the data determines the user preference data of each application in the current environment, including:
    当多个所述应用程序中的一个启动并在前台运行时,将其作为前台应用程序;When one of the multiple applications is started and runs in the foreground, it is regarded as the foreground application;
    获取所述前台应用程序运行时,所述电子设备所处环境的环境数据;Acquiring environmental data of the environment in which the electronic device is located when the foreground application is running;
    获取所述前台应用程序对应于所述环境数据的活跃时长;以及Acquiring the active duration of the foreground application corresponding to the environmental data; and
    根据所述活跃时长确定所述前台应用程序在对应的所述历史环境的用户偏好数据。The user preference data of the foreground application in the corresponding historical environment is determined according to the active duration.
  6. 如权利要求5所述的方法,其特征在于,所述根据所述活跃时长确定所述前台应用程序在对应的所述历史环境的用户偏好数据,包括:The method of claim 5, wherein the determining user preference data of the foreground application in the corresponding historical environment according to the active duration comprises:
    将所述前台应用程序的所述活跃时长作为所述用户偏好数据;或,Use the active duration of the foreground application as the user preference data; or,
    将所述活跃时长与活跃时长总和之间的比值作为所述用户偏好数据,其中,所述活跃时长总和是指多个所述应用程序在历史运行中对应于当前环境的活跃时长的和。The ratio between the active duration and the total active duration is used as the user preference data, where the total active duration refers to the sum of the active durations of a plurality of the application programs corresponding to the current environment in the historical operation.
  7. 如权利要求1~6中任一项所述的方法,其特征在于,所述当前环境数据包括时间数据,所述获取所述电子设备当前所处环境的当前环境数据,包括:The method according to any one of claims 1 to 6, wherein the current environment data includes time data, and the obtaining the current environment data of the environment where the electronic device is currently located includes:
    所述电子设备运行时,获取所述电子设备当前的时间点;以及Acquiring the current time point of the electronic device when the electronic device is running; and
    将该当前时间点作为所述电子设备当前所处环境的当前环境数据。The current time point is taken as the current environment data of the environment where the electronic device is currently located.
  8. 如权利要求7所述的方法,其特征在于,所述用户偏好数据包括所述应用程序在历史运行中的启动时间数据;所述将需预加载的应用程序的启动数据加载至所述电子设备的内存,包括:The method according to claim 7, wherein the user preference data includes the startup time data of the application program in historical operation; the startup data of the application program that needs to be preloaded is loaded to the electronic device The memory includes:
    根据启动时间数据以及提前时长,确定需预加载的应用程序的启动数据的加载时间点;其中,所述提前时长表征加载所述启动数据的时间点与需预加载的应用程序的启动时间数据之间的差值;According to the startup time data and the advance duration, determine the loading time point of the startup data of the application program that needs to be preloaded; wherein the advance duration represents the time point at which the startup data is loaded and the startup time data of the application program that needs to be preloaded. Difference between
    在所述加载时间点将需预加载的应用程序启动数据加载至所述电子设备的内存。At the loading time point, the application startup data that needs to be preloaded are loaded into the memory of the electronic device.
  9. 如权利要求1~8中任一项所述的方法,其特征在于,所述当前环境数据包括场景数据,所述获取所述电子设备当前所处环境的当前环境数据,包括:The method according to any one of claims 1 to 8, wherein the current environment data includes scene data, and the obtaining the current environment data of the environment where the electronic device is currently located includes:
    所述电子设备运行时,获取所述电子设备当前的位置信息;Acquiring the current location information of the electronic device when the electronic device is running;
    通过所述电子设备的摄像头获取所述电子设备当前所处环境的环境图像;Acquiring the environment image of the environment where the electronic device is currently located through the camera of the electronic device;
    根据所述位置信息以及所述环境图像,确定所述电子设备的场景数据;以及Determine the scene data of the electronic device according to the location information and the environment image; and
    根据所述场景数据,确定所述当前环境数据。According to the scene data, the current environment data is determined.
  10. 如权利要求9所述的方法,其特征在于,所述用户偏好数据包括所述应用程序在历史运行中的启动地点数据;所述将需预加载的应用程序的启动数据加载至所述电子设备的内存,包括:The method according to claim 9, wherein the user preference data includes data on the startup location of the application program in historical operation; and the loading of the startup data of the application program that needs to be preloaded to the electronic device The memory includes:
    根据电子设备启动地点数据以及距离阈值,确定需预加载的应用程序的启动数据的加载地理围栏,其中,距离阈值表征所述启动地点数据与加载地理围栏的边界之间的距离;以及Determine the loading geofence of the startup data of the application to be preloaded according to the start location data of the electronic device and the distance threshold, where the distance threshold represents the distance between the start location data and the boundary of the loading geofence; and
    当所述电子设备进入所述地理围栏时,将需预加载的应用程序启动数据加载至所述电子设备的内存。When the electronic device enters the geofence, the application startup data that needs to be preloaded are loaded into the memory of the electronic device.
  11. 如权利要求1~10中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 10, wherein the method further comprises:
    根据预设的周期,获取所述电子设备当前所处环境的当前环境数据;Acquire current environmental data of the environment in which the electronic device is currently located according to a preset period;
    确定所述当前环境数据的数据变化量;以及Determine the data change amount of the current environmental data; and
    在所述数据变化量大于变化阈值时,根据变化后的当前环境数据以及所述用户偏好数据,重新确定需预加载的应用程序,并加载重新确定的需预加载的应用程序。When the amount of data change is greater than the change threshold, based on the changed current environment data and the user preference data, the application program that needs to be preloaded is re-determined, and the re-determined application program that needs to be preloaded is loaded.
  12. 如权利要求1~11中任一项所述的方法,其特征在于,所述将需预加载的应用程序的启动数据加载至所述电子设备的内存,包括:The method according to any one of claims 1 to 11, wherein the loading the startup data of the application program that needs to be preloaded into the memory of the electronic device comprises:
    根据需加载的应用程序,在多个所述应用程序中确定不需加载的应用程序;According to the application program to be loaded, determine the application program that does not need to be loaded among the plurality of application programs;
    将不需加载的应用程序所占用的内存回收;Reclaim the memory occupied by applications that do not need to be loaded;
    确定需预加载的应用程序的启动数据;以及Determine the startup data of the application that needs to be preloaded; and
    将所述启动数据加载至所述电子设备的内存。The boot data is loaded into the memory of the electronic device.
  13. 如权利要求1~12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-12, wherein the method further comprises:
    所述电子设备运行时,根据预设的周期确定电子设备的空闲内存;以及When the electronic device is running, determine the free memory of the electronic device according to a preset period; and
    根据所述空闲内存,确定对多个所述应用程序的控制方案。According to the free memory, a control scheme for a plurality of the application programs is determined.
  14. 如权利要求13所述的方法,其特征在于,所述根据所述空闲内存,确定对多个所述应用程序的控制方案,包括:The method according to claim 13, wherein the determining a control scheme for a plurality of the application programs according to the free memory comprises:
    在检测到空闲内存小于内存阈值时,确定处于后台运行的应用程序;When it is detected that the free memory is less than the memory threshold, determine the application running in the background;
    根据所述用户偏好数据,在多个所述应用程序中确定待回收的应用程序;以及According to the user preference data, determine the application program to be recycled among a plurality of the application programs; and
    将所述待回收的应用程序占用的内存回收。The memory occupied by the application program to be recycled is recycled.
  15. 如权利要求13~14中任一项所述的方法,其特征在于,所述根据所述空闲内存,确定对多个所述应用程序的控制方案,包括:The method according to any one of claims 13 to 14, wherein the determining a control scheme for a plurality of the application programs according to the free memory comprises:
    在检测到空闲内存小于内存阈值时,根据所述用户偏好数据,在多个所述应用程序中确定受保护的应用程序;When it is detected that the free memory is less than the memory threshold, determine the protected application program among the plurality of the application programs according to the user preference data;
    将受保护的应用程序所占用的内存之外的内存释放;以及Release the memory other than the memory occupied by the protected application; and
    将所述电子设备的系统资源优先分配给受保护的应用程序。The system resources of the electronic device are preferentially allocated to the protected application.
  16. 一种应用程序管理装置,应用于电子设备,所述电子设备配置有多个应用程序,所述应用程序管理装置包括:An application program management device applied to an electronic device, the electronic device is configured with a plurality of application programs, and the application program management device includes:
    环境数据获取模块,用于获取所述电子设备当前所处环境的当前环境数据;An environmental data acquisition module for acquiring current environmental data of the environment where the electronic device is currently located;
    偏好数据获取模块,用于获取每个所述应用程序的用户偏好数据,所述用户偏好数据用于指示应用程序在对应环境中被调用的可能性大小;A preference data acquisition module, configured to acquire user preference data of each application program, where the user preference data is used to indicate the probability that the application program is invoked in the corresponding environment;
    预加载确定模块,用于根据所述当前环境数据以及所述用户偏好数据,在多个所述应用程序中确定需预加载的应用程序;以及A preload determination module, configured to determine an application program that needs to be preloaded among a plurality of the application programs according to the current environment data and the user preference data; and
    加载模块,用于将需预加载的应用程序的启动数据加载至所述电子设备的内存。The loading module is used to load the startup data of the application program that needs to be preloaded into the memory of the electronic device.
  17. 如权利要求16所述的应用程序管理装置,其特征在于,所述加载模块包括:The application management device according to claim 16, wherein the loading module comprises:
    回收程序确定单元,用于根据需加载的应用程序,在多个所述应用程序中确定不需加载的应用程序;The recycling program determining unit is configured to determine the application program that does not need to be loaded among the multiple application programs according to the application program to be loaded;
    回收单元,用于将不需加载的应用程序所占用的内存回收;The recovery unit is used to recover the memory occupied by applications that do not need to be loaded;
    启动数据获取单元,用于确定需预加载的应用程序的启动数据;以及The startup data acquisition unit is used to determine the startup data of the application program to be preloaded; and
    加载单元,用于将所述启动数据加载至所述电子设备的内存。The loading unit is configured to load the startup data to the memory of the electronic device.
  18. 如权利要求16所述的应用程序管理装置,其特征在于,所述应用程序管理装置还包括:15. The application management device of claim 16, wherein the application management device further comprises:
    空闲内存检测模块,用于所述电子设备运行时,根据预设的周期确定电子设备的空闲内存,以及The free memory detection module is used to determine the free memory of the electronic device according to a preset period when the electronic device is running, and
    应用程序控制模块,用于根据所述空闲内存,确定对多个所述应用程序的控制方案The application program control module is used to determine a control plan for a plurality of the application programs according to the free memory
  19. 一种电子设备,其特征在于,所述电子设备一个或多个处理器、存储器以及一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-15中任一项所述的应用程序管理方法。An electronic device, characterized in that the electronic device has one or more processors, a memory, and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be operated by The one or more processors execute, and the one or more programs are configured to execute the application management method according to any one of claims 1-15.
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,所述程序代码可被处理器调用执行所述权利要求1-15中任一项所述的应用程序管理方法。A computer-readable storage medium, wherein a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the application according to any one of claims 1-15 Procedure management method.
PCT/CN2019/112319 2019-10-21 2019-10-21 Application program management method and apparatus, electronic device, and storage medium WO2021077261A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980098911.3A CN114174987A (en) 2019-10-21 2019-10-21 Application program management method and device, electronic equipment and storage medium
PCT/CN2019/112319 WO2021077261A1 (en) 2019-10-21 2019-10-21 Application program management method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/112319 WO2021077261A1 (en) 2019-10-21 2019-10-21 Application program management method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021077261A1 true WO2021077261A1 (en) 2021-04-29

Family

ID=75619305

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/112319 WO2021077261A1 (en) 2019-10-21 2019-10-21 Application program management method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114174987A (en)
WO (1) WO2021077261A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568745A (en) * 2021-07-23 2021-10-29 Oppo广东移动通信有限公司 Hardware resource control method, device, storage medium and terminal
CN116048648A (en) * 2022-07-28 2023-05-02 荣耀终端有限公司 Application preloading method, application starting method and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661377A (en) * 2022-03-31 2022-06-24 四川酷比通信设备有限公司 Software preloading method based on position information and preloading system thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843961A (en) * 2017-01-19 2017-06-13 上海斐讯数据通信技术有限公司 System and its application method that a kind of application program of mobile phone is preloaded and cleared up
CN109947495A (en) * 2017-12-20 2019-06-28 广东欧珀移动通信有限公司 Application program preloads method, apparatus, storage medium and mobile terminal
WO2019171237A1 (en) * 2018-03-05 2019-09-12 Tensera Networks Ltd. Application preloading in the presence of user actions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843961A (en) * 2017-01-19 2017-06-13 上海斐讯数据通信技术有限公司 System and its application method that a kind of application program of mobile phone is preloaded and cleared up
CN109947495A (en) * 2017-12-20 2019-06-28 广东欧珀移动通信有限公司 Application program preloads method, apparatus, storage medium and mobile terminal
WO2019171237A1 (en) * 2018-03-05 2019-09-12 Tensera Networks Ltd. Application preloading in the presence of user actions

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568745A (en) * 2021-07-23 2021-10-29 Oppo广东移动通信有限公司 Hardware resource control method, device, storage medium and terminal
CN116048648A (en) * 2022-07-28 2023-05-02 荣耀终端有限公司 Application preloading method, application starting method and electronic equipment
CN116048648B (en) * 2022-07-28 2024-04-05 荣耀终端有限公司 Application preloading method, application starting method and electronic equipment

Also Published As

Publication number Publication date
CN114174987A (en) 2022-03-11

Similar Documents

Publication Publication Date Title
EP3502880B1 (en) Method for preloading application, storage medium, and terminal device
WO2021077261A1 (en) Application program management method and apparatus, electronic device, and storage medium
CN107209781B (en) Contextual search using natural language
US20210389973A1 (en) Electronic device and method for operating the same
US11164097B2 (en) Method for preloading application, storage medium, and terminal device
EP3502879B1 (en) Method for preloading application, storage medium, and terminal device
US10908920B2 (en) Method for preloading application, computer readable storage medium, and terminal device
CN107835311B (en) Application management method and device, storage medium and electronic equipment
CN107885545B (en) Application management method and device, storage medium and electronic equipment
US20180367325A1 (en) Method and system for sorting chatroom list based on conversational activeness and contextual information
CN111158910A (en) Memory management method and device, storage medium and electronic equipment
CN107608778B (en) Application program control method and device, storage medium and electronic equipment
CN108701026A (en) Method and apparatus for the managing process under memory constraints
CN111274039A (en) Memory recovery method and device, storage medium and electronic equipment
CN109634762B (en) Data recovery method and device, electronic equipment and storage medium
CN111381953B (en) Process management method and device, storage medium and electronic equipment
CN108038050B (en) Performance adjusting method and device, storage medium and electronic equipment
CN111008079B (en) Process management method, device, storage medium and electronic equipment
CN111475299A (en) Memory allocation method and device, storage medium and electronic equipment
CN113342505A (en) Thread identification method, thread identification device, storage medium and electronic equipment
CN113368494A (en) Cloud equipment distribution method and device, electronic equipment and storage medium
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN114938363B (en) Voice data transmission device and method
CN116700816A (en) Resource management method and electronic equipment
CN107835309B (en) Background application cleaning method and device, storage medium and electronic equipment

Legal Events

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

Ref document number: 19949628

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19949628

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19949628

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.10.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19949628

Country of ref document: EP

Kind code of ref document: A1