Model training, memory management method and device, equipment, medium, program product

By training the memory management model, combining user operation data and label data, the problem of low memory management accuracy in the existing technology is solved, more accurate memory release and resource retention is achieved, and system performance and user experience are improved.

CN114706530BActive Publication Date: 2025-05-13BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210399426.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-15
Publication Date
2025-05-13
Estimated Expiration
2042-04-15

AI Technical Summary

Technical Problem

In the browser or applet system, the unused web pages or applets in the background are released through artificially formulated rules, resulting in low accuracy in memory management and unable to meet the needs of different users.

Method used

By obtaining operation data for the application and its corresponding label data, the user behavior description sub-model and neural network sub-model in the memory management model are trained to generate the user behavior description sub-model and neural network sub-model, and the memory management strategy is adjusted according to the user's habits.

Benefits of technology

Improves the accuracy of memory management, can more accurately release web pages or applets that users will not use, while retaining resources that users will use, improving system performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114706530B_ABST
    Figure CN114706530B_ABST
Patent Text Reader

Abstract

The present application relates to a model training, memory management method and apparatus, device, medium, and program product, which are applied to the field of Internet technology. The model training method includes: obtaining first operation data for one or more applications and label data corresponding to the first operation data, the label data is used to characterize whether the application is used within a preset time period before the acquisition of the first operation data; generating a user behavior description submodel in the memory management model based on the first operation data and the label data; inputting a single first operation data into the user behavior description submodel to obtain result data corresponding to the single first operation data; using the result data and label data corresponding to the single first operation data as a training data pair, and training and generating a neural network submodel in the memory management model based on the training data pairs corresponding to each first operation data. The present application can improve the accuracy of memory management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a model training, memory management method and apparatus, equipment, medium, and program product. Background Art

[0002] In a browser or mini-program system, when a user opens a large number of web pages or mini-programs, a large amount of system memory will be occupied, causing the system to freeze or fail to open new web pages and mini-programs. Therefore, memory management is used to freeze or release unused web pages or mini-programs in the background to free up memory and ensure normal use of the system.

[0003] In the related art, artificially formulated rules can be used to select web pages or applets to be released. For example, using a background timeout mechanism, if a web page is in the background for more than a certain time, then the web page can be released. However, due to the information gap between the rule maker and the user, the effect of the rule will be different or insufficient, and the user's usage habits are different, which cannot meet the needs of different users. Therefore, the accuracy of the above memory management method is low. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a model training, memory management method and device, equipment, medium, and program product.

[0005] According to a first aspect of the present application, a method for training a memory management model is provided, comprising:

[0006] Acquire first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the acquisition time of the first operation data;

[0007] generating a user behavior description submodel in a memory management model according to the first operation data and label data corresponding to the first operation data;

[0008] Inputting a single piece of the first operation data into the user behavior description sub-model to obtain result data corresponding to the single piece of the first operation data;

[0009] The result data and label data corresponding to a single first operation data are used as a training data pair, and based on the training data pairs corresponding to each of the first operation data, a neural network sub-model in the memory management model is trained and generated.

[0010] Optionally, the training method of the memory management model further includes:

[0011] Periodically acquiring second operation data for one or more application programs, and label data respectively corresponding to the second operation data;

[0012] The user behavior description sub-model and the neural network sub-model in the memory management model are updated according to the second operation data and the label data respectively corresponding to the second operation data.

[0013] Optionally, the training method of the memory management model further includes:

[0014] The memory management model is sent to a terminal device used by a user, so that the terminal device obtains the third operation data of the user for the application and the label data corresponding to the third operation data, and updates the user behavior description submodel and the neural network submodel in the memory management model according to the third operation data and the label data corresponding to the third operation data.

[0015] Optionally, training and generating a neural network sub-model based on training data pairs corresponding to each of the first operation data includes:

