A Real-Time Container Memory Management Method and System for Operating Systems
By building memory management feature sets and strategies, the overall memory allocation of system users in the operating system's real-time container is realized, solving the problems of changes in memory allocation requirements and differences in delay tolerance, improving the rationality and precision of memory management, avoiding delays, and meeting more user needs.
Patent Information
- Application Number
- CN202510585547.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-05-08
AI Technical Summary
The prior art has failed to effectively solve the problems of low memory usage and program operation delay caused by changes in memory allocation requirements and differences in delay tolerance in operating system multi-user real-time containers, especially when memory resources are tight, it is impossible to rationally and intelligently manage memory resources.
By obtaining the program operation requirements and delay tolerance levels of system users, a memory management feature set is built, a system user combination policy and memory allocation strategy is generated, overall memory allocation is performed to avoid delays caused by separate memory allocation, and free memory for users when resources are sufficient, so as to maximize memory utilization when stressed.
It improves the rationality and intelligence of memory management in multi-user scenarios of the operating system, improves the precision of memory allocation, avoids program operation delays, and meets the memory needs of more users.
Smart Images

Figure CN120086028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of operating system memory management, and particularly to a method and system for real-time container memory management in an operating system. Background Art
[0002] Multi-user real-time container memory management in an operating system refers to the fine-grained allocation, isolation, and dynamic regulation of memory resources for tasks or services with extremely high real-time requirements through container technology in an operating system that supports multiple users (such as different tenants, process groups, or application clusters). Its core goal is to ensure that multiple real-time containers can meet their respective performance requirements (such as low latency and high throughput) when sharing physical memory, and at the same time avoid task failures or system instability caused by resource competition.
[0003] In practical applications, this process will face the following limitations: Each user has different program running requirements at different times, which will lead to changes in memory allocation requirements. If a fixed memory allocation strategy is adopted, the memory utilization rate will be reduced, while dynamic memory allocation requires real-time and accurate monitoring or prediction of changes in users' memory requirements. If the accuracy of dynamic memory allocation is insufficient (for example, when memory allocation is insufficient, the program needs to call data from the disk), it will affect the real-time performance of the program; at the same time, each user runs different programs at different times, and there are differences in latency tolerance. Considering the impact of latency tolerance during memory allocation can increase the upper limit of system memory usage at the expense of the user experience within the tolerable range (for example, when memory resources are tight, considering latency tolerance can slightly reduce the required memory allocated to users and increase the number of concurrently running users), alleviating the memory tension problem to a certain extent. Existing solutions do not consider the above limitations.
[0004] Therefore, how to improve the rationality and intelligence of memory management in a multi-user scenario of an operating system, and at the same time improve the fineness of memory allocation while satisfying the memory requirements of more users as much as possible, is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method and system for real-time container memory management in an operating system, aiming to solve at least one of the above technical problems.
[0006] To achieve the above purpose, the present invention provides a method for real-time container memory management in an operating system, including the following steps:
[0007] Obtain the program running requirements of several system users during the target memory management period; wherein, the program running requirements include the program running type and the program running period;
[0008] Determine the memory requirement size and latency tolerance level of each system user within each minimum management period during the program running period according to the program running type, and construct a memory management feature set based on the memory requirement size and latency tolerance level;
[0009] Construct a memory management association list including the memory management feature groups of each system user in different minimum management periods in the order of the position of each minimum management period in the target memory management period;
[0010] Query the memory allocation resources of the operating system during the target memory management period, consider the memory requirement size and latency tolerance level corresponding to the memory management feature groups of each system user in each different minimum management period in the memory management association list, and generate a system user combination strategy and a system memory allocation strategy;
[0011] Based on the system user combination strategy and the system memory allocation strategy, execute the combination and memory allocation strategies for each system user group during the target memory management period.
[0012] Optionally, the steps for obtaining the program running requirements of several system users during the target memory management period specifically include:
[0013] Obtain the program running reservation information sent by each system user before the target memory management period for the target memory management period; wherein, the program running reservation information includes the program running identifier and the program running period of each reserved running program;
[0014] Based on the program running identifier of each reserved running program, query the program running type of the reserved running program, and use the program running type and the program running period to determine the program running requirements of several system users during the target memory management period.
[0015] Optionally, the steps for obtaining the program running requirements of several system users during the target memory management period specifically include:
[0016] Obtain the program running information of several system users in the past N target memory management periods; wherein, the program running information includes the program running type and the program running period of each system user;
[0017] Encode the program running type and the program running period of each system user in each past target memory management period, and combine several associated features affecting the program running type and the program running period to construct a program running requirement training sample;
[0018] Use the program running requirement training sample to train the initially constructed convolutional neural network, and when the training reaches the target number of times or the training converges, obtain a program running requirement prediction model;
[0019] The program running demand prediction samples are constructed based on the program running demand prediction model and a plurality of associated features corresponding to the target memory management period, and the program running demands of a plurality of system users in the target memory management period are predicted.
[0020] Optionally, according to the program running type, determining the memory requirement size of each system user in each minimum management cycle during the program running period specifically includes:
[0021] According to the program running type, query the running data information recorded in the historical running database for the running program corresponding to each program running type of each system user;
[0022] Extract the memory call value curve of the running program corresponding to each program running type in the running data information, add up the values at the same time point on the memory call value curve of each program running type, and use the maximum value of the interval after adding and summing according to each minimum management cycle as the memory demand size within each minimum management cycle.
[0023] Optionally, the step of determining the delay tolerance level of each system user in each minimum management period during the program running period according to the program running type specifically includes:
[0024] According to the program running type, matching the delay tolerance level of the running program corresponding to each program running type of each system user in a program running type and delay tolerance level comparison mapping table;
[0025] The lowest tolerance level among the delay tolerance levels of the running programs corresponding to all program running types within the interval of each minimum management cycle is used as the delay tolerance level of each minimum management cycle.
[0026] Optionally, based on the memory requirement size and latency tolerance level, a memory management feature set is constructed, specifically including:
[0027] The memory requirement size and delay tolerance level of each system user in each minimum management cycle are spliced together, and the spliced features are used as a memory management feature group;
[0028] The memory management feature groups of all system users in each minimum management period are summarized to construct the memory management feature set of each system user in each minimum management period.
[0029] Optionally, the step of constructing a memory management association list including the memory management feature set of each system user in different minimum management cycles according to the position sequence of each minimum management cycle in the target memory management period specifically includes:
[0030] Analyze the position order of each minimum management cycle among several minimum management cycles in the target memory management period, and extract the memory management feature set of each minimum management cycle;
[0031] According to the position order of each minimum management cycle, store the memory management feature sets corresponding to several minimum management cycles of each system user into the corresponding list, and construct a memory management association list including the memory management feature sets of each system user in different minimum management cycles.
[0032] Optionally, query the memory allocation resources of the operating system in the target memory management period, consider the memory requirement size and delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list, and generate a system user combination and merging strategy and a system memory allocation strategy step, specifically including:
[0033] Query the memory allocation resources of the operating system in the target memory management period; wherein, the memory allocation resources include the memory allocation size of each minimum management cycle in the target memory management period;
[0034] Consider the memory requirement size and delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list, perform system user combination and merging and memory allocation for each minimum management cycle of several system users in the target memory management period. Take that the sum of the memory requirement sizes of all system user groups in each minimum management cycle is less than the memory allocation size of the operating system in each minimum management cycle as the first constraint condition, take that the ratio of the memory requirement size of each system user in each system user group to the sum of the memory requirement sizes of all system users in the corresponding minimum management cycle is less than the preset ratio threshold corresponding to the delay tolerance level of each system user as the second constraint condition, and take that the number of changes in the system user combination between all adjacent two minimum management cycles in the target memory management period is minimized as the optimization objective, and optimize and solve the system user combination and merging strategy and the system memory allocation strategy;
[0035] Among them, the system user combination and merging strategy includes the system user combination scheme of each minimum management cycle of several system users in the target memory management period, and the system memory allocation strategy includes the memory allocation scheme provided by the operating system for each system user group in each minimum management cycle.
[0036] Optionally, based on the system user combination and merging strategy and the system memory allocation strategy, in the target memory management period, execute the combination and memory allocation strategy steps for each system user group, specifically including:
[0037] Extract the system user combination plan for several system users in each minimum management cycle during the target memory management period and the memory allocation plan provided by the operating system for each system user group in each minimum management cycle in the system memory allocation policy;
[0038] Use the system user combination plan to perform the combination for each system user group in each minimum management cycle during the target memory management period, and use the memory allocation plan to perform the memory allocation for each system user group in each minimum management cycle during the target memory management period.
[0039] In addition, to achieve the above object, the present invention also provides an operating system real-time container memory management system, including:
[0040] An acquisition module, configured to acquire the program running requirements of several system users during the target memory management period; wherein, the program running requirements include the program running type and the program running period;
[0041] A determination module, configured to determine the memory requirement size and the delay tolerance level of each system user in each minimum management cycle during the program running period according to the program running type, and construct a memory management feature set based on the memory requirement size and the delay tolerance level;
[0042] A construction module, configured to construct a memory management association list including the memory management feature groups of each system user in different minimum management cycles according to the position order of each minimum management cycle during the target memory management period;
[0043] A query module, configured to query the memory allocation resources of the operating system during the target memory management period, and generate a system user combination policy and a system memory allocation policy in consideration of the memory requirement size and the delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list;
[0044] An execution module, configured to execute the combination and memory allocation policies for each system user group during the target memory management period based on the system user combination policy and the system memory allocation policy.
[0045] The beneficial effects of the present invention are as follows: A real-time container memory management method and system for an operating system are proposed. By combining different minimum management cycles of several system users during the target memory management period and performing overall memory allocation for each system user group instead of individual memory allocation for each system user, redundant memory allocation can be provided for each system user, avoiding the problem of program running delay caused by calling data from the disk due to insufficient memory allocation accuracy. At the same time, when the memory resources are sufficient, the memory can be released as much as possible for users to use, and when the memory resources are tight, the memory can be utilized to the maximum, improving the rationality and intelligence of memory management in the multi-user scenario of the operating system, and improving the memory allocation fineness while satisfying the memory requirements of more users as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flowchart of the real-time container memory management method for the operating system of the present invention;
[0047] Figure 2 is a structural diagram of the real-time container memory management system for the operating system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0049] An embodiment of the present invention provides a real-time container memory management method for an operating system, referring to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the real-time container memory management method for the operating system of the present invention.
[0050] In this embodiment, a real-time container memory management method for an operating system includes the following steps:
[0051] S100: Obtain the program running requirements of several system users during the target memory management period; wherein, the program running requirements include the program running type and the program running period;
[0052] S200: Determine the memory requirement size and delay tolerance level of each system user within each minimum management cycle during the program running period according to the program running type, and construct a memory management feature set based on the memory requirement size and the delay tolerance level;
[0053] S300: Construct a memory management association list including memory management feature groups of each system user in different minimum management cycles according to the position order of each minimum management cycle during the target memory management period;
[0054] S400: Query the memory allocation resources of the operating system during the target memory management period, consider the memory requirements and latency tolerance levels corresponding to the memory management feature groups of each different minimum management cycle of each system user in the memory management association list, and generate a system user combination strategy and a system memory allocation strategy;
[0055] S500: Based on the system user combination strategy and the system memory allocation strategy, during the target memory management period, execute the combination and memory allocation strategies for each system user group.
[0056] It should be noted that in practical applications, the multi-user real-time container memory management of the operating system will face the following limitations: each user has different program running requirements at different times, which will lead to changes in memory allocation requirements. If a fixed memory allocation strategy is adopted, the memory utilization rate will be reduced. While adopting dynamic memory allocation requires real-time and accurate monitoring or prediction of the memory requirement changes of users. If the accuracy of memory dynamic allocation is insufficient (for example, when the memory allocation is insufficient, the program needs to call data from the disk for operation), it will affect the real-time performance of the program operation. At the same time, each user runs different programs at different times and has different latency tolerance levels. Considering the impact of latency tolerance during memory allocation can increase the upper limit of system memory usage at the cost of sacrificing the user experience within the tolerable range (for example, when memory resources are tight, considering latency tolerance can increase the number of concurrently running users by slightly reducing the required memory allocated to users), alleviating the memory tension problem to a certain extent. The existing solutions do not consider the above limitations.
[0057] To solve the above problems, in this embodiment, the memory management of the operating system is guided by solving the system user combination strategy and the system memory allocation strategy. The system user combination is performed for different minimum management cycles of several system users during the target memory management period, and the overall memory is allocated to each system user group instead of allocating memory to each system user separately. It can provide redundant memory allocation for each system user, avoid the program operation delay problem caused by calling data from the disk due to insufficient memory allocation accuracy. At the same time, when the memory resources are sufficient, it can release the memory for users to use as much as possible, and when the memory resources are tight, it can maximize the use of memory, improving the rationality and intelligence of the memory management in the multi-user scenario of the operating system, and improving the memory allocation fineness while satisfying the memory requirements of more users as much as possible.
[0058] In a preferred embodiment, the step of obtaining the program running requirements of several system users during the target memory management period specifically includes:
[0059] S110: Obtain the program running reservation information for the target memory management period sent by each system user before the target memory management period; wherein, the program running reservation information includes the program running identifier and the program running period of each reserved running program.
[0060] S120: Based on the program running identifier of each reserved running program, query the program running type of the reserved running program, and use the program running type and the program running period to determine the program running requirements of several system users during the target memory management period.
[0061] In another optional embodiment, the step of obtaining the program running requirements of several system users during the target memory management period specifically includes:
[0062] S130: Obtain the program running information of several system users in the past N target memory management periods; wherein, the program running information includes the program running type and the program running period of each system user.
[0063] S140: Encode the program running type and the program running period of each system user in each past target memory management period, and combine several associated features that affect the program running type and the program running period to construct a program running requirement training sample.
[0064] S150: Use the program running requirement training sample to train the initially constructed convolutional neural network. When the training reaches the target number of times or the training converges, obtain a program running requirement prediction model.
[0065] S160: Predict the program running requirements of several system users during the target memory management period according to the program running requirement prediction sample constructed based on the program running requirement prediction model and several associated features corresponding to the target memory management period.
[0066] In this embodiment, to obtain the program running requirements of several system users during the target memory management period, on the one hand, it can be extracted and analyzed from the program running reservation information provided by each system user in the form of reservation, and on the other hand, it can be predicted by referring to the program running and usage rules of each system user in the historical memory management period and using the program running requirement prediction model. The two methods can adapt to the program running requirement acquisition in different program application scenarios.
[0067] In a preferred embodiment, according to the program running type, to determine the memory requirement size of each system user within each minimum management cycle during the program running period, specifically includes:
[0068] S210: According to the program running type, query the running data information of the running program corresponding to each program running type of each system user recorded in the historical running database;
[0069] S220: Extract the memory call value curve of the running program corresponding to each program running type in the running data information, add up the values at the same time point on the memory call value curve of each program running type, and use the maximum value of the interval after adding and summing according to each minimum management cycle as the memory demand size within each minimum management cycle.
[0070] Furthermore, according to the program running type, the step of determining the delay tolerance level of each system user in each minimum management period during the program running period specifically includes:
[0071] S230: matching the delay tolerance level of the running program corresponding to each program running type of each system user in a program running type and delay tolerance level comparison mapping table according to the program running type;
[0072] S240: taking the lowest tolerance level among the delay tolerance levels of the running programs corresponding to all program running types within the interval of each minimum management cycle as the delay tolerance level of each minimum management cycle.
[0073] In this embodiment, after obtaining the program running type, the running data information recorded in the historical running database of the running program corresponding to each program running type of each system user is queried, and the values at the same time point on the memory call value curve of each program running type are added and summed, and the memory requirement size of each minimum management cycle is determined according to the interval maximum value selection principle; at the same time, using the program running type, the delay tolerance level of the running program corresponding to each program running type of each system user can be matched in the program running type and delay tolerance level comparison mapping table, and the delay tolerance level of each minimum management cycle is determined according to the minimum tolerance level selection principle.
[0074] In a preferred embodiment, based on the memory requirement size and the delay tolerance level, the step of constructing a memory management feature set specifically includes:
[0075] S250: performing feature splicing on the memory requirement size and delay tolerance level of each system user in each minimum management cycle, and using the spliced features as a memory management feature group;
[0076] S260: Summarize the memory management feature groups of all system users in each minimum management period, and construct a memory management feature set of each system user in each minimum management period.
[0077] Further, according to the position order of each minimum management cycle in the target memory management period, the step of constructing a memory management association list including the memory management feature sets of each system user in different minimum management cycles specifically includes:
[0078] S310: Analyze the position order of each minimum management cycle among several minimum management cycles in the target memory management period, and extract the memory management feature set of each minimum management cycle;
[0079] S320: According to the position order of each minimum management cycle, store the memory management feature sets corresponding to several minimum management cycles of each system user into the corresponding list, and construct a memory management association list including the memory management feature sets of each system user in different minimum management cycles.
[0080] In this embodiment, after obtaining the memory requirement size and latency tolerance level of each minimum management cycle, perform feature splicing on the memory requirement size and latency tolerance level, construct a memory management feature set, and construct a memory management association list according to the position order of each minimum management cycle, providing data support for subsequent generation of system user combination strategies and system memory allocation strategies.
[0081] In a preferred embodiment, the steps of querying the memory allocation resources of the operating system in the target memory management period, considering the memory requirement size and latency tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list, and generating a system user combination strategy and a system memory allocation strategy specifically include:
[0082] S410: Query the memory allocation resources of the operating system in the target memory management period; wherein, the memory allocation resources include the memory allocation size of each minimum management cycle in the target memory management period;
[0083] S420: Consider the memory requirement sizes and latency tolerance levels corresponding to the memory management feature groups of each different minimum management period in the memory management association list for each system user, and perform system user combination and memory allocation for each minimum management period of several system users within the target memory management period. Take the sum of the memory requirement sizes of all system user groups in each minimum management period being less than the memory allocation size of the operating system in each minimum management period as the first constraint condition, and take the ratio of the memory requirement size of each system user in each system user group to the sum of the memory requirement sizes of all system users in the corresponding minimum management period being less than the preset ratio threshold corresponding to the latency tolerance level of each system user as the second constraint condition. Take the minimum number of changes in the system user combination among all adjacent two minimum management periods in the target memory management period as the optimization objective, and optimize and solve the system user combination strategy and the system memory allocation strategy;
[0084] Among them, the system user combination strategy includes the system user combination scheme for each minimum management period of several system users within the target memory management period, and the system memory allocation strategy includes the memory allocation scheme provided by the operating system for each system user group in each minimum management period.
[0085] In this embodiment, by considering the memory requirement sizes and latency tolerance levels corresponding to the memory management feature groups of each different minimum management period in the memory management association list for each system user, constructing a constraint condition set with the ratio of memory allocation resources to memory requirements and taking the minimum number of memory allocation adjustments as the optimization objective, and using an optimization algorithm to optimize and solve the system user combination strategy and the system memory allocation strategy, and then guiding the operating system to perform system user combination and memory allocation during the target memory management period. Thus, by combining several system users in different minimum management periods within the target memory management period, and performing overall memory allocation for each system user group instead of individual memory allocation for each system user, redundant memory allocation can be provided for each system user, avoiding the program running delay problem caused by insufficient memory allocation accuracy and calling data from the disk. At the same time, when the memory resources are sufficient, the memory can be released as much as possible for users to use, and when the memory resources are tight, the memory can be utilized to the maximum, improving the rationality and intelligence of memory management in the multi-user scenario of the operating system, and enhancing the memory allocation fineness while satisfying the memory requirements of more users as much as possible.
[0086] In a preferred embodiment, based on the system user combination strategy and the system memory allocation strategy, during the target memory management period, execute the steps of the combination and memory allocation strategy for each system user group, specifically including:
[0087] S510: Extract the system user combination plan for several system users in each minimum management cycle during the target memory management period in the system user combination and merging policy, and the memory allocation plan provided by the operating system for each system user group in each minimum management cycle in the system memory allocation policy;
[0088] S520: Use the system user combination plan to perform the combination for each system user group in each minimum management cycle during the target memory management period, and use the memory allocation plan to perform the memory allocation for each system user group in each minimum management cycle during the target memory management period.
[0089] In this embodiment, after obtaining the final system user combination and merging policy and the system memory allocation policy, according to the system user combination plan in the system user combination and merging policy and the memory allocation plan in the system memory allocation policy, perform the memory allocation for each system user group during the target memory management period.
[0090] Refer to Figure 2 , Figure 2 which is the structural block diagram of the embodiment of the real-time container memory management system of the operating system of the present invention.
[0091] As Figure 2 shown, the real-time container memory management system of the operating system proposed in the embodiment of the present invention includes:
[0092] An acquisition module 10, configured to acquire the program running requirements of several system users during the target memory management period; wherein, the program running requirements include the program running type and the program running period;
[0093] A determination module 20, configured to determine the memory requirement size and the delay tolerance level of each system user in each minimum management cycle during the program running period according to the program running type, and construct a memory management feature set based on the memory requirement size and the delay tolerance level;
[0094] A construction module 30, configured to construct a memory management association list including the memory management feature groups of each system user in different minimum management cycles in the order of the positions of each minimum management cycle during the target memory management period;
[0095] A query module 40, configured to query the memory allocation resources of the operating system during the target memory management period, and generate a system user combination and merging policy and a system memory allocation policy in consideration of the memory requirement size and the delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list;
[0096] An execution module 50, configured to execute the merging and memory allocation policies for each system user group during a target memory management period based on a system user combination policy and a system memory allocation policy.
[0097] For other embodiments or specific implementation manners of the operating system real-time container memory management system of the present invention, reference may be made to the above method embodiments, which will not be elaborated herein.
[0098] It can be understood that in the description of this specification, the descriptions with reference to terms such as "one embodiment", "another embodiment", "other embodiments", or "the first embodiment to the Nth embodiment" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0099] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including an..." does not exclude the existence of another identical element in the process, method, article or system including the element.
[0100] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A real-time container memory management method for an operating system, characterized in that, It includes the following steps: Obtain the program running requirements of several system users during the target memory management period; wherein, the program running requirements include the program running type and the program running period; According to the program running type, determine the memory requirement size and the delay tolerance level of each system user within each minimum management cycle during the program running period, and construct a memory management feature set based on the memory requirement size and the delay tolerance level; Construct a memory management association list that includes the memory management feature groups of each system user in different minimum management cycles in the order of the positions of each minimum management cycle during the target memory management period; Query the memory allocation resources of the operating system during the target memory management period, and consider the memory requirement size and the delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list to generate a system user combination strategy and a system memory allocation strategy; specifically including: Query the memory allocation resources of the operating system during the target memory management period; wherein, the memory allocation resources include the memory allocation size of each minimum management cycle during the target memory management period; Consider the memory requirement size and the delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list, and perform system user combination and memory allocation for each minimum management cycle of several system users during the target memory management period. Taking the sum of the memory requirement sizes of all system user groups in each minimum management cycle being less than the memory allocation size of the operating system in each minimum management cycle as the first constraint condition, taking the ratio of the memory requirement size of each system user in each system user group to the sum of the memory requirement sizes of all system users in the corresponding minimum management cycle being less than the preset ratio threshold corresponding to the delay tolerance level of each system user as the second constraint condition, and taking the minimum number of changes in the system user combination between all adjacent two minimum management cycles during the target memory management period as the optimization objective, and optimize and solve the system user combination strategy and the system memory allocation strategy; Wherein, the system user combination strategy includes the system user combination scheme of each minimum management cycle of several system users during the target memory management period, and the system memory allocation strategy includes the memory allocation scheme provided by the operating system for each system user group in each minimum management cycle; Based on the system user combination strategy and the system memory allocation strategy, execute the combination and memory allocation strategy for each system user group during the target memory management period.
2. The real-time container memory management method for an operating system according to claim 1, wherein The step of obtaining the program running requirements of several system users during the target memory management period specifically includes: Obtain the program running reservation information sent by each system user before the target memory management period for the target memory management period; wherein, the program running reservation information includes the program running identifier and the program running period of each reserved running program; Query the program running type of the reservation running program based on the program running identifier of each reservation running program, and use the program running type and the program running time period to determine the program running requirements of several system users during the target memory management period.
3. The real-time container memory management method for an operating system according to claim 1, characterized in that, The steps for obtaining the program running requirements of several system users during the target memory management period specifically include: Obtain the program running information of several system users during the past N target memory management periods; wherein, the program running information includes the program running type and the program running time period of each system user. Encode the program running type and the program running time period of each system user during each past target memory management period, and combine several associated features that affect the program running type and the program running time period to construct a program running requirement training sample. Use the program running requirement training sample to train the initially constructed convolutional neural network. When the training reaches the target number of times or the training converges, obtain a program running requirement prediction model. Predict the program running requirements of several system users during the target memory management period according to the program running requirement prediction sample constructed based on the program running requirement prediction model and several associated features corresponding to the target memory management period.
4. The real-time container memory management method for an operating system according to claim 1, characterized in that, Determine the memory requirement size of each system user during each minimum management cycle of the program running time period according to the program running type, specifically including: Query the running data information recorded in the historical running database of the running program corresponding to each program running type of each system user according to the program running type. Extract the memory call numerical curve of the running program corresponding to each program running type in the running data information, add up the values at the same time points on the memory call numerical curve of each program running type, and use the maximum value of the interval after adding up according to each minimum management cycle as the memory requirement size during each minimum management cycle.
5. The real-time container memory management method for an operating system according to claim 1, characterized in that, The steps for determining the delay tolerance level of each system user during each minimum management cycle of the program running time period according to the program running type specifically include: Match the delay tolerance level of the running program corresponding to each program running type of each system user in the program running type and delay tolerance level comparison mapping table according to the program running type. Use the lowest tolerance level among the delay tolerance levels of the running programs corresponding to all program running types within the interval of each minimum management cycle as the delay tolerance level of each minimum management cycle.
6. The real-time container memory management method for an operating system according to claim 1, characterized in that, The steps for constructing a memory management feature set based on the memory requirement size and the delay tolerance level specifically include: Perform feature splicing on the memory requirement size and the delay tolerance level of each system user during each minimum management cycle, and use the spliced features as a memory management feature group. Summarize the memory management feature groups of all system users during each minimum management cycle to construct a memory management feature set of each system user during each minimum management cycle.
7. The real-time container memory management method for an operating system according to claim 1, characterized in that The steps for constructing a memory management association list that includes the memory management feature sets of each system user during different minimum management cycles in the order of the positions of each minimum management cycle in the target memory management period specifically include: Analyze the position order of each minimum management cycle among several minimum management cycles in the target memory management period, and extract the memory management feature set of each minimum management cycle; According to the position order of each minimum management cycle, store the memory management feature sets corresponding to several minimum management cycles of each system user into the corresponding list, and construct a memory management association list including the memory management feature sets of each system user in different minimum management cycles.
8. The real-time container memory management method for an operating system according to claim 1, wherein Based on the system user combination strategy and the system memory allocation strategy, in the target memory management period, execute the combination and memory allocation strategy steps for each system user group, specifically including: Extract the system user combination plan of several system users in each minimum management cycle in the target memory management period in the system user combination strategy and the memory allocation plan provided by the operating system for each system user group in each minimum management cycle in the system memory allocation strategy; Use the system user combination plan to execute the combination for each system user group in each minimum management cycle in the target memory management period, and use the memory allocation plan to execute the memory allocation for each system user group in each minimum management cycle in the target memory management period.
9. A real-time container memory management system for an operating system, characterized in that, Including: An acquisition module for acquiring the program operation requirements of several system users in the target memory management period; wherein, the program operation requirements include the program operation type and the program operation period; A determination module for determining the memory requirement size and the delay tolerance level of each system user in each minimum management cycle during the program operation period according to the program operation type, and constructing a memory management feature set based on the memory requirement size and the delay tolerance level; A construction module for constructing a memory management association list including the memory management feature groups of each system user in different minimum management cycles according to the position order of each minimum management cycle in the target memory management period; A query module for querying the memory allocation resources of the operating system in the target memory management period, considering the memory requirement size and the delay tolerance level corresponding to the memory management feature groups of each system user in each different minimum management cycle in the memory management association list, and generating a system user combination strategy and a system memory allocation strategy; specifically including: Query the memory allocation resources of the operating system in the target memory management period; wherein, the memory allocation resources include the memory allocation size of each minimum management cycle in the target memory management period; Considering the memory requirement sizes and latency tolerance levels corresponding to the memory management feature groups of each different minimum management period in the memory management association list for each system user, combine system users and allocate memory for each minimum management period of several system users within the target memory management period. Take the sum of the memory requirement sizes of all system user groups in each minimum management period being less than the memory allocation size of the operating system in each minimum management period as the first constraint condition, and take the ratio of the memory requirement size of each system user in each system user group to the sum of the memory requirement sizes of all system users in the corresponding minimum management period being less than the preset ratio threshold corresponding to the latency tolerance level of each system user as the second constraint condition. Take the minimum number of changes in the system user group combination between all adjacent two minimum management periods in the target memory management period as the optimization goal, and optimize and solve the system user combination strategy and the system memory allocation strategy; Among them, the system user combination strategy includes the system user combination plan for each minimum management period of several system users within the target memory management period, and the system memory allocation strategy includes the memory allocation plan provided by the operating system for each system user group in each minimum management period; An execution module, configured to execute the combination and memory allocation strategy for each system user group during the target memory management period based on the system user combination strategy and the system memory allocation strategy.
Citation Information
Patent Citations
Method and device used for managing memory resources
CN104077191A
Memory allocation method and device, electronic equipment, storage medium and product
CN115269190A