A memory management method and terminal

By establishing associated memory structure tables for different memory attributes and updating the data in real time, the problem of low efficiency in traditional memory analysis is solved, achieving efficient memory management and data analysis.

CN118779316BActive Publication Date: 2025-12-05福建天晴在线互动科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410776261.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2025-12-05
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Traditional memory analysis requires traversing each memory attribute, resulting in low management efficiency, and adding new memory requires time-consuming traversal operations.

Method used

Based on the form and state of memory data, an associated memory structure table is established for different memory attributes. Data is updated by monitoring the attribute identifiers of newly added data in real time, and a tree structure is used to classify and manage memory data.

Benefits of technology

It improves the efficiency of memory analysis and management, reduces the number of times all memory attributes are traversed, and enhances the speed and accuracy of data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779316B_ABST
    Figure CN118779316B_ABST
Patent Text Reader

Abstract

The application discloses a memory management method and terminal, when a process is started, existing data in the memory is divided according to memory attributes of memory data, attribute identifiers are added, and associated memory structure tables are respectively established for different memory attributes according to forms and states of the memory data; the memory data is monitored in real time, when new data is found, attribute identifiers are added to the new data according to memory attributes of the new data, and the memory structure table associated with the memory attributes is updated with data according to the forms and states of the new data; when memory data analysis is needed, the corresponding memory structure table of the memory attribute can be directly called, and data can be further filtered according to the forms and states of the memory data, so that all memory attributes do not need to be traversed, and the efficiency of memory analysis and management is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a method and terminal for memory management. Background Technology

[0002] Memory is a crucial component of a computer, also known as internal memory or main memory. It temporarily stores data used for CPU operations, as well as data exchanged with external storage devices such as hard drives. It acts as a bridge between external storage and the CPU. All programs in a computer run in memory. As soon as the computer starts running, the operating system retrieves the necessary data from memory to the CPU for processing. Once the processing is complete, the CPU sends the result back.

[0003] During program execution, the process generates memory with various memory attributes, including heap memory, stack memory, and global variables.

[0004] Traditional memory analysis requires traversing every memory attribute to ensure effective memory management and monitoring. This traversal of each memory attribute is time-consuming and increases system load. When new memory is added, a similar traversal is needed to ensure proper allocation and release. Therefore, this scanning process is very time-consuming and requires real-time scanning to ensure normal system memory operation.

[0005] Improving the efficiency of memory analysis and management is a pressing technical problem that needs to be solved. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a memory management method and terminal to improve the efficiency of memory analysis and management.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0008] A memory management method includes the following steps:

[0009] S1. When the process starts, the existing data in memory is divided according to the memory attributes of the memory data, attribute identifiers are added, and associated memory structure tables are established for different memory attributes according to the form and status of the memory data.

[0010] S2. Monitor the memory data in real time. When new data is detected, add an attribute identifier to the new data according to the memory attributes of the new data, and update the data in the memory structure table associated with the memory attributes based on the form and status of the new data.

[0011] S3. Analyze and manage memory data based on the memory structure table.

[0012] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0013] A memory management terminal includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0014] S1. When the process starts, the existing data in memory is divided according to the memory attributes of the memory data, attribute identifiers are added, and associated memory structure tables are established for different memory attributes according to the form and status of the memory data.

[0015] S2. Monitor the memory data in real time. When new data is detected, add an attribute identifier to the new data according to the memory attributes of the new data, and update the data in the memory structure table associated with the memory attributes based on the form and status of the new data.

[0016] S3. Analyze and manage memory data based on the memory structure table.

[0017] The beneficial effects of the present invention are as follows: The memory management method and terminal of the present invention establish associated memory structure tables for different memory attributes according to the form and state of memory data. This allows memory data analysis to be performed directly by calling the memory structure table of the corresponding memory attribute, and further filtering of data according to the form and state of memory data, without having to traverse all memory attributes, thus effectively improving the efficiency of memory analysis and management. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a memory management method according to an embodiment of the present invention;

[0019] Figure 2 This is a structural diagram of a memory management terminal according to an embodiment of the present invention;

[0020] Figure 3 This is an example diagram of the memory structure table of a memory management method according to an embodiment of the present invention;

[0021] Figure 4 This is a schematic diagram illustrating the memory attribute partitioning of a memory management method according to an embodiment of the present invention;

