Memory management method for lightweight UPF

Through the memory management method for lightweight UPF, including pre-allocated memory pool, hybrid policy allocation management and adaptive threshold control, the problem of low memory management efficiency in lightweight 5G core network is solved, and resource occupancy optimization and system stability are achieved. improvement.

CN119336491APending Publication Date: 2025-01-21INSPUR COMM TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411312179.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing memory management methods have problems such as memory usage caused by excessive resource usage and difficulty in effectively releasing instantaneous large amount of message data in the lightweight 5G core network, which affects system performance and stability.

Method used

Provides a memory management method for lightweight UPF, optimizing resource usage and improving operating efficiency and stability through pre-allocated memory pools, mixed strategy allocation management, memory recycling and reuse, and adaptive threshold control.

Benefits of technology

This method can reduce resource usage when UPF is started, effectively cope with memory pressure during operation, avoid memory waste and fragmentation, improve memory usage efficiency, and enhance system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336491A_ABST
    Figure CN119336491A_ABST
Patent Text Reader

Abstract

The invention discloses a memory management method for a lightweight UPF, and relates to the technical field of network resource management. Comprising the following steps of: 1, initializing and pre-distributing a memory pool with a certain size for the lightweight UPF aiming at the user quantity scale of the lightweight UPF, and 2, performing distribution management on the memory pool by utilizing a hybrid strategy: preferentially using a memory pool mechanism to distribute a memory for small memory requests which are frequently applied and released, and preferentially using a memory pool mechanism to distribute a memory for large memory requests or memory requests with special requirements. The memory is allocated by adopting a malloc mechanism or an alignedalloc mechanism; the memory blocks which are not used any more in the memory pool are recycled and put into the memory pool again for follow-up use, and the step 4 of conducting self-adaptive threshold value control over the memory pool, the threshold value of memory application is dynamically adjusted according to the system load and the memory use condition, and when the system is close to the resource limit, the memory blocks are reused. Unnecessary memory applications are automatically reduced, and memories are preferentially distributed for operation of key services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a memory management method for a lightweight UPF, and relates to the technical field of network resource management. Background Art

[0002] With the rapid development of 5G technology, the user plane function (UPF), as a key component in the 5G core network, is responsible for important functions such as packet routing, traffic control, and user data management. Its demand for memory and computing resources is increasing. Driven by lightweight 5G core network technology, how to efficiently run UPF on resource-constrained devices has become an urgent problem to be solved. Existing memory management methods often have problems such as excessive resource occupation at the initial startup and difficulty in effectively releasing memory occupation caused by a large amount of instantaneous message data during operation, which affects the overall performance and stability of the system. For example, static memory allocation: Although it is simple to implement, it cannot be flexibly adjusted according to actual needs, which is easy to cause resource waste or shortage; for example, a fixed-size memory pool: Although it can improve memory allocation efficiency, it may generate a large amount of memory fragmentation when facing data packets of different sizes, affecting subsequent allocation; another example is the standard malloc / free mechanism: Although it is flexible, frequent memory allocation and release may lead to performance bottlenecks and memory fragmentation in high-concurrency scenarios. Summary of the invention

[0003] In view of the problems of the prior art, the present invention provides a memory management method for lightweight UPF, aiming to optimize resource occupancy and improve operating efficiency and stability in an environment with limited physical resources.

[0004] The specific scheme proposed by the present invention is:

[0005] The present invention provides a memory management method for a lightweight UPF, comprising:

[0006] Step 1: According to the user scale of lightweight UPF, a memory pool of a certain size is pre-allocated for lightweight UPF initialization.

[0007] Step 2: Use a hybrid strategy to manage memory pool allocation: For small memory requests that are frequently applied for and released, use the memory pool mechanism to allocate memory first; for large memory requests or memory requests with special requirements, use the malloc mechanism or the aligned_alloc mechanism to allocate memory;

[0008] Step 3: Memory recycling and reuse strategy: Recycle the memory blocks that are no longer used in the memory pool and put them back into the memory pool for subsequent use.

[0009] Step 4: Perform adaptive threshold control of the memory pool: Dynamically adjust the threshold of memory application based on system load and memory usage. When the system approaches the resource limit, automatically reduce unnecessary memory applications and prioritize memory allocation for the operation of critical services.

