Network page memory management method and device and electronic equipment
By collecting and analyzing server multi-dimensional operation data and obtaining memory performance prediction values and health data, the problem of inability to predict and handle accurately in traditional memory management methods is solved, and the server performance and stability is improved.
Patent Information
- Application Number
- CN202510771844.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-10
AI Technical Summary
Traditional network page memory management methods cannot predict memory performance changes in advance, resulting in server performance degradation, response delay or crash, and processing actions are not accurate enough, affecting user experience and server stability.
By collecting server operation data in multiple dimensions, feature extraction and analysis are performed, memory performance prediction values are obtained, and memory health-related data are combined for targeted processing.
It realizes advance prediction and precise handling of memory problems, improves server performance and stability, reduces memory failures and lags, and improves user experience.
Smart Images

Figure CN120336030A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and an electronic device for managing network page memory. Background Art
[0002] In today's digital age, network page applications are becoming increasingly complex, and the requirements for server memory management are also getting higher and higher. Traditional network page memory management methods mostly rely on fixed threshold judgments and simple periodic cleaning strategies. These traditional methods can only perform limited monitoring on the immediate state of memory, cannot predict the changing trend of memory performance in advance, and are difficult to effectively cope with potential problems such as memory leaks, often resulting in a decline in server performance, response delays, and even crashes. At the same time, in dealing with memory problems in related technologies, the overall operating state of the server is not considered, the processing actions are relatively single and inaccurate, and targeted measures cannot be taken according to the subtle differences in memory health, easily causing waste of system resources or untimely and inadequate handling of memory problems, greatly affecting the user experience of network pages and the stable operation efficiency of servers, and it is difficult to meet the memory management requirements of modern network applications for high performance and high reliability. Summary of the Invention
[0003] The present disclosure provides a method, an apparatus, and an electronic device for managing network page memory. Its main purpose is to solve the problem of relatively low accuracy in network page memory management.
[0004] According to a first aspect of the present disclosure, there is provided a method for managing network page memory, including: Collecting multi-dimensional operation data in a server; Performing feature extraction and analysis on the operation data to obtain a predicted value of network page memory performance; Performing processing and analysis according to the predicted value of network page memory performance to obtain data related to memory health; Performing corresponding processing on the memory of the server according to the data related to memory health.
[0005] According to a second aspect of the present disclosure, there is provided a device for managing network page memory, including: A data collection module, configured to collect multi-dimensional operation data in a server; A feature extraction module, configured to perform feature extraction and analysis on the operation data to obtain a predicted value of network page memory performance; An analysis module, configured to perform processing and analysis according to the predicted value of network page memory performance to obtain data related to memory health; A memory processing module, configured to perform corresponding processing on the memory of the server according to the data related to memory health.
[0006] According to a third aspect of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the foregoing first aspect.
[0007] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in the foregoing first aspect.
[0008] According to a fifth aspect of the present disclosure, there is provided a computer program product including a computer program, where the computer program, when executed by a processor, implements the method described in the foregoing first aspect.
[0009] Through the present disclosure, by collecting multi-dimensional operation data in the server, the operation state of the server can be comprehensively understood, providing a rich and accurate data basis for subsequent memory performance prediction and health assessment. Feature extraction and analysis are performed on the operation data to obtain a network page memory performance prediction value, which can predict in advance possible problems with the memory, such as insufficient memory and memory leaks. Thus, corresponding processing can be performed on the server memory according to different memory health-related data, effectively optimizing memory usage and improving the performance and stability of the server.
[0010] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understandable through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them: Figure 1 is a flowchart of a network page memory management method provided by an embodiment of the present disclosure; Figure 2 is a flowchart of another network page memory management method provided by an embodiment of the present disclosure; Figure 3 is a flowchart of yet another network page memory management method provided by an embodiment of the present disclosure; Figure 4 is a structural diagram of a network page memory management device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] The exemplary embodiments of the present disclosure will be described below in conjunction with the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0013] Current Web applications, especially single-page applications, face severe memory management challenges. With the increasing complexity of front-end technologies, typical business scenarios such as data visualization dashboards, real-time communication applications, 3D editors, etc. are widespread.
[0014] According to the data in the 2024 Web Quality Annual Report, more than 83% of SPA applications have observable memory leaks. Among them, 42% of the leaks are due to uncorrectly unbound DOM event listeners, 28% are caused by global cache objects not being released in a timely manner, and another 19% are related to residual references of third-party libraries.
[0015] Existing solutions have obvious limitations: The developer's manual cleaning mechanism (such as the useEffect cleaning function in React) has a coverage rate of less than 60% in actual projects. Scanning of GitHub open-source projects shows that about 35% of components do not correctly set the cleaning logic; The browser's native garbage collection (GC) mechanism, due to its passive recycling characteristics, has an average delay of more than 5 seconds in mobile scenarios, resulting in a three-fold increase in the memory overrun crash rate; Static detection tools (such as the Chrome DevTools Memory panel) can identify some leaks, but have a false alarm rate of 22% and cannot actively intervene during runtime. More critically, the traditional fixed-threshold cleaning strategy (such as triggering recycling when the memory occupancy reaches 80%) faces a dilemma - cleaning too early leads to frequent resource reconstruction (increasing the CPU overhead by 30%), and cleaning too late causes interface lags (the FPS drops below 20). Against this background, there is an urgent need for a new memory management system that integrates dynamic monitoring, intelligent decision-making, and hierarchical execution to fundamentally solve the timeliness, accuracy, and compatibility problems of Web page memory management.
[0016] The network page memory management method, device, and electronic device of the embodiments of the present disclosure will be described below with reference to the accompanying drawings.
[0017] Figure 1 It is a flowchart showing the process of a network page memory management method provided by an embodiment of the present disclosure.
[0018] As Figure 1 shown, the method includes the following steps: Step 101, collect multi-dimensional operation data in the server; In this embodiment, the server is a device or system that provides resources such as computing, storage, and services for network users to provide keywords. It can be a high-performance computer or a group of computer clusters. Servers can be classified into various types according to their functions, such as Web servers, mail servers, database servers, etc. For example, a Web server is used to store web page files (such as HTML files, pictures, etc.) of a website and send these files to the client browser through the HTTP protocol.
[0019] A network page (web page) is a document written in formats such as HTML (HyperText Markup Language) that can be accessed through the network and displayed in a browser. A web page contains various elements such as text, pictures, videos, and audio, and is one of the main carriers for users to obtain information on the Internet.
[0020] The server is the generator and provider of network pages. Taking a Web server as an example, it is responsible for storing web page files. When a user enters a website address in the browser and sends a request, the Web server will find the corresponding web page file according to the request. For example, the server of an e-commerce website stores various web page files such as product display pages, shopping cart pages, and settlement pages. When a user wants to view product details, after receiving the request, the server will send the HTML file of the product details page, as well as relevant pictures, CSS (Cascading Style Sheets) files, etc. to the user's browser.
[0021] The server receives and processes requests from the user's browser. When a user performs operations on a web page, such as clicking a link, submitting a form (such as a login form, a search form, etc.), these operations will send requests to the server. The server makes corresponding processing according to the type and content of the request. For example, when a user submits an order on a shopping website, the server will receive the order information, verify the user's login status, check product inventory and other information, then store the order information in the database, and return a corresponding response page, such as an order confirmation page, to the user's browser.
[0022] The multi-dimensional operation data in the server is the data generated during the server operation, which reflects the performance and operation status of the server. The multi-dimensional operation data can comprehensively evaluate the server performance from multiple aspects such as the change rate of the number of Document Object Model (DOM) nodes, memory occupancy rate, network throughput, frequency of user interaction events, and the survival status of WebSocket connections. Among them, the memory occupancy rate includes: the real-time memory occupancy rate, which is the amount of memory used by the current page; the peak memory occupancy rate, which is the maximum memory usage within a period of time; the average memory occupancy rate: the average memory consumption, which reflects the overall trend. The change rate of the number of DOM nodes: tracks the increase and decrease speed of DOM nodes in the page to avoid performance impact due to excessive nodes. The survival status of WebSocket connections: detects the health status of WebSocket connections, including whether they are normally opened, closed, and reconnected. The frequency of user interaction events (click / page switching): counts the number of user clicks and the page switching frequency, calculates the request concurrency, and analyzes the user behavior pattern.
[0023] In an alternative embodiment, a probe is deployed in the server to obtain the multi-dimensional operation data in the server. The probe can collect the performance index data of the server in real time, such as CPU usage rate, memory occupancy, disk I / O, network traffic, etc. By continuously monitoring these key indicators, it provides real-time status information of the server operation for the administrator to help discover performance bottlenecks or abnormal situations in a timely manner.
[0024] For example, a DOM status tracker can be deployed in the server to listen for DOM tree changes based on the MutationObserver API. An event leak detector can be deployed in the server: by rewriting the addEventListener / removeEventListener methods, an event listening mapping table is established. A performance index collector can be deployed in the server: the performance.memory API is called every 5 seconds to obtain heap memory data, and the operation data of the CPU is synchronously monitored.
[0025] Step 102, perform feature extraction and analysis on the operation data to obtain a network page memory performance prediction value; In this embodiment, feature extraction is a method of transforming a set of measured values of a certain pattern to highlight the representative features of the pattern. Optionally, common means for feature extraction include: statistical analysis methods, traffic content analysis, machine learning methods, information theory methods, etc. Among them, machine learning methods include: principal component analysis (PCA), which linearly transforms the original network traffic features and projects them into a new feature space to obtain the principal components. The principal components are linear combinations of the original features, which can retain as much data variance as possible, while reducing the dimension of the data and removing redundant information. Linear discriminant analysis (LDA), a supervised learning dimensionality reduction method, aims to find a projection direction such that samples of the same class are as close as possible in the network traffic feature space, and samples of different classes are as far apart as possible. It is commonly used in network traffic classification tasks, such as classifying normal traffic and attack traffic. Autoencoder, an unsupervised neural network, learns to encode the input data into a compressed representation and then decode it back to the original data. During the encoding process, the compressed representation learned by the network can be used as the feature representation of the network traffic for subsequent classification, clustering, and other tasks. Convolutional neural network (CNN), in the feature extraction of network traffic data, the network traffic data can be transformed into an image or other forms suitable for CNN processing. Through the combination of convolutional layers, pooling layers, and fully connected layers, CNN can automatically learn the local and global features in the data. Recurrent neural network (RNN) and its variants (such as LSTM, GRU) are suitable for processing sequential data in network traffic, such as time series traffic data or packet sequences in a session. RNN can capture the temporal dependencies and context information in the sequence, thereby extracting features related to the time series. In a possible embodiment, the collected operation data is input into a pre-trained feature extraction model for in-depth feature analysis. The feature extraction model is trained with a large amount of data and has powerful data analysis and mining capabilities. It can extract feature information closely related to the memory performance of the network page from the complex operation data, and then output a prediction value of the network page memory performance. This prediction value provides an important basis for subsequent memory management decisions.
[0026] The memory performance prediction value is the value that the memory performance in the server may reach in the future. The memory performance prediction value reflects the performance development trend of the server. Optionally, the memory performance prediction values include: memory increment prediction value, memory prediction deviation rate, document object model node prediction deviation rate, central processing unit prediction deviation rate, etc.
[0027] Step 103, perform processing and analysis according to the prediction value of the network page memory performance to obtain data related to the memory health. In this embodiment, the memory health related data is an evaluation index of the server memory, and the memory health related data reflects the future health of the server memory. Optionally, the memory health related data includes memory leak parameters, memory health parameters, CPU health parameters, document object model node health parameters, etc.
[0028] In a possible embodiment, the network page memory performance prediction value is input into a preset health calculation model for processing, taking into account the relative importance of each parameter in the network page memory performance prediction value in the overall health assessment, so that the health parameters can comprehensively and accurately reflect the comprehensive health status of the server memory and its associated resources.
[0029] Step 104: Perform corresponding processing on the memory of the server according to the memory health related data.
[0030] In this embodiment, the future health of the server memory can be obtained based on the memory health related data, and the risk faced by the server in the future is determined based on the future health of the server memory, and the server memory is processed accordingly according to the severity of the risk. Optionally, the processing of the server memory includes: clearing the LRU cache, terminating idle WebWorkers, removing zombie DOM nodes, and unbinding unused events.
[0031] In summary, the method provided by the embodiments of the present disclosure can comprehensively understand the operating status of the server by collecting multi-dimensional operating data in the server, and provide a rich and accurate data basis for subsequent memory performance prediction and health assessment. Feature extraction and analysis of the operating data to obtain the predicted value of the memory performance of the web page can predict possible memory problems in advance, such as insufficient memory, memory leaks, etc., so as to take measures in advance to prevent and deal with them. Obtaining memory health-related data based on the memory performance prediction value can quantitatively evaluate the health of the memory and provide a basis for subsequent targeted memory processing. Finally, corresponding processing of the server memory according to different memory health-related data can effectively optimize memory usage, improve server performance and stability, reduce failures and freezes caused by memory problems, and improve user experience.
[0032] In a possible embodiment, the operation data includes at least one of the following: memory-related data, document object model node-related data, and central processing unit-related data, and the feature extraction and analysis of the operation data to obtain the network page memory performance prediction value includes: Extract the temporal features of the operation data to obtain the data related to the memory health of the network page. Among them, the predicted value of the memory performance of the network page includes at least one of the following: predicted value of memory increment, memory prediction deviation rate, document object model node prediction deviation rate, and central processing unit prediction deviation rate.
[0033] In this embodiment, the memory-related data reflects the operation of the server memory, the document object model node-related data reflects the quantity and changes of the document object model nodes in the server, and the central processing unit-related data reflects the operation status of the central processing unit in the server.
[0034] Optionally, the memory-related data includes but is not limited to: Memory usage: including used memory, available memory, total memory, etc., which reflects the current occupancy of the server's memory resources and is a basic indicator for evaluating memory performance. Memory utilization rate: The calculation formula is used memory / total memory × 100%, which intuitively shows the utilization degree of memory resources. A higher memory utilization rate may mean insufficient memory and may affect the performance of the server. Memory swap usage: When physical memory is insufficient, the system uses the swap area on the disk as virtual memory to store some temporarily unused data. The usage and utilization rate of the swap area are also important indicators for measuring memory performance. Excessive use of the swap area will lead to a decline in system performance because the read and write speed of the disk is much lower than that of memory. Memory hit rate: It refers to the success rate of directly obtaining data from memory and reflects the efficiency of memory access. A higher memory hit rate means that the system can quickly obtain the required data from memory, thereby reducing disk access and improving system performance.
[0035] Optionally, the document object model node-related data includes but is not limited to: DOM tree structure: representing the hierarchical relationship and organizational structure of all DOM nodes in the page, including root nodes, element nodes, text nodes, attribute nodes, etc. By analyzing the DOM tree structure, the layout and composition of the page and the relationships between different elements can be understood. DOM node quantity: counting the quantity of various DOM nodes in the page, such as the number of element nodes and text nodes. Too many DOM nodes may lead to a decline in page rendering performance and affect the user experience. DOM node attributes: Each DOM node has its specific attributes, such as the id, class, tag name, style attributes, event attributes, etc. of the element node. These attributes are used to describe the characteristics and behaviors of the nodes. By analyzing the node attributes, the specific settings and functions of the page elements can be understood. DOM operation frequency: recording the number of operations on DOM nodes, such as node creation, deletion, modification, movement, etc. Frequent DOM operations may cause page reflow and repaint, thus affecting the rendering performance of the page. Therefore, its frequency needs to be concerned about.
[0036] Optionally, the central processing unit (CPU) related data includes, but is not limited to: CPU utilization rate: One of the most common performance metrics of the CPU, which represents the degree of CPU occupancy and is presented as a percentage. It reflects the busyness of the CPU when executing tasks. An excessively high utilization rate may lead to slower system response and even lags. CPU core utilization rate: For multi-core CPUs, the utilization rate of each core can be viewed separately, so as to more detailedly understand the working status of each core and whether there is a situation where some cores are overloaded while other cores are idle. CPU frequency: Refers to the clock frequency of the CPU, usually in GHz. It represents the number of cycles that the CPU can process per second. The higher the frequency, the stronger the theoretical processing ability of the CPU. However, the actual performance is also affected by other factors, such as architecture, instruction set, etc. CPU load average: Usually represented by the average values within three time windows of 1 minute, 5 minutes, and 15 minutes, which represents the number of processes waiting to run within the corresponding time. This value can help understand the overall load situation of the system. If the load average is greater than the number of CPU cores for a long time, it may mean that the system resources are tense.
[0037] Optionally, the running data is input into the LSTM model for feature extraction and analysis to obtain the predicted value of the network page memory performance. The LSTM model includes three layers: an input layer, a core layer, and an output layer. Among them, the input layer is used to input the running data. The core layer includes a forget gate, an input gate, and an output gate, and the unit state control mechanism composed of the forget gate, the input gate, and the output gate is used for extracting temporal features. The output layer is used to output the predicted value of the network page memory performance.
[0038] In summary, the method provided by the embodiments of the present disclosure clarifies that the specific content of the running data includes memory-related data, document object model node-related data, central processing unit-related data, etc., covering the key factors affecting the network page memory performance, making the data collection more targeted and comprehensive. Extracting the temporal features of the running data can capture the changing trends and rules of the data over time, more accurately reflect the dynamic changes of the memory performance, and then obtain more accurate predicted values of the network page memory performance, including memory increment prediction value, memory prediction deviation rate, document object model node prediction deviation rate, central processing unit prediction deviation rate, etc. These predicted values quantitatively evaluate the memory performance from different perspectives, provide more detailed and comprehensive reference indicators for subsequent memory health analysis and processing, and help to timely discover potential memory problems and risks.
[0039] In a possible embodiment, the memory health - related data includes a memory leak situation parameter. The process of processing and analyzing based on the predicted value of the network page memory performance to obtain memory health - related data includes: Determining the memory leak situation parameter based on the change of the predicted memory increment value.
[0040] In this embodiment, the predicted memory increment value reflects the future increase in the server memory value. During the normal operation of the server, a memory increment is inevitable. When an application or service on the server starts, processes new tasks or requests, it will apply for new memory space to store data, variables, program code, etc., causing the memory usage to gradually increase. For example, when a Web server receives and processes client requests, it will allocate a certain amount of memory for each request to store request data, session information, etc., resulting in a certain incremental trend in memory usage.
[0041] Memory leak refers to the phenomenon that after a program applies for memory, due to the failure to release the allocated but no longer used memory in a timely manner, the memory usage continuously increases. This unreleased memory cannot be reused by other programs or processes, resulting in a waste of memory resources.
[0042] The memory leak situation parameter reflects the severity of the server memory leak. When there is a memory leak on the server, the memory increment will show abnormal characteristics. In the case of no new tasks or requests being processed and normal business loads being stable, the memory usage still continues to grow slowly and will not automatically drop back. Over time, the memory utilization rate will gradually approach or even reach the memory capacity limit, and ultimately may cause problems such as a decline in server performance, slower service response, or even server crashes due to insufficient memory.
[0043] In summary, the method provided by the embodiments of the present disclosure determines the memory leak situation parameter through the change of the predicted memory increment value, providing a direct and effective memory leak detection method. It can timely detect memory leak problems, avoid serious consequences such as gradual decline in server performance and system crashes caused by memory leaks, help improve the reliability and stability of the server, and ensure the normal operation of network pages.
[0044] In a possible embodiment, a network page memory management method is proposed. Figure 2 The following is a schematic flowchart of a network page memory management method provided by an embodiment of the present disclosure. As Figure 2 shown, determining the memory leak situation parameter based on the change of the predicted memory increment value includes: Step 201, slide a sliding window with a preset size over the sampling points of the memory increment prediction value to obtain the memory increment prediction values corresponding to the sampling points in the sliding window; Step 202, calculate the total memory growth rate within the sliding window according to the memory increment prediction values corresponding to the sampling points within the sliding window, and determine the total memory growth rate as the memory leak situation parameter.
[0045] In this embodiment, when determining the total memory growth rate, a sliding window with a preset size slides over the sampling points of the memory increment prediction value. The use of the sliding window enables us to conduct local observation and analysis on time-series data, avoiding interference from the fluctuations of individual sampling point data, thereby more accurately grasping the overall trend of memory increment changes. During the sliding process of the sliding window, the memory increment prediction values corresponding to the sampling points within the window are obtained, and these data points gather the detailed information of memory changes during this time period. Then, based on the memory increment prediction values of the sampling points within the sliding window, a comprehensive calculation is performed to obtain the total memory growth rate within the sliding window, and this growth rate is determined as the memory leak situation parameter. This method not only improves the accuracy and reliability of the total memory growth rate calculation, but also can timely and dynamically reflect the development trend of the memory leak situation, making the detection of memory leaks more timely and accurate, providing more powerful support for subsequent targeted memory optimization measures, effectively improving the intelligent level of server memory management, ensuring that the network page memory can operate in a healthy state, and avoiding potential risks caused by memory leaks.
[0046] In a possible embodiment, the size of the sliding window can accommodate 10 sampling points, and the time intervals between adjacent sampling points are equal (for example, 0.1 second). During the sliding process of the sliding window, the total memory growth rate within the sliding window is calculated by synthesizing the memory increment prediction values of the sampling points therein.
[0047] In summary, the method provided by the embodiments of the present disclosure slides a sliding window with a preset size over the sampling points of the memory increment prediction value, obtains the memory increment prediction values corresponding to the sampling points within the sliding window, and calculates the total memory growth rate based on this. This method can smooth data fluctuations, more accurately reflect the trend and amplitude of memory growth, avoid misjudgment caused by short-term data fluctuations, make the determined memory leak situation parameter more reliable, further improve the accuracy and stability of memory leak detection, and provide a more accurate basis for subsequent memory processing measures.
[0048] In a possible embodiment, the memory health-related data includes a health parameter, and the processing and analysis of the network page memory performance prediction value to obtain memory health-related data further includes: Determine the health parameter based on the memory prediction deviation rate, the document object model node prediction deviation rate, and the central processing unit prediction deviation rate.
[0049] In this embodiment, the health parameter comprehensively reflects the comprehensive health status of the server memory and is of great significance for comprehensively evaluating the memory performance. When obtaining the health parameter, multiple key indicators in the network page memory performance prediction value are fully utilized, namely, the memory prediction deviation rate, the document object model node prediction deviation rate, and the central processing unit prediction deviation rate. These prediction deviation rates respectively reveal potential problems and abnormal conditions of the memory and related resources of the server when running the network page from different perspectives such as memory prediction accuracy, document object model node-related performance prediction deviation, and central processing unit-related performance prediction deviation. By comprehensively analyzing these three prediction deviation rates, the operating status of the memory and its associated resources can be comprehensively considered, and then the health parameter that can comprehensively reflect the memory health status can be determined. This method breaks the limitation of single-index evaluation, realizes multi-dimensional comprehensive evaluation, makes the judgment of memory health more comprehensive and accurate, provides a more scientific and reliable basis for subsequent taking targeted memory management measures according to different health statuses, helps to achieve refined management of the server memory, and improves the stability and performance of the overall operation of the network page.
[0050] In summary, the method provided by the embodiment of the present disclosure introduces a health parameter in the memory health-related data and determines the parameter based on the memory prediction deviation rate, the document object model node prediction deviation rate, and the central processing unit prediction deviation rate. It comprehensively considers multiple key factors affecting memory health, can more comprehensively and objectively evaluate the overall health status of the memory. Compared with the single-index evaluation method, this comprehensive evaluation method can more accurately reflect the actual operating status of the memory, provides stronger support for subsequent taking reasonable memory processing measures, and helps to better ensure the stable operation of the server memory.
[0051] In a possible embodiment, a network page memory management method is proposed. Figure 3 It is a schematic flowchart of a network page memory management method provided by an embodiment of the present disclosure. As Figure 3 shown, determining the health parameter based on the memory prediction deviation rate, the document object model node prediction deviation rate, and the central processing unit prediction deviation rate includes: Step 301, determine the memory health parameter according to the memory prediction deviation rate, the corresponding memory impact coefficient, and the memory prediction value confidence level; In this embodiment, the memory impact coefficient reflects the importance of memory-related data for the overall health parameter, and the memory prediction value confidence reflects the reliability of the memory prediction deviation rate. For the determination of the memory health parameter, the memory prediction deviation rate and two important factors related to memory, namely the memory impact coefficient and the memory prediction value confidence, are fully considered. The memory impact coefficient reflects the impact weight of memory performance on the overall network page running performance, while the memory prediction value confidence reflects the reliability degree of the memory prediction result. Combining these three factors can more accurately measure the actual health status of the memory and obtain a more representative memory health parameter.
[0052] Step 302: Determine the central processing unit health parameter according to the central processing unit prediction deviation rate, the corresponding central processing unit impact coefficient, and the central processing unit prediction value confidence. In this embodiment, the central processing unit impact coefficient reflects the importance of central processing unit-related data for the overall health parameter, and the central processing unit prediction value confidence reflects the reliability of the central processing unit prediction deviation rate. When determining the central processing unit health parameter, calculations are carried out based on the central processing unit prediction deviation rate, the central processing unit impact coefficient, and the central processing unit prediction value confidence. The central processing unit impact coefficient represents the impact degree of the central processing unit performance on the network page running, and the central processing unit prediction value confidence reflects the credibility of the prediction result. The central processing unit health parameter obtained by comprehensively considering these factors can accurately reflect the health status of the central processing unit in aspects related to memory management.
[0053] Step 303: Determine the document object model node health parameter according to the document object model node prediction deviation rate, the corresponding document object model node impact coefficient, and the document object model node prediction value confidence. In this embodiment, the document object model node impact coefficient reflects the importance of document object model node-related data for the overall health parameter, and the document object model node prediction value confidence reflects the reliability of the document object model node prediction deviation rate. For the determination of the document object model node health parameter, the document object model node prediction deviation rate, the document object model node impact coefficient, and the document object model node prediction value confidence are comprehensively considered. Among them, the document object model node impact coefficient reflects the impact of the document object model node on the network page performance, and the prediction value confidence ensures the reliability of the prediction result, thereby obtaining an accurate document object model node health parameter.
[0054] Step 304: Weight the memory health parameter, the central processing unit health parameter, and the document object model node health parameter according to their corresponding weights to obtain the health parameter.
[0055] In this embodiment, a weighted calculation is performed according to the weights corresponding to the memory health parameter, the central processing unit health parameter, and the document object model node health parameter respectively to obtain the final health parameter. This process fully considers the relative importance of each parameter in the overall health assessment, enabling the health parameter to comprehensively and accurately reflect the comprehensive health status of the server memory and its associated resources, providing a solid data basis for subsequent implementation of precise memory management strategies, ensuring that the network page memory management can be optimized based on comprehensive and accurate health assessment results, and improving the stability and efficiency of the server operation.
[0056] In one possible embodiment, the following formula is used to calculate the health parameter:
[0057] where the meanings of the parameters are: memory prediction deviation rate, α memory impact coefficient, λ memory prediction value confidence level, central processing unit prediction deviation rate, γ central processing unit impact coefficient, v central processing unit prediction value confidence level, document object model node prediction deviation rate, β document object model node impact coefficient, μ document object model node prediction value confidence level. is the memory health parameter, is the document object model node health parameter, is the central processing unit health parameter.
[0058] In summary, the method provided by the embodiments of the present disclosure determines the memory health parameter according to the memory prediction deviation rate and the corresponding memory impact coefficient and memory prediction value confidence level, determines the central processing unit health parameter according to the central processing unit prediction deviation rate and the corresponding central processing unit impact coefficient and central processing unit prediction value confidence level, and determines the document object model node health parameter according to the document object model node prediction deviation rate and the corresponding document object model node impact coefficient and document object model node prediction value confidence level, fully considering the importance and reliability differences of various factors, making the determination of each health parameter more scientific, reasonable, and accurate. Then, a comprehensive health parameter is obtained by weighting according to the weights corresponding to these health parameters, further refining the health assessment process, being able to more accurately reflect the overall health status of the memory system, providing a more reliable basis for subsequent taking targeted treatment measures according to different health levels, and contributing to the refined management and optimization of the server memory.
[0059] In a possible embodiment, the steps for obtaining the weights corresponding to the memory health parameter, the central processing unit health parameter, and the document object model node health parameter include: Calculating the weight corresponding to the memory health parameter according to the occupied memory value and the total memory value; Calculating the weight corresponding to the document object model node health parameter according to the valid value of the document object model node and the total value of the document object model node; Calculating the weight corresponding to the central processing unit health parameter according to the idle time of the central processing unit and the total running time of the central processing unit.
[0060] In this embodiment, for obtaining the weight corresponding to the memory health parameter, the actual situation of the server memory is fully considered, that is, it is calculated according to the occupied memory value and the total memory value. The occupied memory value intuitively reflects the current usage amount of the memory, and the total memory value represents the overall capacity of the memory. By combining the two, the usage pressure and importance of the memory can be accurately measured, so as to obtain a reasonable weight of the memory health parameter and ensure that the memory health status occupies an appropriate position in the overall health assessment. For obtaining the weight corresponding to the document object model node health parameter, it is calculated according to the valid value of the document object model node and the total value of the document object model node. The valid value reflects the part that actually plays a role in the document object model node, and the total value covers all document object model nodes. This method can accurately evaluate the actual contribution and value of the document object model node in terms of quantity, and then determine a reasonable weight, so that the health status of the document object model node can be accurately reflected in the comprehensive assessment. For obtaining the weight corresponding to the central processing unit health parameter, it is achieved by analyzing the idle time of the central processing unit and the total running time of the central processing unit. The idle time reflects the resource situation not occupied by the central processing unit, and the total running time reflects the overall workload of the central processing unit. By combining the two, the load situation and resource utilization degree of the central processing unit can be accurately evaluated, so as to obtain a reasonable weight and ensure that the weight of the central processing unit health status in the overall health assessment matches the actual running situation. Through these detailed and reasonable weight obtaining steps, the calculation of the health parameter can more accurately reflect the actual importance of each factor in the memory health assessment, further improving the scientificity and reliability of the health parameter as a basis for memory management decision-making, providing strong support for realizing precise and efficient server memory management, and ensuring the stability of network page operation and performance optimization.
[0061] In a possible embodiment, the following formula is used to calculate the health parameter:
[0062] Wherein, is the occupied memory value, is the total memory value, is the valid value of the document object model node, is the total value of the document object model node, is the idle time of the central processing unit, is the total running time of the central processing unit.
[0063] Optionally, different weights can be set according to the type of the server and the memory capacity. Through such dynamic adjustment, it can better adapt to the performance characteristics of different devices and achieve more refined memory management.
[0064] In summary, the method provided by the embodiments of the present disclosure clarifies the methods for obtaining the weights corresponding to the memory health parameter, the central processing unit health parameter, and the document object model node health parameter. Calculate the weight corresponding to the memory health parameter according to the occupied memory value and the total memory value, calculate the weight corresponding to the document object model node health parameter according to the valid value of the document object model node and the total value of the document object model node, and calculate the weight corresponding to the central processing unit health parameter according to the idle time of the central processing unit and the total running time of the central processing unit. These methods make the determination of the weights closely related to the actual resource occupation and usage conditions, and can more reasonably reflect the importance and influence of each health parameter in the overall memory health assessment, thereby improving the accuracy and credibility of the comprehensive health parameter, further optimizing the memory health assessment model, making it more in line with the actual operating conditions, and providing a more scientific reference for subsequent memory processing decisions.
[0065] In a possible embodiment, the corresponding processing of the memory of the server according to the memory health-related data includes: Determine the response level according to the intervals where the health parameter and the memory leak situation parameter are located; Determine the corresponding processing action according to the response level, and execute the processing action on the server memory.
[0066] In this embodiment, during the actual operation process, the response level is first determined based on the intervals where the health parameter and the memory leak situation parameter are located. Different intervals of the health parameter represent different degrees of health status of the server memory, ranging from a good state to a warning state where potential problems may occur, and then to a dangerous state with serious risks, etc. Different intervals of the memory leak situation parameter represent different degrees of health status of the server memory, ranging from a good state to a warning state where potential problems may occur, and then to a dangerous state with serious risks, etc. By presetting a reasonable standard for dividing the intervals of the health parameter, the level corresponding to the current memory health status can be quickly and accurately judged, thus providing a clear level basis for subsequent corresponding processing measures. After determining the response level, the corresponding processing actions are immediately determined according to this response level, and these processing actions are executed for the server memory. The processing actions may include but are not limited to operations such as memory release, memory optimization, resource allocation, and process adjustment. The specific actions are selected according to the severity of the response level and the specific characteristics of the memory health status. For example, for a minor health warning, only simple memory optimization operations may be required; while for serious health problems, emergency measures such as immediately releasing a large amount of memory and adjusting the resource occupancy of critical processes may be needed. Through this strategy of determining the response level according to the intervals of the health parameter and implementing the corresponding processing actions accordingly, dynamic and precise management of the server memory can be achieved, various problems that may occur in the memory can be timely addressed, the server memory can always be kept in a healthy and stable state, thereby ensuring the smooth operation of the network page, improving the user experience, and at the same time helping to extend the service life of the server, reduce the system maintenance cost, provide a solid guarantee for the stable operation of the network page, and ensure that the server can efficiently and reliably process various network page requests in a complex and changeable network environment to meet the diverse needs of users.
[0067] In a possible embodiment, a memory leak is determined when the memory leak situation parameter (i.e., the memory growth rate) in three consecutive windows exceeds 5%. The following actions can be executed in the case of determining a memory leak: Release unused memory: For the detected and located memory leak problem, modify the code to ensure that the memory is released in a timely manner when it is no longer needed. Optimize the memory management strategy: According to the characteristics and requirements of the application program, adjust the memory allocation and management strategy. For example, use the object pool technology to manage frequently created and destroyed objects, reduce the overhead of memory allocation and release; reasonably set the size and expiration strategy of the cache to avoid the cache occupying too much memory.
[0068] In a possible embodiment, when the health parameter is less than 70%, the processing operations of cleaning the LRU cache and terminating the idle WebWorker are executed. When the health parameter is less than 50%, the processing operations of removing zombie DOM nodes and unbinding unused events are executed. When the health parameter is less than 30%, the processing operations of forcibly triggering GC and pausing non-core rendering tasks are executed.
[0069] In summary, the method provided by the embodiment of the present disclosure determines the response level according to the interval of the health parameter and the memory leakage parameter, can perform hierarchical management of the health status of the memory, take corresponding processing actions according to the severity of different levels, and realize the refined management and efficient response of the server memory. This method of executing corresponding processing actions according to different response levels can reasonably allocate system resources and avoid over-processing or under-processing. It can not only solve the existing memory problems in a timely manner, but also reduce interference with the normal operation of the server, effectively improve the management efficiency and reliability of the server memory, and ensure the stable operation of the network page.
[0070] It should be noted that the embodiments of the present disclosure may include multiple steps. For the convenience of description, these steps are numbered, but these numbers do not limit the execution time slots or execution order between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not limit this.
[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0072] According to an embodiment of the present disclosure, the present disclosure also provides a network page memory management device.
[0073] For example, Figure 4 The schematic diagram of the structure of a network page memory management device provided by an embodiment of the present disclosure. The network page memory management device 400 includes: The data collection module 410 is used to collect multi-dimensional operation data in the server; A feature extraction module 420 is used to extract and analyze the features of the operation data to obtain a network page memory performance prediction value; An analysis module 430 is used to process and analyze the network page memory performance prediction value to obtain memory health related data; The memory processing module 440 is used to perform corresponding processing on the memory of the server according to the memory health related data.
[0074] Further, the feature extraction module 420 includes: A feature extraction sub-module for performing time-series feature extraction on the operation data to obtain data related to the memory health of the network page. The memory performance prediction value of the network page includes at least one of the following: memory increment prediction value, memory prediction deviation rate, document object model node prediction deviation rate, and central processing unit prediction deviation rate.
[0075] Further, the feature extraction sub-module includes: A memory leak determination module for determining memory leak situation parameters based on the change of the memory increment prediction value.
[0076] Further, the memory leak determination module includes: A memory leak determination sub-module for determining memory leak situation parameters based on the change of the memory increment prediction value.
[0077] Further, the memory leak determination sub-module includes: A sliding unit for sliding on the sampling points of the memory increment prediction value through a sliding window of a preset size to obtain the memory increment prediction values corresponding to the sampling points in the sliding window; A memory leak determination unit for calculating the total memory growth rate within the sliding window according to the memory increment prediction values corresponding to the sampling points in the sliding window, and determining the total memory growth rate as the memory leak situation parameter.
[0078] Further, the analysis module 430 includes: A health parameter determination module for determining health parameters based on the memory prediction deviation rate, document object model node prediction deviation rate, and central processing unit prediction deviation rate.
[0079] Further, the health parameter determination module includes: A first determination module for determining the memory health parameter according to the memory prediction deviation rate, the corresponding memory influence coefficient, and the memory prediction value confidence level; A second determination module for determining the central processing unit health parameter according to the central processing unit prediction deviation rate, the corresponding central processing unit influence coefficient, and the central processing unit prediction value confidence level; A third determination module for determining the document object model node health parameter according to the document object model node prediction deviation rate, the corresponding document object model node influence coefficient, and the document object model node prediction value confidence level; A fourth determination module for weighting according to the weights corresponding to the memory health parameter, the central processing unit health parameter, and the document object model node health parameter to obtain the health parameter.
[0080] Further, the device further includes: A first weight acquisition module, configured to calculate the weight corresponding to the memory health parameter according to the occupied memory value and the total memory value; A second weight acquisition module, configured to calculate the weight corresponding to the document object model node health parameter according to the valid value of the document object model node and the total value of the document object model node; A third weight acquisition module, configured to calculate the weight corresponding to the central processing unit health parameter according to the idle time of the central processing unit and the total running time of the central processing unit.
[0081] Further, the memory processing module 440 includes: A response level determination module, configured to determine the response level according to the interval in which the health parameter and the memory leak situation parameter are located; A processing module, configured to determine the corresponding processing action according to the response level and execute the processing action on the server memory.
[0082] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned embodiments of the network page memory management method.
[0083] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any one of the above-mentioned embodiments of the network page memory management method when running.
[0084] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0085] An embodiment of the present disclosure further provides a computer program product. The above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any one of the above-mentioned embodiments of the network page memory management method.
[0086] An embodiment of the present disclosure further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any one of the above-mentioned embodiments of the network page memory management method.
[0087] Those skilled in the art may further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0088] The above has introduced in detail a network page memory management method provided by the present disclosure. Specific examples are used herein to elaborate on the principles and implementation manners of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of the present disclosure, several improvements and modifications can also be made to the present disclosure, and these improvements and modifications also fall within the protection scope of the claims of the present disclosure.
Claims
1. A method for network page memory management, characterized in that Including: Collecting multi-dimensional operation data in the collection server; Performing feature extraction and analysis on the operation data to obtain a predicted value of the memory performance of the web page; Performing processing and analysis according to the predicted value of the memory performance of the web page to obtain data related to the memory health; Performing corresponding processing on the memory of the server according to the data related to the memory health; 2. The method according to claim 1, characterized in that, The operation data includes at least one of the following: memory-related data, document object model node-related data, central processing unit-related data. The performing feature extraction and analysis on the operation data to obtain a predicted value of the memory performance of the web page includes: Performing time series feature extraction on the operation data to obtain the data related to the memory health of the web page. Among them, the predicted value of the memory performance of the web page includes at least one of the following: memory increment prediction value, memory prediction deviation rate, document object model node prediction deviation rate, central processing unit prediction deviation rate.
3. The method according to claim 2, characterized in that The data related to the memory health includes memory leak situation parameters. The performing processing and analysis according to the predicted value of the memory performance of the web page to obtain the data related to the memory health includes: Determining the memory leak situation parameters based on the change situation of the memory increment prediction value.
4. The method according to claim 3, wherein The determining the memory leak situation parameters based on the change situation of the memory increment prediction value includes: Sliding a sliding window of a preset size on the sampling points of the memory increment prediction value to obtain the memory increment prediction values corresponding to the sampling points in the sliding window; Calculating the total memory growth rate within the sliding window according to the memory increment prediction values corresponding to the sampling points within the sliding window, and determining the total memory growth rate as the memory leak situation parameter.
5. The method according to claim 2, wherein The data related to the memory health includes health parameters. The performing processing and analysis according to the predicted value of the memory performance of the web page to obtain the data related to the memory health further includes: Determining the health parameters based on the memory prediction deviation rate, document object model node prediction deviation rate, and central processing unit prediction deviation rate.
6. The method according to claim 5, characterized in that, The determining the health parameters based on the memory prediction deviation rate, document object model node prediction deviation rate, and central processing unit prediction deviation rate includes: Determining the memory health parameter according to the memory prediction deviation rate and the corresponding memory impact coefficient and memory prediction value confidence; Determining the central processing unit health parameter according to the central processing unit prediction deviation rate and the corresponding central processing unit impact coefficient and central processing unit prediction value confidence; Determining the document object model node health parameter according to the document object model node prediction deviation rate and the corresponding document object model node impact coefficient and document object model node prediction value confidence; Weighting according to the weights corresponding to the memory health parameter, central processing unit health parameter, and document object model node health parameter to obtain the health parameter.
7. The method according to claim 6, wherein The steps for obtaining the weights corresponding to the memory health parameter, central processing unit health parameter, and document object model node health parameter include: Calculating the weight corresponding to the memory health parameter according to the occupied memory value and the total memory value; Calculate the weight corresponding to the health parameter of the document object model node according to the valid value of the document object model node and the total value of the document object model node; Calculate the weight corresponding to the health parameter of the central processing unit according to the idle time of the central processing unit and the total running time of the central processing unit.
8. The method according to claim 4 or 7, characterized in that The corresponding processing of the memory of the server according to the memory health-related data includes: Determine the response level according to the interval where the health parameter and the memory leak situation parameter are located; Determine the corresponding processing action according to the response level, and execute the processing action for the server memory.
9. A network page memory management device, characterized in that, Including: A data acquisition module for acquiring multi-dimensional operation data in the server; A feature extraction module for extracting and analyzing features of the operation data to obtain a network page memory performance prediction value; An analysis module for performing processing and analysis according to the network page memory performance prediction value to obtain memory health-related data; A memory processing module for performing corresponding processing on the memory of the server according to the memory health-related data.
10. An electronic device, characterized in that Including: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for predicting mobile application program page performance and electronic equipment
CN106294902A
Memory evaluation method and device
CN112131071A
Server health state assessment method and system, electronic equipment and storage medium
CN114138625A
Intelligent memory leak predicting and tracking method and system for micro-service architecture
CN119690725A
Server health state diagnosis method based on GAT-LP algorithm
CN120086105A