Software management method, software management system, equipment and storage medium

By establishing a virtual address mapping relationship in the software management method, directly accessing the physical memory of the target process, solving the problem of interference between the debugging tool on the target process, improving data management efficiency and reducing processing costs.

CN120371371APending Publication Date: 2025-07-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510492149.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When the existing software management method debugs the target process, it will interfere with the normal process of the target process, resulting in high performance overhead and high processing costs, and unintuitive operation.

Method used

The management process obtains data management instructions, recognizes the first virtual address of the target process where the data to be managed is located, and establishes a mapping relationship with the second virtual address on the management process side, directly accesses the physical memory mapped by the target virtual address to execute data management instructions, and reduces interference to the target process.

Benefits of technology

Improve data management efficiency, reduce interference to target processes and data processing overhead, and simplify the interaction between management processes and target processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371371A_ABST
    Figure CN120371371A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data management, in particular to a software management method, a software management system, equipment and a storage medium. The software management method comprises the steps that when a data management instruction is received, a target process where to-be-managed data is located is analyzed, a first virtual address of the to-be-managed data is obtained, a target virtual address is obtained through the mapping relation between the first virtual address and a second virtual address of a management process, and the to-be-managed data is managed based on a physical address corresponding to the target virtual address. And obtaining to-be-managed data to execute the data management instruction. According to the method, the technical problems of high performance overhead and high processing cost are solved, and the technical effects of improving the data management efficiency, reducing interference to the target process and reducing the data processing overhead are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data management, and in particular, to a software management method, a software management system, an electronic device, and a computer-readable storage medium. Background Art

[0002] Software plays a crucial role in various fields. Software generally includes at least a data structure and an algorithm. However, the interweaving of data structures and complex algorithms makes current software often have a high complexity, which in turn leads to a sharp increase in the difficulty of software development, debugging, and maintenance.

[0003] Generally, the control of a target process can be achieved based on a debugging tool, but this will interfere with the normal process of the target process, affect real-time performance, and have a large performance overhead and unintuitive operation. Summary of the Invention

[0004] This application provides a software management method, a software management system, a device, and a storage medium to at least solve the technical problems of large performance overhead and high processing cost.

[0005] This application provides a software management method. The software management method includes: a management process obtains a data management instruction; identifies the software process where the data to be managed is located as the target process, and parses the first virtual address of the data to be managed in the target process; uses the second virtual address on the management process side that is pre-formed to be paired with the first virtual address as the target virtual address; accesses the physical memory mapped by the target virtual address to obtain the data to be managed, and executes the data management instruction on it.

[0006] This application also provides a software management system. The software management method includes: an interaction module and a management module. The interaction module is used to obtain a data management instruction; the management module is connected to the interaction module; the management module includes a management process for implementing the steps of any of the above software management methods.

[0007] This application also provides an electronic device. The software management method includes: a memory for storing a computer program; a processor for implementing the steps of any of the above software management methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of any of the above software management methods are implemented.

[0009] Through this application, a data management instruction is obtained, and the software process where the data to be managed is located is identified as the target process based on the data management instruction. By locating the first virtual address of the target process where the data to be managed is located, it is possible to avoid taking over the target process or interrupting the execution of the target process, thus reducing the interference with the running state of the target process. Moreover, in this application, a mapping relationship can be established in advance among the first virtual address of the data in the target process, the physical memory, and the second virtual address of the management process. In this way, through the virtual address mapping mechanism, this application can reduce the substantial participation of the target process in the data management process of the software, reduce the impact of the inter-process space isolation limit to a certain extent, and also reduce the invasive modification of the target process source code. When managing the data to be managed, the management process can locate the data to be managed through the mapping relationship using the second virtual address on the management process side, and execute the data management instruction on the data to be managed, thereby reducing the interference with the target process while reducing the data processing overhead. In addition, this application can simplify the interaction between the cumbersome management process and the target process, thereby improving the data management efficiency. Therefore, this method can solve the technical problems of large performance overhead and high processing cost, and achieve the technical effects of improving data management efficiency, reducing interference with the target process, and reducing data processing overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0011] Figure 1 It is a timing diagram of a software management method provided by an embodiment of the present application;

[0012] Figure 2 It is a timing diagram of another software management method provided by an embodiment of the present application;

[0013] Figure 3 It is a timing diagram of another software management method provided by an embodiment of the present application;

[0014] Figure 4 It is an application environment diagram of a software management method of the method provided by an embodiment of the present application;

[0015] Figure 5 It is a flowchart of a software management method provided by an embodiment of the present application;

[0016] Figure 6 It is a schematic diagram of the data structure of a software management method provided by an embodiment of the present application;

[0017] Figure 7 Flow schematic diagram of another software management method provided by an embodiment of the present application;