[0010] Furthermore, in step 2 of the memory management method for lightweight UPF, before allocating memory, the memory request type is judged. If memory allocation is requested multiple times within a preset time, and based on the application scenario and the memory limit of the system, the memory block with the requested memory amount is less than the preset threshold, then it is a small memory request that is frequently applied for and released; if based on the application scenario and the memory limit of the system, the memory block with the requested memory amount is greater than the preset threshold, then it is a large memory request; if there is a memory request with special needs based on the application scenario, then it is a memory request with special needs.

[0011] Furthermore, in step 3 of the memory management method for lightweight UPF, a timer is used to detect the usage of memory pool resources, count the memory blocks in use and unused memory blocks in the current memory pool, and release the free resources of the unused memory pool.

[0012] Furthermore, in step 4 of the memory management method for lightweight UPF, dynamically adjusting the threshold of memory application includes:

[0013] First, detect and obtain the system load and memory usage. According to the size of the memory pool that the system can provide to UPF, set the maximum limit value that can be requested for memory requests. If the system increases the memory pool capacity, the maximum limit value is increased accordingly. If the system reduces the memory pool capacity, the maximum limit value is reduced accordingly.

[0014] The present invention also provides a memory management device for lightweight UPF, including a pre-allocation module, an allocation management module, a recycling module and a threshold control module.

[0015] The pre-allocation module pre-allocates a certain size of memory pool for lightweight UPF initialization according to the user scale of lightweight UPF.

[0016] The allocation management module uses a hybrid strategy to manage the memory pool allocation: for small memory requests that are frequently applied for and released, the memory pool mechanism is used to allocate memory first; for large memory requests or memory requests with special requirements, the malloc mechanism or the aligned_alloc mechanism is used to allocate memory;

[0017] The recycling module recycles memory and reuses the strategy: recycles memory blocks that are no longer used in the memory pool and puts them back into the memory pool for subsequent use.

[0018] The threshold control module performs adaptive threshold control of the memory pool: dynamically adjusts the threshold of memory application according to system load and memory usage. When the system approaches the resource limit, it automatically reduces unnecessary memory applications and prioritizes memory allocation for the operation of key services.

[0019] Furthermore, before allocating memory, the allocation management module of the memory management device for lightweight UPF determines the type of memory request. If memory allocation is requested multiple times within a preset time, and according to the application scenario and the memory limit of the system, the memory block with the requested memory amount is less than the preset threshold, then it is a small memory request that is frequently applied for and released; if according to the application scenario and the memory limit of the system, the memory block with the requested memory amount is greater than the preset threshold, then it is a large memory request; if there is a memory request with special needs according to the application scenario, then it is a memory request with special needs.

[0020] Furthermore, the recycling module of the memory management device for lightweight UPF uses a timer to detect the usage of memory pool resources, counts the memory blocks in use and unused memory blocks in the current memory pool, and releases the idle resources of the unused memory pool.

[0021] Furthermore, the threshold control module of the memory management device for the lightweight UPF dynamically adjusts the threshold of the memory application, including:

[0022] First, detect and obtain the system load and memory usage. According to the size of the memory pool that the system can provide to UPF, set the maximum limit value that can be requested for memory requests. If the system increases the memory pool capacity, the maximum limit value is increased accordingly. If the system reduces the memory pool capacity, the maximum limit value is reduced accordingly.

[0023] The benefits of the present invention are:

[0024] The present invention provides a lightweight UPF minimalist memory management method, which realizes the fine management of UPF memory resources through the organic combination of intelligent memory pool and dynamic malloc. This method can not only reduce the resource occupation when UPF is started, but also effectively cope with the memory pressure caused by the instantaneous large amount of message data during operation, avoiding the waste of memory and the generation of memory fragmentation. At the same time, through real-time monitoring and dynamic adjustment strategy, the memory utilization efficiency is improved, and the stability and reliability of the system are enhanced. In addition, the method also has good scalability and adaptability, and can meet the needs of UPF for memory management in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION

[0026] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0027] Example 1

[0028] The present invention provides a memory management method for a lightweight UPF, comprising:

[0029] Step 1: Pre-allocate a memory pool of a certain size for the lightweight UPF initialization according to the user scale of the lightweight UPF. For example, pre-allocate a memory pool of a certain size according to the user scale of the lightweight UPF, which can be a memory pool of 256 or a memory pool of 1024.

[0030] Step 2: Use a hybrid strategy to manage the memory pool allocation: For small memory requests that are frequently applied for and released, the memory pool mechanism is used to allocate memory first. For large memory requests or memory requests with special requirements, the malloc mechanism or the aligned_alloc mechanism is used to allocate memory. Before allocating memory, the memory request type is determined. If multiple requests for memory allocation are made within a preset time, and the memory block with the requested memory amount is less than the preset threshold according to the application scenario and the system's memory restrictions, it is a small memory request that is frequently applied for and released; if the memory block with the requested memory amount is greater than the preset threshold according to the application scenario and the system's memory restrictions, it is a large memory request; if there is a memory request with special requirements according to the application scenario, it is a memory request with special requirements. For example, for standard requirements, the malloc mechanism is used to allocate memory; for memory requests that require specific alignment, aligned_alloc can be used to allocate memory.

[0031] Step 3: Memory recycling and reuse strategy: Recycle the memory blocks that are no longer used in the memory pool and put them back into the memory pool for subsequent use. Use a timer to detect the usage of memory pool resources, count the memory blocks in use and unused memory blocks in the current memory pool, and release the idle resources of the unused memory pool.

[0032] Step 4: Perform adaptive threshold control of the memory pool: Dynamically adjust the threshold of memory application based on system load and memory usage. When the system approaches the resource limit, automatically reduce unnecessary memory applications and prioritize memory allocation for the operation of critical services.

[0033] The threshold for dynamically adjusting memory application includes:

[0034] First, detect and obtain the system load and memory usage. According to the size of the memory pool that the system can provide to UPF, set the maximum limit value that can be requested for memory requests. If the system increases the memory pool capacity, the maximum limit value will be increased accordingly. If the system reduces the memory pool capacity, the maximum limit value will be reduced accordingly. For example, if the system can provide 4G memory to UPF, the maximum supported session resources are set to 10,000, and the maximum limit values ​​of other resources are also set; if the memory provided to UPF by the system is increased to 8G, the maximum limit value of supported session resources is increased to 20,000, and the maximum limit values ​​of other resource limits are also increased.

[0035] Example 2

[0036] The present invention also provides a memory management device for lightweight UPF, including a pre-allocation module, an allocation management module, a recycling module and a threshold control module.

[0037] The pre-allocation module pre-allocates a certain size of memory pool for lightweight UPF initialization according to the user scale of lightweight UPF.

[0038] The allocation management module uses a hybrid strategy to manage the allocation of memory pools: for small memory requests that are frequently applied for and released, the memory pool mechanism is used to allocate memory first; for large memory requests or memory requests with special requirements, the malloc mechanism is used to allocate memory;

[0039] The recycling module recycles memory and reuses the strategy: recycles memory blocks that are no longer used in the memory pool and puts them back into the memory pool for subsequent use.

[0040] The threshold control module performs adaptive threshold control of the memory pool: dynamically adjusts the threshold of memory application according to system load and memory usage. When the system approaches the resource limit, it automatically reduces unnecessary memory applications and prioritizes memory allocation for the operation of key services.

[0041] As the information interaction, execution of readable program process and other contents of the processor in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.

[0042] Similarly, the device of the present invention provides lightweight UPF minimalist memory management, and realizes fine management of UPF memory resources through the organic combination of intelligent memory pool and dynamic malloc. It can not only reduce the resource occupation when UPF is started, but also effectively deal with the memory pressure caused by the instantaneous large amount of message data during operation, avoiding memory waste and memory fragmentation. At the same time, through real-time monitoring and dynamic adjustment strategies, the memory utilization efficiency is improved, and the stability and reliability of the system are enhanced. In addition, it also has good scalability and adaptability, and can meet the needs of UPF for memory management in different scenarios.

[0043] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0044] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A memory management method for lightweight UPF, characterized by include: Step 1: According to the user scale of lightweight UPF, a memory pool of a certain size is pre-allocated for lightweight UPF initialization. Step 2: Use a hybrid strategy to manage memory pool allocation: For small memory requests that are frequently applied for and released, use the memory pool mechanism to allocate memory first; for large memory requests or memory requests with special requirements, use the malloc mechanism or the aligned_alloc mechanism to allocate memory; Step 3: Memory recycling and reuse strategy: Recycle the memory blocks that are no longer used in the memory pool and put them back into the memory pool for subsequent use. Step 4: Perform adaptive threshold control of the memory pool: Dynamically adjust the threshold of memory application based on system load and memory usage. When the system approaches the resource limit, automatically reduce unnecessary memory applications and prioritize memory allocation for the operation of critical services.

2. A memory management method for lightweight UPF according to claim 1, characterized in that Before allocating memory in step 2, determine the memory request type. If multiple requests for memory allocation are made within a preset time, and the memory block whose requested memory amount is less than a preset threshold value according to the application scenario and the system's memory limit, then it is a small memory block request that is frequently applied for and released; If the memory block with the requested memory amount greater than the preset threshold is a large memory request based on the application scenario and the system's memory limit, then it is a memory request with special requirements; if there is a memory request with special requirements based on the application scenario, then it is a memory request with special requirements.

3. According to claim 1, a memory management method for lightweight UPF is characterized in that in step 3, a timer is used to detect the usage of memory pool resources, count the memory blocks in use and unused memory blocks in the current memory pool, and release the idle resources of the unused memory pool.

4. A memory management method for lightweight UPF according to claim 1, characterized in that In step 4, the threshold for dynamically adjusting memory requests is as follows: First, detect and obtain the system load and memory usage. According to the size of the memory pool that the system can provide to UPF, set the maximum limit value that can be requested for memory requests. If the system increases the memory pool capacity, the maximum limit value is increased accordingly. If the system reduces the memory pool capacity, the maximum limit value is reduced accordingly.

5. A memory management device for lightweight UPF, characterized by It includes pre-allocation module, allocation management module, recycling module and threshold control module. The pre-allocation module pre-allocates a certain size of memory pool for lightweight UPF initialization according to the user scale of lightweight UPF. The allocation management module uses a hybrid strategy to manage the memory pool allocation: for small memory requests that are frequently applied for and released, the memory pool mechanism is used to allocate memory first; for large memory requests or memory requests with special requirements, the malloc mechanism or the aligned_alloc mechanism is used to allocate memory; The recycling module recycles memory and reuses the strategy: recycles memory blocks that are no longer used in the memory pool and puts them back into the memory pool for subsequent use. The threshold control module performs adaptive threshold control of the memory pool: dynamically adjusts the threshold of memory application according to system load and memory usage. When the system approaches the resource limit, it automatically reduces unnecessary memory applications and prioritizes memory allocation for the operation of key services.

6. A memory management device for lightweight UPF according to claim 5, characterized in that: Before the management module allocates memory, it determines the type of memory request. If multiple requests for memory allocation are made within a preset time, and the memory block with a requested memory amount less than a preset threshold value according to the application scenario and the system's memory limit, it is a small memory block request that is frequently applied for and released; If the memory block with the requested memory amount greater than the preset threshold is a large memory request based on the application scenario and the system's memory limit, then it is a memory request with special requirements; if there is a memory request with special requirements based on the application scenario, then it is a memory request with special requirements.

7. A memory management device for lightweight UPF according to claim 5, characterized in that The recycling module uses a timer to detect the usage of memory pool resources, count the memory blocks in use and unused memory blocks in the current memory pool, and release the free resources of the unused memory pool.

8. A memory management device for lightweight UPF according to claim 5, characterized in that The threshold control module dynamically adjusts the threshold of memory application, including: First, detect and obtain the system load and memory usage. According to the size of the memory pool that the system can provide to UPF, set the maximum limit value that can be requested for memory requests. If the system increases the memory pool capacity, the maximum limit value is increased accordingly. If the system reduces the memory pool capacity, the maximum limit value is reduced accordingly.

Citation Information

Patent Citations

  • Management method and device of memories

    CN103885569A

  • Streaming data heterogeneous computing memory optimization method based on dynamic telescopic memory pool

    CN114048025A

  • Memory management method and device, equipment and storage medium

    CN116048777A

  • A memory management method for embedded system

    CN1635482A