[0016] Based on the training data pairs corresponding to each of the first operation data, a neural network sub-model is generated by training using a random forest algorithm.

[0017] Optionally, generating a user behavior description submodel in a memory management model according to the first operation data and label data corresponding to the first operation data includes:

[0018] A user behavior description submodel in a memory management model is generated by using a genetic algorithm according to the first operation data and label data corresponding to the first operation data.

[0019] Optionally, the first operation data includes: one or more operation data;

[0020] The step of generating a user behavior description sub-model in a memory management model according to the first operation data and the label data corresponding to the first operation data includes:

[0021] If the operation data and the label data are non-numerical data, numerically process the operation data and the label data to obtain numerical data;

[0022] According to one or more numerical data of the operation data and a preset formula, and by using the numerical data of the label data for fitting, a user behavior description formula in the memory management model is generated.

[0023] According to a second aspect of the present application, a memory management method is provided, comprising:

[0024] Get current operation data for one or more applications;

[0025] Inputting the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model to obtain result data corresponding to the current operation data;

[0026] Inputting the result data into the neural network sub-model in the memory management model to obtain an output result, wherein the memory management model is generated based on the training of the method described in the first aspect;

[0027] According to the output result, it is determined whether to release the memory occupied by the single application.

[0028] According to a third aspect of the present application, a training device for a memory management model is provided, comprising:

[0029] A training data acquisition module, used to acquire first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the acquisition time of the first operation data;

[0030] A user behavior description sub-model generation module, used to generate a user behavior description sub-model in a memory management model according to the first operation data and label data corresponding to the first operation data;

[0031] A result data determination module, used for inputting a single first operation data into the user behavior description sub-model to obtain result data corresponding to the single first operation data;

[0032] The neural network sub-model generation module is used to use the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, train and generate the neural network sub-model in the memory management model.

[0033] Optionally, the training device of the memory management model further includes:

[0034] An update data acquisition module is used to periodically acquire second operation data for one or more application programs, and label data corresponding to the second operation data;

[0035] A model updating module is used to update the user behavior description sub-model and the neural network sub-model in the memory management model according to the second operation data and the label data corresponding to the first operation data respectively.

[0036] Optionally, the training device of the memory management model further includes:

[0037] A memory management model sending module is used to send the memory management model to a terminal device used by a user, so that the terminal device obtains the third operation data of the user for the application, and the label data corresponding to the third operation data, and updates the user behavior description submodel and the neural network submodel in the memory management model according to the third operation data and the label data corresponding to the third operation data.

[0038] Optionally, the neural network sub-model generation module is specifically used to use the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, use a random forest algorithm to train and generate a neural network sub-model.

[0039] Optionally, the user behavior description sub-model generating module is specifically used to generate the user behavior description sub-model in the memory management model by using a genetic algorithm according to the first operation data and label data corresponding to the first operation data.

[0040] Optionally, the first operation data includes: one or more operation data;

[0041] The user behavior description sub-model generation module is specifically used to digitize the operation data and the label data respectively to obtain numerical data if the operation data and the label data are non-numerical data; and to generate a user behavior description formula in the memory management model based on one or more numerical data of the operation data and a preset formula, and using the numerical data of the label data for fitting.

[0042] According to a fourth aspect of the present application, a memory management device is provided, comprising:

[0043] A current operation data acquisition module, used to acquire current operation data for one or more applications;

[0044] A result data determination module, used for inputting the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model to obtain result data corresponding to the current operation data;

[0045] An output result determination module, used for inputting the result data into the neural network sub-model in the memory management model to obtain an output result, wherein the memory management model is generated based on the training of the method described in the first aspect;

[0046] A judgment module is used to determine whether to release the memory occupied by the single application according to the output result.

[0047] According to a fifth aspect of the present application, an electronic device is provided, comprising: a processor, wherein the processor is used to execute a computer program stored in a memory, wherein the computer program implements the method described in the first aspect or the second aspect when executed by the processor.