[0022] Figure 5 This is a functional module illustration of a memory management method according to an embodiment of the present invention;

[0023] Label Explanation:

[0024] 1. A memory management terminal; 2. A processor; 3. A memory. Detailed Implementation

[0025] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0026] Please refer to Figure 1 A memory management method, comprising the following steps:

[0027] S1. When the process starts, the existing data in memory is divided according to the memory attributes of the memory data, attribute identifiers are added, and associated memory structure tables are established for different memory attributes according to the form and status of the memory data.

[0028] S2. Monitor the memory data in real time. When new data is detected, add an attribute identifier to the new data according to the memory attributes of the new data, and update the data in the memory structure table associated with the memory attributes based on the form and status of the new data.

[0029] S3. Analyze and manage memory data based on the memory structure table.

[0030] As can be seen from the above description, the beneficial effects of the present invention are as follows: The memory management method and terminal of the present invention establish associated memory structure tables for different memory attributes according to the form and state of memory data, so that when memory data analysis is required, it can be performed directly by calling the memory structure table of the corresponding memory attribute, and the data can be further filtered according to the form and state of memory data without having to traverse all memory attributes, which effectively improves the efficiency of memory analysis and management.

[0031] Furthermore, the establishment of the memory structure table includes the following steps:

[0032] S11. Divide the memory into temporary storage memory, and in the temporary storage memory, construct a memory structure table with an associated tree structure for different memory attributes;

[0033] S12. In the memory structure table associated with each memory attribute, divide the memory data according to the memory format and generate child nodes;

[0034] The memory format includes initial data and dynamic data;

[0035] S13. Divide the memory data that already exists when the process starts into initial data, and the memory data added later into dynamic data. Build a memory list under each child node to record the memory data.

[0036] As described above, a tree-structured memory table is constructed to classify memory data and record data attributes.

[0037] Furthermore, step S2 also includes the following steps:

[0038] When a change in memory data is detected, the data in the memory structure table is updated synchronously, and the memory data table records the changed memory data under the changed memory data.

[0039] As described above, the memory structure table records changes in memory data, facilitating analysis.

[0040] Furthermore, the steps between step S2 and step S3 include:

[0041] The memory structure table receives information about data changes, compares the memory data before and after the changes, and obtains the difference data for memory data analysis.

[0042] As described above, extracting differential data for in-memory data analysis can improve data analysis efficiency.

[0043] Furthermore, the memory attributes include mapped memory, virtual machine memory, and stack memory.

[0044] As described above, memory attributes include mapped memory, virtual machine memory, and stack memory, as a specific embodiment of the present invention.

[0045] Please refer to Figure 2 A memory management terminal includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0046] S1. When the process starts, the existing data in memory is divided according to the memory attributes of the memory data, attribute identifiers are added, and associated memory structure tables are established for different memory attributes according to the form and status of the memory data.

[0047] S2. Monitor the memory data in real time. When new data is detected, add an attribute identifier to the new data according to the memory attributes of the new data, and update the data in the memory structure table associated with the memory attributes based on the form and status of the new data.

[0048] S3. Analyze and manage memory data based on the memory structure table.

[0049] As can be seen from the above description, the beneficial effects of the present invention are as follows: The memory management method and terminal of the present invention establish associated memory structure tables for different memory attributes according to the form and state of memory data, so that when memory data analysis is required, it can be performed directly by calling the memory structure table of the corresponding memory attribute, and the data can be further filtered according to the form and state of memory data without having to traverse all memory attributes, which effectively improves the efficiency of memory analysis and management.

[0050] Furthermore, the establishment of the memory structure table includes the following steps:

[0051] S11. Divide the memory into temporary storage memory, and in the temporary storage memory, construct a memory structure table with an associated tree structure for different memory attributes;

[0052] S12. In the memory structure table associated with each memory attribute, divide the memory data according to the memory format and generate child nodes;

[0053] The memory format includes initial data and dynamic data;

[0054] S13. Divide the memory data that already exists when the process starts into initial data, and the memory data added later into dynamic data. Build a memory list under each child node to record the memory data.

[0055] As described above, a tree-structured memory table is constructed to classify memory data and record data attributes.

[0056] Furthermore, step S2 also includes the following steps:

[0057] When a change in memory data is detected, the data in the memory structure table is updated synchronously, and the memory data table records the changed memory data under the changed memory data.

[0058] As described above, the memory structure table records changes in memory data, facilitating analysis.

[0059] Furthermore, the steps between step S2 and step S3 include:

[0060] The memory structure table receives information about data changes, compares the memory data before and after the changes, and obtains the difference data for memory data analysis.

[0061] As described above, extracting differential data for in-memory data analysis can improve data analysis efficiency.

[0062] Furthermore, the memory attributes include mapped memory, virtual machine memory, and stack memory.

[0063] As described above, memory attributes include mapped memory, virtual machine memory, and stack memory, as a specific embodiment of the present invention.

[0064] The present invention provides a memory management method and terminal, which is applicable to scenarios that require traversal and analysis of memory data, and manages memory data to improve the efficiency of memory data analysis.

[0065] Please refer to Figure 1 as well as Figures 3 to 5 Embodiment 1 of the present invention is as follows:

[0066] A memory management method includes the following steps:

[0067] S1. When the process starts, the existing data in memory is divided according to the memory attributes of the memory data, attribute identifiers are added, and associated memory structure tables are established for different memory attributes according to the form and status of the memory data.

[0068] The memory attributes include mapped memory, virtual machine memory, and stack memory.

[0069] In this embodiment, it can be referred to Figure 4 and Figure 5 A functional module translator was designed. During startup, the translator redefines the existing memory data and adds attribute identifiers M, V, and H. M identifies mapped memory, V identifies virtual memory, and H identifies stack memory.

[0070] For example: 0x10000 M: Map type.

[0071] 0x150000V: Virtual type.

[0072] 0x567000H: Heap type.

[0073] The creation of the memory structure table includes the following steps:

[0074] S11. Divide the memory into temporary storage memory, and in the temporary storage memory, construct a memory structure table with an associated tree structure for different memory attributes;

[0075] S12. In the memory structure table associated with each memory attribute, divide the memory data according to the memory format and generate child nodes;

[0076] The memory format includes initial data and dynamic data;

[0077] S13. Divide the memory data that already exists when the process starts into initial data, and the memory data added later into dynamic data. Build a memory list under each child node to record the memory data.

[0078] In this embodiment, the function module synchronizer is activated, which creates a synchronized temporary storage area for the process to store the memory structure table. The memory structure table is recorded using a tree structure.

[0079] In this embodiment, memory data for each memory attribute is categorized based on whether it existed at process startup. Memory data existing at process startup is classified as initial data, and only changes to this initial data need to be monitored. Memory data generated during program execution is classified as dynamic data, and its protection (readability and writability), memory status (whether it has been released or still exists), and data content are recorded and monitored. In this embodiment, memory data generated during process startup is assumed to be within the scope requiring protection; that is, the list of memory addresses generated at the moment of program startup.

[0080] During data retrieval, if the data is deemed illegal or tampered with by the server, it can be located through memory protection, memory status, and data analysis. If it belongs to the initialization memory, only the initialization data needs to be located, eliminating the need to traverse the memory again.

[0081] For reference Figure 3 The image shows an example of a memory attribute structure table.

[0082] S2. Monitor the memory data in real time. When new data is detected, add an attribute identifier to the new data according to the memory attributes of the new data, and update the data in the memory structure table associated with the memory attributes based on the form and status of the new data.

[0083] Step S2 also includes the following steps:

[0084] When a change in memory data is detected, the data in the memory structure table is updated synchronously, and the memory data table records the changed memory data under the changed memory data.

[0085] In this embodiment, Figure 3Taking the memory structure table shown as an example, in the memory format, the initial data -> memory List 0xE7000 is the initial memory address. After being parsed and synchronized by the translator, it is converted to address 0x110000, and the data is the same. At this time, 0xE7000 serves as the reference for the initial data. 35112755 is the data change that occurred at the system timestamp. Offset means that the position changed at time 35112755. 3 10 10 10 indicates that the position data was first changed to E6 and then changed to EF. Dynamic data refers to memory data that does not exist when the process starts. This data is dynamically created during program execution and needs to be recorded. The reason for having memory protection, memory status, and data attributes is to allow the memory to be traversed once based on the preceding attributes when searching for data, and then to search for data based on the traversed memory for easier retrieval.

[0086] In this embodiment, this process is performed through a functional module synchronizer. Furthermore, this embodiment employs a system mapping mechanism for data synchronization from memory to the memory structure table, eliminating the need for the program to actively synchronize memory data.

