Control method, device and electronic equipment

By building a memory recycling feature model and generating a memory recycling strategy based on sample application data, the memory recycling pause problem of low-code platform applications is solved, and the policy setting efficiency and user experience are improved.

CN113900819BActive Publication Date: 2025-02-25LENOVO (BEIJING) LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111240183.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-02-25
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

There is a long pause in the memory recovery process of low-code platform applications during runtime memory, which affects the user experience.

Method used

By obtaining the application parameters of the target application, based on the memory state data in the sample application data and the feature data that performs memory recovery, a linear regression algorithm is used to build a memory recovery feature model, obtain a memory recovery strategy, and control the target application to perform memory recovery according to this strategy .

Benefits of technology

It improves the efficiency of setting the memory recovery strategy, reduces the need for manual settings by operation and maintenance personnel, optimizes the memory recovery process, reduces application pause time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113900819B_ABST
    Figure CN113900819B_ABST
Patent Text Reader

Abstract

The present application discloses a control method, device and electronic device, the method comprising: obtaining application parameters of a target application, the application parameters characterizing the type of memory recycling performed by the target application; obtaining a memory recycling strategy corresponding to the application parameters; the memory recycling strategy corresponding to the application parameters is obtained based on at least sample application data corresponding to the application parameters, the sample application data at least including memory status data and characteristic data for performing memory recycling; controlling the target application to perform memory recycling according to the memory recycling strategy during operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a control method, device and electronic equipment. Background Art

[0002] When low-code platform applications are running, there is a long pause due to memory recycling GC (Garbage Collection), which has a great impact on the user experience of low-code platform applications. Therefore, it is necessary to adjust the memory recycling mechanism.

[0003] Currently, the memory recycling mechanism is usually set by experienced operation and maintenance personnel. Summary of the invention

[0004] In view of this, the present application provides a control method, device and electronic device as follows:

[0005] A control method, comprising:

[0006] Obtaining an application parameter of a target application, wherein the application parameter represents a type of memory recycling performed by the target application;

[0007] Obtaining a memory reclaiming strategy corresponding to the application parameter; the memory reclaiming strategy corresponding to the application parameter is obtained based on at least sample application data corresponding to the application parameter, the sample application data at least including memory state data and characteristic data for executing memory reclaiming;

[0008] The target application is controlled to perform memory reclamation according to the memory reclamation policy during operation.

[0009] In the above method, preferably, the memory reclamation strategy at least includes memory state data corresponding to executing memory reclamation and the type of memory reclamation algorithm for executing memory reclamation.

[0010] In the above method, preferably, the memory recovery strategy corresponding to the application parameter is obtained in the following manner:

[0011] According to the linear regression algorithm, the memory status data in the sample application data and the characteristic data of executing memory recycling are analyzed to obtain a memory recycling strategy; the memory recycling strategy makes the duration of executing memory recycling and / or the recycled memory space meet the control conditions.

[0012] The above method preferably analyzes the memory state data and the characteristic data of executing memory recycling in the sample application data according to a linear regression algorithm to obtain a memory recycling strategy, including:

[0013] According to the linear regression algorithm, a memory recycling feature model is constructed, wherein the memory recycling feature model represents the corresponding relationship between the memory state data and the feature data;

[0014] Based on the control conditions, the memory recovery feature model is trained using the memory status data in the sample application data and the feature data for executing memory recovery. The memory recovery feature model obtained by training contains a memory recovery strategy that ensures that the duration of executing memory recovery and / or the recovered memory space meet the control conditions.

[0015] In the above method, preferably, the control conditions include: the duration is less than or equal to a duration threshold, and / or the recovered memory space is greater than or equal to a recovery threshold.

[0016] The above method preferably controls the target application to perform memory reclamation according to the memory reclamation policy during operation, including:

[0017] According to the memory state data corresponding to the memory reclamation executed in the memory reclamation strategy and the type of the memory reclamation algorithm for executing the memory reclamation, the execution parameters for executing the memory reclamation by the target application are set so that the target application executes the memory reclamation according to the execution parameters.

[0018] Preferably, the above method further comprises, before controlling the target application to perform memory reclamation according to the memory reclamation policy during operation:

[0019] Receiving a modification operation, wherein the modification operation includes modification parameters for the memory reclaiming strategy;

[0020] The memory reclaiming strategy is adjusted according to the modification parameters.

[0021] Preferably, the above method further comprises, before controlling the target application to perform memory reclamation according to the memory reclamation policy during operation:

[0022] Controlling the target application to perform memory reclamation according to the memory reclamation strategy during the test process to obtain a test result of the memory reclamation strategy; the test result indicates whether the memory reclamation strategy satisfies the control condition;

[0023] If the test result indicates that the memory reclaiming strategy satisfies the control condition, executing the step of: controlling the target application to perform memory reclaiming according to the memory reclaiming strategy during operation;