[0048] According to a sixth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.

[0049] According to a seventh aspect of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method described in the first aspect or the second aspect.

[0050] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:

[0051] The present application obtains first operation data for one or more applications, and label data corresponding to the first operation data, and the label data is used to characterize whether the application is used within a preset time period before the first operation data is obtained. In this way, the memory management model is trained by constructing training data, so as to adjust the management strategy according to the user's habits. Specifically, the user behavior description submodel in the memory management model can be generated according to the first operation data and the label data corresponding to the first operation data. Further, a single first operation data is input into the user behavior description submodel to obtain the result data corresponding to the single first operation data; the result data and label data corresponding to the single first operation data are used as training data pairs, and based on the training data pairs corresponding to each first operation data, the neural network submodel in the memory management model is trained and generated. It can be seen that the memory management model generated by training includes two parts: the user behavior description submodel and the neural network submodel, which is more accurate in judging user behavior than a single model. Therefore, the accuracy of memory management can be improved by using multiple models in combination. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0054] Figure 1 A schematic diagram showing a system architecture of an exemplary application environment of a training method for a memory management model and a memory management method that can be applied to an embodiment of the present application;

[0055] Figure 2 A flow chart of a method for training a memory management model in an embodiment of the present application;

[0056] Figure 3 A schematic diagram of a training method for a memory management model in an embodiment of the present application;

[0057] Figure 4 Another flow chart of the training method of the memory management model in the embodiment of the present application;

[0058] Figure 5 A flow chart of the memory management method in the embodiment of the present application;

[0059] Figure 6 A structural schematic diagram of a training device for a memory management model in an embodiment of the present application;

[0060] Figure 7 A schematic diagram of the structure of a memory management device in an embodiment of the present application;

[0061] Figure 8 A schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0063] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0064] In memory management, if a web page or applet is released, after the user clicks on the released web page or applet, the web page or applet needs to be reloaded, and the user will see a short white screen or loading process, and there is a risk of losing user operation information. If a web page or applet is not released, but the user will not use it later, the web page or applet will occupy a large amount of memory, resulting in a waste of system resources and even affecting system performance, directly affecting the user's experience. It can be seen that the criterion for measuring the accuracy of memory management is whether the web pages or applets that users will not use can be accurately released while retaining the web pages or applets that users will use. Therefore, the memory management strategy directly affects the effect of memory management.

[0065] In order to improve the accuracy of memory management, the embodiments of the present application provide a training method and device for a memory management model, a memory management method and device, an electronic device, a storage medium, and a computer program product.

[0066] See also Figure 1 , Figure 1 A schematic diagram of a system architecture of an exemplary application environment of a training method for a memory management model and a memory management method that can be applied to an embodiment of the present application is shown. System architecture 100 includes: one or more of terminal device 101, terminal device 102, terminal device 103, network 104, and server 105. Network 104 is a medium for providing a communication link between terminal device 101, terminal device 102, terminal device 103, and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc. Terminal devices 101, terminal devices 102, and terminal devices 103 include but are not limited to desktop computers, portable computers, smart phones, and tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0067] The training method of the memory management model and the memory management method provided in the embodiment of the present application can be executed by the server 105, and accordingly, the training device of the memory management model and the memory management device can be arranged in the server 105. For example, the server 105 can obtain the first operation data of different users for one or more applications, and the label data corresponding to the first operation data. Among them, the first operation data may include the time when the application is opened, the current time (i.e., the time when the first operation data is obtained), the relevant information of the application itself, etc. The memory management model is generated based on the first operation data and the label data training, and the memory management model may include two parts: a user behavior description submodel and a neural network submodel. Based on the machine learning method, the management strategy is adjusted according to the user's habits to improve the accuracy of memory management. In addition, the accuracy of memory management can be further improved by using multiple models in combination.

