CN116661882A - Method for preloading applet, electronic device and storage medium - Google Patents

Method for preloading applet, electronic device and storage medium Download PDF

Info

Publication number
CN116661882A
CN116661882A CN202211466475.0A CN202211466475A CN116661882A CN 116661882 A CN116661882 A CN 116661882A CN 202211466475 A CN202211466475 A CN 202211466475A CN 116661882 A CN116661882 A CN 116661882A
Authority
CN
China
Prior art keywords
applet
alive
keep
application
preloading
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202211466475.0A
Other languages
Chinese (zh)
Other versions
CN116661882B (en
Inventor
林洪甫
朱金鹏
司徒景山
周晓龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211466475.0A priority Critical patent/CN116661882B/en
Publication of CN116661882A publication Critical patent/CN116661882A/en
Application granted granted Critical
Publication of CN116661882B publication Critical patent/CN116661882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a method for preloading an applet, electronic equipment and a storage medium. The method for preloading the applet comprises the following steps: according to the current scene, a first applet in the first application needs to be preloaded, and under the condition that the first applet is not operated, the first applet is preloaded and kept alive, so that the first applet can be preloaded and kept alive in advance. When the instruction of starting the applet by the user is detected subsequently, the electronic device can directly execute the flow of starting the applet after preloading, so that the time consumed in the process of starting the applet can be reduced, and the user experience is improved.

Description

Method for preloading applet, electronic device and storage medium
Technical Field
The present application relates to the field of terminal devices, and in particular, to a method for preloading an applet, an electronic device, and a storage medium.
Background
The applet has the characteristics of no downloading, small occupied memory, smooth running and the like, and is applied to more and more fields. The user may be able to access the application (e.g.)) Middle clickThe applet icon or the two-dimensional code scanning mode opens the applet. In the prior art, electronic devices such as mobile phones generally start to execute the starting flow of the applet when detecting the instruction for starting the applet, and the problem of long time consumption in the starting process of the applet is easy to occur.
Disclosure of Invention
The application provides a method for preloading an applet, electronic equipment and a storage medium, which are used for solving the problem of long time consumption in the starting process of the applet in the prior art.
In order to achieve the above purpose, the application adopts the following technical scheme:
in a first aspect, a method for preloading an applet is provided, applied to an electronic device, including:
determining that a first applet in a first application needs to be preloaded according to a current scene; and preloading the first applet to keep alive the first applet under the condition that the first applet is not operated.
In the above embodiment, when it is determined that the first applet in the first application needs to be preloaded according to the current scene, it is explained that the user may open the first applet in the current scene. If the first applet is not operated at this time, which means that no instruction for starting the applet by the user is detected, the first applet is preloaded and kept alive, so that the first applet can be preloaded and kept alive in advance. When the instruction of starting the applet by the user is detected subsequently, the electronic device can directly execute the flow of starting the applet after preloading, so that the time consumed in the process of starting the applet can be reduced, and the user experience is improved.
In one embodiment, the keeping the first applet alive includes: and intercepting the first process in the first application to prevent the first process from killing the first applet, so that the first application can be prevented from killing the first applet after preloading the first applet.
In an embodiment, the intercepting the first process in the first application to prevent the first process from killing the first applet includes: and sending the keep-alive attribute of the first application and the first identification of the first applet to the first process to indicate that the first process does not kill the first applet when receiving the instruction of the first application for killing the first applet.
In one embodiment, the keeping the first applet alive includes: and adding the second identifier of the first applet to a keep-alive white list, wherein the identifier of a process which is not killed by the operating system is stored in the keep-alive white list, so that the operating system can be prevented from killing the first applet after preloading the first applet.
In an embodiment, the preloading the first applet, the keeping alive the first applet includes: the first applet is preloaded, and under the condition that the electronic equipment is detected to execute the preloading, the first applet is kept alive, so that the first applet can be ensured to run in the background after the first applet is completely preloaded.
In an embodiment, after determining that the first applet in the first application needs to be preloaded according to the current scenario, the method further comprises: and under the condition that the first applet is detected to be operated, the first applet is kept alive, so that in a scene that the first applet is required to be used for a plurality of times, the starting time can be shortened each time the first applet is used.
In an embodiment, after the determining that the first applet in the first application needs to be preloaded according to the current scenario, the method further comprises: determining the keep-alive time corresponding to the first applet;
correspondingly, after said keeping alive the first applet, the method further comprises: and when the keep-alive time is reached, the keep-alive of the first applet is released.
By deactivating the keep-alive at the end of the keep-alive time, the effect of the long-term keep-alive first applet on the operating speed of the electronic device can be prevented.
In an embodiment, the method further comprises: acquiring the starting time of the first applet in a preset period; and updating the keep-alive time according to the starting time, so that the keep-alive time can be updated according to the actual use habit of the user, and the starting time of the first applet is shortened when the user needs to start the first applet.
In an embodiment, the current scene includes one or more of a location where the electronic device is currently located, a current time, and an application running on the electronic device.
In a second aspect, an apparatus for preloading an applet is provided, applied to an electronic device, comprising:
the storage module is used for determining that a first applet in a first application needs to be preloaded according to the current scene;
and the processing module is used for preloading the first applet and keeping the first applet alive under the condition that the first applet is not operated.
In one embodiment, the processing module is specifically configured to:
a first process in the first application is intercepted to prevent the first process from killing the first applet.
In one embodiment, the processing module is specifically configured to:
and sending the keep-alive attribute of the first application and the first identification of the first applet to the first process to indicate that the first process does not kill the first applet when receiving the instruction of the first application for killing the first applet.
In one embodiment, the processing module is specifically configured to:
and adding the second identification of the first applet to a keep-alive white list, wherein the keep-alive white list stores the identifications of the processes which are not killed by the operating system.
In one embodiment, the processing module is specifically configured to:
preloading the first applet;
and keeping the first applet alive under the condition that the electronic device is detected to execute preloading.
In an embodiment, the processing module is further configured to:
and keeping the first applet alive under the condition that the first applet is detected to be operated.
In an embodiment, the processing module is further configured to:
determining the keep-alive time corresponding to the first applet;
and when the keep-alive time is reached, the keep-alive of the first applet is released.
In an embodiment, the processing module is further configured to:
acquiring the starting time of the first applet in a preset period;
and updating the keep-alive time according to the starting time.
In an embodiment, the current scene includes one or more of a location where the electronic device is currently located, a current time, and an application running on the electronic device.
In a third aspect, an electronic device is provided, comprising a processor for executing a computer program stored in a memory for implementing a method of preloading an applet as described in the first aspect above.
In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program which, when executed by a processor, implements a method of preloading an applet as described in the first aspect above.
In a fifth aspect, there is provided a chip comprising a processor coupled to a memory, the processor executing a computer program or instructions stored in the memory to implement the method of preloading the applet as in the first aspect.
In a sixth aspect, there is provided a computer program product for causing an electronic device to perform the method of preloading the applet described in the first aspect above, when the computer program product is run on the electronic device.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
FIG. 1 is a schematic diagram of a procedure of starting an applet according to a user operation of an electronic device according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for preloading a applet according to an embodiment of the present application;
FIG. 3 is a block diagram of a method for implementing a preload applet, according to an embodiment of the application;
FIG. 4 is a software architecture diagram of a method for implementing a preload applet, provided by an embodiment of the application;
FIG. 5 is a flowchart illustrating a method for preloading applets according to an embodiment of the application;
FIG. 6 is an interaction diagram of the YOYO suggestion and IAware APK provided by an embodiment of the application;
FIG. 7 is a flowchart of a method for implementing a preload applet by a preload module provided in an embodiment of the application;
FIG. 8 is a flowchart of an implementation of a preloaded and keep-alive first applet provided by an embodiment of the application;
FIG. 9 is a flowchart of a deactivation implementation provided by an embodiment of the present application;
FIG. 10 is a flowchart of an implementation of a pull-up first applet blank process provided in an embodiment of the application;
FIG. 11 is a flowchart illustrating a process for intercepting and killing a first applet according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The term "and/or" refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise.
The method for preloading the applet is applied to the electronic equipment. The electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a handheld computer, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, a media player, a wearable device, or the like, which may be held/operated by one hand, and the specific form/type of the electronic device is not particularly limited in the embodiments of the present application. The electronic device includes but is not limited to a mounted device Hong Mongolian System (Harmony OS) or other operating system devices.
As shown in fig. 1, the procedure of the electronic device for starting the applet according to the user operation is generally as follows. And the electronic equipment starts the application program under the condition that the shortcut of the application program is clicked on the desktop by the user. After the application program is started, the electronic device detects an operation of starting the applet by a user (for example, clicking an icon of the applet or scanning a two-dimensional code corresponding to the starting applet), and opens a starting interface of the applet in response to the operation of starting the applet. After the display interface of the electronic device displays the starting interface of the applet, the process of initializing the applet is started. After the initialization is completed, the electronic device opens the main page of the applet. And after the main page of the applet is displayed on the display interface of the electronic equipment, loading the content of the applet. After loading is complete, the user can use the applet.
Wherein the time taken by the electronic device from starting the start of the application to displaying the start interface of the applet on the display interface is approximately 0.5s. The user may also launch the applet by clicking on a shortcut to the card or applet on the desktop on the negative screen, or by clicking on a notification message in a functional module on the electronic device (e.g., yoyoyo advice). The above-described method also requires a certain time. After the electronic device responds to the operation of starting the applet, the applet is initialized. The time consumed by the electronic device to initialize the applet is approximately 2s, the time consumed by the electronic device to open the main page of the applet is approximately 0.5s, and the time for the electronic device to load the content of the applet is approximately 2s. Therefore, the time required for the whole start-up procedure of the applet is typically more than 5s, which results in a longer waiting time for the user, which affects the user experience.
Therefore, the application provides a method for preloading the applet, which is used for explaining that a user may use the first applet in the current scene when the first applet in the first application needs to be preloaded according to the current scene, and preloading the first applet to keep alive under the condition that the first applet is not operated. The process of preloading the first applet is a process of initializing the first applet. When the instruction of starting the first applet by the user is detected subsequently, the electronic device can skip the process of preloading the first applet and execute the process after preloading the first applet after displaying the starting interface of the first applet on the display interface according to the user operation, so that the time consumed in the starting process of the first applet can be reduced, and the user experience is improved.
The method for preloading the applet provided by the embodiment of the application is exemplified below.
As shown in fig. 2, a method for preloading an applet according to an embodiment of the present application includes:
s201: a first applet in the first application needs to be preloaded according to the current scenario.
The first application is an application program which needs to be installed on the electronic equipment to be run, and the first applet can be started under the condition that the first application is started. For example, the first application may be And the like. The first applet may be a ride code applet, a health code applet, or the like. The need to preload the first applet refers to the first applet that the user may use after a preset period (e.g., 1 minute) in the current scenario.
The current context may be one or more of a location where the electronic device is currently located, a current time, an application running on the electronic device. For example, when the current position of the electronic equipment is in the range of the subway station, determining that the car riding code applet in the WeChat needs to be preloaded; determining that a health code applet in a WeChat needs to be preloaded when the current position is in the range of a work place and the current time is between 8 and 9 points in the morning; determining that the take-out applet in the payment device needs to be preloaded when the current position is the range of the work place and the current time is 11 am; and when the current position is the range of the airport, the WeChat application program runs on the electronic equipment, and the health code applet is opened by the user, determining that the journey card applet in the WeChat needs to be preloaded.
The electronic device may determine that the first applet in the first application needs to be preloaded when the current scene is consistent with a preset scene of preloading the first applet in the first application. The current scene can also be input into a preset scene recognition model, and whether the applet needs to be preloaded and the identification of the applet needing to be preloaded are determined according to the output result of the scene recognition model. The scene recognition model may be a model stored in the electronic device in advance, or may be obtained by learning a scene in which the user uses each applet. For example, the electronic device records the scene of the user using each applet in a preset period (for example, the last week or the last month), trains the classification model (initial model based on the intelligent algorithm) by using the recorded information as a training sample, and obtains a scene recognition model. For another example, the electronic device may send the recorded information to a server, and the server trains the classification model according to the received information to obtain a scene recognition model, and then sends the scene recognition model to the corresponding electronic device.
S202: and preloading the first applet to keep alive the first applet under the condition that the first applet is not operated.
Specifically, the first applet is not running, which means that the user has not started the first applet, i.e. the operation of starting the first applet by the user has not been detected in the current scenario. Preloading the first applet refers to pulling up the first applet empty process and also to initializing the first applet. Keep-alive the first applet means that the first applet is not killed when the first applet is running in the background.
In one embodiment, the keep-alive the first applet includes: a first process in the first application is intercepted to prevent the first process from killing the first applet. Specifically, the first process may be a kill (kill) process of the first application, configured to kill a process running in the background under a certain condition (for example, reaching a set time, running memory of the electronic device being lower than a preset value, etc.) according to a setting parameter of the first application. The electronic device intercepting the first process refers to sending an interception instruction to the first process, where the interception instruction includes a first identifier (may be a process identifier or a process name) of the first applet. And the first process skips the step of killing the first applet when receiving the instruction of killing the first applet according to the interception instruction. The electronic device sets the keep-alive attribute of the first application to a preset value, and stores the first identifier of the first applet in the memory, so that the first process determines when the process of the applet in the first application is killed, and determines whether the identifier of the applet to be killed is consistent with the first identifier of the first applet. If the first applet is consistent, determining the first applet as the applet needing to be kept alive, and skipping the step of killing the first applet when the first applet needs to be killed, thereby avoiding the first application from killing the first applet of the first application. After the first process skips the step of killing the first applet, according to the instruction of the first application, continuing to kill other processes of the first application which do not need to be kept alive.
In one embodiment, the keep-alive the first applet includes: a second identification of the first applet is added to the keep-alive whitelist. The keep-alive white list is stored in the memory, and the identifiers of the processes which are not killed by the operating system are stored in the keep-alive white list. That is, the operating system determines the applet in the keep-alive whitelist as the applet that needs to be kept alive, and does not kill the first applet, thereby avoiding the operating system killing the first applet.
In an embodiment, after preloading the first applet, the electronic device intercepts the first process in the first application to prevent the first process from killing the first applet, and adds the second identifier of the first applet to the keep-alive whitelist, so that the first applet is not killed by the first application and the operating system, and the first applet can be ensured to normally run in the background.
In an embodiment, the information that does not kill the first applet has been preset in the first application, and the electronic device only performs the step of adding the second identification of the first applet to the keep-alive whitelist after preloading the first applet.
In an embodiment, when the first applet is opened for the first time, the electronic device has added the second identifier of the first applet to the keep-alive whitelist and is not deleted, and after preloading the first applet, the electronic device only performs the step of intercepting the first process.
In an embodiment, the electronic device, after preloading the first applet, only performs the step of adding the second identification of the first applet to the keep-alive whitelist or only performs the step of intercepting the first process. And then inquiring whether the first applet exists (namely, whether the first applet is killed or not) according to a set period, and if the first applet does not exist, reloading the first applet and keeping the first applet alive again.
In one embodiment, the electronic device first performs the step of preloading the first applet. And then, under the condition that the electronic device is detected to execute the preloading, namely, the condition that the first applet is detected to exist, the first applet is kept alive, so that the first applet can be ensured to always run in the background after the preloading is completed.
In another embodiment, the electronic device may also execute the step of keeping the first applet alive before preloading the first applet, so that the first applet may be prevented from being killed before keeping the first applet alive.
After preloading the first applet and keeping the first applet alive, the first applet runs in the background and has completed the preloading procedure in the start-up procedure. When the electronic device detects an instruction of starting the applet by a user (for example, clicking a shortcut icon of the applet and scanning a two-dimensional code of the applet), the electronic device directly executes the starting process after the preloading process, so that the time consumed for starting the applet can be shortened, and the user experience can be improved.
For example, the electronic device determines, according to a scenario in which the user uses the health code applet, that the user will use the health code applet when the electronic device is located in a range of a work place and the current time is about 9 am. The health code applet is preloaded when the current time is 8 point 55 minutes in the range where the electronic device is determined to be located at the work site. And then, when the code scanning operation of the user is detected, the pre-loaded process in the process of starting the health code applet can be directly executed, so that the time for opening the health code applet by the user can be shortened.
In an embodiment, under the condition that it is determined that the first applet in the first application needs to be preloaded according to the current scene, if the first application is not started, the electronic device first pulls up a first application empty process, and the first application empty process is pulled up to complete the process of preloading the first applet. After the empty process of the first application is pulled up, the electronic device pre-loads the first applet and keeps the first applet alive, so that the pre-loading process of the first applet can be guaranteed to be normally carried out.
In the above embodiment, when it is determined that the user may open the first applet in the current scene according to the current scene, and the first applet is not running, the first applet is preloaded and kept alive, so that the first applet may be preloaded and kept alive in advance. When the instruction of starting the applet by the user is detected subsequently, the electronic device can directly execute the flow of starting the applet after preloading, so that the time consumed in the process of starting the applet can be reduced, and the user experience is improved.
In an embodiment, after determining that the first applet in the first application needs to be preloaded according to the current scenario, the electronic device obtains a keep-alive time corresponding to the first applet. The keep-alive time may be a preset value, for example, keep-alive times corresponding to different applets are the same, or keep-alive time of the same applet is fixed. The keep-alive time can also be determined from the current scenario. For example, the electronic device may determine a duration of the first applet used by the user according to a predetermined time of use of the first applet in the current scene, and further determine the keep-alive time according to the duration of the first applet used by the user. The electronic device may also set a corresponding keep-alive time according to a predetermined start time of the first applet in the current scene. For example, according to the scene that the user uses the ride code applet, the electronic device determines that the ride code applet will be used within 3 minutes after the user enters the range of the subway station, and determines that the keep-alive time corresponding to the ride code applet is 3 minutes. The keep-alive time may also be determined based on the current scenario and the time the first applet was preloaded. For example, the electronic device determines that the user will use the health code applet when the user enters the range of the job site and the current time is between 8 hours and 50 minutes and 9 hours in the morning, based on the context in which the user is using the health code applet. The electronic device will preload the health code applet when it detects that the user is in the range of the work place and the current time is between 8 points 30 minutes and 9 points. If the time of preloading the health code applet is 8 points and 40 minutes, the keep-alive time is 20 minutes, and if the time of preloading the health code applet is 8 points and 50 minutes, the keep-alive time is 10 minutes.
Correspondingly, when the electronic device starts to keep the first applet alive, the electronic device starts to count the time at the same time, and when the keep-alive time is reached, the electronic device removes the keep-alive of the first applet. Specifically, if the keep-alive of the first applet includes intercepting the first process in the first application, the interception of the first process is released when the keep-alive time is reached. For example, when the keep-alive time is reached, a disaggregation instruction is sent to the first process, where the disaggregation instruction is used to disaggregate the process of killing the first applet, so that the first process directly kills the first applet when receiving the instruction of killing the first applet. If the keep-alive for the first applet includes adding the second identification of the first applet to the keep-alive whitelist, then removing the second identification from the keep-alive whitelist when the keep-alive time is reached, causing the operating system to kill the first process when the set condition is met.
In an embodiment, when the first process receives the interception information, the first application starts a timeout processing mechanism, and when the keep-alive time is reached, if an interception-removing instruction is not received, interception of the first applet is removed. The memory management of the electronic device can also start a timeout processing mechanism, and if the unblocking instruction is not received when the keep-alive time is reached, the second identifier is directly removed from the keep-alive white list, so that the problem of occupying memory resources caused by long-time keep-alive applets is avoided.
In an embodiment, after the electronic device performs keep-alive on the first applet, if the keep-alive time is reached and an operation of starting the first applet by the user is not detected within the keep-alive time, which indicates that the user does not need to use the first applet in the current scene, the keep-alive on the first applet is released.
In an embodiment, after the electronic device performs the keep-alive on the first applet, if the operation of starting the first applet by the user is detected when the keep-alive time is not reached, the electronic device executes a pre-loaded procedure in the procedure of starting the first applet, and meanwhile, the keep-alive on the first applet is released.
In an embodiment, after the first applet is activated, the electronic device deactivates the first applet when the activation time is reached, regardless of whether the user is detected to activate the first applet, so that the activation time of the applet can be reduced when the applet is used again. For example, the electronic device determines that when the electronic device is located in a range of a subway station and the current time is between 8 points and 10 minutes according to a scene of using the riding code by the user, and the user opens the riding code applet. When the electronic equipment is located in the range of the subway station, the current time is between 8 points and 20 minutes and 30 minutes, and the user opens the riding code again. According to the information of the using car riding code, when the electronic equipment is determined to be located in the range of the subway station and the current time is between 7 points and 50 minutes and 8 points, the car riding code applet is determined to need to be preloaded, and the keep-alive time is 40 minutes. After the electronic equipment preloads the riding code applet and keeps the riding code applet alive, starting timing, and when 40 minutes are reached, removing the riding code applet from the keep alive, so that the riding code applet can be quickly opened when a user enters and exits.
In one embodiment, the electronic device may update the keep-alive time in real-time based on a user's usage record of the first applet. Specifically, the electronic device records the starting time of the applet in a preset period (for example, one week or one month), determines whether the keep-alive time is suitable according to the starting time of the applet and the time for deactivating the first applet, and updates the keep-alive time if the keep-alive time is unsuitable. For example, if it is determined that the time to deactivate the first applet is earlier than the activation time of the applet, based on the activation time of the applet, indicating that the activation time is too short, the activation time is increased. If the starting time of the applet is determined to be earlier than the time for releasing the keep-alive first applet according to the starting time of the applet, and the interval time between the two is longer, which means that the keep-alive time is too long, the keep-alive time is reduced.
In an embodiment, when it is determined that the first applet in the first application needs to be preloaded according to the current scenario, if it is detected that the first applet is already running, that is, the user has started the first applet, the first applet is kept alive, so that under the scenario that the user uses the first applet for many times, the first applet is prevented from being killed, and the starting time of the first applet is reduced. The keep-alive time corresponding to the case that the first applet is already running may be the same as or different from the keep-alive time corresponding to the case that the first applet is not already running. The keep-alive time corresponding to the situation that the first applet is already running can be a fixed value or can be determined according to the starting time of the first applet. For example, the electronic device determines a starting duration of the first applet, if the first applet has been started for a longer time, the corresponding keep-alive time is short, and if the first applet is started for a shorter time, the corresponding keep-alive time is long.
In another embodiment, when it is determined that the first applet in the first application needs to be preloaded according to the current scenario, if it is detected that the first applet is already running, the current flow may also be ended, and the first applet is not kept alive.
In an embodiment, after the electronic device performs the keep-alive on the first applet, if the keep-alive time is reached, the keep-alive level of the first applet is reduced. In an exemplary embodiment, the first applet has a highest keep-alive level during the keep-alive time, neither the first application nor the operating system kills the first applet, and after the keep-alive time is reached, the keep-alive level of the first applet decreases, and when a set condition is obtained, the first application or the operating system kills the applet. For example, after the keep-alive time is reached, the electronic device sends information to the first process that the first applet is the process that needs keep-alive and the keep-alive level is reduced. When the number of the applets running in the background is determined to be larger than or equal to a preset value, if an instruction for killing the first applet is received, the first applet is killed. For another example, after the keep-alive time is reached, if the current remaining running memory of the electronic device is larger, the second identifier of the first applet still exists in the keep-alive whitelist, and if the current remaining running memory of the electronic device is smaller, the second identifier is removed from the keep-alive whitelist, so that the operating system kills the first applet. Illustratively, decreasing the keep-alive level of the first applet can also include reloading the first applet for a preset period of time after the first applet is killed. For example, the first applet will not be killed by the first application and the operating system when the first applet is at its highest keep-alive level during the keep-alive time. After the keep-alive time is reached, the keep-alive level of the first applet decreases, and both the first application and the operating system kill the first applet. And after the preset time period is reached, if the current scene is kept unchanged, preloading the first applet again. After the first applet is preloaded again, the keep-alive time can be shortened.
In the above embodiment, by setting the keep-alive time, the keep-alive of the first applet is released when the keep-alive time is reached, so that the influence of the long-time keep-alive of the first applet on the running memory of the electronic device can be avoided.
In one embodiment, the electronic device determines whether to perform the operations of the preloaded applet and the keep-alive applet based on user operations. Illustratively, the user may set whether to execute the preloaded applet and the operation of the keep-alive applet through a functional module of the electronic device (e.g., yoyoyo suggestion). For example, if the user turns on the "smart preload" function in the YOYO suggestion, the electronic device performs the operations of the preload applet and the keep-alive applet according to the current scenario. If the user turns off the "smart preload" function in the yoyoyo suggestion, the electronic device will not determine whether to perform the preload applet and keep alive applet operations based on the scene.
In one embodiment, the electronic device implements a method of preloading applets through a functional module installed on the electronic device. Illustratively, as shown in FIG. 3, the electronic device includes a YOYO suggestion and a preload module. The YOYO suggestion can be understood as a service presentation module. The YOYO suggestion can collect the scene of the user using the applet in a preset period, takes the collected information as a training sample, and trains the classification model to obtain a scene recognition model. And then, the YOYO suggestion inputs the information in the acquired current scene into the scene recognition model to obtain the identification of the applet which needs to be preloaded and is output by the scene recognition model. The preloading module is communicated with the YOYO suggestion through a process to acquire the identification of the applet needing preloading, which occurs in the YOYO suggestion, and the idle process of the applet is pulled up according to the identification of the applet needing preloading so as to preload the applet, and meanwhile keep alive the applet needing preloading. The method includes the steps of enabling the applet to be preloaded to keep alive, including intercepting the application program to kill the applet to be preloaded, and adding the identification of the applet to be preloaded to a keep alive white list in a memory.
As shown in fig. 4, taking an Android system as an example, a layered architecture divides software on an electronic device into a plurality of layers, and each layer has a clear role and division. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages, among other things. The application package may include camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications. The application programs can be called as three-party applications, and some three-party applications can run applets thereon.
As shown in fig. 4, the application package may also include YOYO suggestions and a preloading module.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
The application framework layer may include a System Server (SS) manager, an application management system (application management system, AMS), a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
As shown in fig. 4, the system library may also include an iaware Daemon.
The kernel layer is a layer between hardware and software. The kernel layer at least comprises a memory driver, a display driver, a camera driver, an audio driver and a sensor driver.
As shown in fig. 4, the memory driver may include a memory management module and a shared memory module, and the memory driver may further include a process management module.
The method for preloading the applet provided in the embodiment of the present application is described below with reference to the software architecture of the electronic device shown in fig. 4.
The YOYO suggestion sends an identification of a first application and an identification of the first applet to a preloading module when it is determined that the first applet in the first application (one of the three-party applications) needs to be preloaded according to a current scenario. The preloading module instructs the application management system to preload the first applet in the first application, sets the keep-alive attribute of the first application as true, and writes the keep-alive attribute into the shared memory through attribute management of the kernel layer based on the communication mode of the socket. Meanwhile, the preloading module sends the identification of the first applet to the memory management in the kernel through the memory management service in the system service manager and the iaware Daemon so as to instruct the memory management to write the second identification of the first applet into the keep-alive white list of the memory.
The kill process in the first application reads information with a keep-alive attribute true from the shared memory. And then, when the kill process receives an instruction of killing the process sent by the first application, acquiring an identification of the first applet needing to be preloaded from the preloading module, and determining whether the process needing to be killed currently is the first applet needing to be preloaded. If so, skipping the step of killing the first applet by the kill process, otherwise, calling a send signal function in the process class by the kill process, and calling an android_unit_process_android_os_process_send signal function by the send signal function to send the identification of the corresponding applet and a kill instruction to process management in the kernel layer to instruct the process management to kill the corresponding applet.
Meanwhile, the operating system acquires the identification of the first applet from the keep-alive white list, and the first applet is not killed.
A specific flow for preloading a first applet according to one embodiment of the present application is shown in FIG. 5.
YOYO suggests that the preloading information is determined according to the current scene, the preloading information comprises a first applet in the first application to be preloaded, and the keep-alive time is N minutes. YOYO suggests that the preload information be sent to the preload module. The preloading module sends a query instruction to the application management system to query whether the first applet exists in the memory. The application management system returns the query information to the preloading module, and the preloading module determines whether the first applet exists in the memory according to the query information. If the first applet does not exist in the memory, the preloading module instructs the application management system to pull up the empty process of the first applet, and the application management system returns the successful information of the pulling up to the preloading module after the first applet is pulled up. If the first applet exists in the memory, the application management system returns the information of the existence of the first applet to the preloading module. After receiving the information of the first applet or the successful pulling-up information, the preloading module intercepts the first application to kill the first applet, and simultaneously instructs the memory management in the kernel to write the identification of the first applet into the keep-alive white list of the memory.
And then, starting timing by the preloading module according to the keep-alive time, and when the keep-alive time is reached, removing interception of killing the first applet by the first application and simultaneously indicating the memory management to remove the identification of the first applet from the keep-alive white list. Meanwhile, the first application can start a timeout processing mechanism, and when the set time (greater than or equal to the keep-alive time) is reached, if the information of releasing interception by the preloading module is not received, the interception of killing the first applet by the first application is released. The memory management may also start a timeout mechanism, and when the set time is reached, if the information that the preloading module releases the interception is not received, the identifier of the first applet is removed from the keep-alive white list.
In one embodiment, the YOYO recommendation includes iawaresdk. IAware APKs include IAware SdkManager.Java, arsServer.Java, preloadArsPlugin.Java, preloadDMEplugin.Java, appPreloadTask.Java, etc., which are used to perform the functions of the preload module.
Specifically, as shown in fig. 6, iawaresdk.java sends the pre-load information to IAwareSdkManager.java, IAwareSdkManager.java by means of asynchronous communication and sends the pre-load information to arsserver.java. After ArsServer.java receives the preloading information, determining an event ID corresponding to the preloading information according to the preloading information, and sending the preloading information and the event ID to PreloadArsPlugin.java according to the event ID. The preloadArsPlugin.java sends the preloading information and the event ID to the AppPreloadTask.java through the preloadDMEplugin according to the event ID.
The AppPreloadTask.java analyzes the received event ID and the preloading information, determines a first applet to be preloaded and a keep-alive time, preloads the first applet, and keeps alive the first applet within the keep-alive time.
Specifically, as shown in fig. 7, apppreloadtask.java includes an object such as Handler, looper, messageQueue. The information of the first applet which needs to be preloaded and is obtained through analysis by the AppPreloadTask.Java is stored in a MessageQuue. The Looper sends a query request to the MessageQuue, sends a message acquired from the MessageQuue to the Handler, and the Handler executes the steps of preloading the first applet and keeping the first applet alive according to the acquired message, wherein the step of keeping the first applet alive comprises the steps of sending an instruction for starting interception to a first application where the first applet is located and instructing memory management to add an identifier of the first applet to a keep-alive white list in a memory. The Handler also generates information of ending the keep-alive according to the keep-alive time, and sends the information of ending the keep-alive to the MessageQueue. And then, the Handler acquires a message from the MessageQuue through the Looper, and executes the step of releasing the keep-alive of the first applet according to the acquired message, specifically, when the keep-alive time is reached, sending an instruction for releasing the interception to the first application where the first applet is located, and simultaneously, instructing the memory management to remove the identification of the first applet from the keep-alive whitelist.
In one embodiment, the preloading module performs the steps of preloading the first applet and deactivating the first applet by executing a handlepreloadMiniApp function in the Handler, and deactivating the first applet by executing a handleFinishKeepAlveMiniApp function in the Handler.
Specifically, the execution logic of the handlepreloadMiniApp function is shown in FIG. 8. The method comprises the steps of firstly analyzing event ID and preloading information, and determining a first applet needing preloading and keep-alive time. Thereafter, a step of preloading the first applet is performed. After the step of preloading the first applet is executed, inquiring whether the first applet exists, if not, ending the flow; and if so, executing the step of keeping the first applet alive. The step of keeping the first applet alive specifically comprises: setting a keep-alive attribute of a first application in a shared memory as true, and sending an identification of a first applet to a first process of the first application, so as to intercept the first application from killing the first applet; and sending an instruction to the memory management in the kernel through the system service manager to instruct the memory management to add the identification of the first applet to the keep-alive white list in the memory. Then, when the keep-alive time is reached, a keep-alive canceling message is generated, and the flow is ended. In an embodiment, the handlepreloadMiniApp function also performs sending the keep-alive time to the first application and memory management such that the first application unblocks the first applet from blocking when the keep-alive time is reached and no de-keep-alive message is received, such that the memory management removes the identity of the first applet from the keep-alive whitelist when the keep-alive time is reached and no de-keep-alive message is received.
The execution logic of the handlefinishkeepalifeminisapp function is shown in fig. 9. After receiving the message for removing the keep-alive, setting the keep-alive attribute of the first application in the shared memory to false, thereby removing interception of killing the first applet by the first application, simultaneously indicating the memory management to remove the identification of the first applet from the keep-alive white list, and ending the flow after the steps are completed.
In one embodiment, as shown in fig. 10, the process of preloading the first applet is: firstly, a current process (i.e. a process running on the electronic equipment) list is obtained, whether a first applet needing to be preloaded exists or not is determined according to the current process list, and if the first applet exists, the process is ended. If not, the AMS is instructed to pull up the first applet empty process.
In one embodiment, as shown in fig. 11, the process of blocking and killing the first applet in the kill process in the first application is as follows: inquiring the current process (namely the process where the kill process is located) and the corresponding keep-alive attribute, if the current process is the first application and the keep-alive attribute of the first application is true, executing the subsequent steps, otherwise ending the flow. The subsequent steps are that when an instruction for killing a process is received, a process identifier (for example, a process identification number) of the process needing to be killed is determined, and then whether the process identifier of the process needing to be killed is an identifier of the process needing to be kept alive is determined. The identification of the process needing keep-alive is obtained from the preloading module in advance through the kill process. If the process identification of the process needing killing is the identification of the process needing keep-alive, executing the process of intercepting and killing the first applet, otherwise ending the process.
In the above embodiment, the preloading module preloads the first applet according to the preloading information sent by the yoyoyo recommendation. The preloading module sets the keep-alive attribute of the first application to indicate that the first process in the first application inquires from the preloading module whether the process needing to be killed is the process needing to be kept alive when the process needing to be killed, so that interception of the process needing to kill the first applet is realized. The preloading module writes the identification of the first applet into a keep-alive white list in the memory so as to prevent the operating system from killing the first applet, thereby preloading the first applet and keeping the first applet alive under a certain scene and further shortening the starting time of the first applet.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
By way of example, fig. 12 shows a schematic structural diagram of the electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a camera device/electronic apparatus, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Finally, it should be noted that: the foregoing is merely illustrative of specific embodiments of the present application, and the scope of the present application is not limited thereto, but any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method of preloading an applet for an electronic device, the method comprising:
determining that a first applet in a first application needs to be preloaded according to a current scene;
and preloading the first applet to keep alive the first applet under the condition that the first applet is not operated.
2. The method of claim 1, wherein said maintaining said first applet comprises:
a first process in the first application is intercepted to prevent the first process from killing the first applet.
3. The method of claim 2, wherein intercepting the first process in the first application to prevent the first process from killing the first applet comprises:
And sending the keep-alive attribute of the first application and the first identification of the first applet to the first process to indicate that the first process does not kill the first applet when receiving the instruction of the first application for killing the first applet.
4. A method according to any one of claims 1 to 3, wherein said keeping alive said first applet comprises:
and adding the second identification of the first applet to a keep-alive white list, wherein the keep-alive white list stores the identifications of the processes which are not killed by the operating system.
5. The method of any of claims 1-4, wherein preloading the first applet to keep the first applet alive comprises:
preloading the first applet;
and keeping the first applet alive under the condition that the electronic device is detected to execute preloading.
6. The method according to any one of claims 1-5, wherein after determining that the first applet in the first application needs to be preloaded according to the current scenario, the method further comprises:
and keeping the first applet alive under the condition that the first applet is detected to be operated.
7. The method according to any one of claims 1-6, wherein after said determining that a first applet in a first application needs to be preloaded according to a current scenario, the method further comprises:
determining the keep-alive time corresponding to the first applet;
correspondingly, after said keeping alive the first applet, the method further comprises:
and when the keep-alive time is reached, the keep-alive of the first applet is released.
8. The method of claim 7, wherein the method further comprises:
acquiring the starting time of the first applet in a preset period;
and updating the keep-alive time according to the starting time.
9. The method of any of claims 1-8, wherein the current context comprises one or more of a current location of the electronic device, a current time, and an application running on the electronic device.
10. An electronic device comprising a processor for executing a computer program stored in a memory to implement the method of preloading the applet according to any of claims 1-9.
11. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements a method of preloading an applet according to any of claims 1-9.
CN202211466475.0A 2022-11-22 2022-11-22 Method for preloading applet, electronic device and storage medium Active CN116661882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211466475.0A CN116661882B (en) 2022-11-22 2022-11-22 Method for preloading applet, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211466475.0A CN116661882B (en) 2022-11-22 2022-11-22 Method for preloading applet, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN116661882A true CN116661882A (en) 2023-08-29
CN116661882B CN116661882B (en) 2024-04-16