[0087] The steps between step S2 and step S3 include:

[0088] The memory structure table receives information about data changes, compares the memory data before and after the changes, and obtains the difference data for memory data analysis.

[0089] S3. Analyze and manage memory data based on the memory structure table.

[0090] Please refer to Figure 2 Embodiment two of the present invention is as follows:

[0091] A memory management terminal 1 includes a processor 2, a memory 3, and a computer program stored in the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, it implements the steps of a memory management method according to the above embodiment 1.

[0092] In summary, the memory management method and terminal provided by this invention establishes associated memory structure tables for different memory attributes based on the form and state of memory data. This allows for direct access to the corresponding memory structure table of the memory attribute when memory data analysis is required. Furthermore, data can be further filtered based on the form and state of the memory data without traversing all memory attributes, effectively improving the efficiency of memory analysis and management.

[0093] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method of memory management, characterized by, The method comprises the steps of: S1, when a process is started, dividing existing data in memory according to memory attributes of the data, adding attribute identifiers, and establishing associated memory structure tables for different memory attributes according to forms and states of the memory data; S2, performing real-time monitoring on the memory data, adding attribute identifiers to newly added data according to memory attributes of the data when it is found that the newly added data exists, and updating the memory structure tables associated with the memory attributes according to forms and states of the newly added data; S3, analyzing and managing the memory data based on the memory structure tables; The establishment of the memory structure tables comprises the steps of: S11, dividing temporary storage memory in the memory, and constructing tree-shaped memory structure tables associated with different memory attributes in the temporary storage memory; S12, generating child nodes by dividing the memory data according to memory forms in the memory structure tables associated with each memory attribute; The memory forms include initial data and dynamic data; S13, dividing existing memory data at the start of the process into initial data, and dividing newly added memory data into dynamic data, and constructing memory lists under each child node to record the memory data.

2. The method of claim 1, wherein, The step S2 further comprises the step of: When it is found that the memory data has changed, synchronously updating the data in the memory structure tables, and recording the changed memory data in the memory structure tables.

3. The method of claim 2, wherein, The step S2 and the step S3 further comprise the step of: The memory structure tables receive information about data changes, compare the memory data before and after the changes, and obtain difference data for analysis of the memory data.

4. The method of claim 1, wherein, The memory attributes include mapping memory, virtual machine memory, and stack memory.

5. A memory managed terminal comprising a processor, a memory, and a computer program stored in said memory and loadable into said processor, comprising software code portions for performing the steps of the method of claim 1 when the computer program is run on the processor. 5 The processor executes the computer program to implement the following steps: S1, when a process is started, dividing existing data in memory according to memory attributes of the data, adding attribute identifiers, and establishing associated memory structure tables for different memory attributes according to forms and states of the memory data; S2, performing real-time monitoring on the memory data, adding attribute identifiers to newly added data according to memory attributes of the data when it is found that the newly added data exists, and updating the memory structure tables associated with the memory attributes according to forms and states of the newly added data; S3, analyzing and managing the memory data based on the memory structure tables; The establishment of the memory structure tables comprises the steps of: S11, dividing temporary storage memory in the memory, and constructing tree-shaped memory structure tables associated with different memory attributes in the temporary storage memory; S12, generating child nodes by dividing the memory data according to memory forms in the memory structure tables associated with each memory attribute; The memory forms include initial data and dynamic data; S13, dividing existing memory data at the start of the process into initial data, and dividing newly added memory data into dynamic data, and constructing memory lists under each child node to record the memory data.

6. A memory managed terminal according to claim 5, characterized in that The step S2 further comprises the step of: When it is monitored that the memory data has data change, the data of the memory structure table is updated synchronously, and the changed memory data is recorded in the memory structure table.

7. A memory managed terminal according to claim 6, characterized in that Between step S2 and step S3, there is also a step: The memory structure table receives the information of the data change, compares the memory data before and after the change, and obtains the difference data for the analysis of the memory data.

8. The memory managed terminal of claim 5, wherein, The memory attribute includes a mapping memory, a virtual machine memory and a stack memory.

Citation Information

Patent Citations

  • Automatic memory evidence analyzing method based on data association

    CN104392171A

  • Multi-device association method, system and device of smart rail transit system and storage medium

    CN117539873A