[0068] See also Figure 2 , Figure 2 A flowchart of a method for training a memory management model in an embodiment of the present application may include the following steps:

[0069] Step S210, obtaining first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the first operation data is obtained.

[0070] In the embodiment of the present application, the server can directly obtain the first operation data of the developer for one or more applications and the label data corresponding to the first operation data, and the server can also obtain the first operation data of the user for one or more applications and the label data corresponding to the first operation data after the user's authorization. Single first operation data refers to the operation data of a developer or a user for an application, and has corresponding label data.

[0071] The first operation data may include, for example, relevant data when a developer or user operates an application, and may include: the URL (uniform resource locator) of a web page or the ID of an application, the time when the web page or application is opened, the current time, etc. Since the user's usage habits are often related to time, the time when the web page or application is opened and the current time may include not only the specific hour, minute, and second, but also the day of the week. Since a web page or application with a higher priority is less likely to be released, the first operation data may also include the priority of the web page or application. It is understandable that the first operation data may also include more information related to the web page or application.

[0072] The first operation data may be data obtained by statistics in a recent period of time (e.g., within a week). By obtaining the most recent data to train the memory management model, the accuracy of model training can be improved. Since the time of obtaining different first operation data may be different, the current time in different first operation data may also be different.

[0073] The tag data can be used, for example, to characterize whether the developer or user used the application within a preset time period before the first operation data was obtained. For example, within 8 hours before the first operation data was obtained, if the developer or user used the application, the tag data of the first operation data can be represented as 1; if the developer or user did not use the application, the tag data of the first operation data can be represented as 0.

[0074] Step S220: generating a user behavior description sub-model in the memory management model according to the first operation data and the label data corresponding to the first operation data.

[0075] The user behavior description sub-model is a model that describes user behavior. The input of the user behavior description sub-model is the first operation data, and the corresponding output is the label data of the first operation data.

[0076] Optionally, according to the first operation data and the label data corresponding to the first operation data, a user behavior descriptor model in the memory management model can be generated using a genetic algorithm. A genetic algorithm is a computational model of biological evolution that simulates the natural selection and genetics mechanism of Darwin's theory of biological evolution. It is a method for searching for the optimal solution by simulating the natural evolution process. When solving more complex combinatorial optimization problems, it is usually possible to obtain better optimization results faster than some conventional optimization algorithms. Therefore, a more accurate user behavior descriptor model can be obtained through a genetic algorithm.

[0077] In some embodiments, the first operation data includes: one or more operation data, for example, the URL of the aforementioned web page is an operation data, the moment of opening the web page or application is an operation data, the current moment is an operation data, and the priority of the web page or application is also an operation data. Optionally, the user behavior description submodel can specifically be a user behavior description formula. If the operation data and label data are non-numerical data, the operation data and label data can be numerically processed respectively to obtain numerical data. For example, for the URL of a web page or the ID of an application, it can be converted into a digital index ID through an index table or the like. Label data can be represented as 1 and 0.

[0078] Afterwards, the user behavior description formula in the memory management model is generated based on the numerical data of one or more operation data and the preset formula, and the numerical data of the label data is used for fitting. For example, the first operation data contains four operation data, corresponding to four numerical data, namely: a, b, c, d. If the numerical data of the label data is e, the following formula can be obtained: X1(a,b,c,d)=e, X2(a,b,c)=e, X3(a,c,d)=e, X4(a,b)=e, X5(a,c)=e……

[0079] It should be noted that the number of user behavior description formulas can be one or more, for example, more than a dozen or even dozens. X1, X2, X3, X4, X5... can be composed of simple basic formulas, including but not limited to: 'add', 'sub', 'mul', 'div', 'sqrt', 'log', 'neg', 'inv', 'abs', 'max', 'min', 'sin', 'cos', 'tan'. Of course, it can also be other pre-constructed formulas, which are not limited here. According to the above formulas, the parameter values ​​in X1, X2, X3, X4, X5... can be obtained by fitting, thereby obtaining the user behavior description formula.