[0018] Figure 8 Address mapping schematic diagram of a software management method provided by an embodiment of the present application;

[0019] Figure 9 Flow schematic diagram of another software management method provided by an embodiment of the present application;

[0020] Figure 10 Structural schematic diagram of a software management system provided by an embodiment of the present application;

[0021] Figure 11 Structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0022] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0023] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0024] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of step description, and do not particularly refer to the meaning of order or sequence, nor are they used to limit the present application. They are only used to conveniently describe the method of the present application and cannot be understood as indicating the order of steps. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present application.

[0025] To solve the technical problems that controlling a target process based on a debugging tool will interfere with the normal process of the target process, affect real-time performance, have a large performance overhead, and be unintuitive to operate, this application obtains a data management instruction through a management process; identifies the software process where the data to be managed is located as the target process, and parses the first virtual address of the data to be managed in the target process; forms a second virtual address on the management process side that is paired with the first virtual address in advance as the target virtual address; accesses the physical memory mapped by the target virtual address to obtain the data to be managed, and executes the data management instruction on it to solve the technical problems of large performance overhead and high processing cost, achieving the technical effects of improving data management efficiency, reducing interference with the target process, and reducing data processing overhead.

[0026] To enable those skilled in the art of this technical field to better understand the solution of this application, the following further describes this application in detail with reference to the accompanying drawings and specific implementation manners. The software management method provided by this application can be applied to an application environment as Figure 4 shown. Among them, the terminal 12 communicates with the server 14 through the network. Among them, the terminal 12 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 14 can be implemented by an independent server or a server cluster composed of multiple servers.

[0027] To enable those skilled in the art of this technical field to better understand the solution of this application, the following further describes this application in detail with reference to the accompanying drawings and specific implementation manners.

[0028] An embodiment of this application provides a software management method, and describes the method in detail in combination with the execution process of the software management method.

[0029] In one embodiment, as Figure 5 shown, Figure 5 is a schematic flowchart of a software management method provided by an embodiment of this application.

[0030] S101: The management process obtains a data management instruction.

[0031] In this embodiment, the management process receives and parses a data management instruction issued by a user or a system.

[0032] Specifically, the management process receives user instructions through a visual terminal interface, such as a ncurse TUI (Text-based User Interface Library) interface. Among them, the user can select the hierarchical path of the target data structure through the visual terminal interface and trigger a read operation or a write operation. It is also possible to batch send instructions through an external script or API (Application Programming Interface), which is suitable for automated testing or monitoring scenarios.

[0033] S102: Identify the software process where the data to be managed is located as the target process, and resolve the first virtual address of the data to be managed in the target process.

[0034] In this embodiment, the software process where the data to be managed is located is used as the target process, and the first virtual address corresponding to the data to be managed is obtained by parsing the data to be managed.

[0035] Among them, the first virtual address is used to form a mapping relationship with the physical memory of the data to be managed.

[0036] S103: Use the second virtual address on the management process side that is pre-formed to be paired with the first virtual address as the target virtual address.

[0037] In this embodiment, the management process receives the first virtual address of the target process obtained in S102, converts the first virtual address into the corresponding physical address through the operating system kernel interface, and the management process maps the memory area corresponding to the target physical address to its own virtual address space to generate a second virtual address as the target virtual address.

[0038] Among them, the operating system kernel interface can be used to traverse the pre-maintained page table of the target process.

[0039] S104: Access the physical memory mapped by the target virtual address to obtain the data to be managed, and execute data management instructions on it.

[0040] In this embodiment, by directly operating the virtual address mapped on the management process side, that is, the second virtual address, the reading, writing, and control of the physical memory of the target process are realized.

[0041] This embodiment ensures the purposefulness and controllability of data management behaviors by obtaining data management instructions. Based on the data management instructions, the software process where the data to be managed is located is identified as the target process, and the first virtual address of the target process is located. It is possible to avoid taking over the target process or interrupting the execution of the target process, and avoid the interference of traditional debugging tools on the running state of the target process. Further, through the virtual address mapping mechanism, that is, the first virtual address → physical address → second virtual address, the spatial isolation limit of virtual addresses between processes is bypassed to reduce the need for code-invasive transformation. Finally, data reading and writing are performed based on the physical memory corresponding to the target virtual address, significantly improving the real-time performance of data operations.