Family

ID=87715943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211466475.0A Active CN116661882B (en) 2022-11-22 2022-11-22 Method for preloading applet, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116661882B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595231A (en) * 2018-05-15 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and intelligent terminal
CN109284142A (en) * 2018-08-15 2019-01-29 Oppo广东移动通信有限公司 File preloads method, apparatus, electronic equipment and computer readable storage medium
CN112286656A (en) * 2020-10-21 2021-01-29 百度在线网络技术(北京)有限公司 Applet simulation method, apparatus, electronic device and computer readable storage medium
CN114020360A (en) * 2021-11-08 2022-02-08 广州繁星互娱信息科技有限公司 Method, device and equipment for preloading small program resources and storage medium
CN114942800A (en) * 2021-02-09 2022-08-26 荣耀终端有限公司 Method and device for accelerating running of application program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595231A (en) * 2018-05-15 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and intelligent terminal
CN109284142A (en) * 2018-08-15 2019-01-29 Oppo广东移动通信有限公司 File preloads method, apparatus, electronic equipment and computer readable storage medium
CN112286656A (en) * 2020-10-21 2021-01-29 百度在线网络技术(北京)有限公司 Applet simulation method, apparatus, electronic device and computer readable storage medium
CN114942800A (en) * 2021-02-09 2022-08-26 荣耀终端有限公司 Method and device for accelerating running of application program
CN114020360A (en) * 2021-11-08 2022-02-08 广州繁星互娱信息科技有限公司 Method, device and equipment for preloading small program resources and storage medium