[0024] If the test result indicates that the memory reclaiming strategy does not satisfy the control condition, the step of obtaining the memory reclaiming strategy corresponding to the application parameter is re-executed.

[0025] A control device, comprising:

[0026] A parameter obtaining unit, configured to obtain an application parameter of a target application, wherein the application parameter represents a type of memory recycling performed by the target application;

[0027] A policy obtaining unit, configured to obtain a memory reclaiming policy corresponding to the application parameter; the memory reclaiming policy corresponding to the application parameter is obtained based at least on sample application data corresponding to the application parameter, the sample application data at least including memory state data and feature data for executing memory reclaiming;

[0028] A recycling control unit is used to control the target application to perform memory recycling according to the memory recycling strategy during operation.

[0029] An electronic device, comprising:

[0030] A memory, used to store a computer program and data generated by the execution of the computer program;

[0031] A processor is used to execute the computer program to achieve: obtaining application parameters of a target application, the application parameters characterizing the type of memory reclamation performed by the target application; obtaining a memory reclamation policy corresponding to the application parameters; the memory reclamation policy corresponding to the application parameters is obtained based on at least sample application data corresponding to the application parameters, the sample application data at least including memory status data and characteristic data for performing memory reclamation; and controlling the target application to perform memory reclamation according to the memory reclamation policy during operation.

[0032] It can be seen from the above technical solutions that in a control method, device and electronic device disclosed in the present application, the sample application data corresponding to the application parameters of the target application are learned, and then the memory recovery strategy corresponding to the application parameters is obtained. Based on this, the target application is controlled to perform memory recovery according to the memory recovery strategy. It can be seen that in the present application, the memory state data in the sample application data and the characteristic data for performing memory recovery are learned to obtain a memory recovery strategy that can control the target application to perform memory recovery, without the need for the operation and maintenance personnel to manually set the memory recovery mechanism, thereby improving the setting efficiency of the memory recovery strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0034] Figure 1 A flow chart of a control method provided in Example 1 of the present application;

[0035] Figure 2 A schematic diagram of a memory heap structure in an electronic device;

[0036] Figure 3 A partial flow chart of a control method provided in Example 1 of the present application;

[0037] Figure 4-Figure 6 They are respectively another flow chart of a control method provided in Embodiment 1 of the present application;

[0038] Figure 7 A schematic diagram of the structure of a control device provided in Example 2 of the present application;

[0039] Figure 8-Figure 10 They are respectively another structural schematic diagram of a control device provided in Embodiment 2 of the present application;

[0040] Fig.11 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present application;

[0041] Fig.12 This application is an example flowchart for application development on a low-code platform. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] refer to Figure 1 As shown, it is a flow chart for realizing a control method provided in the first embodiment of the present application, and the method can be applied to an electronic device capable of running an application, and the electronic device can be a mobile phone, a pad, a computer or a server and other devices. The application here is a program that occupies the memory of the electronic device during operation to realize the corresponding data processing function, such as a chat application or a shopping application. The technical solution in this embodiment is mainly used to improve the setting efficiency of the memory recovery strategy used in the operation of the application.

[0044] Specifically, the method in this embodiment may include the following steps:

[0045] Step 101: Obtain application parameters of a target application.

[0046] Among them, the application parameter is a parameter that characterizes the type of memory recycling performed by the target application. For example, the application parameter includes an algorithm type parameter and an application type parameter. The algorithm type parameter characterizes the memory recycling algorithm used by the target application to perform memory recycling, such as minor gc or full gc algorithms. The application type parameter characterizes the application type of the target application, specifically the type of application function implemented by the target application, such as an e-commerce type application or a chat type application.

[0047] Step 102: Obtain a memory recovery strategy corresponding to the application parameters.

[0048] The memory reclaiming strategy corresponding to the application parameter is obtained based on at least the sample application data corresponding to the application parameter, that is, the memory reclaiming strategy corresponding to the application parameter is obtained based on at least the sample application data corresponding to the application parameter in step 102. The sample application data here includes at least memory state data and characteristic data for executing memory reclaiming.

[0049] Specifically, the sample application data may be historical application data generated by the target application during the testing process of the target application. For example, in this embodiment, the application data generated by the target application during the stress test before delivery is collected and recorded, and the recorded sample application data may be recorded in the application log file corresponding to the target application in the electronic device. Thus, in this embodiment, the recorded sample application data is read.

[0050] The memory status data in the sample application data may include a variety of data representing the memory status, such as the maximum value of the new generation memory involved in memory recycling, the maximum value of the old generation memory involved in memory recycling, the maximum value of the off-heap memory, the size of the stack, the maximum value of the thread, and the minimum value of the thread, etc. Figure 2 As shown in the memory heap structure in , eden is the area in the memory where the created objects are stored, s0 and s1 are the areas of the new generation memory, and tenured is the area of ​​the old generation memory. The maximum value of off-heap memory refers to the maximum value of the memory in the virtual machine running the target application in the electronic device, excluding the memory of the heap involved in memory recycling. The size of the stack refers to the size of the stack built by the virtual machine running the target application in the electronic device. The maximum and minimum values ​​of threads refer to the maximum and minimum values ​​of threads running in the virtual machine running the target application in the electronic device.

[0051] In addition, the characteristic data in the sample application data refers to the execution characteristic data of the target application performing memory recycling during the test process. For example, the characteristic data may at least include the following: memory status data corresponding to the execution of memory recycling, the duration of the execution of memory recycling, the memory space reclaimed by the execution of memory recycling, and the type of memory recycling algorithm for the execution of memory recycling.

[0052] Among them, the memory status data corresponding to the memory recycling execution in the feature data refers to: the real-time memory status data corresponding to each memory recycling action performed by the target application during the test process. For example, the feature data includes: the real-time maximum value of the new generation memory, the maximum value of the old generation memory, the maximum value of the off-heap memory, the stack size, the maximum value of the thread, and the minimum value of the thread when the target application performs each memory recycling action during the test process.

[0053] The duration of memory recycling in the feature data refers to the duration from the start to the end of each memory recycling action performed by the target application during the test. For example, the duration of memory recycling performed by the target application at a certain moment is 20 milliseconds.

[0054] The memory space reclaimed by executing memory recycling in the feature data refers to the size of the memory space that the target application will reclaim each time it executes memory recycling during the test. For example, the target application reclaims 2M of memory space when executing memory recycling at a certain moment.

[0055] The type of memory recycling algorithm used to perform memory recycling in the feature data refers to the type of memory recycling algorithm used by the target application to perform memory recycling during the test, such as the replication algorithm for the new generation memory or the mark compression algorithm for the old generation memory.

[0056] Based on this, in this embodiment, sample learning can be performed on sample application data to obtain a memory recovery strategy. It should be noted that different application parameters correspond to different sample application data. Based on this, in this embodiment, for target applications with different application parameters, the corresponding sample application data can be learned to obtain memory recovery strategies for target applications with different application parameters.

[0057] Step 103: Control the target application to perform memory recycling according to the memory recycling policy during its running process.

[0058] The memory recycling policy includes indication parameters that can instruct the target application to perform recycling, and the target application can be instructed to perform memory recycling according to the memory recycling policy based on these indication parameters.

[0059] Specifically, in this embodiment, the memory reclamation policy can be sent to the target application so that the target application performs memory reclamation according to the received memory reclamation policy; or, in this embodiment, the parameters related to executing memory reclamation in the target application can be adjusted according to the memory reclamation policy, so that the target application performs memory reclamation according to the adjusted parameters.

[0060] It can be seen from the above technical solution that in a control method provided in the first embodiment of the present application, the sample application data corresponding to the application parameters of the target application is learned, and then the memory recovery strategy corresponding to the application parameters is obtained. Based on this, the target application is controlled to perform memory recovery according to the memory recovery strategy. It can be seen that in this embodiment, the memory state data in the sample application data and the characteristic data for performing memory recovery are learned to obtain a memory recovery strategy that can control the target application to perform memory recovery, without the need for the operation and maintenance personnel to manually set the memory recovery mechanism, thereby improving the setting efficiency of the memory recovery strategy.

[0061] In one implementation, the memory reclamation strategy obtained in step 102 may include at least memory state data corresponding to executing memory reclamation and the type of memory reclamation algorithm for executing memory reclamation.

[0062] Among them, the memory status data in the memory recovery policy may include any one or more of the maximum value of the new generation memory participating in memory recovery, the maximum value of the old generation memory participating in memory recovery, the maximum value of the off-heap memory, the size of the stack, the maximum value of the thread, and the minimum value of the thread. Specifically, the memory status data in the memory recovery policy means: in the process of running the target application in the electronic device, if it is detected that the current memory status data is consistent with the memory status data in the memory recovery policy, then the target application performs a memory recovery. In other words, the memory status data in the memory recovery policy is used to trigger the target application to perform memory recovery when the memory status data in the electronic device is consistent with the memory status data in the memory recovery policy.

[0063] The type of memory reclamation algorithm in the memory reclamation policy is used to instruct the target application to perform memory reclamation according to the algorithm. In other words, when the target application performs memory reclamation, it performs memory reclamation according to the memory reclamation algorithm in the memory reclamation policy. For example, the target application performs memory reclamation for the new generation memory according to the copy algorithm, and performs memory reclamation for the old generation according to the mark-compression algorithm.

[0064] Based on the above implementation, in step 103, when the target application is controlled to perform memory recycling according to the memory recycling policy during operation, it can be specifically implemented in the following ways:

[0065] According to the type of memory recycling algorithm for executing memory recycling according to the memory status data corresponding to the memory recycling in the memory recycling policy, the execution parameters for the target application to execute memory recycling are set so that the target application executes memory recycling according to the execution parameters.

[0066] The execution parameters here may include: memory state data corresponding to the target application executing memory reclamation and the type of memory reclamation algorithm for executing memory reclamation.

[0067] That is to say, in this embodiment, execution parameters such as memory status data corresponding to memory recovery and the type of memory recovery algorithm for performing memory recovery in the target application are set according to the memory status data and the type of memory recovery algorithm in the memory recovery strategy. Thus, during the running of the target application, the target application performs memory recovery according to these execution parameters. For example, when the memory status data of the electronic device is consistent with the memory status data in the execution parameters, the target application performs memory recovery once, and when the target application performs memory recovery, it performs memory recovery according to the type of memory recovery algorithm in the execution parameters.

[0068] In one implementation, the memory reclaiming strategy corresponding to the application parameter in step 102 may be obtained in the following manner:

[0069] According to the linear regression algorithm, the memory state data in the sample application data and the characteristic data of executing memory recycling are analyzed to obtain the memory recycling strategy.

[0070] The memory recycling strategy here makes the duration of memory recycling and / or the recycled memory space meet the control condition. That is to say, in this embodiment, the memory state data in the sample application data and the feature data of memory recycling are learned in a linear regression manner to obtain the memory recycling strategy that meets the control condition.

[0071] The control condition here may be: the duration of executing memory recycling is less than or equal to the duration threshold, and / or the memory space recycled by executing memory recycling is greater than or equal to the recycling threshold.

[0072] That is to say, in this embodiment, the memory status data in the sample application data and the characteristic data of executing memory recycling are learned and optimized by linear regression, and then a memory recycling strategy with a shorter duration of executing memory recycling and / or a larger memory space reclaimed by executing memory recycling is learned. The shorter the duration of executing memory recycling, the shorter the duration of the lag generated during the operation of the target application, and the larger the memory space reclaimed by executing memory recycling, the more memory space can be used during the operation of the target application. Therefore, in this embodiment, while realizing automatic acquisition of the memory recycling strategy, the obtained memory recycling strategy can be made more optimized. The optimized memory recycling strategy enables the target application to shorten the lag duration and / or improve the memory recycling efficiency, thereby further improving the user experience when using the target application.

[0073] In a specific implementation, step 102 can be implemented in the following manner: Figure 3 As shown in:

[0074] Step 301: Construct a memory recycling feature model according to a linear regression algorithm.

[0075] Among them, the memory recycling feature model represents the correspondence between memory state data and feature data. The memory state data here refers to the memory state data when the target application performs memory recycling, and the feature data refers to the feature data when the target application performs memory recycling. The memory recycling feature model is constructed based on the correspondence between the two.

[0076] For example, in this embodiment, a linear regression curve is used to identify the memory recycling feature model, and the points in the curve represent the feature data corresponding to the memory state data.

[0077] Step 302: Based on the control conditions, the memory recovery feature model is trained using the memory status data in the sample application data and the feature data for executing memory recovery. The memory recovery strategy contained in the trained memory recovery feature model ensures that the duration of executing memory recovery and / or the recovered memory space meet the control conditions.

[0078] Specifically, in this embodiment, based on the content set in the control conditions: the duration of executing memory recycling is less than or equal to the duration threshold, and / or the memory space recovered by executing memory recycling is greater than or equal to the recycling threshold, the memory status data in the sample application data and the feature data of executing memory recycling are learned, and then the correspondence between the memory status data and the feature data that can make the duration of executing memory recycling less than or equal to the duration threshold and / or the memory space recovered by executing memory recycling is greater than or equal to the recycling threshold is learned, thereby obtaining a memory recycling feature model, and the memory recycling features in the memory recycling feature model meet the conditions for duration and recycled memory space in the control conditions.

[0079] In one implementation, this embodiment may further include the following steps before step 103, that is, after obtaining the memory recycling policy corresponding to the application parameters and before controlling the target application to execute memory recycling according to the memory recycling policy during operation: Figure 4 As shown in:

[0080] Step 104: Receive a modification operation.

[0081] The modification operation includes modification parameters for the memory recycling strategy.

[0082] Specifically, the modification parameters here may include: modifying the parameters of the memory state data corresponding to the memory recycling execution in the memory recycling strategy, and / or modifying the parameters of the type of the memory recycling algorithm in the memory recycling strategy. For example, the user can modify the maximum value of the new generation memory in the memory recycling strategy, modify the off-heap memory size in the memory recycling strategy, and modify the memory recycling algorithm in the memory recycling strategy in the modification interface output by the electronic device, and so on.

[0083] Step 105: Adjust the memory recycling strategy according to the modified parameters.

[0084] Among them, in this embodiment, according to the modified parameters: modifying the parameters of the memory status data corresponding to the memory recovery policy executing memory recovery, and / or modifying the parameters of the type of the memory recovery algorithm in the memory recovery policy, the indicative parameters such as the memory status data corresponding to the memory recovery policy executing memory recovery and the type of the memory recovery algorithm executing memory recovery can be adjusted. Thus, after controlling the target application to execute memory recovery according to the memory recovery policy during operation, the target application can execute memory recovery according to the indicative parameters in the adjusted memory recovery policy. For example, according to the indicative parameters in the adjusted memory recovery policy, the execution parameters for the target application to execute memory recovery are set, so that the target application executes memory recovery according to the execution parameters.

[0085] In one implementation, before step 103, this embodiment first verifies the memory reclamation policy, that is, verifies whether the memory reclamation policy satisfies the control condition. That is, after obtaining the memory reclamation policy corresponding to the application parameters in step 102, before controlling the target application to execute memory reclamation according to the memory reclamation policy during operation in step 103, the following steps may also be included, such as Figure 5 As shown in:

[0086] Step 106: Control the target application to perform memory reclamation according to the memory reclamation policy during the test process to obtain a test result of the memory reclamation policy.

[0087] Among them, the test results may include the duration of memory recycling executed by the target application during the test process and / or the memory space reclaimed by the memory recycling, so as to characterize the effect of the target application executing memory recycling according to the memory recycling strategy. At the same time, the test results include the judgment results of whether the duration is less than or equal to the duration threshold and / or whether the reclaimed memory space is greater than or equal to the space threshold, so as to characterize whether the memory recycling strategy meets the control conditions.

[0088] Step 107: Determine whether the test result indicates that the memory recovery side meets the control conditions. If the test result indicates that the memory recovery strategy meets the control conditions, then execute step 103 to control the target application to perform memory recovery according to the memory recovery strategy during operation. If the test result indicates that the memory recovery strategy does not meet the control conditions, then re-execute step 102 to re-obtain the memory recovery strategy corresponding to the application parameters until the obtained test result indicates that the newly obtained memory recovery strategy meets the control conditions.

[0089] Among them, the memory recycling strategy meets the control conditions, which can be: whether the duration is less than or equal to the duration threshold, and whether the recovered memory space is greater than or equal to the space threshold; and the memory recycling strategy does not meet the control conditions, which can be: whether the duration is less than or equal to the duration threshold, or whether the recovered memory space is greater than or equal to the space threshold

[0090] It should be noted that step 106 and step 107 can be performed after step 105 and before step 103. Figure 6 As shown in , therefore, after obtaining the memory reclaim policy corresponding to the application parameters in step 102, the memory reclaim policy is first adjusted according to the modification parameters for the memory reclaim policy, and then the actual use of the memory reclaim policy in the target application test process is verified, and then after obtaining a verified and qualified memory reclaim policy that meets the control conditions, the target application is controlled to perform memory reclaim according to the verified and qualified memory reclaim policy.

[0091] refer to Figure 7 , is a schematic diagram of the structure of a control device provided in the second embodiment of the present application, which can be configured in an electronic device capable of running an application, and the electronic device can be a mobile phone, pad, computer or server and other devices. The application here is a program that occupies the memory of the electronic device during operation to realize the corresponding data processing function, such as a chat application or a shopping application. The technical solution in this embodiment is mainly used to improve the setting efficiency of the memory recovery strategy used in the operation of the application.

[0092] Specifically, the device in this embodiment may include the following units:

[0093] A parameter obtaining unit 701 is used to obtain an application parameter of a target application, where the application parameter represents a type of memory recycling performed by the target application;

[0094] A policy obtaining unit 702 is used to obtain a memory reclaiming policy corresponding to the application parameter; the memory reclaiming policy corresponding to the application parameter is obtained based on at least sample application data corresponding to the application parameter, and the sample application data at least includes memory state data and feature data for executing memory reclaiming;

[0095] The recycling control unit 703 is used to control the target application to perform memory recycling according to the memory recycling policy during operation.

[0096] It can be seen from the above technical solution that in a control device provided in the second embodiment of the present application, the sample application data corresponding to the application parameters of the target application is learned, and then the memory recovery strategy corresponding to the application parameters is obtained. Based on this, the target application is controlled to perform memory recovery according to the memory recovery strategy. It can be seen that in this embodiment, the memory state data in the sample application data and the characteristic data for performing memory recovery are learned to obtain a memory recovery strategy that can control the target application to perform memory recovery, without the need for the operation and maintenance personnel to manually set the memory recovery mechanism, thereby improving the setting efficiency of the memory recovery strategy.

[0097] In one implementation, the memory reclamation strategy at least includes memory state data corresponding to executing memory reclamation and the type of memory reclamation algorithm for executing memory reclamation.

[0098] In one implementation, the memory recovery strategy corresponding to the application parameters is obtained in the following manner: according to a linear regression algorithm, the memory status data in the sample application data and the characteristic data for executing memory recovery are analyzed to obtain a memory recovery strategy; the memory recovery strategy makes the duration of executing memory recovery and / or the recovered memory space meet the control condition. For example, first, according to a linear regression algorithm, a memory recovery feature model is constructed, and the memory recovery feature model characterizes the corresponding relationship between memory status data and characteristic data; then, based on the control condition, the memory status data in the sample application data and the characteristic data for executing memory recovery are used to train the memory recovery feature model, and the memory recovery strategy contained in the trained memory recovery feature model makes the duration of executing memory recovery and / or the recovered memory space meet the control condition.

[0099] The control conditions include: the duration is less than or equal to a duration threshold, and / or the recovered memory space is greater than or equal to a recovery threshold.

[0100] In one implementation, the recycling control unit 703 is specifically used to: set the execution parameters of the target application for performing memory recycling according to the memory status data corresponding to the memory recycling performed in the memory recycling strategy and the type of the memory recycling algorithm for performing memory recycling, so that the target application performs memory recycling according to the execution parameters.

[0101] In one implementation, the device in this embodiment may further include the following units: Figure 8 As shown in:

[0102] The policy modification unit 704 is used to: receive a modification operation including modification parameters for the memory recovery policy; and adjust the memory recovery policy according to the modification parameters before the recovery control unit 703 controls the target application to perform memory recovery according to the memory recovery policy during operation.

[0103] In one implementation, the device in this embodiment may further include the following units: Fig. 9 or Fig.10 As shown in:

[0104] The policy verification unit 705 is used to: control the target application to perform memory recovery according to the memory recovery policy during the test process to obtain the test result of the memory recovery policy; the test result indicates whether the memory recovery policy meets the control condition; if the test result indicates that the memory recovery policy meets the control condition, trigger the recovery control unit 703; if the test result indicates that the memory recovery policy does not meet the control condition, re-trigger the policy acquisition unit 702.

[0105] It should be noted that the specific implementation of each unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.

[0106] refer to Fig.11 , is a schematic diagram of the structure of an electronic device provided in the third embodiment of the present application, the electronic device may be an electronic device capable of running an application, the electronic device may be a mobile phone, a pad, a computer or a server and other devices. The application here is a program that occupies the memory of the electronic device during operation to realize the corresponding data processing function, such as a chat application or a shopping application. The technical solution in this embodiment is mainly used to improve the setting efficiency of the memory recovery strategy used in the operation of the application.

[0107] Specifically, the electronic device in this embodiment may include the following structure:

[0108] Memory 1101, used to store computer programs and data generated by the execution of the computer programs;

[0109] Processor 1102 is used to execute the computer program to achieve: obtaining application parameters of the target application, the application parameters characterizing the type of memory reclamation performed by the target application; obtaining a memory reclamation policy corresponding to the application parameters; the memory reclamation policy corresponding to the application parameters is obtained based on at least sample application data corresponding to the application parameters, the sample application data at least including memory status data and characteristic data for performing memory reclamation; controlling the target application to perform memory reclamation according to the memory reclamation policy during operation.

[0110] It can be seen from the above technical solution that in an electronic device provided in Example 3 of the present application, by learning the sample application data corresponding to the application parameters of the target application, a memory recovery strategy corresponding to the application parameters is obtained, and based on this, the target application is controlled to perform memory recovery according to the memory recovery strategy. It can be seen that in this embodiment, by learning the memory status data in the sample application data and the characteristic data for performing memory recovery, a memory recovery strategy that can control the target application to perform memory recovery is obtained, without the need for the operation and maintenance personnel to manually set the memory recovery mechanism, thereby improving the setting efficiency of the memory recovery strategy.

[0111] Taking application development in a low-code platform as an example, applications published by the low-code platform through JAVA will generate long-term memory recovery consumption during operation, which has a great impact on the application experience published by the low-code platform. For this reason, it is necessary to adjust the strategy for this type of memory recovery mechanism. The current solution that completely relies on the personal experience of engineers and system operation and maintenance personnel to set memory recovery policies will result in a long time for policy setting and the adjustment of policies requires a long time of testing and verification, and cannot be automated. In response to these defects, the technical solution of the present application realizes the automatic generation of memory recovery policies by learning application data from sample applications, and in the learning process, the application memory consumption and the possible execution time of memory recovery are estimated in advance, so that the set memory recovery policy can avoid the phenomenon that long-term memory recovery causes long pauses in service nodes.

[0112] The following is an explanation of the execution process of the technical solution of this application. Fig.12 As shown in:

[0113] Before releasing the low-code platform application, prepare the low-code application GC (Garbage Collection) feature model in advance, that is, the memory recycling feature model mentioned above. The preparation process of the GC feature model is as follows:

[0114] 1. Use linear regression analysis to establish a low-code application GC feature model. It should be noted that the GC feature model that has been trained and matured can be reused. In this case, the user completes the preparation steps for application release on the low-code platform in advance and executes the release of the application sandbox environment.

[0115] (a) The memory status data of the released low-code application sandbox (which can be understood as the stress testing environment) (such as the maximum value of the new generation memory, the maximum value of the old generation memory, the maximum value of the off-heap memory, the stack size, and the maximum and minimum values ​​of the threads) are used as independent variables, and various GC feature data (such as the memory status data corresponding to the execution of memory recycling, the duration of the execution of memory recycling, the memory space recovered by the execution of memory recycling, the type of memory recycling algorithm for the execution of memory recycling, etc.) are used as dependent variables. Through the linear regression algorithm, the sample application data in the GC log file of the low-code platform application stress testing is analyzed, and finally a GC feature model is constructed.

[0116] (b) Manually adjust the policy content in the GC feature model. For example, when the application access volume reaches 100,000, a minor GC is executed, and when the application access volume reaches 1,000,000, a full GC is executed. Thus, an adjusted GC feature model is obtained.

[0117] (c) Based on the low-code platform application, a linear regression analysis is performed on the adjusted GC feature model to verify the GC feature model. After adjusting the strategy in (b), a relatively complete GC feature model is finally established.

[0118] Based on the GC feature model obtained above, when the application is released on the low-code platform, the technical solution of this application requires that the user first logs in to the low-code platform and completes the preparation steps for application release on the low-code platform, and executes the release of the application sandbox environment. Before the application is released, the GC configuration extraction and GC policy setting tasks are triggered, that is: the memory status data generated by the Java runtime in the sandbox environment is input into the GC feature model, so that the GC feature model predicts the GC configuration based on these memory status data, and then fills the GC configuration into the application startup item, thereby completing the startup of the application instance after the application is released. The GC feature model is obtained in the manner described above, that is: a GC feature model is constructed based on the stress test data of the application in the design environment and the memory status data generated by the application, and after manual adjustment and regression verification, the GC feature model is completed, so as to predict the corresponding GC configuration after the application is released, that is, the memory status data for performing memory recovery and the type of memory recovery algorithm for performing memory recovery, etc. It can be seen that in this application, when stress testing the application, the memory status data of the application execution and the characteristic data of the GC are obtained. After the GC characteristic model is obtained, when the user executes the application release, the decision tree-based algorithm program, i.e., the memory recovery algorithm mentioned above, is automatically triggered to run. The GC characteristic model prepared in the above steps is used to adapt the memory and GC data generated by the low-code platform application to be released, and the memory recovery strategy is set, so that the application performs memory recovery according to the set memory recovery strategy.

[0119] In summary, the technical solution of this application has the following core points:

[0120] 1. In the design environment of the low-code platform, the monitoring technology is used to monitor the memory change curve of the virtual machine where the application is located and the time curve of memory recycling, and to mark the feature classification. At the same time, the values ​​of each area of ​​the JAVA virtual machine memory where the application is located are recorded and the recorded memory values ​​are associated with the previously marked feature classification, thereby obtaining the memory status data in the sample application data mentioned above and the feature data of executing memory recycling;

[0121] 2. According to the various data and characteristic data in the memory status data, plan the appropriate memory scheduling mechanism and the memory recycling GC parameters suitable for application startup, that is, the indication parameters in the memory recycling strategy mentioned above;

[0122] 3. Users can flexibly adjust memory recycling policies according to business needs. For example, memory recycling should be carried out two days before 6.18 to avoid long memory recycling time and application pauses when the traffic is large.

[0123] It can be seen that the technical solution of the present application does not require a long time to debug the memory recovery strategy of the application, which can simplify the operation and maintenance management, and can improve the availability of the system and reduce the learning cost of the system operation and maintenance personnel.

[0124] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0125] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0126] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0127] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may 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 shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A control method, comprising: Obtaining application parameters of the target application, wherein the application parameters characterize the type of memory recycling performed by the target application, and the application parameters include an algorithm type parameter and an application type parameter, wherein the algorithm type parameter characterizes the memory recycling algorithm used by the target application to perform memory recycling, and the application type parameter characterizes the application type of the target application, specifically the type of application function implemented by the target application; Obtaining a memory recovery strategy corresponding to the application parameters; The memory reclaiming strategy corresponding to the application parameter is obtained based on at least sample application data corresponding to the application parameter, the sample application data at least including memory state data and characteristic data for executing memory reclaiming, the characteristic data referring to execution characteristic data of memory reclaiming executed by the target application during the test process; Controlling the target application to perform memory reclamation according to the memory reclamation policy during operation; The memory recovery strategy corresponding to the application parameters is obtained in the following way: According to the linear regression algorithm, a memory recycling feature model is constructed, wherein the memory recycling feature model represents the corresponding relationship between the memory state data and the feature data; Based on the control conditions, the memory recycling feature model is trained using the memory status data in the sample application data and the feature data for executing memory recycling. The memory recycling feature model obtained by training contains a memory recycling strategy that ensures that the duration of executing memory recycling and / or the reclaimed memory space meet the control conditions.

2. According to the method of claim 1, the memory reclamation strategy at least includes memory state data corresponding to executing memory reclamation and the type of memory reclamation algorithm for executing memory reclamation.

3. According to the method of claim 1, the control conditions include: the duration is less than or equal to a duration threshold, and / or the reclaimed memory space is greater than or equal to a reclaim threshold.

4. The method according to claim 2, controlling the target application to perform memory reclamation according to the memory reclamation policy during operation, comprising: According to the memory state data corresponding to the memory reclamation executed in the memory reclamation strategy and the type of the memory reclamation algorithm for executing the memory reclamation, the execution parameters for executing the memory reclamation by the target application are set so that the target application executes the memory reclamation according to the execution parameters.

5. The method according to claim 1 or 2, before controlling the target application to perform memory reclamation according to the memory reclamation policy during operation, the method further comprises: Receiving a modification operation, wherein the modification operation includes modification parameters for the memory reclaiming strategy; The memory reclaiming strategy is adjusted according to the modification parameters.

6. The method according to claim 1 or 2, before controlling the target application to perform memory reclamation according to the memory reclamation policy during operation, the method further comprises: Controlling the target application to perform memory reclamation according to the memory reclamation strategy during the test process to obtain a test result of the memory reclamation strategy; The test result indicates whether the memory recycling strategy satisfies the control condition; If the test result indicates that the memory reclaiming strategy satisfies the control condition, executing the step of: controlling the target application to perform memory reclaiming according to the memory reclaiming strategy during operation; If the test result indicates that the memory reclaiming strategy does not satisfy the control condition, the step of obtaining the memory reclaiming strategy corresponding to the application parameter is re-executed.

7. A control device comprising: a parameter obtaining unit, configured to obtain an application parameter of a target application, wherein the application parameter represents a type of memory recycling performed by the target application, and the application parameter comprises an algorithm type parameter and an application type parameter, wherein the algorithm type parameter represents a memory recycling algorithm used by the target application to perform memory recycling, and the application type parameter represents an application type of the target application, specifically a type of application function implemented by the target application; A strategy obtaining unit, used to obtain a memory recovery strategy corresponding to the application parameters; The memory reclaiming strategy corresponding to the application parameter is obtained based on at least sample application data corresponding to the application parameter, the sample application data at least including memory state data and characteristic data for executing memory reclaiming, the characteristic data referring to execution characteristic data of memory reclaiming executed by the target application during the test process; A recycling control unit, used to control the target application to perform memory recycling according to the memory recycling strategy during operation; The memory recovery strategy corresponding to the application parameters is obtained in the following way: According to the linear regression algorithm, a memory recycling feature model is constructed, wherein the memory recycling feature model represents the corresponding relationship between the memory state data and the feature data; Based on the control conditions, the memory recycling feature model is trained using the memory status data in the sample application data and the feature data for executing memory recycling. The memory recycling feature model obtained by training contains a memory recycling strategy that ensures that the duration of executing memory recycling and / or the reclaimed memory space meet the control conditions.

8. An electronic device comprising: A memory, used to store a computer program and data generated by the execution of the computer program; A processor is used to execute the computer program to achieve: obtaining application parameters of a target application, the application parameters representing the type of memory recycling performed by the target application, the application parameters including an algorithm type parameter and an application type parameter, the algorithm type parameter representing the memory recycling algorithm used by the target application to perform memory recycling, the application type parameter representing the application type of the target application, specifically the type of application function implemented by the target application; obtaining a memory recycling strategy corresponding to the application parameters; The memory reclaiming strategy corresponding to the application parameter is obtained based on at least sample application data corresponding to the application parameter, the sample application data at least including memory state data and characteristic data for executing memory reclaiming, the characteristic data referring to execution characteristic data of memory reclaiming executed by the target application during the test process; controlling the target application to execute memory reclaiming according to the memory reclaiming strategy during the running process; The memory recovery strategy corresponding to the application parameters is obtained in the following way: According to the linear regression algorithm, a memory recycling feature model is constructed, wherein the memory recycling feature model represents the corresponding relationship between the memory state data and the feature data; Based on the control conditions, the memory recycling feature model is trained using the memory status data in the sample application data and the feature data for executing memory recycling. The memory recycling feature model obtained by training contains a memory recycling strategy that ensures that the duration of executing memory recycling and / or the reclaimed memory space meet the control conditions.

Citation Information

Patent Citations

  • Memory recovery method and device

    CN105701025A

  • Data processing method and device for solid state disk

    CN111913648A

  • Storage garbage recycling method and device, equipment and readable medium

    CN112463069A