[0042] In other words, the software process where the data to be managed is located is identified as the target process based on the data management instruction. By locating the first virtual address of the target process where the data to be managed is located, it is possible to avoid taking over the target process or interrupting the execution of the target process, thus reducing the interference with the running state of the target process. Moreover, in this application, a mapping relationship can be established in advance among the first virtual address of the data in the target process, the physical memory, and the second virtual address of the management process. In this way, through the virtual address mapping mechanism, this application can reduce the substantial participation of the target process in the data management process of the software, reduce the impact of the process - to - process space isolation limit to a certain extent, and also reduce the invasive modification of the target process source code. When managing the data to be managed, the management process can locate the data to be managed through the mapping relationship using the second virtual address on the management process side, and execute the data management instruction on the data to be managed, thereby reducing the interference with the target process while reducing the data processing overhead. In addition, this application can simplify the interaction between the cumbersome management process and the target process, thus improving the data management efficiency. Therefore, this method can solve the technical problems of large performance overhead and high processing cost, achieving the technical effects of improving data management efficiency, reducing interference with the target process, and reducing data processing overhead. Therefore, it can solve the technical problems of large performance overhead and high processing cost, achieving the technical effects of improving data management efficiency, reducing interference with the target process, and reducing data processing overhead.

[0043] In one embodiment, forming the second virtual address on the management process side paired with the first virtual address includes: obtaining the data to be written into the target process; wherein, the data to be written includes at least one member data instance; writing the member data instance into the physical memory and allocating a first virtual address for it, forming a second virtual address paired with the first virtual address; establishing a mapping relationship between the written physical memory and its first virtual address, and establishing a mapping relationship between the written physical memory and its second virtual address.

[0044] In this embodiment, the data to be written includes at least one group data structure, such as animal. This member data instance has 2 group identifiers, "Dogs" and "Cats", and there are 5 and 3 member data instances respectively in the group identifiers. The address of the animal group data structure can be obtained through the entry identifier main. This animal group data structure occupies one line on the TUI and is displayed as "animals", and its address is 0x28000. Its algorithm code can be:

[0045] define animal{

[0046] 5 stdog “Dogs”

[0047] 3 stcat “Cats”

[0048] }

[0049] define main{

[0050] addr 0x28000 animal “Animals”

[0051] Among them, the member data instance address obtained through the entry identifier main can be obtained through the executable file.

[0052] The executable file is used to record the data source of the member data instance to be displayed, including the address of the member data instance in the target process.

[0053] In this embodiment, because the process memories are isolated from each other and the management process cannot directly read the target process address, the physical memory corresponding to the first virtual address can be mapped into its own process space to form a second virtual address paired with the first virtual address, and a mapping relationship between the written physical memory and its first virtual address is established, and a mapping relationship between the written physical memory and its second virtual address is established.

[0054] In this embodiment, by directly writing the member data instance into the physical memory and allocating a first virtual address on the target process side and a second virtual address on the management process side, the multi-layer data copy overhead of traditional cross-process communication is avoided, and the atomicity and real-time nature of data writing are ensured; at the same time, by establishing a mapping relationship between the physical memory and the dual virtual addresses, the target process and the management process can access the same physical memory without modifying their own memory management logics, which not only ensures zero intrusion of the target process code but also supports both parties to independently operate data according to their respective virtual address spaces, and solves the system stability risks caused by address conflicts or management coupling.

[0055] In one embodiment, allocating a first virtual address for the member data instance includes: configuring the group order of the group data structure to which the member data instance belongs; configuring the position order of the member data instance in the group data structure to which it belongs; fitting the group order and the first address length to obtain a first address; fitting the position order and the second address length to obtain a second address; and adding the starting virtual address, the first address, and the second address as the first virtual address.

[0056] In this embodiment, configuring the group order of the group data structure to which the member data instance belongs and configuring the position order of the member data instance in the group data structure to which it belongs. For example, in the animal group data structure mentioned above, there are 2 group identifiers shown as “Dogs” and “Cats”. When the user enters “Dogs”, there are 5 display items, each of which is a stdog member data instance. When entering “Cats”, there are 3 display items, each of which is a stcat member data instance.

[0057] That is to say, in this embodiment, the number of entry identifiers representing the data structure can be one. The group data structure of the entry identifier attachment level can include multiple ones, and the group data structure can have one or more levels. In this embodiment, the implementation manner including a two-level data structure is exemplified. That is, the first-level group data structure is a data structure of the animal group identifier, and this animal group data structure further includes two sub-level group data structures, namely Dogs and Cats.

[0058] Further, when entering a display of a certain stdog, stdog has 2 member data instances of the int32 type, which are respectively displayed as id and high; when entering a display of a certain stcat, stcat has 2 member data instances of the int32 type, which are respectively displayed as id and weight. Among them, the address of id can be calculated based on the starting address and the offset, and its algorithm code can be:

[0059] define stdog{

[0060] int32 “id”

[0061] int32 “high”

[0062] };

[0063] define stcat{

[0064] int32 “id”

[0065] int32 “weigh”

[0066] };

[0067] Fit the group order and the first address length to obtain the first address; fit the position order and the second address length to obtain the second address; superimpose the starting virtual address, the first address, and the second address as the first virtual address. That is, the first virtual address is calculated based on the starting virtual address and the offset. As Figure 6 shown, Figure 6 is a schematic diagram of the data structure of a software management method provided by an embodiment of the present application, including an animal group data structure. The animal group data structure contains 2 group identifiers displayed as “Dogs” and “Cats”. Among them, “Dogs” contains 5 display items, and each item is a stdog member data instance. “Cats” contains 3 display items, and each item is a stcat member data instance.

[0068] Specifically, for a "Dogs" group identifier, its entry virtual address is 0x28000 + 5 * 8. Among them, 0x28000 is the starting virtual address of the "Animals" group to which "Dogs" belongs, 5 * 8 is the first address, where 5 is the order of the "Animals" group to which "Dogs" belongs, including 5 member data instances, 8 is the size of each instance in this group, 8 * i is the second address, where 8 is the size of each member data instance in this group, and i is the range of the member data instance index. That is, there are 5 member data instances in "Dogs", namely 0 - 4.

[0069] Furthermore, add the starting virtual address, the first address, and the second address together as the first virtual address. That is, the first virtual address of stdog is 0x28000 + 5 * 8 + 8 * i.

[0070] In this embodiment, an efficient and accurate memory management is achieved through a hierarchical address generation mechanism. First, by configuring the group order, such as the data structure hierarchy and the position order, such as the offset of members within the group, the logical relationship of complex data structures is transformed into a quantifiable mathematical rule to ensure the structuring and predictability of the memory layout. Second, by fitting the group order and the address length to generate the first address, fitting the position order to generate the second address, and combining with the starting virtual address for superposition calculation, the rapid positioning of the address of nested arrays is realized, reducing the performance loss of traditional layer-by-layer traversal or hash calculation. At the same time, this regular address allocation mechanism ensures the continuous alignment of memory allocation, reduces the risk of memory fragmentation, and supports seamless expansion when groups or members are dynamically added or deleted.

[0071] In one embodiment, as Figure 7 shown, Figure 7 is a flowchart of another software management method provided by the embodiment of the present application. Taking the second virtual address on the management process side pre-formed and paired with the first virtual address as the target virtual address includes:

[0072] S201: Query the pre-maintained target process page table to obtain the physical memory address mapped to the first virtual address to which the data to be managed belongs;

[0073] In this embodiment, the memory usage of the target process can be obtained through various methods such as IOCTL (device control interface function), VFS (virtual file system), etc., and the target process page table is recorded and formed. For example, a data structure can be designed to represent a section of memory, used to record the starting address and length of the memory. Apply for an instance array to save the usage of the target memory, and the number of member data instances can be set relatively large or adjusted as needed.

[0074] Among them, the number of member data instances is related to the actual situation of the target memory, which can be dynamically adjusted or set to a fixed value, such as 50.

[0075] Its algorithm code can be:

[0076] struct memrange{

[0077] int64 start_addr;

[0078] int64 len;

[0079] };

[0080] struct memrange*usage;

[0081] usage = malloc(MAX_RANGES * sizeof(memrange));

[0082] Among them, start_addr represents the starting virtual address; len represents the length of the starting virtual address, and the length is mainly related to the display method, that is, the data integer and string to be obtained; the starting virtual address and the length of the starting virtual address are used for memory operations.

[0083] Furthermore, obtain the physical address according to the target process page table, and determine the range range corresponding to the first virtual address of the management process by judging start_addr and len, and the range rangeA of the first virtual address in the corresponding target process. For example, 0x28000 + 8 * 0 belongs to range A.

[0084] Both 0x28000 and start_addr in memrange are virtual linear addresses, and the corresponding physical address can be obtained through this virtual linear address.

[0085] S202: Query the pre-maintained virtual device file to obtain the second virtual address that has a mapping relationship with the physical memory address.

[0086] In this embodiment, query the pre-maintained virtual device file to obtain the first virtual address of the target process corresponding to the second virtual address with the same physical address.

[0087] Among them, the virtual device file is used to indirectly implement matching the target process memory.

[0088] Optionally, the target process page table and the virtual device file can be integrated, or the virtual device file includes the target process page table, etc., which is not limited here.

[0089] Specifically, such as Figure 8As shown Figure 8 This is a schematic diagram of address mapping for a software management method provided by an embodiment of the present application. For example, the range range A to which the first virtual address in the target process belongs is mapped to the management process and represented as rangemA; where mA.start_addr corresponds to the same physical address as A.start_addr, and mA.len is equal to A.len. Therefore, if you want to obtain the data of the first virtual address 0x28000 + 8 * 0 in the target process, you can directly read it in the management process by (mA.start_addr + 0x28000 + 8 * 0 - A.start_addr). When a memory access occurs, memory operations are performed through the corresponding physical address.

[0090] In this embodiment, the physical address corresponding to the first virtual address is obtained by directly querying the page table of the target process, bypassing the process takeover and interrupt operations of traditional debugging tools, reducing the context switching and system call overhead. Based on the virtual device file, the physical address is mapped to the second virtual address accessible by the management process, breaking through the virtual address space isolation limit between processes, and realizing zero-copy direct reading and writing of cross-process memory to achieve efficient and secure memory management.

[0091] In one embodiment, the data to be written is obtained, and the display rule file carried by the data to be written is parsed; the entry identifier indicating the data structure in the display rule file is identified; the group data structure and member data instances nested in the entry identifier are extracted, and the entry identifier and member data instances are displayed in the display module according to the nesting relationship.

[0092] Specifically, the rules in the display rule file include the display name, data source, and display method. This rule file can be written and developed as needed and can be written according to actual requirements.

[0093] Among them, the display rule file defines an entry data structure, that is, the entry identifier main mentioned above. You can enter from this entry to obtain the group data structure and member data instances nested in the main structure. Display the data at one level in a list and support deep expansion to solve the visualization problem of data structure display. And for the member data instances, a set of operation rules are defined, such as refresh, assignment, conversion, etc., which allows users to modify the content of the data structure. Further, the member data instances at different levels can be displayed according to the nesting relationship.

[0094] In this embodiment, by parsing the display rule file in the data to be written and identifying the entry identifier, such as the main entry identifier, nested group data structures and member instances are automatically extracted, converting complex data relationships into traversable tree-like logical models, reducing manual parsing costs, and dynamically rendering the display module based on the nested relationships of the display rule file, realizing the hierarchical expansion and visual presentation of the data structure, enabling developers to intuitively track the data flow and state changes, and supporting dynamic expansion, providing a zero-coding, highly-readable visual interaction path for the debugging and operation and maintenance of software systems, achieving the purpose of program control and debugging, and greatly reducing the data structure analysis and processing costs.

[0095] In one embodiment, displaying the entry identifier and member data instances in the display module according to the nested relationship includes: using the entry identifier as the first-level display data; identifying the group identifier of the group data structure and using the group identifier as the display data of the subordinate level of the entry identifier; identifying the member identifier of the member data instance nested in the group data structure and using the member identifier as the display data of the subordinate level of the group identifier.

[0096] Specifically, taking main as the first-level display data, further identifying the sub-levels under "Animals" as mentioned before, such as "Dogs" and "Cats", and using "Dogs" and "Cats" as the display data of the subordinate level of "Animals".

[0097] In this embodiment, the first-level display data is generated with the entry identifier as the root node, the group identifier is parsed downward as the second-level node, and the member identifier is further expanded as the leaf node, converting the complex nested relationship into a tree-like visual hierarchy, enabling developers to intuitively locate the target data, such as clicking main→animal→Dogs[0]→high to directly reach the memory field.

[0098] In one embodiment, before displaying the display data in the display module according to the subordinate level relationship therebetween includes: determining whether the display data meets the display conditions; wherein, the display conditions include that the display data is mapped to physical memory and is equipped with a first virtual address and a second virtual address. In response to the display data meeting the display conditions, it is determined that the display data can be displayed in the display module.

[0099] In this embodiment, as Figure 9 shown, Figure 9 is a schematic flow chart of another software management method provided by the embodiments of the present application.

[0100] S301: Parse the display rule file carried by the data to be written.

[0101] In this embodiment, the display rule file mainly includes a display name, a data source, and a display method, and the rules are clarified in a hierarchical form. The specific method of parsing and displaying data is obtained by parsing the display rule file.

[0102] S302: Use the entry identifier as the first-level display data.

[0103] In this embodiment, the entry identifier defined in the file can be obtained through the parsing of the display rule file in S301, that is, main described above. Data display starts from this entry.

[0104] S303: Superimpose the starting virtual address, the first address, and the second address as the first virtual address.

[0105] In this embodiment, the first virtual address of any member data instance is obtained by acquiring the starting virtual address, the first address, and the second address of the member data instance. Among them, its virtual address is obtained through the display rule file, the first address is obtained through the group order of the data structure of the group to which the member data instance belongs, and the second address is obtained through the position order of the member data instance in the data structure of the group to which it belongs.

[0106] S304: Determine whether the first virtual address is valid.

[0107] If it meets the condition, execute S305 to determine whether the display data is mapped to physical memory. If not, end this process.

[0108] In this embodiment, it is determined whether the first virtual address obtained by the execution of S303 is valid.

[0109] S305: Determine whether the display data is mapped to physical memory.

[0110] If so, execute S306 to allocate the first virtual address. If not, execute S307 to parse the first virtual address of the data to be managed in the target process.

[0111] In this embodiment, it is determined whether the first virtual address of the display data has been mapped to physical memory. If it has been mapped, the mapping between the physical address and the second virtual address can be performed. If not, the mapping between the first virtual address of the display data and physical memory can be completed first to form a mapping relationship among the mappings of the first virtual address, the physical address, and the second virtual address.

[0112] S306: Allocate the first virtual address.

[0113] In this embodiment, the specific process of allocating the first virtual address includes configuring the group order of the group data structure to which the member data instance belongs and the position order of the group data structure to which it belongs. By fitting, the first address and the second address are obtained, and the starting virtual address, the first address, and the second address are superimposed as the first virtual address. The specific process has been described above and will not be elaborated here.

[0114] S307: Analyze the first virtual address of the data to be managed in the target process.

[0115] In this embodiment, the specific process of analyzing the data to be managed has been described in S102 above and will not be elaborated here.

[0116] S308: Use the second virtual address on the management process side that has been pre-formed and paired with the first virtual address as the target virtual address.

[0117] In this embodiment, the specific process of analyzing the data to be managed has been described in S103 above and will not be elaborated here.

[0118] S309: Access the physical memory mapped by the target virtual address to obtain the data to be managed.

[0119] In this embodiment, when a memory access occurs, the memory operation is performed by finding the physical address.

[0120] S310: Determine whether the displayed data meets the display conditions.

[0121] If it meets the conditions, then execute S310 to identify the member identifier of the member data instance nested in the group data structure; if it does not meet the conditions, then execute S303 to superimpose the starting virtual address, the first address, and the second address as the first virtual address.

[0122] In this embodiment, first determine whether there is still data to be displayed on this layer, that is, through the main entry point, layer by layer, obtain the member data instances of this layer, and determine whether the displayed data of this layer has been displayed according to the data management instruction. If the displayed data of this layer has been displayed, then determine whether the data management instruction requires continuing to display the data of the next layer. If there is still data to be displayed on this layer, then obtain the first virtual address of the data to be displayed.

[0123] S311: Determine whether to display the displayed data of the lower layer.

[0124] If so, then execute S301; if not, then end this process.

[0125] In this embodiment, if there is still data to be displayed in the lower layer, then according to the display rule file, obtain the display rules of the data to be displayed in the next layer. If there is no data to be displayed in the lower layer, it means that the corresponding displayed data has been displayed according to the data management instruction.

[0126] In this embodiment, by verifying whether the display data has been successfully mapped to physical memory and completing the configuration of the first virtual address on the target process side and the second virtual address on the management process side, unmapped addresses are intercepted, avoiding the risk of process crashes or data leaks caused by illegal memory access. This conditional determination mechanism ensures that the display module only processes operable and valid data, and provides highly stable and reliable visual output for scenarios such as real-time monitoring and debugging through a visual interface, improving the efficiency of human-computer interaction.

[0127] In addition, in this embodiment, it is also possible to determine whether the display data belongs to high-frequency display data by means of a preset display threshold. If the access count of the display data is higher than the set display threshold, the display data is considered to be high-frequency display data, and a long-term mapping of the first virtual address and the second virtual address of the display data is set. By establishing a long-term and stable dual virtual address mapping for high-frequency access data, the system calls for repeated mapping operations and the overhead of updating the target process page table can be reduced, reducing data access latency.

[0128] From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0129] The foregoing software management method can solve the technical problems of large performance overhead and high processing cost, achieving the technical effects of improving data management efficiency, reducing interference with the target process, and reducing data processing overhead.

[0130] Current software is becoming increasingly widely applicable in life. From mobile applications to complex systems in key fields such as industrial control and aerospace, the functions and scale of software are constantly expanding. Software is no longer a simple collection of functions, but a huge system composed of a large number of data structures and complex algorithms intertwined. The interaction between data structures and algorithms also makes software behavior extremely complex. This complexity poses huge challenges in the development, debugging, and maintenance of software, and it is difficult for developers to accurately grasp the running state and behavioral logic of software.

[0131] Data structure is an important part of software, and its core concept in computer science is to organize, store, and manage data. Data structures are like the "infrastructure" of the digital world, with their influence everywhere, from mobile phone apps to supercomputers, from gene sequencing to space exploration. Efficient access to and modification of data structures can improve the performance, readability, and maintainability of software.

[0132] By obtaining the content of the data structure, information in multiple aspects such as software running status, performance analysis, debugging information, and data analysis can be obtained. This information is of great significance for optimizing software performance, locating and fixing problems, and supporting decision-making. For example, by obtaining the current value, type, and scope of variables to check whether the values of variables meet expectations and understand the current state of the software; by obtaining performance statistics to understand the performance status in real time and evaluate performance bottlenecks, etc.

[0133] Specifically, the modification of the memory data corresponding to the data structure can be regarded as a debugging technique and an optimization technique, which can have an impact on program behavior. It provides immediacy, flexibility, and precision for development and debugging. By directly modifying the memory, developers can quickly verify hypotheses, fix problems, optimize performance, and even implement some advanced functions. It has the following three advantages:

[0134] In terms of quick verification, test data can be dynamically injected. Without modifying the code, boundary values, outlier values, or special scenario data can be injected in real time to quickly verify the program's fault tolerance logic. Real-time parameter adjustment, directly modify configuration parameters, and observe the function changes without restarting the program to accelerate iterative verification. Condition coverage enhancement, force the triggering of uncovered branch logic, and break through the code coverage bottleneck.

[0135] In terms of improving debugging efficiency, incorrect data in memory can be directly corrected during the debugging process, skipping the cumbersome process of code modification - compilation - restart. By actively modifying the memory data to trigger unexpected behaviors, verify the robustness of the exception handling mechanism.

[0136] In terms of performance verification, cache data or intermediate results of algorithms can be modified to quickly evaluate the effects of optimization strategies. By branch control, different algorithm models can be dynamically switched to obtain the optimal solutions for performance and stability, etc.

[0137] Through the Ptrace (Process Trace) system, Ptrace is a widely used technology in Unix-like systems, mainly implemented through the Ptrace system call for process tracking and debugging. It allows one process (usually called the "tracer" or "debugger") to monitor and control the execution of another process (called the "traced" or "target process"), providing comprehensive control over the target process. Through the Ptrace debugger, the memory of the target process can be read and modified. Ptrace provides rich functions, but the use of Ptrace incurs significant performance overhead. Each time the target process makes a system call or receives a signal, a Ptrace event is triggered, resulting in frequent context switches and switches between the kernel mode and the user mode, affecting the execution efficiency of the target process. The interface of Ptrace is relatively complex and requires certain experience and skills to use. The debugger needs to handle a large number of details, such as signal transmission, process state management, memory and register operations, etc., increasing the difficulty of development and maintenance.

[0138] Specifically, the GDB (GNU Debugger) debugging tool is adopted. GDB is a debugging tool in the GNU project. It mainly controls the child process based on the Ptrace system call and can be used to read the content of data structures. The specific workflow is mainly divided into establishing a debugging relationship and reading the content of data structures. Among them, there are mainly 2 ways to establish a debugging relationship:

[0139] 1. Start a new process: GDB creates a child process through fork(), and the child process declares to be traced by GDB using PTRACE_TRACEME (anti-debugging instruction), and then calls execv() (process replacement instruction) to load the target process. The general process is as Figure 1 shown, Figure 1 It is a timing diagram of a software management method provided by an embodiment of this application.

[0140] 2. Attach to an existing process: Use attach <pid>The command causes GDB to take over the running target process by means of PTRACE_ATTACH (trace instruction). The general process is as Figure 2 shown, Figure 2 which is a timing diagram of another software management method provided by an embodiment of the present application.

[0141] Obtaining the data structure content includes reading the data structure content using the command line interface of GDB. The command will be further parsed by GDB and the data reading will be completed through the Ptrace system call. Also, due to certain limitations on the amount of data read by the Ptrace system call, multiple loops are required when the amount of data is large. The general process is as Figure 3 shown, Figure 3 which is a timing diagram of another software management method provided by an embodiment of the present application.

[0142] According to the background art, in the prior art, for the target process to become an attached process of GDB, the interaction between the target process and the system will be taken over by GDB by default, changing the original behavior of the target process. During the debugging process, it is also inevitable to interrupt the normal operation of the target process, which is unacceptable for a real-time process with a strict timer inside. When the target process pauses, but the clock cannot be synchronized and paused, this will lead to clock timeout, bringing more complex problems.

[0143] Since GDB implements the debugging function through the Ptrace system call, this will bring certain performance overhead. Especially in the case of debugging large programs or requiring frequent memory reading, writing, and signal processing, it will significantly reduce the running speed of the program. For example, multiple Ptrace system calls are required to complete the requests for reading and writing data structure content. Although in some high versions, system calls with less overhead may be used, this will bring additional memory application and copying, increasing the system pressure. In addition, the Ptrace mechanism may cause problems in thread scheduling and synchronization in a multi-threaded environment, further affecting the performance and stability of the program. The command line mode of GDB has certain advantages in terms of flexibility and automation, but lacks an intuitive visual interface. When debugging complex programs, it is difficult for developers to quickly view the overall structure of the program and the relationships between variables.

[0144] In addition, the process actively writes a defined data structure to a file or other cache medium, and users can read it with the help of tools. The implementation is relatively simple, but the application scenario is very limited and only suitable for obtaining the content of a single and simple data structure.

[0145] In one embodiment, as Figure 10 shown, Figure 10 which is a schematic structural diagram of a software management system provided by an embodiment of the present application. The software management system may include an interaction module 21 and a management module 22, and the management module is connected to the interaction module.

[0146] The management module 22 includes a management process for implementing the steps of the software management method described in the foregoing S101 - S104, which will not be elaborated herein again.

[0147] Furthermore, the management module 22 may include a display control unit and a memory read - write unit. The display control unit is used to implement the relevant software management method for displaying the data structure on the display module, and the memory read - write module is used to implement the relevant software management method related to the first virtual address, the second virtual address, and the physical memory, which will not be elaborated herein.

[0148] Each module in the above - mentioned software management system can be implemented in whole or in part by software, hardware, or a combination thereof. The above - mentioned modules can be embedded in the processor of the electronic device in hardware form or be independent of it, or be stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each of the above - mentioned modules.

[0149] In one embodiment, an electronic device is provided. The electronic device can be a server, and its internal structure diagram can be as Figure 11 shown. The electronic device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non - volatile storage medium and an internal memory. The non - volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non - volatile storage medium. The database of the electronic device is used to store software management data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a software management method.

[0150] Those skilled in the art can understand that Figure 11 the structure shown in

[0151] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0152] The management process obtains a data management instruction; identifies the software process where the data to be managed is located as the target process, and parses the first virtual address of the data to be managed in the target process; forms in advance a second virtual address on the management process side paired with the first virtual address as the target virtual address;

[0153] Accesses the physical memory mapped by the target virtual address to obtain the data to be managed, and executes the data management instruction on it.

[0154] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk, or optical disc and other media that can store computer programs.

[0155] Those skilled in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to memory, storage, database, or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0156] It can also be further realized that the units and algorithm steps of each example described in combination with the embodiments disclosed in this text can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to 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. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0157] The above has introduced in detail a software management method, system, device, and storage medium provided by this application. Specific examples have been used in this text to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of this application, several improvements and modifications can still be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.< / pid>

Claims

1. A software management method, characterized in that, Including: The management process obtains a data management instruction; Identifies the software process where the data to be managed is located as the target process, and parses the first virtual address of the data to be managed in the target process; Uses the second virtual address on the management process side that is pre-formed and paired with the first virtual address as the target virtual address; accesses the physical memory mapped by the target virtual address to obtain the data to be managed, and executes the data management instruction on it.

2. The software management method according to claim 1, wherein The forming of the second virtual address on the management process side that is paired with the first virtual address includes: Obtains the data to be written to the target process; wherein, the data to be written includes at least one member data instance; Writes the member data instance into physical memory and assigns a first virtual address to it, forming a second virtual address paired with the first virtual address; Establishes a mapping relationship between the written physical memory and its first virtual address, and establishes a mapping relationship between the written physical memory and its second virtual address.

3. The software management method according to claim 2, characterized in that The assigning of the first virtual address to it includes: configuring the group order of the group data structure to which the member data instance belongs; Configuring the position order of the member data instance in the group data structure to which it belongs; Fitting the group order and the first address length to obtain a first address; Fitting the position order and the second address length to obtain a second address; Adding the starting virtual address, the first address, and the second address as the first virtual address.

4. The software management method according to claim 1, wherein The using of the second virtual address on the management process side that is pre-formed and paired with the first virtual address as the target virtual address includes: Querying the pre-maintained page table of the target process to obtain the physical memory address that has a mapping relationship with the first virtual address to which the data to be managed belongs; Querying the pre-maintained virtual device file to obtain the second virtual address that has a mapping relationship with the physical memory address.

5. The software management method according to claim 1, characterized in that The software management method further includes: Obtaining the data to be written, and parsing the display rule file carried by the data to be written; Identifying the entry identifier that identifies the data structure in the display rule file; Extracting the group data structure and the member data instance nested in the entry identifier, and displaying the entry identifier and the member data instance in the display module according to the nesting relationship.

6. The software management method according to claim 5, wherein The displaying of the entry identifier and the member data instance in the display module according to the nesting relationship includes: Using the entry identifier as the first-level display data; Identifying the group identifier of the group data structure, and using the group identifier as the display data of the subordinate level of the entry identifier; Identifying the member identifier of the member data instance nested in the group data structure, and using the member identifier as the display data of the subordinate level of the group identifier.

7. The software management method according to claim 6, characterized in that Before displaying the display data according to the subordinate level relationship between them in the display module, it includes: Judging whether the display data meets the display conditions; wherein, the display conditions include that the display data is mapped to physical memory, and is equipped with the first virtual address and the second virtual address; In response to the display data meeting the display conditions, determining that the display data can be displayed in the display module.

8. A software management system, characterized in that, The software management system includes: An interaction module for obtaining data management instructions; A management module connected to the interaction module; the management module includes a management process for implementing the steps of the software management method according to any one of claims 1 to 7.

9. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the software management method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the software management method according to any one of claims 1 to 7 when executed by a processor.