Also Published As

Publication number Publication date
CN116661882B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
CN115809139A (en) Memory management method and electronic equipment
WO2021185352A1 (en) Version upgrade method and related apparatus
CN115629884B (en) Thread scheduling method, electronic equipment and storage medium
CN115292199B (en) Video memory leakage processing method and related device
CN112732434A (en) Application management method and device
CN115687035A (en) Memory leak detection method and electronic equipment
CN115016631B (en) Process scheduling method and terminal equipment
CN116661882B (en) Method for preloading applet, electronic device and storage medium
CN114706633B (en) Preloading method, electronic device and storage medium
CN113656089A (en) Class verification method and device in application program
WO2022228109A1 (en) Advertisement display method and related device
CN116468882B (en) Image processing method, device, equipment and storage medium
CN112783418B (en) Method for storing application program data and mobile terminal
WO2023246604A1 (en) Handwriting input method and terminal
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN117076089B (en) Application management method, terminal device and storage medium
CN116049113B (en) File system arrangement method, electronic device and computer readable storage medium
CN117131240B (en) Service recommendation method, electronic device and computer readable storage medium
CN116662150B (en) Application starting time-consuming detection method and related device
CN116643778B (en) Application program optimization method and electronic equipment
CN117724634A (en) Process management method and device for application program
CN117097883B (en) Frame loss fault cause determining method, electronic equipment and storage medium
WO2022247664A1 (en) Graphical interface display method, electronic device, medium, and program product
WO2024113999A1 (en) Game management method and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant