Method for improving RAM read-write performance, electronic device and medium
By acquiring RAM environmental parameters and identifying abnormal processes, their memory usage can be limited, thus solving the problem of low RAM read/write efficiency and improving performance.
Patent Information
- Application Number
- CN202510256706.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-03-05
AI Technical Summary
RAM read and write efficiency is low in certain environments, and existing technologies are unable to effectively improve it.
By acquiring the target environment parameters of RAM, abnormal processes can be identified and their memory usage restricted to improve RAM read and write performance.
Accurate identification and restriction of abnormal processes improves RAM read and write performance.
Smart Images

Figure CN120179170B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of storage or the technical field of computer, in particular to a method for improving RAM read-write performance, an electronic device and a medium. BACKGROUND
[0002] With the rapid development of electronic technology, various storage requirements have become the focus of users, for example, the read-write of random access memory (RAM) is also the focus of users, but in the process of using RAM, due to environmental constraints, sometimes the read-write efficiency is low, therefore, the problem of how to intelligently improve the RAM read-write performance needs to be solved urgently. SUMMARY
[0003] The embodiments of the present application provide a method for improving RAM read-write performance, an electronic device and a medium, which can intelligently improve the RAM read-write performance.
[0004] In a first aspect, the embodiments of the present application provide a method for improving RAM read-write performance, applied to an electronic device, the electronic device comprising a RAM, and the method comprising:
[0005] obtaining a target environment parameter of the RAM;
[0006] obtaining a current read-write speed of the RAM at a current time;
[0007] obtaining a reference read-write speed corresponding to the target environment parameter;
[0008] when the current read-write speed is less than the reference read-write speed, determining a first memory usage parameter of the RAM, the first memory usage parameter comprising a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period between the current time and a preset time length; the first total memory usage being a total memory usage of the RAM corresponding to the current time;
[0009] identifying a number of abnormal processes a according to the first total memory usage and the first memory change monitoring data, a being a positive integer;
[0010] limiting b abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a.
[0011] In a second aspect, the embodiments of the present application provide an electronic device, comprising a RAM, and the electronic device comprises an obtaining unit, a determining unit, an identifying unit and a limiting unit, wherein,
[0012] The acquisition unit is configured to acquire a target environment parameter of the RAM; acquire a current read-write speed of the RAM at a current time; and acquire a reference read-write speed corresponding to the target environment parameter;
[0013] The determination unit is configured to determine a first memory usage parameter of the RAM when the current read-write speed is less than the reference read-write speed, the first memory usage parameter including a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period between the current time and a preset time length; and the first total memory usage being a total memory usage of the RAM at the current time.
[0014] The identification unit is configured to identify a number a of abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer.
[0015] The limiting unit is configured to limit a number b of abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of the present application.
[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to perform some or all of the steps described in the first aspect of the present application.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the present application. The computer program product can be a software installation package.
[0019] By implementing the embodiments of the present application, the following beneficial effects are achieved:
[0020] It can be seen that the method for improving RAM read-write performance, the electronic device and the medium provided in the embodiments of the present application are applied to an electronic device, the electronic device includes a RAM, a target environment parameter of the RAM is acquired, a current read-write rate of the RAM at a current time is acquired, a reference read-write rate corresponding to the target environment parameter is acquired, when the current read-write rate is less than the reference read-write rate, a first memory usage parameter of the RAM is determined, the first memory usage parameter includes a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period is a time period between the current time and a preset time length; the first total memory usage is a total memory usage of the RAM corresponding to the current time, a number a of abnormal processes is identified according to the first total memory usage and the first memory change monitoring data, a is a positive integer, b abnormal processes in the a abnormal processes are limited, b is a positive integer less than or equal to a, in this way, when the RAM read-write performance is lower than expected, the abnormal processes are accurately identified, and accordingly, the corresponding processes can be accurately limited to improve the RAM read-write performance. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 is a flow diagram of a method for improving RAM read-write performance provided by an embodiment of the present application;
[0023] Figure 2 is a structural diagram of an electronic device provided by an embodiment of the present application;
[0024] Figure 3 is a functional unit composition block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0026] The terms "first", "second", and the like in the description and in the claims of the present application and above drawings are used for distinguishing between similar objects, not necessarily described in a particular order. Also, the terms "comprise", "comprising", and the like are intended to encompass non-exclusive inclusions. For example, processes, methods, articles, or apparatuses that comprise a list of steps or elements are not limited to the listed steps or elements, but can also comprise additional steps or elements not expressly listed, or can also comprise steps or elements inherent in such processes, methods, articles, or apparatuses.
[0027] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. It is expressly understood that the embodiments described herein are merely examples from a potentially infinite number of embodiments that serve the same, a similar, or other purposes, as will be apparent to one of ordinary skill in the art.
[0028] In the embodiments of the present application, the electronic device can be a device with communication capability. The electronic device can include various handheld devices with wireless communication functions, in-vehicle devices (e.g., a driving recorder, an in-vehicle camera, an in-vehicle audio, etc.), smart home devices, wearable devices (e.g., smart glasses, a smart bracelet, Internet of Things devices (e.g., a smart refrigerator, a smart washing machine, a smart television), a smart watch, etc.), computing devices, or other processing devices connected to a wireless modem, and various forms of user equipment (UE), mobile stations (MS), terminal devices, and the like.
[0029] The embodiments of the present application are described in detail below.
[0030] Please refer to Figure 1 , Figure 1 is a flowchart of a method for improving RAM read-write performance provided by the embodiments of the present application, as shown in the figure, applied to an electronic device, the electronic device comprising a RAM, and the method for improving RAM read-write performance comprises the following steps.
[0031] 101, obtaining a target environment parameter of the RAM.
[0032] In the embodiments of the present application, the target environment parameter can include at least one of the following: a first hardware environment parameter, a first software environment parameter, a first external environment parameter of the RAM, and the like, which are not limited herein.
[0033] The first hardware environment parameter can include at least one of the following: a model of RAM, a circuit structure of RAM, a memory size of RAM, a remaining service life of RAM, a hardware current, a hardware voltage, a hardware power, and the like, without limitation.
[0034] The first software environment parameter can include at least one of the following: a network bandwidth, a system file type, a cache size, an operating system, and the like, without limitation.
[0035] The first external environment parameter of the RAM can include at least one of the following: an environmental temperature, an environmental humidity, a magnetic field interference intensity, and the like, without limitation.
[0036] In a specific implementation, a target environment parameter of the RAM at a current time can be acquired, and the target environment parameter represents an actual environment.
[0037] 102. Acquire a current read-write speed of the RAM at a current time.
[0038] In the embodiments of the present application, the current read-write speed reflects the read-write performance of the RAM, and thus the current read-write speed of the RAM at a current time can be acquired.
[0039] 103. Acquire a reference read-write speed corresponding to the target environment parameter.
[0040] In the embodiments of the present application, different environment parameters reflect actual environment, and a mapping relationship between a preset environment parameter and a read-write speed can be stored in advance, and thus a reference read-write speed corresponding to the target environment parameter can be determined based on the mapping relationship, so that a read-write speed corresponding to the actual environment can be obtained.
[0041] Optionally, the target environment parameter includes a first hardware environment parameter, a first software environment parameter, and a first external environment parameter of the RAM; and the step 103 of acquiring a reference read-write speed corresponding to the target environment parameter can include the following steps:
[0042] Determine a first reference read-write speed corresponding to the first hardware environment parameter;
[0043] Determine a first adjustment parameter corresponding to the first software environment parameter;
[0044] Determine a first fine adjustment parameter corresponding to the first external environment parameter;
[0045] Adjust the first reference read-write speed according to the first adjustment parameter and the first fine adjustment parameter, to obtain the reference read-write speed.
[0046] In a specific implementation, a mapping relationship between the preset hardware environment parameter and the read-write speed can be stored in advance, and then the first reference read-write speed corresponding to the first hardware environment parameter can be determined based on the mapping relationship. In addition, a mapping relationship between the preset software environment parameter and the adjustment parameter can be stored in advance, and then the first adjustment parameter corresponding to the first software environment parameter can be determined based on the mapping relationship. The value range of the adjustment parameter can be preset or defaulted by the system, for example, the value range of the adjustment parameter is -0.25~0.25. Furthermore, a mapping relationship between the preset external environment parameter and the fine-tuning parameter can be stored in advance, and then the first fine-tuning parameter corresponding to the first external environment parameter can be determined based on the mapping relationship. The value range of the fine-tuning parameter can be preset or defaulted by the system, for example, the value range of the fine-tuning parameter is -0.05~0.05. Finally, the first reference read-write speed can be adjusted according to the first adjustment parameter and the first fine-tuning parameter to obtain the reference read-write speed, reference read-write speed = first reference read-write speed (1+first adjustment parameter) (1+first fine-tuning parameter).
[0047] In this example, the hardware environment parameter has a dominant influence on the read-write speed, and the read-write efficiency corresponding to the actual hardware environment parameter can be determined first. The software environment parameter will affect the read-write speed to some extent, and therefore the adjustment parameter corresponding to the actual software environment parameter can be adapted, and the read-write speed can be dynamically adjusted based on the adjustment parameter. In addition, the external environment parameter will also have some influence on the read-write speed, and therefore the fine-tuning parameter corresponding to the external environment parameter can be adapted, and the read-write speed can be further fine-tuned based on the fine-tuning parameter, so that the final read-write speed is deeply consistent with the actual environment.
[0048] 104、In the case where the current read-write speed is less than the reference read-write speed, a first memory usage parameter of the RAM is determined, the first memory usage parameter including a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, and the preset time period being a time period between the current time and a preset time length. The first total memory usage is a total memory usage of the RAM corresponding to the current time.
[0049] In a specific implementation, the preset time length can be preset or defaulted by the system. The preset time length can be related to the target environment parameter, for example, the preset time length can be related to the first hardware environment parameter, or the preset time length can be related to the first software environment parameter, or the preset time length can be related to the first external environment parameter of the RAM.
[0050] In the embodiments of the present application, when the current read-write rate is less than the reference read-write rate, it indicates that the RAM read-write performance is lower than expected, and then the first memory usage parameter of the RAM can be determined, the first memory usage parameter including a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period between the current time and a preset time length, and the first total memory usage being a total memory usage of the RAM at the current time.
[0051] The first memory usage parameter reflects the actual memory change and the memory change trend of the RAM.
[0052] Of course, when the current read-write rate is greater than or equal to the reference read-write rate, it indicates that the RAM read-write performance is not a problem (as expected), and the RAM read-write performance can not be improved.
[0053] 105. Identify a abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer.
[0054] In the embodiments of the present application, a abnormal processes can be identified according to the first total memory usage and the first memory change monitoring data, a being a positive integer. The abnormal processes can include at least one of the following: a process with abnormal resource occupation, a process of malicious software, a process warned by security software, a process with abnormal execution behavior, and the like, without limitation.
[0055] In the specific implementation, a abnormal processes can be identified according to the first total memory usage and the first memory change monitoring data, a being a positive integer,
[0056] Optionally, the step 105 of identifying a abnormal processes according to the first total memory usage and the first memory change monitoring data can be implemented in the following manner:
[0057] Determine c process memory data sets corresponding to the c processes according to the first memory change monitoring data, each process memory data set including a plurality of memory data, each memory data corresponding to a monitoring time; c being an integer greater than or equal to a;
[0058] Fit according to the c process memory data sets to obtain c fitting straight lines and c fitting curves, each process memory data set corresponding to a fitting straight line and a fitting curve;
[0059] Determine c slopes and c mean square errors according to the c fitting straight lines and the c fitting curves;
[0060] Obtain c attribute information according to the c process memory data sets, each process memory data set corresponding to an attribute information;
[0061] The a abnormal processes are determined according to the c attribute information, the c slopes and the c mean square errors.
[0062] In a specific implementation, the c process memory data sets corresponding to the c processes can be determined according to the first memory change monitoring data, each process memory data set includes a plurality of memory data, and each memory data corresponds to a monitoring time; c is an integer greater than or equal to a; the c fitting straight lines and the c fitting curves can be obtained by fitting the c process memory data sets; each process memory data set corresponds to a fitting straight line and a fitting curve; specifically, each memory data corresponding to each process can correspond to a monitoring time, and the memory data can be mapped to a coordinate system, the horizontal axis of the coordinate system is time, that is, a plurality of coordinate points can be obtained, and the plurality of coordinates corresponding to each process are fitted to obtain the corresponding fitting straight line and fitting curve.
[0063] Next, the c slopes and the c mean square errors can be determined according to the c fitting straight lines and the c fitting curves, and each process corresponds to a fitting straight line, a fitting curve, a slope and a mean square error. Specifically, for any process, the slope of the fitting straight line can be obtained to obtain the corresponding slope, a curve segment of the fitting curve in a preset time period can be intercepted to obtain a fitting curve segment, the period of the fitting curve segment is determined, the sampling number corresponding to the period is obtained, the fitting curve segment is uniformly sampled based on the sampling number to obtain a plurality of sampling points, and the mean square error operation is performed based on the plurality of sampling points to obtain the corresponding mean square error. The mean square error reflects the process stability to a certain extent.
[0064] The attribute information of the process can include at least one of the following: process name, process source, whether the process can be limited, limitation degree, and the like, which are not limited herein. The process memory data set reflects the change of the process to a certain extent, or the attribute of the process, and of course, the mapping relationship between the preset process memory data set and the attribute information can be set in advance, and then the attribute information corresponding to the process memory data set of each process can be determined based on the mapping relationship.
[0065] Then, the c attribute information can be obtained according to the c process memory data sets, each process memory data set corresponds to an attribute information, and finally, the a abnormal processes can be determined according to the c attribute information, the c slopes and the c mean square errors. In this way, since the attribute information deeply reflects the characteristics of the process, the slope reflects the memory change trend of the process, and the mean square error reflects the process stability to a certain extent, the corresponding abnormal process can be identified based on the characteristics of the process, the memory change trend of the process and the process stability. In this way, the abnormal process can be accurately identified, and the corresponding process can be accurately limited, so that the RAM read-write performance is improved.
[0066] Further, the step of determining the a abnormal processes according to the c attribute information, the c slopes and the c mean square deviations can be implemented as follows:
[0067] determining the d processes from the c processes according to the c attribute information, d being an integer greater than or equal to b and less than or equal to c;
[0068] obtaining the slopes and the mean square deviations corresponding to the d processes from the c slopes and the c mean square deviations, to obtain d slopes and d mean square deviations;
[0069] selecting the slopes greater than a first preset threshold from the d slopes, to obtain m slopes, m being an integer less than or equal to d;
[0070] selecting the mean square deviations greater than a second preset threshold from the d mean square deviations, to obtain n mean square deviations, n being an integer less than or equal to d;
[0071] determining the a abnormal processes according to the m slopes and the n mean square deviations.
[0072] In a specific implementation, the d processes can be determined from the c processes according to the c attribute information, d being an integer greater than or equal to b and less than or equal to c. For example, a mapping relationship between preset attribute information and a limitable degree can be stored in advance, and then the limitable degree of each process in the c processes can be determined based on the mapping relationship, to obtain c limitable degrees. The limitable degrees in a preset range can be selected from the c limitable degrees, and the corresponding processes are obtained, to obtain the d processes.
[0073] The first preset threshold can be set in advance or by default of the system, and the second preset threshold can be set in advance or by default of the system. The slope greater than the first preset threshold indicates that the memory change is abnormal, and the mean square deviation greater than the second preset threshold indicates that the process stability is abnormal.
[0074] Then, the slopes and mean square errors corresponding to the d processes can be obtained from the c slopes and c mean square errors, d slopes and d mean square errors are obtained, slopes greater than a first preset threshold are selected from the d slopes, m slopes are obtained, m is an integer less than or equal to d, and mean square errors greater than a second preset threshold are selected from the d mean square errors, n mean square errors are obtained, n is an integer less than or equal to d, and finally, a can be determined according to the m slopes and n mean square errors. abnormal processes, that is, the processes corresponding to the m slopes and the processes corresponding to the n mean square errors can be obtained, the union of the two processes is determined, and a is obtained. abnormal processes, in this way, since the attribute information depth reflects the characteristics of the process, the slope reflects the memory change trend of the process, and the mean square error reflects the process stability to a certain extent, the corresponding abnormal process can be identified based on the characteristics of the process, the memory change trend of the process and the process stability, in this way, the abnormal process can be accurately identified, and the corresponding process can be accurately limited, thereby improving the RAM read-write performance.
[0075] 106、limiting b abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, the b being a positive integer less than or equal to the a.
[0076] In the embodiments of the present application, limitation can be understood as improving memory space by memory release, and the limitation method can be at least one of the following: ending the process, hibernating the process, process compression, process memory release, etc., which are not limited here.
[0077] In specific implementation, b abnormal processes in a abnormal processes can be limited to improve the RAM read-write performance, b being a positive integer less than or equal to a, and the RAM read-write performance can be intelligently improved.
[0078] In specific implementation, b abnormal processes can be limited synchronously or asynchronously based on actual situation to improve the RAM read-write performance.
[0079] Optionally, the step 106 of limiting b abnormal processes in the a abnormal processes can be implemented in the following way:
[0080] determine the first attribute information of the first abnormal process; the first abnormal process is any abnormal process in the a abnormal processes;
[0081] determine the first limitation strategy corresponding to the first attribute information;
[0082] limit the first abnormal process according to the first limitation strategy.
[0083] The first limitation strategy can include at least one of the following: ending the process, hibernating the process, process compression, process memory release, etc., which are not limited here.
[0084] In a particular implementation, the first attribute information of the first abnormal process can be determined, and the preset attribute information can be stored in advance to limit the mapping relationship between the strategies, and then the first limiting strategy corresponding to the first attribute information can be determined based on the mapping relationship, and finally the first abnormal process can be limited according to the first limiting strategy. In this way, the process can be personalized limited based on the characteristics of the process, which can ensure the overall stability of the RAM memory environment and intelligently improve the RAM read-write performance.
[0085] Optionally, the step 106 of limiting b abnormal processes in the a abnormal processes can be implemented in the following manner:
[0086] The memory size of the a abnormal processes is obtained to obtain a memory size;
[0087] The limiting manner of the a abnormal processes is determined to obtain a limiting manner;
[0088] The contribution degree of improving the read-write performance of the RAM is determined according to the a memory size and the a limiting manner to obtain a contribution degree;
[0089] The priority order corresponding to the a abnormal processes is determined according to the a contribution degree;
[0090] The b abnormal processes in the a abnormal processes are limited according to the priority order.
[0091] The limiting manner can include at least one of the following: ending the process, hibernating the process, compressing the process, releasing the memory of the process, and the like, which are not limited herein.
[0092] The contribution degree can be understood as the degree of improvement of the RAM read-write performance. The greater the contribution degree, the greater the degree of improvement of the RAM read-write performance, and vice versa.
[0093] In the embodiments of the present application, the memory size of the a abnormal processes can be obtained to obtain a memory size, and the mapping relationship between the preset attribute information and the limiting manner can be stored in advance, and then the limiting manner of the a abnormal processes can be determined based on the mapping relationship to obtain a limiting manner.
[0094] Next, the contribution of the RAM read-write performance improvement can be determined according to a memory size and a restriction mode, a contribution is obtained, for example, the memory change value can be estimated based on the memory size and the restriction mode, based on this mode, a memory change value can be estimated according to a memory size and a restriction mode, and a mapping relationship between the preset memory change value and the contribution is stored in advance, and then the corresponding a contribution can be determined based on the mapping relationship, and the priority order corresponding to the a abnormal processes is determined according to the a contribution, and finally, the b abnormal processes in the a abnormal processes can be restricted according to the priority order, in this way, the contribution of the actual process can be determined based on the restriction mode, and the corresponding priority order is determined, and the abnormal process is dynamically limited based on the priority order, which not only ensures the stability of the RAM internal environment, but also intelligently improves the RAM read-write performance.
[0095] It can be seen that the method for improving the RAM read-write performance described in the embodiment of the application is applied to an electronic device, the electronic device includes a RAM, a target environment parameter of the RAM is obtained, a current read-write rate of the RAM at a current time is obtained, a reference read-write rate corresponding to the target environment parameter is obtained, when the current read-write rate is less than the reference read-write rate, a first memory usage parameter of the RAM is determined, the first memory usage parameter includes a first total memory usage and first memory change monitoring data of each process memory usage in a preset time period, the preset time period is a time period between the current time and a preset time length; the first total memory usage is the total memory usage of the RAM at the current time, a is a positive integer, and b is a positive integer less than or equal to a, and the b abnormal processes in the a abnormal processes are limited to improve the RAM read-write performance, in this way, when the RAM read-write performance is lower than expected, the abnormal process is accurately identified, and thus the corresponding process can be accurately limited to improve the RAM read-write performance.
[0096] Consistent with the above embodiment, please refer to Figure 2 , Figure 2 is a structural schematic diagram of an electronic device provided by the embodiment of the application, as shown in the figure, the electronic device includes a processor, a memory, a communication interface and one or more programs, the above-mentioned one or more programs are stored in the above-mentioned memory, and are configured to be executed by the above-mentioned processor, in the embodiment of the application, the electronic device includes a RAM, and the above-mentioned program includes instructions for executing the following steps:
[0097] obtaining a target environment parameter of the RAM;
[0098] obtaining a current read-write rate of the RAM at a current time;
[0099] acquire a reference read-write speed corresponding to the target environment parameter;
[0100] when the current read-write speed is less than the reference read-write speed, determine a first memory usage parameter of the RAM, the first memory usage parameter including a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period between the current time and a preset time length; the first total memory usage being a total memory usage of the RAM corresponding to the current time;
[0101] identify a number of abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer;
[0102] limit b abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a.
[0103] Optionally, the target environment parameter includes a first hardware environment parameter, a first software environment parameter, and a first external environment parameter of the RAM; in the aspect of acquiring the reference read-write speed corresponding to the target environment parameter, the above program includes instructions for performing the following steps:
[0104] determine a first reference read-write speed corresponding to the first hardware environment parameter;
[0105] determine a first adjustment parameter corresponding to the first software environment parameter;
[0106] determine a first fine-tuning parameter corresponding to the first external environment parameter;
[0107] adjust the first reference read-write speed according to the first adjustment parameter and the first fine-tuning parameter to obtain the reference read-write speed.
[0108] Optionally, in the aspect of identifying a number of abnormal processes according to the first total memory usage and the first memory change monitoring data, the above program includes instructions for performing the following steps:
[0109] determine c process memory data sets corresponding to c processes according to the first memory change monitoring data, each process memory data set including a plurality of memory data, each memory data corresponding to a monitoring time; c being an integer greater than or equal to a;
[0110] fit according to the c process memory data sets to obtain c fitting straight lines and c fitting curves, each process memory data set corresponding to a fitting straight line and a fitting curve;
[0111] determining c slopes and c mean square errors according to the c fitted straight lines and the c fitted curves;
[0112] obtaining c attribute information according to the c process memory data sets, each process memory data set corresponding to one attribute information;
[0113] determining the a abnormal processes according to the c attribute information, the c slopes and the c mean square errors.
[0114] Optionally, in the aspect of determining the a abnormal processes according to the c attribute information, the c slopes and the c mean square errors, the program comprises instructions for performing the following steps:
[0115] determining limitable processes in the c processes according to the c attribute information, obtaining d processes, d being an integer greater than or equal to b and less than or equal to c;
[0116] obtaining slopes and mean square errors corresponding to the d processes from the c slopes and the c mean square errors, obtaining d slopes and d mean square errors;
[0117] selecting slopes greater than a first preset threshold from the d slopes, obtaining m slopes, m being an integer less than or equal to d;
[0118] selecting mean square errors greater than a second preset threshold from the d mean square errors, obtaining n mean square errors, n being an integer less than or equal to d;
[0119] determining the a abnormal processes according to the m slopes and the n mean square errors.
[0120] Optionally, in the aspect of limiting b abnormal processes in the a abnormal processes, the program comprises instructions for performing the following steps:
[0121] determining first attribute information of a first abnormal process; the first abnormal process being any abnormal process in the a abnormal processes;
[0122] determining a first limiting strategy corresponding to the first attribute information;
[0123] limiting the first abnormal process according to the first limiting strategy.
[0124] It can be seen that the electronic device described in the embodiments of the present application includes RAM, obtains a target environment parameter of the RAM, obtains a current read-write rate of the RAM at the current time, obtains a reference read-write rate corresponding to the target environment parameter, determines a first memory usage parameter of the RAM when the current read-write rate is less than the reference read-write rate, the first memory usage parameter includes a first total memory usage and first memory change monitoring data of memory occupied by each process in a preset time period, the preset time period is a time period between the current time and a preset length of time; the first total memory usage is a total memory usage of the RAM corresponding to the current time, a number a of abnormal processes are identified according to the first total memory usage and the first memory change monitoring data, a is a positive integer, b abnormal processes in the a abnormal processes are limited, b is a positive integer less than or equal to a, in this way, when the RAM read-write performance is lower than expected, the abnormal processes are accurately identified, and accordingly, the corresponding processes can be accurately limited to improve the RAM read-write performance.
[0125] Figure 3 is a functional unit composition block diagram of an electronic device 300 involved in the embodiments of the present application. The electronic device 300 includes RAM, and the electronic device 300 includes an obtaining unit 301, a determining unit 302, an identifying unit 303, and a limiting unit 304.
[0126] The obtaining unit 301 is configured to obtain a target environment parameter of the RAM, obtain a current read-write rate of the RAM at the current time, and obtain a reference read-write rate corresponding to the target environment parameter.
[0127] The determining unit 302 is configured to determine a first memory usage parameter of the RAM when the current read-write rate is less than the reference read-write rate, the first memory usage parameter including a first total memory usage and first memory change monitoring data of memory occupied by each process in a preset time period, the preset time period being a time period between the current time and a preset length of time, and the first total memory usage being a total memory usage of the RAM corresponding to the current time.
[0128] The identifying unit 303 is configured to identify a number a of abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer.
[0129] The limiting unit 304 is configured to limit b abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a.
[0130] Optionally, the target environment parameter comprises a first hardware environment parameter, a first software environment parameter and a first external environment parameter of the RAM; in the obtaining of the reference read-write speed corresponding to the target environment parameter, the obtaining unit 301 is specifically configured to:
[0131] determine a first reference read-write speed corresponding to the first hardware environment parameter;
[0132] determine a first adjustment parameter corresponding to the first software environment parameter;
[0133] determine a first fine-tuning parameter corresponding to the first external environment parameter;
[0134] adjust the first reference read-write speed according to the first adjustment parameter and the first fine-tuning parameter, to obtain the reference read-write speed.
[0135] Optionally, in the identifying of the a abnormal processes according to the first total memory usage and the first memory change monitoring data, the identifying unit 303 is specifically configured to:
[0136] determine c process memory data sets corresponding to c processes according to the first memory change monitoring data, each process memory data set comprising a plurality of memory data, each memory data corresponding to a monitoring time; c is an integer greater than or equal to a;
[0137] fit according to the c process memory data sets to obtain c fitting straight lines and c fitting curves, each process memory data set corresponding to a fitting straight line and a fitting curve;
[0138] determine c slopes and c mean square errors according to the c fitting straight lines and the c fitting curves;
[0139] obtain c attribute information according to the c process memory data sets, each process memory data set corresponding to an attribute information;
[0140] determine the a abnormal processes according to the c attribute information, the c slopes and the c mean square errors.
[0141] Optionally, in the identifying of the a abnormal processes according to the first total memory usage and the first memory change monitoring data, the identifying unit 303 is specifically configured to:
[0142] determine c process memory data sets corresponding to c processes according to the first memory change monitoring data, each process memory data set comprising a plurality of memory data, each memory data corresponding to a monitoring time; c is an integer greater than or equal to a;
[0143] fitting according to the c process memory data sets, c fitting straight lines and c fitting curves are obtained, each process memory data set corresponds to a fitting straight line and a fitting curve;
[0144] determining c slopes and c mean square errors according to the c fitting straight lines and the c fitting curves;
[0145] obtaining c attribute information according to the c process memory data sets, each process memory data set corresponds to an attribute information;
[0146] determining the a abnormal processes according to the c attribute information, the c slopes and the c mean square errors.
[0147] Optionally, in the aspect of determining the a abnormal processes according to the c attribute information, the c slopes and the c mean square errors, the identification unit 303 is specifically configured to:
[0148] determining the limitable processes in the c processes according to the c attribute information, d processes are obtained, d is an integer greater than or equal to b and less than or equal to c;
[0149] obtaining the slopes and the mean square errors corresponding to the d processes from the c slopes and the c mean square errors, d slopes and d mean square errors are obtained;
[0150] selecting the slopes greater than a first preset threshold from the d slopes, m slopes are obtained, m is an integer less than or equal to d;
[0151] selecting the mean square errors greater than a second preset threshold from the d mean square errors, n mean square errors are obtained, n is an integer less than or equal to d;
[0152] determining the a abnormal processes according to the m slopes and the n mean square errors.
[0153] Optionally, in the aspect of limiting the b abnormal processes in the a abnormal processes, the limiting unit 304 is specifically configured to:
[0154] determining a first attribute information of a first abnormal process; the first abnormal process is any abnormal process in the a abnormal processes;
[0155] determining a first limiting strategy corresponding to the first attribute information;
[0156] limiting the first abnormal process according to the first limiting strategy.
[0157] It can be seen that the electronic device described in the embodiment of the application includes the RAM, the target environment parameter of the RAM is acquired, the current read-write rate of the RAM at the current time is acquired, the reference read-write rate corresponding to the target environment parameter is acquired, when the current read-write rate is less than the reference read-write rate, the first memory usage parameter of the RAM is determined, the first memory usage parameter includes the first total memory usage and the first memory change monitoring data of the memory usage of each process in a preset time period, the preset time period is a time period between the preset time length corresponding to the current time, the first total memory usage is the total memory usage of the RAM corresponding to the current time, a number of abnormal processes are identified according to the first total memory usage and the first memory change monitoring data, a is a positive integer, b abnormal processes in the a abnormal processes are limited, b is a positive integer less than or equal to a, in this way, when the RAM read-write performance is lower than expected, the abnormal processes are accurately identified, and accordingly, the corresponding processes can be accurately limited to improve the RAM read-write performance.
[0158] It can be understood that the functions of each program module of the electronic device of the embodiment can be specifically implemented according to the method in the method embodiment, and the specific implementation process can be referred to the related description of the method embodiment, which will not be described here.
[0159] The embodiment of the application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes the computer to execute part or all steps of any method described in the above method embodiments.
[0160] The embodiment of the application further provides a computer program product, and the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all steps of any method described in the above method embodiments. The computer program product can be a software installation package.
[0161] It should be noted that, for each of the above method embodiments, in order to simply describe, each is described as a combination of a series of actions, but those skilled in the art should know that the application is not limited to the order of the actions described, because according to the application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the application.
[0162] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0163] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the division of the apparatus embodiments described above is merely illustrative, and the division of the units can be changed according to actual needs. For example, the units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0164] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0165] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0166] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the above-mentioned method of each embodiment of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0167] Those of ordinary skill in the art can understand that all or part of the steps of the various methods of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0168] The above has carried out the detailed introduction to the embodiment of the application, the principle and implementation mode of the application have been described in this article by applying specific examples, the above embodiment explanation is only for helping understanding the method of the application and its core idea; at the same time, for the general technical personnel in the art, according to the idea of the application, the specific implementation mode and application range will have the change, and the above-mentioned, the content of the specification should not be understood as the limitation of the application.
Claims
1. A method for improving RAM read-write performance, characterized in that, The method is applied to an electronic device comprising a RAM, and comprises: obtaining a target environment parameter of the RAM; obtaining a current read-write rate of the RAM at a current time; obtaining a reference read-write rate corresponding to the target environment parameter; when the current read-write rate is less than the reference read-write rate, determining a first memory usage parameter of the RAM, the first memory usage parameter comprising a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period of a preset length between the current time; the first total memory usage being a total memory usage of the RAM corresponding to the current time; identifying a number a of abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer; limiting a number b of abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a; the target environment parameter comprising a first hardware environment parameter, a first software environment parameter, and a first external environment parameter of the RAM; the obtaining of the reference read-write rate corresponding to the target environment parameter comprising: determining a first reference read-write rate corresponding to the first hardware environment parameter; determining a first adjustment parameter corresponding to the first software environment parameter; determining a first fine adjustment parameter corresponding to the first external environment parameter; adjusting the first reference read-write rate according to the first adjustment parameter and the first fine adjustment parameter to obtain the reference read-write rate.
2. The method of claim 1, wherein, the identifying of the a abnormal processes according to the first total memory usage and the first memory change monitoring data comprising: determining c process memory data sets corresponding to c processes according to the first memory change monitoring data, each process memory data set comprising a plurality of memory data, each memory data corresponding to a monitoring time; c being an integer greater than or equal to a; fitting according to the c process memory data sets to obtain c fitted straight lines and c fitted curves, each process memory data set corresponding to a fitted straight line and a fitted curve; determining c slopes and c mean square errors according to the c fitted straight lines and the c fitted curves; obtaining c attribute information according to the c process memory data sets, each process memory data set corresponding to an attribute information; determining the a abnormal processes according to the c attribute information, the c slopes, and the c mean square errors.
3. The method of claim 2, wherein, the determining of the a abnormal processes according to the c attribute information, the c slopes, and the c mean square errors comprising: determining limitable processes in the c processes according to the c attribute information to obtain d processes, d being an integer greater than or equal to b and less than or equal to c; obtaining slopes and mean square errors corresponding to the d processes from the c slopes and the c mean square errors to obtain d slopes and d mean square errors; selecting slopes greater than a first preset threshold from the d slopes to obtain m slopes, m being an integer less than or equal to d; Selecting a mean square error greater than a second preset threshold from the d mean square errors to obtain n mean square errors, n being an integer less than or equal to d; Determining the a abnormal processes according to the m slopes and the n mean square errors.
4. The method of claim 3, wherein, The limiting the b abnormal processes in the a abnormal processes comprises: Determining first attribute information of a first abnormal process; the first abnormal process being any abnormal process in the a abnormal processes; Determining a first limiting strategy corresponding to the first attribute information; Limiting the first abnormal process according to the first limiting strategy.
5. An electronic device, comprising: The electronic device comprises a RAM, and the electronic device comprises an acquisition unit, a determination unit, an identification unit and a limiting unit, wherein, The acquisition unit is configured to acquire a target environment parameter of the RAM, acquire a current read-write rate of the RAM at a current time, and acquire a reference read-write rate corresponding to the target environment parameter; The determination unit is configured to determine a first memory usage parameter of the RAM when the current read-write rate is less than the reference read-write rate, the first memory usage parameter comprising a first total memory usage and first memory change monitoring data of memory usage of each process in a preset time period, the preset time period being a time period of a preset length between the current time; and the first total memory usage being a total memory usage of the RAM corresponding to the current time; The identification unit is configured to identify a number a of abnormal processes according to the first total memory usage and the first memory change monitoring data, a being a positive integer; The limiting unit is configured to limit a number b of abnormal processes in the a abnormal processes to improve the read-write performance of the RAM, b being a positive integer less than or equal to a; The target environment parameter comprises a first hardware environment parameter, a first software environment parameter and a first external environment parameter of the RAM; in the aspect of acquiring the reference read-write rate corresponding to the target environment parameter, the acquisition unit is specifically configured to: Determine a first reference read-write rate corresponding to the first hardware environment parameter; Determine a first adjustment parameter corresponding to the first software environment parameter; Determine a first fine-tuning parameter corresponding to the first external environment parameter; Adjust the first reference read-write rate according to the first adjustment parameter and the first fine-tuning parameter to obtain the reference read-write rate.
6. The electronic device of claim 5, wherein, In the aspect of identifying a number a of abnormal processes according to the first total memory usage and the first memory change monitoring data, the identification unit is specifically configured to: Determine c process memory data sets corresponding to c processes according to the first memory change monitoring data, each process memory data set comprising a plurality of memory data, each memory data corresponding to a monitoring time; c being an integer greater than or equal to a; Fit the c process memory data sets to obtain c fitted straight lines and c fitted curves, each process memory data set corresponding to a fitted straight line and a fitted curve; Determine c slopes and c mean square errors according to the c fitted straight lines and the c fitted curves; c attribute information is obtained according to the c process memory data sets, each process memory data set corresponds to one attribute information; The a abnormal processes are determined according to the c attribute information, the c slopes and the c mean square errors.
7. An electronic device, comprising: A computer program product comprising a computer readable storage medium having stored thereon instructions that, when executed by a computer, cause the computer to carry out the steps of any of the methods of claims 1-4.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method of any one of claims 1-4.
Citation Information
Patent Citations
Multi-channel FIFO (First In First Out) buffer and control method thereof
CN104407809A
NVME SSD storage simulation system based on FPGA
CN117873809A