A method for compensating main memory capacity of electronic equipment
By analyzing historical program running data to build a virtual memory compensation model and dynamically managing the compensation space of electronic devices, the problem of insufficient main memory capacity is solved, and the accuracy of virtual memory and program running speed are improved.
Patent Information
- Application Number
- CN202310384693.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-04-12
AI Technical Summary
In the prior art, the main memory capacity of electronic devices is limited, and the virtual memory size is set by the system and manually, resulting in the problem that the virtual memory is too large to waste hard disk space or too small to meet the program running requirements.
By collecting historical program running data, analyzing congestion parameters, building a virtual memory compensation analysis model, dynamically managing compensation space, and performing memory compensation based on program running habits, the accuracy and efficiency of virtual memory can be improved.
It realizes memory compensation based on user usage habits, improves the accuracy of virtual memory, increases program running speed, and avoids wasting hard disk space.
Smart Images

Figure CN116431346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic device memory, and in particular to a method for compensating the capacity of a main memory of an electronic device. Background Art
[0002] The component in a computer system that implements memory is called memory. Information such as programs and data entered by the user into the computer is stored in memory. Memory is a crucial component of a computer system. When measuring computer system performance, memory performance plays a significant role, and its importance to computer systems is self-evident. The amount of data that can be stored in memory depends on its capacity. A larger capacity means more data can be stored, while a smaller capacity means less data can be stored. A larger memory capacity increases the computer's ability to process information. Since information is constantly exchanged between the CPU and memory during operation, the computer's operating speed is largely determined by the memory's data access speed. Therefore, memory capacity is crucial to computer systems.
[0003] In the prior art, there is a situation where there is insufficient memory, which can be assisted by setting up virtual memory in the computer's hard disk. However, the size of the virtual memory in the prior art is generally set by system settings and manually, and there are problems such as unreasonable virtual memory settings, such as excessive virtual memory wasting hard disk space, or too small virtual memory failing to meet program running requirements. Summary of the Invention
[0004] An embodiment of the present application provides a method for compensating the main memory capacity of an electronic device, which is used to solve the technical problems of unreasonable virtual memory settings in the prior art, such as the limited capacity of the main memory of the electronic device and the size of the virtual memory generally being set by the system and manually, resulting in excessive virtual memory that wastes hard disk space, or excessive virtual memory that cannot meet program running requirements.
[0005] In view of the above problems, an embodiment of the present application provides a method for compensating the main memory capacity of an electronic device.
[0006] In a first aspect, an embodiment of the present application provides a method for compensating the main memory capacity of an electronic device, the method comprising: collecting and setting up compensation space in the hard disk space outside the main memory of the target electronic device based on historical program running data within a preset time range in the past; dividing the preset time period to obtain K time intervals, and analyzing the congestion parameters of the program running in the K time intervals based on the speed and number of program running according to the historical program running data to obtain K congestion parameters, where K is a positive integer; respectively inputting the K congestion parameters into a virtual memory compensation analysis model to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory A compensation analysis unit, Q is a positive integer; according to the accuracy of the Q virtual memory compensation analysis units, weighted calculations are performed on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets to obtain K virtual memory compensation parameters; the K virtual memory compensation parameters are used to perform virtual memory compensation management on the compensation space when the real time is in the K time intervals; the real-time congestion parameter and the real-time time interval of the target electronic device are obtained through detection and analysis according to a preset frequency, and when the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter and manage the compensation space.
[0007] In a second aspect, an embodiment of the present application provides a compensation system for the main memory capacity of an electronic device, the system comprising: a compensation space acquisition module, the compensation space acquisition module being used to collect and, based on historical program running data of a target electronic device within a preset time range in the past, set up a compensation space in the hard disk space outside the main memory of the target electronic device; a congestion parameter acquisition module, the congestion parameter acquisition module being used to divide the preset time period to obtain K time intervals, and analyze the congestion parameters of the program running in the K time intervals based on the speed and number of program running according to the historical program running data to obtain K congestion parameters, where K is a positive integer; a compensation parameter acquisition module, the compensation parameter acquisition module being used to input the K congestion parameters into a virtual memory compensation analysis model respectively to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory compensation analysis units, where Q is a positive integer; a weighted calculation module, configured to perform weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets according to the accuracy of the Q virtual memory compensation analysis units, to obtain K virtual memory compensation parameters; a compensation management module, configured to use the K virtual memory compensation parameters to perform virtual memory compensation management on the compensation space when the real-time time is in the K time intervals; and a compensation space management module, configured to detect and analyze the real-time congestion parameter and the real-time time interval of the target electronic device according to a preset frequency, and when the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, input the real-time congestion parameter into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter and manage the compensation space.
[0008] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0009] The present invention provides a method for compensating the main memory capacity of an electronic device, which relates to the technical field of main memory capacity. The method collects and sets compensation space based on historical program execution data, obtains K time intervals, analyzes program execution congestion parameters within the K time intervals, obtains K congestion parameters, inputs these parameters into a virtual memory compensation analysis model, obtains K virtual memory compensation parameter sets, performs weighted calculations on each of the K virtual memory compensation parameters, and performs virtual memory compensation management when the real-time time is within the K time intervals. The method obtains the real-time congestion parameter and the real-time time interval. When the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter, thereby managing the compensation space. The method solves the technical problem in the prior art that the main memory capacity of electronic devices is limited, and the size of virtual memory is generally set by the system or manually, resulting in excessive virtual memory wasting hard disk space or too small virtual memory to meet program execution requirements. The method implements memory compensation based on the user's program execution habits in the electronic device, thereby improving the accuracy of virtual memory compensation, increasing program execution speed, and avoiding the waste of hard disk space.
[0010] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic flow chart of a method for compensating the main memory capacity of an electronic device is provided for an embodiment of the present application;
[0012] Figure 2 The present invention provides a flow chart of obtaining compensation space in a hard disk space outside the main memory in a method for compensating the main memory capacity of an electronic device.
[0013] Figure 3 The present invention provides a flow chart of obtaining K congestion parameters in a method for compensating the main memory capacity of an electronic device.
[0014] Figure 4 A schematic diagram of the structure of a compensation system for the main memory capacity of an electronic device is provided for an embodiment of the present application.
[0015] Explanation of reference numerals: compensation space acquisition module 10 , congestion parameter acquisition module 20 , compensation parameter acquisition module 30 , weighted calculation module 40 , compensation management module 50 , compensation space management module 60 . DETAILED DESCRIPTION
[0016] The embodiments of the present application provide a method for compensating the main memory capacity of an electronic device, aiming to solve the technical problems in the prior art that the main memory capacity of an electronic device is limited, and the size of the virtual memory is generally set by the system and manually, resulting in excessive virtual memory that wastes hard disk space, or excessive virtual memory that cannot meet the program running requirements.
[0017] Example 1
[0018] like Figure 1 As shown, an embodiment of the present application provides a method for compensating the main memory capacity of an electronic device, the method comprising:
[0019] Step S100: collecting and setting compensation space in the hard disk space outside the main memory of the target electronic device based on historical program running data within a preset time range in the past of the target electronic device;
[0020] Specifically, data on programs running on the target electronic device over the past period of time is collected. This data may include a set of information on the number of programs running at multiple time nodes and a set of information on the response speed. Based on this data, additional storage space that may be needed in the future is predicted. In order to cope with the additional storage space that may be needed for the device in the future, a compensation space is set in the hard disk space outside the main memory of the target electronic device. This compensation space is used to set up virtual memory for the target electronic device, thereby reducing the burden on the main memory. In this way, when the program needs more memory, it can be run in the virtual memory set in the compensation space to avoid the program crashing due to insufficient memory. Through this step, the stability and reliability of program operation can be improved, and the user experience can be enhanced.
[0021] Furthermore, if Figure 2 As shown, step S100 of this application also includes:
[0022] Step S110: collecting the number of program executions and preset instruction response speeds at multiple time points within a preset time range in the past of the target electronic device, and obtaining an execution number information set and a response speed information set as the historical program execution data;
[0023] Step S120: obtaining a peak value in the running quantity information set, obtaining maximum running quantity information, and calculating a maximum running memory requirement based on the maximum running quantity information and the running program;
[0024] Step S130: Obtain the memory in the main memory of the target electronic device, calculate the maximum virtual memory requirement in combination with the maximum running memory requirement, and set the compensation space in the hard disk space outside the main memory.
[0025] Specifically, the preset time range is a period of time in the past, exemplarily set to a week, a month, etc. Multiple time points are set within a week, for example, 48 time points are evenly set each day. Data is collected at multiple time points within the preset time range to fully reflect the changes in historical program execution. The running quantity information set is the number of programs running at each time point. This dataset describes the number of different programs or applications running on the electronic device. The running quantity information can reflect the device's congestion level under high and low loads, and this data helps understand the device's performance under different loads. The response speed information set is the average instruction response time of the program at each time point. This dataset records the device's response speed when performing different tasks. Response speed data can be used to measure device performance and help understand the device's response efficiency under different levels of congestion. For example, a slower response speed may indicate poor performance of the main memory under high load. Using existing methods, the response speed of a specific instruction of a program is measured. If the memory usage is large, the response speed is slow.
[0026] By collecting information about the number of programs running at multiple time points within a preset time range on the target electronic device, a set of running number information is obtained, and the peak value, i.e., the maximum running number information, is obtained from this set. The maximum running number information represents the highest number of programs running on the target electronic device within the preset time range. The maximum running memory requirement refers to the maximum memory space required by these programs when the maximum number of programs is running. Combined with the memory usage of the running programs, the maximum running number information and the memory usage of the running programs corresponding to the maximum running number information are summed to determine the maximum running memory requirement, i.e., the peak memory required within the preset time range.
[0027] The maximum virtual memory requirement is calculated by calculating the difference between the target electronic device's main memory and its maximum operating memory requirement. This maximum virtual memory requirement is then used as a basis for allocating compensation space within the target electronic device's main memory, outside of its physical memory. This approach predicts the potential future virtual memory needs based on the device's historical usage patterns, thus avoiding performance issues caused by insufficient memory during device use.
[0028] Step S200: Divide the preset time period into K time intervals, and analyze the congestion parameters of the program execution in the K time intervals based on the speed and number of program executions according to the historical program execution data to obtain K congestion parameters, where K is a positive integer.
[0029] Specifically, the preset time period is divided into K time intervals, where K is a random number and a positive integer. For example, if the preset time period is 1 day, then 1 day can be divided into 12 time intervals, each time interval is 2 hours. Based on the historical program running data in each time interval, the speed and number of program runs are analyzed to calculate the program running congestion parameter in the time interval. For each of the K time intervals, the congestion parameters in the corresponding time interval are calculated to obtain K congestion parameters. By analyzing the congestion in each interval, the usage habits of the target electronic device can be analyzed and adaptive virtual memory management can be performed. The greater the congestion, the more virtual memory is required to ensure the operation of the process while avoiding waste of hard disk storage space.
[0030] Furthermore, Figure 3 As shown, step S200 of this application also includes:
[0031] Step S210: Dividing the operation quantity information set and the response speed information set according to the K time intervals to obtain K operation quantity information subsets and K response speed information subsets;
[0032] Step S220: Obtain and perform congestion parameter analysis based on the data in the sample running quantity information set and the sample response speed information set to obtain a sample congestion parameter set;
[0033] Step S230: constructing a congestion analysis model using the sample running quantity information set, the sample response speed information set, and the sample congestion parameter set as construction data;
[0034] Step S240: Calculating and obtaining K average running quantity information and K average response speed information respectively based on the K running quantity information subsets and the K response speed information subsets;
[0035] Step S250: inputting the K average running quantity information and the K average response speed information into the congestion analysis model respectively to obtain the K congestion parameters.
[0036] Specifically, the run quantity information set and the response speed information set are divided into K time intervals, each divided into its own time interval, to obtain K run quantity information subsets and K response speed information subsets. Random screening is performed from the K run quantity information subsets and the K response speed information subsets to obtain a sample run quantity information set and a sample response speed information set. A congestion parameter is an indicator of program operation status and can reflect whether the program is overcrowded. A sample congestion parameter set is obtained, which includes K congestion parameters, each corresponding to the program operation status within the K time intervals.
[0037] Using the sample running quantity information set, sample response speed information set and sample congestion parameter set, data features are extracted as training data. Based on the idea of decision tree algorithm, a congestion analysis model is constructed. This model can analyze the congestion of the main memory under different numbers of running programs and instruction response speeds, so as to implement appropriate virtual memory compensation measures.
[0038] The mean of each of the K subsets of operation quantity information and the K subsets of response speed information is calculated to obtain K average operation quantity information and K average response speed information. The K average operation quantity information and K average response speed information are then collated and combined. Specifically, the average operation quantity information and average response speed information within the same time interval are combined and input into a congestion analysis model. The model analyzes the input data to generate K congestion parameters, which are used to reflect the congestion status of the main memory of the devices in different subsets.
[0039] Furthermore, in this application, step S230 further includes:
[0040] Step S231: using the running quantity information as the first decision feature, and constructing a multi-layer first decision partitioning node according to the sample running quantity information set;
[0041] Step S232: using the response speed information as the second decision feature, and constructing a multi-layer second decision partitioning node according to the sample response speed information set;
[0042] Step S233: connecting the multi-layer first decision partitioning nodes and the multi-layer second decision partitioning nodes, and obtaining a plurality of final partitioning results;
[0043] Step S234: taking the multiple sample congestion parameters in the sample congestion parameter set as multiple decision results, marking the multiple final division results, and obtaining the congestion analysis model.
[0044] Specifically, based on the running quantity information, as the first decision feature, the running quantity information can be classified and decided based on the running quantity information; based on the response speed information, the second decision feature is obtained, and the input response speed information can be classified and decided based on the response speed information. The response speed can reflect the efficiency of the device in processing tasks.
[0045] Furthermore, a decision tree is a graphical method that intuitively applies probability analysis. This classifier can correctly classify newly appeared objects. The first decision feature and the second decision feature are used as the basis for constructing the internal nodes of the congestion analysis model.
[0046] Specifically, based on the sample running quantity information set, multiple sample running quantity information is randomly selected as multiple first decision thresholds to construct multi-layer first decision division nodes, wherein each layer of the first decision division node can perform a binary classification division decision on the input running quantity information, and obtain two categories that are greater than and less than or equal to the first decision threshold in the first decision division node, and input the division result into the upper layer first decision division node to perform multi-layer decision division, and use this method to recursively construct multi-layer first decision division nodes.
[0047] Similarly, based on the sample response speed information set, multiple sample response speed information is randomly selected as multiple second decision thresholds to construct a multi-layer second decision division node, wherein each layer of the second decision division node can perform a binary classification division decision on the input response speed information, and obtain two categories greater than and less than or equal to the second decision threshold in the second decision division node, and input the division result into the upper-layer first decision division node to perform multi-layer decision division, thus constructing a multi-layer second decision division node.
[0048] Connecting multiple layers of first decision-making partitioning nodes and multiple layers of second decision-making partitioning nodes, for example, connecting the top-level first decision-making partitioning node and the bottom-level second decision-making partitioning node, and obtaining multiple final partitioning results for the connected multiple layers of first decision-making partitioning nodes and the connected multiple layers of second decision-making partitioning nodes. Each final partitioning result includes a relatively detailed interval of running quantity information and a corresponding interval of speed information obtained through the multi-layer partitioning decision.
[0049] The sample congestion parameters are associated with the multiple final partitioning results obtained previously. For each final partitioning result, an appropriate congestion parameter is assigned based on its corresponding running quantity information and response speed information. By adding a congestion parameter label to each final partitioning result, the multiple final partitioning results are labeled with the associated congestion parameter. The labeled decision tree is then considered a congestion analysis model. This model can predict the congestion parameter based on the running quantity information and response speed information of the device, thereby evaluating the congestion level of the device under different conditions.
[0050] Step S300: inputting the K congestion parameters into a virtual memory compensation analysis model respectively to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory compensation analysis units, where Q is a positive integer;
[0051] Specifically, the virtual memory compensation analysis model is a model composed of Q virtual memory compensation analysis units, where Q is a positive integer. For example, the virtual memory compensation analysis model includes 10 virtual memory compensation analysis units. The K congestion parameters are respectively input into the virtual memory compensation analysis model for analysis. For each input congestion parameter, the virtual memory compensation analysis model will output Q corresponding virtual memory compensation parameters, thereby obtaining a set of K virtual memory compensation parameters. These virtual memory compensation parameters can be used to set virtual memory of corresponding size in the compensation space to compensate for the main memory capacity of the device to meet the needs of the device running programs. The design and implementation of the virtual memory compensation analysis model can be adjusted and optimized according to specific needs and device characteristics to achieve better performance and effects.
[0052] Furthermore, step S300 of the present application also includes:
[0053] Step S310: according to the sample running quantity information set and the sample response speed information set, a corresponding virtual memory compensation space is set in the compensation space, and a sample virtual memory compensation parameter set is calculated;
[0054] Step S320: randomly selecting J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a first constructed data set, where J is a positive integer less than the number of data in the sample crowding parameter set;
[0055] Step S330: using the first constructed data set to construct a first virtual memory compensation analysis unit among the Q virtual memory compensation analysis units;
[0056] Step S340: randomly selecting J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a second constructed data set, and constructing a second virtual memory compensation analysis unit;
[0057] Step S350: Continue to construct and obtain all Q virtual memory compensation analysis units to obtain the virtual memory compensation analysis model;
[0058] Step S360: Input the K congestion parameters into the Q virtual memory compensation analysis units respectively to obtain the K virtual memory compensation parameter sets.
[0059] Specifically, according to the sample running quantity information set and the sample response speed information set, a virtual memory of corresponding size is set in the compensation space. The setting process can be based on the technician setting the corresponding size of virtual memory according to the sample running quantity information set and the combination of each sample running quantity information and sample response speed information in the sample response speed information set, so as to meet the program running requirements. In this way, multiple virtual memories can be set. According to the ratio of the size of the virtual memory setting and the size of the compensation space, the virtual memory compensation parameters of each sample are calculated to obtain a sample virtual memory compensation parameter set. These parameters can represent the degree of virtual memory compensation required by the device under different program running quantity and response speed conditions.
[0060] Select a suitable positive integer J so that it is smaller than the number of data in the sample crowding parameter set. This value will determine the number of data groups randomly extracted from the dataset. For example, the size of J is 2 / 3 of the number of data in the sample crowding parameter set. Randomly extracting data with replacement means that in each extraction process, the data that has been extracted may still be extracted again. This sampling method helps to maintain the diversity of the dataset and prevent model overfitting due to sampling bias. The J groups of randomly extracted data are integrated into a dataset as the first constructed dataset. This dataset contains the sample crowding parameter and the corresponding virtual memory compensation parameter.
[0061] The first constructed data set is used to perform supervised training on the first virtual memory compensation analysis unit based on a BP neural network to learn the relationship between the congestion parameter and the virtual memory compensation parameter, and the first virtual memory compensation analysis unit is obtained to predict the virtual memory compensation parameter, thereby optimizing the main memory capacity of the electronic device.
[0062] The J groups of data randomly sampled again are integrated into a data set as the second constructed data set. This data set includes sample crowding parameters and corresponding virtual memory compensation parameters. The second virtual memory compensation analysis unit is constructed using the same method as step S330.
[0063] Following the above method, continue training with different constructed datasets to construct the remaining virtual memory compensation analysis units until all Q units are constructed. Integrating the Q virtual memory compensation analysis units into a unified virtual memory compensation analysis model can be achieved through ensemble methods such as voting, averaging, and weighted averaging. The ensemble model will combine the prediction results of each unit to improve the overall prediction accuracy.
[0064] The K congestion parameters are input into Q virtual memory compensation analysis units respectively. Each unit will make a prediction based on the input congestion parameters and output the corresponding virtual memory compensation parameters. The prediction results of the Q virtual memory compensation analysis units are collected and combined into K virtual memory compensation parameter sets. Each set contains multiple virtual memory compensation parameters corresponding to different congestion conditions.
[0065] Furthermore, step S330 of the present application also includes:
[0066] Step S331: annotating and dividing the first constructed data set to obtain a first training set, a first validation set, and a first test set;
[0067] Step S332: constructing a network structure of the first virtual memory compensation analysis unit based on a BP neural network;
[0068] Step S333: Use the first training set, the first verification set and the first test set to perform supervised training on the first virtual memory compensation analysis unit, and update the gradient of the network parameters through the error between the actual output and the expected output until the convergence condition is reached, and perform verification and testing. When the accuracy meets the preset requirements, the first virtual memory compensation analysis unit is obtained.
[0069] Specifically, a corresponding label is added to each data item in the first constructed dataset. These labels will be used to supervise the learning algorithm so that the algorithm can learn the relationship between the congestion parameter and the virtual memory compensation parameter. The first constructed dataset is divided into three subsets: the first training set, the first validation set, and the first test set. The data is usually divided according to a certain ratio, for example, 70% for the training set, 15% for the validation set, and 15% for the test set. The training set will be used to train the model, the validation set is used for model selection and hyperparameter adjustment, and the test set is used to evaluate the final performance of the model.
[0070] Based on a BP neural network, design the network structure and determine the number of neurons in the input, hidden, and output layers. The number of neurons in the input layer matches the number of the crowding parameter, the number of neurons in the output layer matches the number of the virtual memory compensation parameter, and the number of neurons in the hidden layer can be adjusted based on the complexity of the problem and the amount of data. Assign initial values to the weights and biases of the neural network. Weights can be randomly drawn from a small normal distribution, and biases can be initialized to 0 or a small constant.
[0071] The first virtual memory compensation analysis unit undergoes supervised training using the first training set. In each iteration, the congestion parameter is input into the network, and the predicted virtual memory compensation parameter is calculated. The error between the predicted and actual values is then calculated using a loss function. The gradients of the weights and biases are calculated using this error, and the network parameters are updated using a selected optimization algorithm. Exemplarily, gradient descent is selected. Gradient descent is an iterative method for solving unconstrained optimization problems, where each step is made along the negative gradient of the objective function until a local minimum or global minimum is reached. Gradient updates are continued until convergence conditions are met. Exemplarily, the convergence condition is set to a preset maximum number of iterations, which is set to 100. During training, the model is periodically validated using the first validation set. Validation helps adjust hyperparameters, such as the learning rate and the number of hidden layer neurons, and helps with model selection to prevent overfitting or underfitting. After training and validation, the performance of the first virtual memory compensation analysis unit is evaluated using the first test set. The test results provide information on the model's generalization performance on new data. Check whether the test accuracy meets the preset requirements. For example, the preset requirement is set to an accuracy of 95%. If the requirement is met, that is, the accuracy is greater than or equal to 95%, it can be considered that the first virtual memory compensation analysis unit has been obtained; if the requirement is not met, the network structure, optimization algorithm, hyperparameters, etc. can be adjusted according to the actual situation, and the training process can be repeated until the expected performance is achieved.
[0072] Step S400: performing weighted calculation on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets according to the accuracy rates of the Q virtual memory compensation analysis units to obtain K virtual memory compensation parameters;
[0073] Specifically, after obtaining K sets of virtual memory compensation parameters, Q virtual memory compensation analysis units are used to analyze these parameters. Each virtual memory compensation analysis unit can calculate different virtual memory compensation parameters based on the model parameters obtained through self-training based on different construction data, so their accuracy may vary. For each virtual memory compensation parameter set, a weighted sum is taken based on the accuracy of the corresponding virtual memory compensation analysis unit to produce a comprehensive prediction result. This combines the prediction capabilities of all virtual memory compensation analysis units to obtain a comprehensive virtual memory compensation parameter, thereby obtaining K virtual memory compensation parameters, and combining the prediction results of multiple virtual memory compensation analysis units to improve the overall prediction accuracy.
[0074] Furthermore, step S400 of the present application also includes:
[0075] Step S410: using the sample congestion parameter set and the sample virtual memory compensation parameter set as a total test data set, testing the Q virtual memory compensation analysis units to obtain Q accuracy information;
[0076] Step S420: performing weight assignment according to the sizes of the Q accuracy information to obtain Q weight coefficients;
[0077] Step S430: using the Q weight coefficients, respectively performing weighted calculation on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets to obtain the K virtual memory compensation parameters.
[0078] Specifically, a set of sample crowding parameters and a set of sample virtual memory compensation parameters are combined to form a total test dataset. This dataset contains input features (crowding parameters) and target outputs (virtual memory compensation parameters). Each virtual memory compensation analysis unit is tested using the total test dataset, and the prediction results of each unit are compared with the sample virtual memory compensation parameters to evaluate the unit's performance. Based on the test results, the accuracy of each virtual memory compensation analysis unit is calculated. For example, the accuracy is expressed as the number of correctly predicted data points divided by the number of data points in the total test dataset.
[0079] According to the size of the accuracy information of the Q virtual memory compensation analysis units, weight distribution is performed to obtain the corresponding weight coefficient. The weight coefficient is the ratio of the accuracy of each virtual memory compensation unit to the sum of the accuracy of the Q virtual memory compensation analysis units, and then Q weight coefficients are obtained, and the sum of the Q weight coefficients is 1.
[0080] For each virtual memory compensation parameter, multiply the prediction results of its Q analysis units by the corresponding weight coefficient, and then add all the products to obtain the weighted prediction result. Repeat the above steps, perform weighted calculation on the K sets of virtual memory compensation parameters, and use the prediction result after weighted calculation as the final prediction result of the virtual memory compensation parameter to obtain the K virtual memory compensation parameters.
[0081] Step S500: using the K virtual memory compensation parameters, performing virtual memory compensation management on the compensation space when the real time is in the K time intervals respectively;
[0082] Specifically, using the K virtual memory compensation parameters obtained previously, when the real time is in a certain time interval, the virtual memory compensation settings are managed according to the virtual memory compensation parameters corresponding to the time interval, including multiplying the virtual memory compensation coefficient corresponding to the time interval by the size of the compensation space to obtain the compensated virtual memory, and migrating infrequently used programs and data from the main memory to the compensated virtual memory for execution to ensure the normal operation of the system.
[0083] Step S600: Detect and analyze the real-time congestion parameter and real-time time interval of the target electronic device according to a preset frequency. If the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, input the real-time congestion parameter into the virtual memory compensation analysis model to obtain a real-time virtual memory compensation parameter and manage the compensation space.
[0084] Specifically, a preset frequency is set based on real-time system load and memory usage. For example, the frequency is set to once every 10 minutes. The real-time congestion parameter and real-time time interval of the target electronic device are detected at this frequency. These real-time parameters are used to determine the current program execution status. The real-time congestion parameter is compared with the congestion parameter corresponding to the real-time time interval. If the real-time congestion parameter is greater than the real-time congestion parameter, it indicates a real-time congestion problem and that the currently configured virtual memory cannot meet the requirements of real-time program execution. The real-time congestion parameter is input into a virtual memory compensation analysis model, which outputs a real-time virtual memory compensation parameter. The compensation space is then managed and virtual memory is configured based on the real-time virtual memory compensation parameter to ensure that the target electronic device's main memory is not overloaded when processing programs. Using this method, the system can optimize the target device's memory usage in real time while the program is running, thereby improving overall system performance.
[0085] In summary, the method for compensating the main memory capacity of an electronic device provided by the embodiments of the present application has the following technical effects:
[0086] The system collects and sets compensation space based on historical program execution data, obtains K time intervals, analyzes the congestion parameters of program execution in the K time intervals, obtains K congestion parameters, inputs them into a virtual memory compensation analysis model, obtains K sets of virtual memory compensation parameters, performs weighted calculations on each of the K virtual memory compensation parameters, and performs virtual memory compensation management when the real time is in the K time intervals. The real-time congestion parameter and the real-time time interval are obtained. When the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter, and manages the compensation space. The system solves the technical problem that the capacity of the main memory of electronic devices is limited, and the size of virtual memory is generally set by the system or manually, resulting in excessive virtual memory wasting hard disk space or too small virtual memory to meet program execution requirements. The system implements memory compensation based on the user's program execution habits when using the electronic device, thereby improving the accuracy of virtual memory compensation, increasing program execution speed, and avoiding the waste of hard disk space.
[0087] Example 2
[0088] Based on the same inventive concept as the method for compensating the main memory capacity of an electronic device in the aforementioned embodiment, Figure 4 As shown, the present application provides a system for compensating the main memory capacity of an electronic device, the system comprising:
[0089] A compensation space acquisition module 10 is configured to collect and obtain compensation space in a hard disk space outside a main memory of a target electronic device based on historical program running data within a preset time range in the past of the target electronic device;
[0090] a congestion parameter acquisition module 20 configured to divide the preset time period into K time intervals, and analyze the congestion parameters of the programs executed in the K time intervals based on the speed and number of the programs executed according to the historical program execution data, to obtain K congestion parameters, where K is a positive integer;
[0091] a compensation parameter acquisition module 30, configured to input the K congestion parameters into a virtual memory compensation analysis model to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory compensation analysis units, where Q is a positive integer;
[0092] a weighted calculation module 40 configured to perform weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets according to the accuracy rates of the Q virtual memory compensation analysis units to obtain K virtual memory compensation parameters;
[0093] a compensation management module 50 configured to use the K virtual memory compensation parameters to perform virtual memory compensation management on the compensation space when the real time is in the K time intervals;
[0094] The compensation space management module 60 is used to detect and analyze the real-time congestion parameter and real-time time interval of the target electronic device according to a preset frequency. When the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter and manage the compensation space.
[0095] Furthermore, the system further comprises:
[0096] a historical operation data acquisition module, configured to collect the number of program executions and preset instruction response speeds of the target electronic device at multiple time points within a preset time range in the past, and obtain an execution number information set and a response speed information set as the historical program execution data;
[0097] a maximum running memory requirement acquisition module, configured to acquire a peak value in the running quantity information set, obtain the maximum running quantity information, and calculate the maximum running memory requirement based on the maximum running quantity information and the running program;
[0098] The compensation space setting module is used to obtain the memory in the main memory of the target electronic device, calculate the maximum virtual memory requirement in combination with the maximum running memory requirement, and set the compensation space in the hard disk space outside the main memory.
[0099] Furthermore, the system further comprises:
[0100] a partitioning module, configured to partition the operation quantity information set and the response speed information set according to the K time intervals to obtain K operation quantity information subsets and K response speed information subsets;
[0101] A congestion parameter analysis module is used to obtain and perform congestion parameter analysis based on the data in the sample running quantity information set and the sample response speed information set to obtain a sample congestion parameter set;
[0102] An analysis model construction module, configured to construct a congestion analysis model using the sample running quantity information set, the sample response speed information set, and the sample congestion parameter set as construction data;
[0103] An information calculation module, configured to calculate and obtain K average running quantity information and K average response speed information respectively based on the K running quantity information subsets and the K response speed information subsets;
[0104] The congestion parameter output module is used to input the K average running quantity information and the K average response speed information into the congestion analysis model respectively to obtain the K congestion parameters.
[0105] Furthermore, the system further comprises:
[0106] A first node construction module is configured to use the running quantity information as a first decision feature and construct a multi-layer first decision partitioning node according to the sample running quantity information set;
[0107] A second node construction module is configured to use the response speed information as a second decision feature and construct a multi-layer second decision partitioning node according to the sample response speed information set;
[0108] A final partitioning result acquisition module, configured to connect the multi-layer first decision partitioning node and the multi-layer second decision partitioning node and acquire a plurality of final partitioning results;
[0109] The marking module is configured to take the multiple sample congestion parameters in the sample congestion parameter set as multiple decision results, mark the multiple final division results, and obtain the congestion analysis model.
[0110] Furthermore, the system further comprises:
[0111] a sample compensation parameter calculation module, configured to set a corresponding virtual memory compensation space in the compensation space according to the sample running quantity information set and the sample response speed information set, and calculate and obtain a sample virtual memory compensation parameter set;
[0112] a first constructed data set acquisition module, configured to randomly select J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a first constructed data set, wherein J is a positive integer less than the number of data in the sample crowding parameter set;
[0113] a first compensation analysis unit construction module, configured to construct a first virtual memory compensation analysis unit among the Q virtual memory compensation analysis units by using the first construction data set;
[0114] A second constructed data set acquisition module is configured to randomly select J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a second constructed data set and construct a second virtual memory compensation analysis unit;
[0115] A compensation analysis model acquisition module, configured to continue constructing and obtaining all Q virtual memory compensation analysis units to obtain the virtual memory compensation analysis model;
[0116] The compensation parameter set acquisition module is used to input the K congestion parameters into the Q virtual memory compensation analysis units respectively to obtain the K virtual memory compensation parameter sets.
[0117] Furthermore, the system further comprises:
[0118] a labeling and partitioning module, configured to label and partition the first constructed data set to obtain a first training set, a first validation set, and a first test set;
[0119] A network structure building module, configured to build a network structure of the first virtual memory compensation analysis unit based on a BP neural network;
[0120] A supervised training module is used to perform supervised training on the first virtual memory compensation analysis unit using the first training set, the first verification set and the first test set, and to perform gradient updates of network parameters through the error between the actual output and the expected output until the convergence condition is reached, and to perform verification and testing. When the accuracy meets the preset requirements, the first virtual memory compensation analysis unit is obtained.
[0121] Furthermore, the system further comprises:
[0122] a testing module, configured to use the sample crowding parameter set and the sample virtual memory compensation parameter set as a total test data set, test the Q virtual memory compensation analysis units, and obtain Q accuracy information;
[0123] A weight allocation module is used to perform weight allocation according to the sizes of the Q accuracy information to obtain Q weight coefficients;
[0124] The parameter weighted calculation module is used to use the Q weight coefficients to perform weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets to obtain the K virtual memory compensation parameters.
[0125] Through the detailed description of a method for compensating the main memory capacity of an electronic device in the foregoing description, those skilled in the art can clearly understand the system for compensating the main memory capacity of an electronic device in this embodiment. As 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 description of the method part.
[0126] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one 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 is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for compensating the main memory capacity of an electronic device, characterized in that: The method comprises: Collecting and setting compensation space in a hard disk space outside a main memory of the target electronic device based on historical program running data within a preset time range in the past of the target electronic device; Divide the preset time period into K time intervals, and analyze, based on the historical program execution data and the speed and number of program executions, the congestion parameters of the program executions in the K time intervals to obtain K congestion parameters, where K is a positive integer; Inputting the K congestion parameters into a virtual memory compensation analysis model respectively to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory compensation analysis units, where Q is a positive integer; performing weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets according to the accuracy rates of the Q virtual memory compensation analysis units to obtain K virtual memory compensation parameters; Using the K virtual memory compensation parameters, performing virtual memory compensation management on the compensation space when the real time is in the K time intervals respectively; The real-time congestion parameter and the real-time time interval of the target electronic device are obtained through detection and analysis according to a preset frequency. When the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain the real-time virtual memory compensation parameter and manage the compensation space.
2. The method according to claim 1, characterized in that Collecting and obtaining compensation space in a hard disk space outside a main memory of the target electronic device based on historical program running data within a preset time range in the past of the target electronic device, including: Collecting the number of program executions and preset instruction response speeds at multiple time points within a preset time range in the past of the target electronic device to obtain an execution number information set and a response speed information set as the historical program execution data; Obtaining a peak value in the set of running quantity information, obtaining maximum running quantity information, and calculating a maximum running memory requirement based on the maximum running quantity information and the running program; The memory in the main memory of the target electronic device is obtained, and the maximum virtual memory requirement is calculated based on the maximum running memory requirement, and the compensation space is set in the hard disk space outside the main memory.
3. The method according to claim 2, characterized in that The preset time period is divided into K time intervals, and based on the historical program running data, the congestion parameters of the program running in the K time intervals are analyzed based on the speed and number of program running, including: Dividing the operation quantity information set and the response speed information set according to the K time intervals to obtain K operation quantity information subsets and K response speed information subsets; Obtain and perform crowding parameter analysis based on data in the sample running quantity information set and the sample response speed information set to obtain a sample crowding parameter set; Using the sample running quantity information set, the sample response speed information set and the sample crowding parameter set as construction data, to construct a crowding analysis model; According to the K running quantity information subsets and the K response speed information subsets, K average running quantity information and K average response speed information are calculated and obtained respectively; The K average running quantity information and the K average response speed information are respectively input into the congestion analysis model to obtain the K congestion parameters.
4. The method according to claim 3, characterized in that The sample running quantity information set, the sample response speed information set, and the sample congestion parameter set are used as construction data to construct a congestion analysis model, including: Taking the running quantity information as the first decision feature, constructing a multi-layer first decision partitioning node according to the sample running quantity information set; Taking the response speed information as the second decision feature, constructing a multi-layer second decision partitioning node according to the sample response speed information set; Connecting the multi-layer first decision partitioning node and the multi-layer second decision partitioning node, and obtaining a plurality of final partitioning results; The multiple sample congestion parameters in the sample congestion parameter set are used as multiple decision results, the multiple final division results are marked, and the congestion analysis model is obtained.
5. The method according to claim 3, characterized in that The K congestion parameters are respectively input into the virtual memory compensation analysis model to obtain K virtual memory compensation parameter sets, including: According to the sample running quantity information set and the sample response speed information set, a corresponding virtual memory compensation space is set in the compensation space, and a sample virtual memory compensation parameter set is calculated; Randomly selecting J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a first constructed data set, where J is a positive integer less than the number of data in the sample crowding parameter set; Using the first constructed data set, constructing a first virtual memory compensation analysis unit among the Q virtual memory compensation analysis units; randomly selecting J groups of data from the sample crowding parameter set and the sample virtual memory compensation parameter set with replacement to obtain a second constructed data set, and constructing a second virtual memory compensation analysis unit; Continue to construct and obtain all Q virtual memory compensation analysis units to obtain the virtual memory compensation analysis model; The K congestion parameters are respectively input into the Q virtual memory compensation analysis units to obtain the K virtual memory compensation parameter sets.
6. The method according to claim 5, characterized in that Using the first constructed data set to construct a first virtual memory compensation analysis unit among the Q virtual memory compensation analysis units includes: Annotating and dividing the first constructed data set to obtain a first training set, a first validation set, and a first test set; Based on the BP neural network, constructing the network structure of the first virtual memory compensation analysis unit; The first virtual memory compensation analysis unit is supervisedly trained using the first training set, the first validation set, and the first test set. The gradient of the network parameters is updated through the error between the actual output and the expected output until the convergence condition is reached. Verification and testing are then performed. When the accuracy meets the preset requirements, the first virtual memory compensation analysis unit is obtained.
7. The method according to claim 5, characterized in that According to the accuracy rates of the Q virtual memory compensation analysis units, weighted calculation is performed on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets, including: Using the sample crowding parameter set and the sample virtual memory compensation parameter set as a total test data set, testing the Q virtual memory compensation analysis units to obtain Q accuracy information; Perform weight allocation according to the sizes of the Q accuracy information to obtain Q weight coefficients; The Q weight coefficients are used to perform weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets to obtain the K virtual memory compensation parameters.
8. A system for compensating the main memory capacity of an electronic device, characterized in that: The system comprises: a compensation space acquisition module configured to collect and, based on historical program execution data of a target electronic device within a preset time range in the past, set a compensation space in a hard disk space outside a main memory of the target electronic device; a congestion parameter acquisition module, the congestion parameter acquisition module being configured to divide a preset time period into K time intervals, and analyze, based on the historical program execution data and the speed and number of program executions, congestion parameters of program executions within the K time intervals to obtain K congestion parameters, where K is a positive integer; a compensation parameter acquisition module, the compensation parameter acquisition module being configured to input the K congestion parameters into a virtual memory compensation analysis model to obtain K virtual memory compensation parameter sets, wherein the virtual memory compensation analysis model includes Q virtual memory compensation analysis units, where Q is a positive integer; a weighted calculation module, configured to perform weighted calculations on the Q virtual memory compensation parameters in the K virtual memory compensation parameter sets according to the accuracy rates of the Q virtual memory compensation analysis units to obtain K virtual memory compensation parameters; a compensation management module, configured to use the K virtual memory compensation parameters to perform virtual memory compensation management on the compensation space when the real time is in the K time intervals; A compensation space management module is configured to detect and analyze the target electronic device at a preset frequency to obtain a real-time congestion parameter and a real-time time interval. When the real-time congestion parameter is greater than the congestion parameter of the real-time time interval, the real-time congestion parameter is input into the virtual memory compensation analysis model to obtain a real-time virtual memory compensation parameter and manage the compensation space.
Citation Information
Patent Citations
Management method of virtual memory of computer
CN106339250A
Method and system for dynamically distributing memory
CN107273212A