[0080] Step S230: input the single first operation data into the user behavior description sub-model to obtain result data corresponding to the single first operation data.

[0081] After obtaining the user behavior description sub-model, each first operation data can be input into the user behavior description sub-model to obtain corresponding result data. It is understandable that, since fitting is performed when generating the user behavior description sub-model, the result data obtained by inputting a single first operation data into the user behavior description sub-model will be different from the label data corresponding to the first operation data. For example, in the case where the user behavior description sub-model is a user behavior description formula, the label data corresponding to the first operation data is 1, and the result data obtained by inputting the first operation data into the user behavior description formula may be 0.9, 1.1, etc.

[0082] In some embodiments, the result data may be neutralized to purify the result data. For example, when the label data includes 1 and 0, if the result data is greater than 1, the result data may be set to 1; or, if the result data is less than 0, the result data may be set to 0, that is, the result data is between 0 and 1 to reduce the diversity of the result data.

[0083] Step S240, using the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, training and generating a neural network sub-model in the memory management model.

[0084] In the embodiment of the present application, the result data corresponding to the single first operation data can be used as the input data of the neural network sub-model to be trained, and the label data corresponding to the first operation data can be used as the label data of the result data, that is, the result data and label data of the single first operation data can be used as a training data pair. Through machine learning, a neural network sub-model can be generated.

[0085] In some embodiments, based on the training data pairs corresponding to each of the first operation data, a neural network sub-model is generated by training using a random forest algorithm. In machine learning, a random forest is a classifier that includes multiple decision trees, and the category of its output is determined by the mode of the category output by the individual trees. The random forest can assign corresponding weighted values ​​to multiple decision trees according to the label data to improve the accuracy of the finally generated neural network sub-model (i.e., the random forest model).

[0086] See also Figure 3 , Figure 3 This is a schematic diagram of the training method of the memory management model in the embodiment of the present application. It can be seen that the training method of the memory management model includes two steps: the first step is to generate a user behavior description sub-model, and the second step is to generate a neural network sub-model based on the user behavior description sub-model generated in the first step. In the case of random forest training, the generated neural network sub-model is the random forest model. By using a genetic algorithm and a multi-model of random forests, the accuracy of the generated memory management model can be improved, thereby improving the accuracy of memory management.

[0087] The training method of the memory management model of the embodiment of the present application is to obtain the first operation data of different users for one or more applications, and the label data corresponding to the first operation data, wherein the label data is used to characterize whether the user uses the application within a preset time period before the acquisition moment of the first operation data. In this way, the memory management model is trained by constructing training data, so as to adjust the management strategy according to the user's habits. Specifically, the user behavior description submodel in the memory management model can be generated according to the first operation data and the label data corresponding to the first operation data. Further, a single first operation data is input into the user behavior description submodel to obtain the result data corresponding to the single first operation data; the result data and label data corresponding to the single first operation data are used as training data pairs, and based on the training data pairs corresponding to each first operation data, the neural network submodel in the memory management model is trained and generated. It can be seen that the memory management model generated by training includes two parts: the user behavior description submodel and the neural network submodel, which is more accurate in judging user behavior than a single model. Therefore, the accuracy of memory management can be improved by using multiple models in combination.

[0088] See also Figure 4 , Figure 4 A flowchart of a method for training a memory management model in an embodiment of the present application may include the following steps:

[0089] Step S410, obtaining first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the first operation data is obtained.

[0090] Step S420: Generate a user behavior description sub-model in the memory management model according to the first operation data and the label data corresponding to the first operation data.

[0091] Step S430: input the single first operation data into the user behavior description sub-model to obtain result data corresponding to the single first operation data.

[0092] Step S440, using the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, training and generating a neural network sub-model in the memory management model.

[0093] The above steps S410 to S440 are Figure 2 Steps S210 to S240 of the embodiment are the same, see Figure 2 The description in the embodiments is sufficient and will not be repeated here.

[0094] Step S450: periodically obtain second operation data for one or more applications and label data corresponding to the second operation data, and update the user behavior description submodel and the neural network submodel in the memory management model according to the second operation data and the label data corresponding to the second operation data.

[0095] It should be noted that the server can also periodically obtain new operation data and label data of the operation data to update the memory management model, obtain a new user behavior description sub-model and a new neural network sub-model, thereby improving the accuracy of the memory management model. For example, the memory management model can be updated in the early morning or other times when the user is not active, to avoid the memory management model being unavailable during the time when the user is active.

[0096] Step S460: Send the memory management model to the terminal device used by the user, so that the terminal device obtains the third operation data of the user on the application and the label data corresponding to the third operation data. According to the third operation data and the label data corresponding to the third operation data, the user behavior description sub-model and the neural network sub-model are updated.

[0097] As mentioned above, the process of generating the memory management model in steps S410 to S440 and the process of updating the memory management model in step S450 can be implemented on the server. Compared with a single terminal device, since the server can obtain more first operation data and label data of the first operation data, the accuracy of the memory management model can be improved by training and generating the memory management model with more training data.

[0098] The server can also send the memory management model to each terminal device after each update of the memory management model. The terminal device uses the memory management model as the initial model, and further updates the memory management model based on the memory management model by obtaining the local third operation data and the label data corresponding to the third operation data. Since the third operation data is the operation data of the application by the user using the terminal device, the updated memory management model obtained by training based on the third operation data and the label data of the third operation data is more suitable for the usage habits of the user using the terminal device. According to the updated memory management model, the accuracy of the memory management of the terminal device can be improved.

[0099] The present application also provides a memory management method, see Figure 5 , the memory management method includes the following steps:

[0100] Step S510: obtaining current operation data for one or more application programs.

[0101] When the user uses the terminal device, the terminal device can obtain the user's operation data on the application in real time. The operation data is the same as the operation data type when training the memory management model. For example, it can include: the URL of the web page or the ID of the application, the time when the web page or application is opened, the current time, the priority of the network or application, etc.

[0102] Step S520, input the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model, obtain the result data corresponding to the current operation data, input the result data into the neural network sub-model in the memory management model, and obtain the output result. Figure 2 Example or Figure 4 The method shown in the embodiment is trained to generate.

[0103] The use process of the memory management model is similar to the training process, that is, the current operation data of a single application is first input into the user behavior description sub-model to obtain the result data corresponding to the current operation data, and the result data is further input into the neural network sub-model to obtain the output result.

[0104] Step S530: Determine whether to release the memory occupied by the single application program according to the output result.

[0105] The output result of the memory management model is consistent with the aforementioned tag data. For example, if the tag data includes 1 and 0, 1 indicates that the user uses the application, and 0 indicates that the user does not use the application. Then the output result of the memory management model is 1 or 0. If the output result is 1, the application is not released. If the output result is 0, the application is released, and accordingly, the memory occupied by the application is also released.

[0106] The memory management method of the embodiment of the present application generates a memory management model by pre-training through machine learning, which can improve the effect of memory management compared with artificially formulated rules. In addition, the memory management model includes two parts: a user behavior description sub-model and a neural network sub-model, which is more accurate in judging user behavior than a single model. Therefore, the accuracy of memory management can be further improved by using multiple models in combination.

[0107] Corresponding to the above method embodiment, the present application embodiment also provides a training device for a memory management model, see Figure 6 , the training device 600 of the memory management model includes:

[0108] The training data acquisition module 610 is used to acquire first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the acquisition time of the first operation data;

[0109] A user behavior description sub-model generation module 620, configured to generate a user behavior description sub-model in a memory management model according to the first operation data and the label data corresponding to the first operation data;

[0110] A result data determination module 630, configured to input a single first operation data into the user behavior description sub-model to obtain result data corresponding to the single first operation data;

[0111] The neural network sub-model generation module 640 is used to use the result data and label data corresponding to a single first operation data as a training data pair, and train and generate a neural network sub-model in the memory management model based on the training data pairs corresponding to each first operation data.

[0112] Optionally, the training device 600 for the memory management model further includes:

[0113] An update data acquisition module is used to periodically acquire second operation data for one or more application programs, and label data corresponding to the second operation data;

[0114] The model updating module is used to update the user behavior description sub-model and the neural network sub-model in the memory management model according to the second operation data and the label data corresponding to the second operation data respectively.

[0115] Optionally, the training device 600 for the memory management model further includes:

[0116] A memory management model sending module is used to send the memory management model to a terminal device used by a user so that the terminal device obtains third operation data for an application and label data corresponding to the third operation data, and updates a user behavior description submodel and a neural network submodel in the memory management model according to the third operation data and the label data corresponding to the third operation data.

[0117] Optionally, the neural network sub-model generation module 640 is specifically used to use the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, use a random forest algorithm to train and generate a neural network sub-model.

[0118] Optionally, the user behavior description sub-model generation module 620 is specifically configured to generate a user behavior description sub-model in the memory management model by using a genetic algorithm according to the first operation data and label data corresponding to the first operation data.

[0119] Optionally, the first operation data includes: one or more operation data;

[0120] The user behavior description sub-model generation module 620 is specifically used to digitize the operation data and the label data respectively to obtain numerical data if the operation data and the label data are non-numerical data; and to generate a user behavior description formula in the memory management model based on the numerical data of one or more operation data and a preset formula, and by fitting with the numerical data of the label data.

[0121] The present application also provides a memory management device. Figure 7 , the memory management device 700 includes:

[0122] The current operation data acquisition module 710 is used to acquire current operation data for one or more applications;

[0123] The result data determination module 720 is used to input the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model to obtain the result data corresponding to the current operation data;

[0124] The output result determination module 730 is used to input the result data into the neural network sub-model in the memory management model to obtain the output result, wherein the memory management model is based on Figure 2 Example or Figure 4 The method shown in the embodiment is trained to generate;

[0125] The judgment module 740 is used to determine whether to release the memory occupied by the single application according to the output result.

[0126] The specific details of each module or unit in the above device have been described in detail in the corresponding method, so they will not be repeated here.

[0127] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0128] In an exemplary embodiment of the present application, an electronic device is also provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute the training method of the above-mentioned memory management model in this example implementation, or to implement the above-mentioned memory management method.

[0129] Figure 8 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. It should be noted that: Figure 8 The electronic device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0130] like Figure 8 As shown, electronic device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In RAM 803, various programs and data required for system operation are also stored. Central processing unit 801, ROM 802 and RAM 803 are connected to each other via a bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0131] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network (LAN) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0132] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 809, and / or installed from a removable medium 811. When the computer program is executed by the central processing unit 801, various functions defined in the device of the present application are executed.

[0133] In an embodiment of the present application, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the training method of the above-mentioned memory management model, or implements the above-mentioned memory management method.

[0134] It should be noted that the computer-readable storage medium shown in the present application may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, radio frequency, etc., or any suitable combination of the above.

[0135] In an embodiment of the present application, a computer program product is also provided. When the computer program product runs on a computer, it enables the computer to execute the training method of the above-mentioned memory management model, or implement the above-mentioned memory management method.

[0136] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0137] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A training method for a memory management model, characterized in that: The method comprises: Acquire first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the acquisition time of the first operation data; generating a user behavior description submodel in a memory management model according to the first operation data and label data corresponding to the first operation data; Inputting a single piece of the first operation data into the user behavior description sub-model to obtain result data corresponding to the single piece of the first operation data; The result data and label data corresponding to a single first operation data are used as a training data pair, and based on the training data pairs corresponding to each of the first operation data, a neural network sub-model in the memory management model is trained and generated.

