A method for cleaning application memory, a server and a terminal
By obtaining the application's runtime information, determining whether memory cleanup is needed, and generating processing instructions to update the integration method of business modules, the problem of losing user-defined configuration information caused by clearing cached data is solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-25
- Publication Date
- 2026-03-17
AI Technical Summary
During application use, clearing cached data can lead to the loss of user-defined configuration information, affecting the user experience.
By obtaining the application's runtime information, it can determine whether memory cleanup is needed and generate processing instructions to update the integration method of business modules, including plugin post-installation, downgrading M-pages or plugin native installation, to avoid clearing cached data.
This allows for the clearing of application memory without affecting user-defined functions, thus improving the user experience.
Smart Images

Figure CN112130986B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, server, and terminal for cleaning up application memory. Background Technology
[0002] During the use of an application (App), app lag often occurs. This may be due to the large size of the app or the limitations of the hardware and software of the terminal running the app.
[0003] Currently, the common method to clear app memory is to clear cached data in order to reduce the size of the app. However, cached data usually contains user-defined configuration information. After the cached data is cleared, functions related to user-defined configuration information are initialized, which may even cause the loss of important user data, resulting in a poor user experience. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, server, and terminal for cleaning up application memory, which can clean up the memory occupied by modular applications without cleaning up the application's cache data, thereby not affecting user-defined functions and improving user experience.
[0005] To achieve the above objectives, according to one aspect of the present invention, a method for cleaning up application memory is provided.
[0006] An embodiment of the present invention provides a method for cleaning up application memory that can be applied to a server, comprising: obtaining application running information, wherein the application includes: at least one business module, and the running information includes: the application's memory information and / or the usage rate of the business module by users;
[0007] Based on the application's runtime information, determine whether the application needs to be cleaned up, and generate corresponding processing instructions, which indicate the target integration method of the business module;
[0008] The processing instructions are sent to the terminal running the application, so that the terminal updates the integration method of the business module according to the processing instructions, so as to perform memory cleanup on the application.
[0009] Optionally, the runtime information further includes: the terminal's attribute information; determining whether to perform memory cleanup on the application based on the application's runtime information includes:
[0010] Based on the application's memory information and the terminal's attribute information, determine the application's memory percentage on the terminal;
[0011] When the memory percentage is less than a first threshold, it is determined that no memory cleanup is needed for the application; when the memory percentage is greater than or equal to the first threshold, it is determined that memory cleanup is needed for the application.
[0012] Optionally, when it is determined that memory cleanup of the application is required, the generation of corresponding processing instructions includes:
[0013] The business modules in the application whose usage rate by users is less than the second threshold are designated as business modules to be cleaned up.
[0014] Based on the usage rate, determine the target integration method for the business modules to be cleaned up;
[0015] The processing instructions are generated based on the target integration method of the business modules to be cleaned.
[0016] Optionally, when there is no need to clean up the application's memory, the processing instruction includes: continuing to run the application according to the current integration method of the business module;
[0017] When memory cleanup of the application is required, the processing instruction includes: running the application according to the target integration method of the business module.
[0018] Optionally, the target integration method includes: plug-in post-installation, downgraded M-page, or plug-in native integration.
[0019] An embodiment of the present invention provides a method for cleaning up application memory that can be applied to a server, comprising: collecting application running information and sending the running information to the server, wherein the application includes: at least one business module, and the running information includes: the application's memory information and / or the usage rate of the business module by users;
[0020] Receive the processing instruction returned by the server based on the running information, the processing instruction indicating the target integration method of the business module;
[0021] When the target integration method is plug-in post-installation, delete the plug-in file package corresponding to the business module;
[0022] When the target integration method is a downgraded M-page, delete the plugin file package and plugin runtime package corresponding to the business module;
[0023] When the target integration method is native plugin, determine whether there is a plugin file package corresponding to the business module. If not, download the plugin file package corresponding to the business module.
[0024] To achieve the above objectives, according to another aspect of the present invention, a server for cleaning up application memory is provided.
[0025] An embodiment of the present invention provides a server for cleaning up application memory, comprising: an information acquisition module, an instruction generation module, and a processing module; wherein,
[0026] The information acquisition module is used to acquire the application's running information, wherein the application includes at least one business module, and the running information includes the application's memory information and / or the usage rate of the business module by users;
[0027] The instruction generation module is used to determine whether the application needs to be cleaned up based on the application's running information, and to generate corresponding processing instructions, which indicate the target integration method of the business module.
[0028] The processing module is used to send the processing instructions to the terminal running the application, so that the terminal updates the integration method of the business module according to the processing instructions, so as to perform memory cleanup on the application.
[0029] Optionally, when the running information further includes the terminal's attribute information, the instruction generation module is used to determine the memory ratio of the application in the terminal based on the application's memory information and the terminal's attribute information; when the memory ratio is less than a first threshold, it is determined that no memory cleanup is needed for the application; when the memory ratio is greater than or equal to the first threshold, it is determined that memory cleanup is needed for the application.
[0030] Optionally, the instruction generation module is configured to, when it is determined that memory cleanup of the application is required, identify the business modules in the application whose usage rate by users is less than a second threshold as business modules to be cleaned up, determine the target integration method of the business modules to be cleaned up based on the usage rate, and generate the processing instruction based on the target integration method of the business modules to be cleaned up.
[0031] Optionally, when there is no need to clean up the application's memory, the processing instruction includes: continuing to run the application according to the current integration method of the business module;
[0032] When memory cleanup of the application is required, the processing instruction includes: running the application according to the target integration method of the business module.
[0033] Optionally, the target integration method includes: plug-in post-installation, downgraded M-page, or plug-in native integration.
[0034] To achieve the above objectives, according to another aspect of the present invention, a terminal for cleaning up application memory is provided.
[0035] A terminal for cleaning application memory according to an embodiment of the present invention includes: an information collection module, an instruction receiving module, and a cleaning module; wherein,
[0036] The information collection module is used to collect the application's running information and send the running information to the server. The application includes at least one business module, and the running information includes the application's memory information and / or the usage rate of the business module by users.
[0037] The instruction receiving module is used to receive the processing instruction returned by the server based on the running information, and the processing instruction indicates the target integration method of the business module;
[0038] The cleanup module is used to delete the plugin file package corresponding to the business module when the target integration method is plug-in post-installation; delete the plugin file package and plugin runtime package corresponding to the business module when the target integration method is downgraded M-page; and determine whether there is a plugin file package corresponding to the business module when the target integration method is plug-in native. If not, download the plugin file package corresponding to the business module.
[0039] To achieve the above objectives, according to another aspect of the present invention, an electronic device for cleaning up application memory is provided.
[0040] An electronic device for cleaning up application memory according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a method for cleaning up application memory according to an embodiment of the present invention.
[0041] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.
[0042] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements a method for cleaning up application memory according to an embodiment of the present invention.
[0043] One embodiment of the above invention has the following advantages or beneficial effects: it determines whether the application needs to be cleaned up based on the application's running information and generates corresponding processing instructions, so that the terminal running the application can update the integration method of the business module according to the processing instructions. When the updated application runs, the business module runs in the target integration method, thereby realizing deep cleaning of the application from the business module level. Moreover, the cleaning process does not involve user-defined configuration information, so it does not affect user-defined functions, thereby improving the user experience.
[0044] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0045] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0046] Figure 1 This is a schematic diagram illustrating the main steps of a method for cleaning up application memory according to an embodiment of the present invention when applied to a server.
[0047] Figure 2 This is a schematic diagram illustrating the main steps of a method for cleaning application memory according to an embodiment of the present invention when applied to a terminal.
[0048] Figure 3 This is a schematic diagram illustrating the main steps of a method for cleaning up application memory according to an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of the main modules of a server for cleaning up application memory according to an embodiment of the present invention;
[0050] Figure 5 This is a schematic diagram of the main modules of a terminal for cleaning up application memory according to an embodiment of the present invention;
[0051] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0052] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0053] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0054] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.
[0055] Figure 1 This is a schematic diagram illustrating the main steps of a method for cleaning up application memory according to an embodiment of the present invention when applied to a server.
[0056] like Figure 1As shown, a method for cleaning up application memory according to an embodiment of the present invention mainly includes the following steps:
[0057] Step S101: Obtain the application's running information.
[0058] Currently, plug-in frameworks are the mainstream development model for applications (Apps). The app in this embodiment of the invention also relies on the plug-in development concept. That is, the app in this embodiment of the invention contains at least one business module, and each business module is a plug-in. Each business module has different integration methods, such as native plug-in, post-installed plug-in, or downgraded M-page. The memory occupied by different integration methods varies. Among the three integration methods—native plug-in, post-installed plug-in, and downgraded M-page—downgraded M-page occupies the least memory, almost negligible. Native plug-in occupies the most memory, while post-installed plug-in occupies memory between downgraded M-page and native plug-in. Typically, the initial integration method for each business module in the application is the native plug-in method.
[0059] During the operation of an app on a terminal, corresponding operational information is generated. This operational information includes any one or more of the following: terminal attribute information, application memory information, and the usage rate of the business module by the user. Preferably, the operational information includes a combination of terminal attribute information and application memory information, and / or the usage rate of the business module by the user.
[0060] The terminal's attribute information may include information such as the terminal system version number, terminal memory, and processor model; the usage rate of the business modules used by the user can be read from the data tracking backend based on the user's PIN and UUID. The user PIN refers to the unique identifier of the user in the application, and the user UUID refers to the unique identifier of the terminal used by the user.
[0061] Step S102: Based on the application's running information, determine whether the application needs to be cleaned up, and generate corresponding processing instructions, which indicate the target integration method of the business module.
[0062] In one embodiment of the present invention, when determining whether memory cleanup of an application is required, the memory percentage of the application in the terminal can be determined based on the application's memory information and the terminal's attribute information; when the memory percentage is less than a first threshold, it is determined that memory cleanup of the application is not required, and when the memory percentage is greater than or equal to the first threshold, it is determined that memory cleanup of the application is required.
[0063] Here, the server can pre-store the correspondence between the app, the terminal, the memory usage, and whether it needs to be cleaned up, as shown in Table 1:
[0064] Table 1
[0065]
[0066] After obtaining the application's runtime information, the server can determine the application's memory usage relative to the terminal based on the application's memory information and the terminal's attribute information. For example, if the application occupies 200MB of memory and the terminal's attribute information indicates that the available memory is 1GB, then the application's memory usage is 200 / 1024 = 19.53%. Based on the application's memory usage and the terminal identifier indicated by the terminal's attribute information, and referring to Table 1, the server determines the running status of application A on the terminal. The terminal identifier can be identified based on the terminal's processor model. Here, taking application A and terminal A as an example, the first threshold is 12%. When the application's memory usage is 19.53%, it is determined that application A needs to be cleaned up.
[0067] Understandably, when the server determines that no cleanup is needed for the application based on factors such as the application's memory information and the hardware information of the terminal on which the application is running, it can directly return a processing instruction that no cleanup is needed to the terminal, allowing the terminal to continue running the application in the current integration mode of the business module.
[0068] The server can determine that no application needs to be cleaned up under various circumstances. One such circumstance is that the application's memory usage is less than the first threshold. Another circumstance is when the server determines that the integration method of each business module of the application is the optimal integration method. For example, if the integration method of the business module is a downgraded M-page or a plugin post-installation method, meaning that the integration method of the business module cannot be updated, or if the integration methods of the business modules to be cleaned up with a usage rate lower than the second threshold have all been updated, then the application is in an "optimal state," and the server also determines that no application needs to be cleaned up.
[0069] In other words, when no memory cleanup is required for the application, the processing instructions include: continuing to run the application according to the current integration method of the business module; when memory cleanup is required for the application, the processing instructions include: running the application according to the target integration method of the business module, where the target integration method includes: plugin post-installation, downgraded M-page, or plugin native installation. The current integration method of the business module is the integration method of the business module when the user last used it, i.e., the integration method of the business module before the update.
[0070] In order to perform targeted cleanup of business modules, when it is determined that the application needs to be cleaned up, the business modules in the application whose usage rate by users is less than a second threshold are identified as business modules to be cleaned up; based on the usage rate, the target integration method of the business modules to be cleaned up is determined; and based on the target integration method of the business modules to be cleaned up, the processing instructions are generated.
[0071] The server can pre-store the correspondence between the usage rate of applications, business modules, terminals, and business modules and the target integration method. This correspondence can be shown in Table 2.
[0072] Table 2
[0073]
[0074]
[0075] Here, taking application A's business module A1 and terminal A as examples, the second threshold is 15%. This means that when the usage rate of business module A1 is less than 15%, it indicates that business module A1 needs to be cleaned up, meaning its integration method can be updated. For example, when the usage rate of business module A1 is 10%, it indicates that it needs to be cleaned up, and according to Table 2, its corresponding target integration method is a downgraded M-page. Then, processing instructions can be generated based on the target integration method of business module A1, allowing the terminal running application A to update the integration method of business module A1 in application A according to the processing instructions.
[0076] It is understandable that there may be multiple business modules that need to be cleaned up in an application. Taking application A and terminal A as an example, when the second threshold is 15%, and the usage rate of business modules A1 and A2 is both 10%, then both business modules A1 and A2 in application A need to be cleaned up. Furthermore, the target integration method for both business modules A1 and A2 is a downgraded M-page. The server can then construct a module list for each business module to be cleaned up, recording the target integration method for each module. The module list is then packaged as a processing instruction and sent to the terminal. The terminal parses the processing instruction to obtain the module list and updates the integration method of the corresponding business modules based on the business modules to be cleaned up and their target integration methods in the module list. The module list constructed by the server can be shown in Table 3.
[0077] Table 3
[0078] Business Module Target integration method Business Module A1 Downgrade to M page Business Module A2 Downgrade to M page
[0079] In addition, when there are multiple business modules to be cleaned up, the priority of each business module to be cleaned up can be determined based on its usage rate and / or size, so as to determine the cleanup order of each business module to be cleaned up. For example, the business module with the larger size to be cleaned up is cleaned up first, that is, its integration method is updated first. Or, the business module with the lowest usage rate to be cleaned up is cleaned up first. Alternatively, different weights can be assigned to usage rate and size, and then the cleanup order of each business module to be cleaned up can be determined based on the usage rate and the size of the business module to be cleaned up and their corresponding weights.
[0080] It's worth noting that after receiving the application's runtime information, the server can directly determine the target integration method for each business module by comparing its usage rate with the corresponding relationships in Table 2 above. Alternatively, the server can directly determine whether the application needs to be cleaned up based on its memory information. For example, if the application's memory information exceeds a preset memory threshold, it is determined that the application needs to be cleaned up. The correspondence between the memory thresholds for each application can also be pre-stored in tabular form.
[0081] It is understood that Tables 2 and 3 above show only one feasible embodiment of the present invention, and the data in Table 2 is only an example. When different business modules run on different terminals, their corresponding second thresholds may be the same or different, and the target integration methods corresponding to different usage rates may be the same or different.
[0082] Step S103: Send the processing instruction to the terminal running the application, so that the terminal updates the integration method of the business module according to the processing instruction, so as to clean up the memory of the application.
[0083] After the server sends the processing instructions to the terminal running the application, the terminal can update the integration method of the business modules to be cleaned to the target integration method according to the processing instructions. For example, when the processing instructions include the module list shown in Table 3, the terminal will update the current integration method of business modules A1 and A2 to the target integration method (downgraded M-page). For example, when the current integration method of business modules A1 and A2 is the initial integration method (plugin native), the terminal can update the integration method of business modules A1 and A2 from plugin native to downgraded M-page according to the processing instructions, thereby reducing the memory occupied by business modules A1 and A2, thus realizing deep cleaning of the application.
[0084] As can be seen from the method for cleaning application memory according to the embodiments of the present invention, it is determined whether the application needs to be cleaned up based on the application's running information, and a corresponding processing instruction is generated. This allows the terminal running the application to update the integration method of the business module according to the processing instruction. When the updated application runs, the business module runs in the target integration method, thereby achieving deep cleaning of the application at the business module level. Furthermore, the cleaning process does not involve user-defined configuration information, thus not affecting user-defined functions and improving user experience.
[0085] Figure 2 This is a schematic diagram illustrating the main steps of a method for cleaning application memory according to an embodiment of the present invention when applied to a terminal.
[0086] like Figure 2 As shown, a method for cleaning up application memory according to an embodiment of the present invention mainly includes the following steps:
[0087] Step S201: Collect the application's running information and send the running information to the server.
[0088] The application includes at least one business module, and the operational information includes the application's memory information and / or the usage rate of the business module by the user. In one embodiment of the invention, the operational information may further include the usage rate of the business module by the user. Preferably, the operational information includes a combination of terminal attribute information and application memory information, and / or the usage rate of the business module by the user.
[0089] Step S202: Receive the processing instruction returned by the server based on the running information. The processing instruction indicates the target integration method of the business module. When the target integration method is plug-in post-installation, execute step S203. When the target integration method is downgraded M-page, execute step S204. When the target integration method is plug-in native, execute step S205.
[0090] Step S203: Delete the plugin file package corresponding to the business module.
[0091] Step S204: Delete the plugin file package and plugin runtime package corresponding to the business module.
[0092] Step S205: Determine whether there is a plugin file package corresponding to the business module. If yes, end the current process; otherwise, proceed to step S206.
[0093] Step S206: Download the plugin file package corresponding to the business module.
[0094] In this embodiment, when the terminal runs the application, it collects the application's running information. When it receives a processing instruction from the server based on this running information, it updates the integration method of the business module according to the integration method indicated in the processing instruction. It can be understood that the terminal can update the integration method of each business module by updating its configuration file. For example, when the processing instruction indicates that the target integration method for business module A1 is a downgraded M-page, the plugin file package and plugin runtime package corresponding to business module A1 are deleted. The next time the user uses business module A1, the corresponding M-page version will be loaded, and the M-page version will not occupy much phone memory, thus achieving deep cleaning of the application. When the processing instruction indicates that the target integration method for business module A2 is a plugin aftermarket installation, the plugin file package for business module A2 is deleted, thereby reducing the memory occupied by the application and achieving deep cleaning of the application. When the target integration method for business module A3 is a plugin native installation, the app needs to restart and check whether a plugin file package corresponding to business module A3 exists locally on the terminal. If it does, business module A3 is run directly without the user's awareness; if not, the user is prompted to download and the plugin will be automatically launched. After the above cleaning operations, the size of the app itself will be reduced, and the memory occupied by the app will also be reduced accordingly after restarting, thus achieving the purpose of deep cleaning of application memory.
[0095] The following describes in detail the method for cleaning up application memory provided in this embodiment of the invention, taking the memory cleanup of application A as an example. Application A includes business module A1 and business module A2, as follows... Figure 3 As shown, the method may include the following steps:
[0096] Step S301: The terminal starts application A according to the user's trigger, reads the configuration file of application A to obtain the memory information of application A and the usage rate of business module A1 and business module A2 respectively, and collects the terminal's attribute information and sends the collected running information to the server.
[0097] Step S302: The server determines the memory ratio of application A in the terminal based on the memory information of application A and the attribute information of the terminal, and determines whether the memory ratio is less than the first threshold. If it is, proceed to step S303; otherwise, proceed to step S304.
[0098] Step S303: The server sends a first processing instruction to the terminal to continue running application A according to the current integration method of each business module, so that the terminal continues to run application A according to the first processing instruction and ends the current process.
[0099] Step S304: Based on the usage rates of business module A1 and business module A2 respectively, business module A1 with a usage rate less than the second threshold is designated as a business module to be cleaned up.
[0100] Step S305: Based on the usage rate of business module A1, the server determines that the target integration method for business module A1 is to be a downgraded M-page.
[0101] Step S306: The server sends a second processing instruction to the terminal to run the business module A1 in a downgraded M-page.
[0102] Step S307: The terminal deletes the plugin file package and plugin runtime package corresponding to the service module A1 according to the second processing instruction.
[0103] Figure 4 This is a schematic diagram of the main module of a server for cleaning up application memory according to an embodiment of the present invention.
[0104] like Figure 4 As shown, a server 400 for cleaning up application memory according to an embodiment of the present invention includes: an information acquisition module 401, an instruction generation module 402, and a processing module 403; wherein,
[0105] The information acquisition module 401 is used to acquire the application's running information, wherein the application includes at least one business module, and the running information includes the application's memory information and / or the usage rate of the business module by users;
[0106] The instruction generation module 402 is used to determine whether the application needs to be cleaned up based on the application's running information, and to generate corresponding processing instructions, which indicate the target integration method of the business module.
[0107] The processing module 403 is used to send the processing instructions to the terminal running the application, so that the terminal updates the integration method of the business module according to the processing instructions, so as to perform memory cleanup on the application.
[0108] In one embodiment of the present invention, when the running information further includes the attribute information of the terminal, the instruction generation module 402 is used to determine the memory ratio of the application in the terminal based on the memory information of the application and the attribute information of the terminal; when the memory ratio is less than a first threshold, it is determined that no memory cleanup is required for the application; when the memory ratio is greater than or equal to the first threshold, it is determined that memory cleanup is required for the application.
[0109] In one embodiment of the present invention, the instruction generation module 402 is used to, when it is determined that memory cleanup of the application is required, identify the business modules in the application whose usage rate by users is less than a second threshold as business modules to be cleaned up, determine the target integration method of the business modules to be cleaned up based on the usage rate, and generate the processing instruction based on the target integration method of the business modules to be cleaned up.
[0110] In one embodiment of the present invention, when there is no need to clean up the memory of the application, the processing instruction includes: continuing to run the application according to the current integration method of the business module;
[0111] When memory cleanup of the application is required, the processing instruction includes: running the application according to the target integration method of the business module.
[0112] In one embodiment of the present invention, the target integration method includes: plug-in post-installation, downgraded M-page, or plug-in native integration.
[0113] Figure 5 This is a schematic diagram of the main module of a terminal for cleaning up application memory according to an embodiment of the present invention.
[0114] like Figure 5 As shown, a terminal 500 for cleaning application memory according to an embodiment of the present invention includes: an information collection module 501, an instruction receiving module 502, and a cleaning module 503; wherein,
[0115] The information collection module 501 is used to collect the application's running information and send the running information to the server. The application includes at least one business module, and the running information includes the application's memory information and / or the usage rate of the business module by users.
[0116] The instruction receiving module 502 is used to receive the processing instruction returned by the server based on the running information, and the processing instruction indicates the target integration method of the business module;
[0117] The cleanup module 503 is used to delete the plugin file package corresponding to the business module when the target integration method is plug-in post-installation; delete the plugin file package and plugin runtime package corresponding to the business module when the target integration method is downgraded M-page; and determine whether there is a plugin file package corresponding to the business module when the target integration method is plug-in native. If not, download the plugin file package corresponding to the business module.
[0118] Figure 6 An exemplary system architecture 600 is shown, in which the method for cleaning up application memory or a server or terminal for cleaning up application memory can be applied according to embodiments of the present invention.
[0119] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0120] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0121] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0122] Server 605 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 601, 602, and 603. The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information and product information) to the terminal devices.
[0123] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0124] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0125] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0126] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0127] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0128] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0130] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor; for example, a processor can be described as including an information acquisition module, an instruction generation module, and a processing module. The names of these modules do not necessarily limit the module itself; for example, the information acquisition module can also be described as a "module for acquiring runtime information."
[0131] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to: acquire application runtime information, wherein the application includes at least one business module, and the runtime information includes: memory information of the application and / or the usage rate of the business module by users; determine, based on the application runtime information, whether memory cleanup of the application is required, and generate corresponding processing instructions, the processing instructions indicating the target integration method of the business module; and send the processing instructions to a terminal running the application, so that the terminal updates the integration method of the business module according to the processing instructions to perform memory cleanup of the application.
[0132] According to the technical solution of this invention, it is determined whether memory cleanup of the application is necessary based on the application's running information, and corresponding processing instructions are generated. This allows the terminal running the application to update the integration method of the business modules according to the processing instructions. When the updated application runs, the business modules operate in the target integration mode, thereby achieving deep cleanup of the application at the business module level. Furthermore, the cleanup process does not involve user-defined configuration information, thus not affecting user-defined functions and improving user experience. Therefore, by analyzing user habits on the server side and combining them with the characteristics of the user's terminal, the application's business module access method is customized to achieve deep cleanup of application memory. This realizes the use of server-side analysis of user usage data to customize personalized applications for users, ensuring that users can run applications smoothly on different terminal devices as much as possible.
[0133] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method of cleaning up memory within an application, characterized by, Applied to a server, comprising: Obtaining running information of an application, wherein the application comprises at least one business module, and the running information comprises memory information of the application and / or usage rate of the business module used by a user; According to the running information of the application, determining whether to perform memory cleaning on the application, and generating a corresponding processing instruction, the processing instruction indicating a target integration mode of the business module; when the memory cleaning on the application is needed, the processing instruction comprising: running the application according to the target integration mode, the memory occupied by the target integration mode being less than the memory occupied by a current integration mode of the business module; Sending the processing instruction to a terminal running the application, so that the terminal updates the integration mode of the business module according to the processing instruction to perform the memory cleaning on the application; When the target integration mode is plug-in after loading, deleting a plug-in file package corresponding to the business module; When the target integration mode is downgraded M page, deleting the plug-in file package and a plug-in running package corresponding to the business module; When the target integration mode is plug-in native, determining whether there is a plug-in file package corresponding to the business module, and if not, downloading the plug-in file package corresponding to the business module.
2. The method of claim 1, wherein, The running information further comprises attribute information of the terminal; and the determining whether to perform memory cleaning on the application according to the running information of the application comprises: According to the memory information of the application and the attribute information of the terminal, determining a memory proportion of the application in the terminal; When the memory proportion is less than a first threshold, determining that the memory cleaning on the application is not needed, and when the memory proportion is greater than or equal to the first threshold, determining that the memory cleaning on the application is needed.
3. The method of claim 2, wherein, When it is determined that the memory cleaning on the application is needed, the generating the corresponding processing instruction comprises: Taking the business module with a usage rate less than a second threshold as a to-be-cleaned business module; According to the usage rate, determining a target integration mode of the to-be-cleaned business module; According to the target integration mode of the to-be-cleaned business module, generating the processing instruction.
4. The method of claim 1, wherein When the memory cleaning on the application is not needed, the processing instruction comprises: continuing to run the application according to the current integration mode of the business module.
5. The method according to claim 3 or 4, characterized in that, The target integration mode comprises plug-in after loading, downgraded M page or plug-in native.
6. A method of cleaning up memory within an application, characterized by, Applied to a terminal, comprising: Collecting running information of an application, and sending the running information to a server, wherein the application comprises at least one business module, and the running information comprises memory information of the application and / or usage rate of the business module used by a user; receive a processing instruction returned by the server according to the running information, the processing instruction indicating a target integration mode of the business module; when it is needed to perform memory cleaning on the application, the processing instruction comprising: running the application according to the target integration mode of the business module, the target integration mode occupying less memory than a current integration mode of the business module; when the target integration mode is plug-in post-loading, deleting a plug-in file package corresponding to the business module; when the target integration mode is downgrade M-page, deleting the plug-in file package and a plug-in running package corresponding to the business module; when the target integration mode is plug-in native, judging whether there is a plug-in file package corresponding to the business module, and if not, downloading the plug-in file package corresponding to the business module.
7. A server for cleaning up application memory, characterized in that comprise: an information acquisition module, an instruction generation module and a processing module; wherein the information acquisition module is configured to acquire running information of an application, wherein the application comprises at least one business module, and the running information comprises memory information of the application and / or usage rate of the business module used by a user; the instruction generation module is configured to determine whether it is needed to perform memory cleaning on the application according to the running information of the application, and generate a corresponding processing instruction, the processing instruction indicating a target integration mode of the business module; when it is needed to perform memory cleaning on the application, the processing instruction comprising: running the application according to the target integration mode of the business module, the target integration mode occupying less memory than a current integration mode of the business module; the processing module is configured to send the processing instruction to a terminal running the application, so that the terminal updates the integration mode of the business module according to the processing instruction to perform memory cleaning on the application; when the target integration mode is plug-in post-loading, deleting a plug-in file package corresponding to the business module; when the target integration mode is downgrade M-page, deleting the plug-in file package and a plug-in running package corresponding to the business module; when the target integration mode is plug-in native, judging whether there is a plug-in file package corresponding to the business module, and if not, downloading the plug-in file package corresponding to the business module.
8. The server of claim 7, wherein when the running information further comprises attribute information of the terminal, the instruction generation module is configured to determine a memory proportion of the application in the terminal according to the memory information of the application and the attribute information of the terminal; when the memory proportion is less than a first threshold, it is determined that it is not needed to perform memory cleaning on the application, and when the memory proportion is greater than or equal to the first threshold, it is determined that it is needed to perform memory cleaning on the application.
9. The server of claim 8, wherein The instruction generation module is configured to, when it is determined that the application needs to be cleaned up, regard the service module of the application whose usage rate is less than a second threshold as a to-be-cleaned service module, determine a target integration mode of the to-be-cleaned service module according to the usage rate, and generate the processing instruction according to the target integration mode of the to-be-cleaned service module.
10. The server of claim 7, wherein, When the application does not need to be cleaned up, the processing instruction comprises: continuing to run the application according to a current integration mode of the service module.
11. The server of claim 9 or 10, wherein, The target integration mode comprises: plug-in post-loading, downgrading M pages, or plug-in native.
12. A terminal that cleans up memory within an application, characterized by, The method comprises: An information collection module, an instruction receiving module, and a cleaning module, wherein The information collection module is configured to collect running information of an application and send the running information to a server, wherein the application comprises at least one service module, and the running information comprises memory information of the application and / or a usage rate of the service module used by a user. The instruction receiving module is configured to receive a processing instruction returned by the server according to the running information, wherein the processing instruction indicates a target integration mode of the service module; when the application needs to be cleaned up, the processing instruction comprises: running the application according to the target integration mode of the service module, wherein the target integration mode occupies less memory than a current integration mode of the service module. The cleaning module is configured to, when the target integration mode is plug-in post-loading, delete a plug-in file package corresponding to the service module; when the target integration mode is downgrading M pages, delete the plug-in file package and a plug-in running package corresponding to the service module; and when the target integration mode is plug-in native, determine whether there is a plug-in file package corresponding to the service module, and if not, download the plug-in file package corresponding to the service module.
13. An electronic device for cleaning up application memory, characterized in that, The method comprises: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-6.
14. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Method and device for clearing memory of mobile terminal
CN106502785A