2. The method according to claim 1, characterized in that The method further comprises: Periodically acquiring second operation data for one or more application programs, and label data respectively corresponding to the second operation data; The user behavior description sub-model and the neural network sub-model in the memory management model are updated according to the second operation data and the label data respectively corresponding to the second operation data.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: The memory management model is sent to a terminal device used by a user, so that the terminal device obtains the third operation data of the user for the application and the label data corresponding to the third operation data, and updates the user behavior description submodel and the neural network submodel in the memory management model according to the third operation data and the label data corresponding to the third operation data.

4. The method according to claim 1 or 2, characterized in that: Based on the training data pairs corresponding to the first operation data, training and generating a neural network sub-model includes: Based on the training data pairs corresponding to each of the first operation data, a neural network sub-model is generated by training using a random forest algorithm.

5. The method according to claim 1 or 2, characterized in that: The step of generating a user behavior description sub-model in a memory management model according to the first operation data and the label data corresponding to the first operation data includes: A user behavior description submodel in a memory management model is generated by using a genetic algorithm according to the first operation data and label data corresponding to the first operation data.

6. The method according to claim 1, characterized in that The first operation data includes: one or more operation data; The step of generating a user behavior description sub-model in a memory management model according to the first operation data and the label data corresponding to the first operation data includes: If the operation data and the label data are non-numerical data, numerically process the operation data and the label data to obtain numerical data; According to one or more numerical data of the operation data and a preset formula, and by using the numerical data of the label data for fitting, a user behavior description formula in the memory management model is generated.

7. A memory management method, characterized in that: The method comprises: Get current operation data for one or more applications; Inputting the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model to obtain result data corresponding to the current operation data; Inputting the result data into the neural network sub-model in the memory management model to obtain an output result, wherein the memory management model is trained and generated based on the method described in any one of claims 1 to 6; According to the output result, it is determined whether to release the memory occupied by the single application.

8. A training device for a memory management model, characterized in that: The device comprises: A training data acquisition module, used to acquire first operation data for one or more applications, and label data corresponding to the first operation data, wherein the label data is used to indicate whether the application is used within a preset time period before the acquisition time of the first operation data; A user behavior description sub-model generation module, used to generate a user behavior description sub-model in a memory management model according to the first operation data and label data corresponding to the first operation data; A result data determination module, used for inputting a single first operation data into the user behavior description sub-model to obtain result data corresponding to the single first operation data; The neural network sub-model generation module is used to use the result data and label data corresponding to a single first operation data as a training data pair, and based on the training data pairs corresponding to each first operation data, train and generate the neural network sub-model in the memory management model.

9. A memory management device, characterized in that: The device comprises: A current operation data acquisition module, used to acquire current operation data for one or more applications; A result data determination module, used for inputting the current operation data of a single application into the user behavior description sub-model in the pre-trained memory management model to obtain result data corresponding to the current operation data; An output result determination module, used for inputting the result data into the neural network sub-model in the memory management model to obtain an output result, wherein the memory management model is trained and generated based on the method described in any one of claims 1 to 6; A judgment module is used to determine whether to release the memory occupied by the single application according to the output result.

10. An electronic device, characterized in that: include: A processor, wherein the processor is used to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the training method of the memory management model described in any one of claims 1 to 6, or implements the memory management method described in claim 7.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the training method of the memory management model described in any one of claims 1 to 6, or implements the memory management method described in claim 7.

12. A computer program product, characterized in that When the computer program product runs on a computer, the computer executes the training method of the memory management model described in any one of claims 1 to 6, or implements the memory management method described in claim 7.

Citation Information

Patent Citations

  • Background application program control method and device, storage medium and electronic equipment

    CN108681480A

  • Application program prediction model establishing and pre-loading method and device, medium and terminal

    CN109814936A