Pico base station memory allocation method and device, electronic device and storage medium
By dividing memory blocks in the base station and managing the main line and split memory pools, intelligent allocation and recycling of memory resources are realized, the problem of uneven memory allocation of base stations in the existing technology is solved, and the memory usage efficiency and performance of the system are improved.
Patent Information
- Application Number
- CN202411642607.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing base station memory allocation mechanism supports multiple cells, it is difficult to balance the allocation of memory resources, resulting in insufficient memory in some cells and excess memory in other cells, and the inability to fully utilize memory resources.
By dividing the memory area of the base station into multiple memory blocks, obtaining the preset main line memory pool and split memory pool, detecting the usage information of the memory blocks to be used in the split memory pool, comparing it based on the number of available memory blocks and the preset number of memory blocks threshold, generating memory resource allocation results, and realizing intelligent allocation and recycling of memory blocks.
The memory resource allocation of each cell under the base station is realized, ensuring that each cell can meet the current data processing and achieve optimal performance, improving memory usage and system stability.
Smart Images

Figure CN119668838A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic design automation, and in particular to a method, device, electronic device and storage medium for allocating memory of a pico base station. Background Art
[0002] With the rapid development of 5G communication technology, base station products need to process large amounts of data in real time, ranging from several hundred Mbps to 10Gbps. As an important part of the 5G network, the pico base station has the characteristics of small size, light weight, and support for multiple backhaul networking methods. It can supplement network coverage for key scenarios and help macro base stations share traffic loads. However, when the pico base station supports multiple cells (such as two cells, four cells, eight cells or even more), the real-time business volume of each cell is different, and the memory for storing data is limited.
[0003] The existing base station memory allocation mechanism usually adopts average allocation or on-demand allocation, but these methods have certain problems. Average allocation may cause some cells to have insufficient memory when the data volume is large, while other cells have sufficient memory when the data volume is small, thus failing to fully utilize memory resources; on-demand allocation can allocate memory according to actual needs, but if there is no reasonable memory management and recovery mechanism, the problem of uneven memory allocation may also occur.
[0004] At present, there is no effective solution to the problem of how to evenly allocate base station memory resources in related technologies to ensure that each cell under the pico base station can handle the current amount of data and achieve optimal performance. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, system, electronic device and storage medium for allocating memory of a pico base station, so as to at least solve the problem in the related technology of how to evenly allocate base station memory resources to ensure that each cell under the pico base station can meet the processing needs of the current data volume and achieve optimal performance.
[0006] In a first aspect, an embodiment of the present application provides a method for allocating memory of a pico base station, including:
[0007] Dividing the memory area in the pico base station into a plurality of memory blocks;
[0008] Obtaining a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks;
[0009] Detecting usage information of the memory block to be used stored in the split-line memory pool, and determining an available memory block of the memory block to be used based on the usage information;
[0010] Based on the comparison result between the number of available memory blocks and a preset memory block number threshold, a memory resource allocation result of the pico base station is generated.
[0011] In some embodiments, after obtaining the preset main line memory pool and branch line memory pool, the method further includes:
[0012] All of the memory blocks are stored in the mainline memory pool;
[0013] Based on the preset default number of memory blocks of the branch-line memory pool, the to-be-allocated memory blocks of the main-line memory pool are allocated to each of the branch-line memory pools and stored as the to-be-used memory blocks.
[0014] In some embodiments, the generating of the memory resource allocation result for the memory block based on the comparison result between the number of the available memory blocks and a preset threshold value of the number of memory blocks includes:
[0015] The memory block quantity threshold includes a minimum memory block quantity threshold;
[0016] In the case where it is detected that the number of available memory blocks is lower than the minimum threshold of the number of memory blocks, allocatable memory blocks in the memory blocks to be allocated are determined, and the allocatable memory blocks are allocated to the split-line memory pool.
[0017] In some embodiments, the determining of the allocatable memory blocks in the memory blocks to be allocated includes:
[0018] The number of the allocatable memory blocks is calculated according to the preset default number of memory blocks and the number of the available memory blocks, and the allocatable memory blocks are acquired from the main line memory pool based on the number of the allocatable memory blocks.
[0019] In some embodiments, the method further comprises:
[0020] The memory block quantity threshold includes a maximum memory block quantity threshold;
[0021] When it is detected that the number of available memory blocks is higher than the maximum threshold of the number of memory blocks, reclaimed memory blocks in the available memory blocks are obtained, and the reclaimed memory blocks are allocated to the main line memory pool.
[0022] In some embodiments, obtaining the reclaimed memory block in the available memory block includes:
[0023] The number of the recovered memory blocks is calculated according to the preset default number of memory blocks and the number of available memory blocks, and the recovered memory blocks are obtained from the split-line memory pool based on the number of recovered memory blocks.
[0024] In some embodiments, the method further comprises:
[0025] Receiving user data using a main thread, wherein the main thread is used to manage the memory blocks in the main line memory pool;
[0026] Based on the user address in the user data, the user data is placed in a corresponding work queue, each of the work queues corresponds to a shunt thread one-to-one, and the shunt thread is used to manage the memory blocks in the shunt memory pool;
[0027] Based on the memory resource allocation result, the user data is stored in the memory block to be used by utilizing the branch thread.
[0028] In a second aspect, an embodiment of the present application provides a memory allocation device for a pico base station, comprising:
[0029] An initial setting module, used for dividing the memory area in the pico base station into a plurality of memory blocks;
[0030] The initial setting module is further used to obtain a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks;
[0031] A memory evaluation module, used for detecting usage information of the memory blocks to be used stored in the split-line memory pool, and determining available memory blocks of the memory blocks to be used based on the usage information;
[0032] The memory allocation module is used to generate a memory resource allocation result for the memory block based on a comparison result between the number of the available memory blocks and a preset memory block number threshold.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the pico base station memory allocation method as described in the first aspect above is implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the memory allocation method for a pico base station as described in the first aspect above is implemented.
[0035] Compared with the related technologies, the pico base station memory allocation method provided in the embodiment of the present application solves the problem of how to evenly allocate base station memory resources through an automated memory allocation and recovery mechanism to ensure that each cell under the pico base station can meet the processing needs of the current data volume and achieve optimal performance. It realizes the intelligent allocation and recovery of memory blocks, as well as the balanced allocation of multi-cell data under the pico base station and the effective use of memory resources.
[0036] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 is a hardware structure block diagram of a terminal of a memory allocation method for a pico base station according to an embodiment of the present invention;
[0039] Figure 2 is a flowchart of a method for allocating memory of a pico base station according to an embodiment of the present application;
[0040] Figure 3 is an architectural diagram of another method for allocating memory of a pico base station according to an embodiment of the present application;
[0041] Figure 4 This is a diagram of the overall network architecture based on a pico base station according to an embodiment of the present application;
[0042] Figure 5 It is a network architecture of the user plane according to an embodiment of the present application;
[0043] Figure 6 It is a structural block diagram of a memory allocation device for a pico base station according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0045] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0046] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0047] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of a method for allocating memory of a pico base station according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0048] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the memory allocation method of the pico base station in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0049] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0050] This embodiment provides a memory allocation method for a pico base station. Figure 2 is a flowchart of a method for allocating memory of a pico base station according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:
[0051] Step S201, dividing the memory area in the pico base station into multiple memory blocks.
[0052] Among them, in the 5G era, due to the increase in network demand in indoor scenarios, pico base stations began to appear and have been widely used. The pico base station is a miniaturized, low-power, low-power micro-cellular base station, which is mainly used to solve the indoor wireless coverage problem in a specific area. It can be installed indoors to achieve fixed-point deep coverage in weak signals and blind areas, including areas with dense traffic or large data traffic transmission requirements. Under the multi-cell architecture, the pico base station needs to receive and process a large number of user-plane data packets from multiple cells from the backhaul port, which requires the use of a multi-threaded architecture, which consists of a main thread and multiple branch threads. The main thread is mainly responsible for obtaining data from all cells from the backhaul port, while each branch thread processes the data of the corresponding cell. After the system is started, the memory area inside the pico base station is divided into multiple memory blocks. These memory blocks are the basic units of data processing, used to store and transmit user-plane data packets. Each memory block has a unified memory size and data structure, which is easy to manage and allocate. This step is the basis for the implementation of the subsequent method, which improves the flexibility and efficiency of memory management. By dividing the memory blocks, dynamic allocation and recovery of memory can be more convenient.
[0053] Step S202, obtaining a preset main line memory pool and a branch line memory pool; wherein the main line memory pool stores memory blocks to be allocated in the memory blocks, and the branch line memory pool stores memory blocks to be used in the memory blocks.
[0054] Among them, the main thread manages the mainline memory pool, and multiple branch threads each manage the corresponding branch-line memory pool. The mainline memory pool stores memory blocks to be allocated, that is, memory blocks to be allocated, and the branch-line memory pool stores memory blocks that have not been used, that is, memory blocks to be used. After the memory blocks are generated, the system will generate a table to record the memory blocks. The table formed by the memory blocks managed by the main thread is the mainline memory pool, and the table formed by the memory blocks managed by the branch threads is the branch-line memory pool. This step realizes the hierarchical management of memory resources. Through the division of the mainline memory pool and the branch-line memory pool, the memory allocation and recovery process can be better controlled, which is convenient for real-time monitoring of memory usage and provides a basis for subsequent memory resource allocation.
[0055] Step S203, detecting usage information of the memory blocks to be used stored in the split-line memory pool, and determining available memory blocks of the memory blocks to be used based on the usage information.
[0056] Among them, real-time monitoring is performed to see whether the memory blocks to be used are in use, and the memory blocks in the idle state are screened out to update the number of currently available memory blocks. These available memory blocks are used for subsequent data storage or processing tasks. This step realizes real-time monitoring of memory usage and ensures the reasonable allocation and utilization of subsequent memory resources.
[0057] Step S204: Generate a memory resource allocation result of the pico base station based on a comparison result between the number of available memory blocks and a preset memory block number threshold.
[0058] Among them, according to the preset threshold of the number of memory blocks (such as the minimum threshold of the number of memory blocks and the maximum threshold of the number of memory blocks), the number of available memory blocks in the current branch memory pool is compared. According to the comparison result, it is decided whether it is necessary to allocate new memory blocks from the main line memory pool to the branch memory pool, or to recycle excess memory blocks from the branch memory pool to the main line memory pool, and the actual number of available memory blocks in each branch memory pool is controlled within a specific range to ensure that there are enough memory resources to store user data in each cell. Specifically, when the number of available memory blocks is lower than the minimum threshold of the number of memory blocks, the allocable memory blocks in the memory blocks to be allocated are determined, and the allocable memory blocks are allocated to the branch memory pool; when the number of available memory blocks is higher than the maximum threshold of the number of memory blocks, the recycled memory blocks in the available memory blocks are obtained, and the recycled memory blocks are allocated to the main line memory pool. This step realizes the dynamic balanced allocation of memory resources. By adjusting the allocation and recovery of memory blocks according to actual needs, it can ensure that each cell (or branch thread) can obtain sufficient memory resources, while improving the stability and reliability of the system. By dynamically adjusting the allocation of memory resources, system crashes or performance degradation caused by insufficient memory can be avoided.
[0059] Through the above steps, the present application divides the memory space into memory blocks, designs the main thread, main line memory pool and branch thread, branch line memory pool, separates the idle memory blocks and the memory blocks to be used, and each time the branch thread runs, it will determine in real time whether the available memory blocks in the corresponding branch line memory pool are within the threshold range, and request the main thread to allocate memory blocks from the main line memory pool or recycle excess memory blocks in the branch line memory pool to the main line memory pool according to actual needs, thereby realizing intelligent allocation and recycling of memory blocks. This allocation method improves the utilization rate of memory, avoids the waste of memory resources, and solves the problem of balanced allocation of base station memory resources to ensure that each cell under the pico base station can meet the processing of the current data volume and achieve optimal performance.
[0060] In some embodiments, after obtaining the preset main line memory pool and branch line memory pool, the method further includes:
[0061] All memory blocks are stored in the mainline memory pool;
[0062] Based on the preset default number of memory blocks of the branch-line memory pool, the memory blocks to be allocated of the main-line memory pool are allocated to each branch-line memory pool and stored as memory blocks to be used.
[0063] Among them, after the Picobase system is started and the memory initialization is completed, all the allocated memory blocks are first stored in the main line memory pool. This main line memory pool is the core of memory management and is responsible for storing all memory blocks to be allocated. The system presets the default number of memory blocks for each branch line memory pool. During the initialization phase, according to this preset value, the system allocates the corresponding number of memory blocks from the main line memory pool to each branch line memory pool. These memory blocks are stored in the branch line memory pool as memory blocks to be used for the corresponding branch thread.
[0064] This embodiment stores all memory blocks in the main line memory pool at the beginning and manages all memory blocks in a centralized manner, which helps the system to comprehensively monitor and flexibly schedule memory resources and facilitates subsequent memory allocation and recovery operations; by presetting a certain number of memory blocks for each branch line memory pool, it ensures that each working thread has sufficient memory resources available when processing data, which helps to achieve balanced allocation of memory resources and avoids excessive concentration and waste of memory resources, thereby improving the efficiency of memory use. In addition, as the amount of data processed by the branch thread changes, the system can dynamically adjust the number of memory blocks in the branch line memory pool as needed, thereby achieving more flexible and efficient memory management.
[0065] In some embodiments, based on the comparison result between the number of available memory blocks and a preset threshold value of the number of memory blocks, generating a memory resource allocation result for the memory blocks includes:
[0066] The memory block quantity threshold includes a memory block quantity minimum threshold;
[0067] When it is detected that the number of available memory blocks is lower than a minimum threshold of the number of memory blocks, allocatable memory blocks in the memory blocks to be allocated are determined, and the allocatable memory blocks are allocated to the line memory pool.
[0068] Among them, a minimum threshold for the number of memory blocks is set for the branch memory pool, and this threshold represents the minimum number of memory blocks that can be owned by the local memory pool managed by the branch thread. The number of available memory blocks in each branch memory pool can be monitored in real time. When it is detected that the number of available memory blocks in a branch memory pool is lower than the set minimum threshold, the memory allocation mechanism is triggered to determine the number of memory blocks to be allocated from the main memory pool. Specifically, the number of memory blocks to be allocated this time is equal to the default number of memory blocks minus the available memory blocks. These memory blocks are removed from the main memory pool and allocated to the branch memory pool, increasing the number of available memory blocks in this branch memory pool, and then the specific number of memory blocks required for use is allocated for the branch thread.
[0069] This embodiment can ensure that each branch memory pool has sufficient memory resources to process data when needed by setting the minimum threshold of the number of memory blocks and allocating memory blocks in a timely manner. This avoids performance degradation or data processing delays caused by insufficient memory; dynamically adjusting the allocation and recycling of memory blocks ensures that memory resources are used more evenly among various branch memory pools, reducing memory waste and idleness, thereby improving overall memory usage efficiency.
[0070] In some embodiments, determining an allocatable memory block in a memory block to be allocated includes:
[0071] The number of allocatable memory blocks is calculated according to the preset default number of memory blocks and the number of available memory blocks, and the allocatable memory blocks are obtained from the mainline memory pool based on the number of allocatable memory blocks.
[0072] When it is detected that the number of available memory blocks in a branch line memory pool is lower than the set minimum threshold, the number of memory blocks to be allocated is determined from the main line memory pool. The formula is as follows:
[0073] The number of allocatable memory blocks = the default number of memory blocks - the number of available memory blocks.
[0074] According to the calculated number of allocatable memory blocks, a corresponding number of memory blocks are obtained from the main line memory pool, and these memory blocks are allocated to the branch line memory pool that issued the request, and these allocated memory blocks are removed from the main line memory pool.
[0075] This embodiment specifically calculates the number of allocatable memory blocks and automates memory allocation, ensuring that the number of available memory blocks in each branch memory pool is higher than the set minimum threshold, ensuring that the data processing thread of each cell can obtain sufficient memory blocks to process data when needed, thereby improving the processing performance and response speed of the overall system. The automated memory allocation and recycling mechanism simplifies system management tasks, reduces the need for manual intervention, and improves operation and maintenance efficiency.
[0076] In some embodiments, the method further comprises:
[0077] The memory block quantity threshold includes a maximum memory block quantity threshold;
[0078] When it is detected that the number of available memory blocks is higher than the maximum threshold of the number of memory blocks, reclaimed memory blocks are obtained from the available memory blocks, and the reclaimed memory blocks are allocated to the main line memory pool.
[0079] Among them, a maximum threshold of the number of memory blocks is set for the branch memory pool, which represents the maximum number of memory blocks that can be owned by the local memory pool managed by the branch thread. The number of available memory blocks in each branch memory pool can be monitored in real time. Each time the number of available memory blocks changes, it is necessary to determine whether the number exceeds the preset maximum threshold. If the number of available memory blocks is higher than the maximum threshold, a certain number of memory blocks need to be selected from the local memory pool as recycled memory blocks, and the selected recycled memory blocks are removed from the local memory pool and allocated back to the main line memory pool.
[0080] This embodiment sets a maximum threshold for the number of memory blocks and recycles excess memory blocks when the threshold is exceeded, thereby avoiding waste of memory resources and improving memory utilization of the entire system. When the memory demand of a working thread is low, the excess memory blocks are recycled and allocated back to the main line memory pool, which can provide more resources for other working threads with higher memory demands, thereby optimizing the processing performance of the entire system.
[0081] In some embodiments, obtaining a reclaimed memory block from an available memory block includes:
[0082] The number of recovered memory blocks is calculated according to the preset default number of memory blocks and the number of available memory blocks, and the recovered memory blocks are obtained from the branch memory pool based on the number of recovered memory blocks.
[0083] When it is detected that the number of available memory blocks in a certain line memory pool exceeds the set maximum threshold, the number of memory blocks to be reclaimed is determined from the line memory pool. The formula is as follows:
[0084] The number of reclaimed memory blocks = the number of available memory blocks - the default number of memory blocks.
[0085] Based on the calculated number of reclaimed memory blocks, a corresponding number of memory blocks are selected from the branch memory pool for reclaiming. The reclaimed memory blocks will be reallocated to the main line memory pool for application by other branch memory pools when needed.
[0086] This embodiment specifically calculates the number of reclaimed memory blocks and automates memory reclaim, ensuring that the number of available memory blocks in each branch memory pool does not exceed the set maximum threshold, effectively avoiding excessive accumulation and waste of memory blocks in the branch memory pool, and evenly allocating memory blocks to ensure that each branch memory pool can obtain sufficient memory resources when processing data. The reclaimed memory blocks can be reallocated to the branch memory pool that needs more memory resources, thereby improving the overall memory utilization.
[0087] In some embodiments, the method further comprises:
[0088] The main thread is used to receive user data. The main thread is used to manage memory blocks in the main line memory pool.
[0089] Based on the user address in the user data, the user data is placed in the corresponding work queue. Each work queue corresponds to a branch thread one by one. The branch thread is used to manage the memory blocks in the branch memory pool.
[0090] Based on the memory resource allocation result, the user data is stored in the memory block to be used by the branch thread.
[0091] in, Figure 3 is an architecture diagram of another method for allocating memory of a pico base station according to an embodiment of the present application, such as Figure 3 As shown, the main thread is responsible for receiving user data transmitted from the return port. These data contain user address information (used to identify the cell and user to which the data belongs). The main thread puts the data into the corresponding work queue according to the user address in the user data. Each work queue corresponds to a branch thread one by one. These branch threads manage the branch memory pools of different cells respectively. After receiving the data in the work queue, the branch thread allocates the memory block to be used from the branch memory pool it manages according to the memory resource allocation result, and stores the user data in it.
[0092] This embodiment can ensure the integrity and accuracy of user data through unified reception and processing of the main thread, providing a reliable basis for subsequent data distribution and processing; through the allocation of work queues, data diversion processing is realized, the concurrency and efficiency of data processing are improved, and because each work queue corresponds to a branch thread, it can flexibly process the data volume of different cells.
[0093] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0094] First, the overall network architecture of the pico base station is described as follows:
[0095] The protocol stack program of the pico base station runs on the micro operating system, and its bottom layer is still based on the Linux operating system. The protocol stack program is a key part of the wireless communication system. It organizes and transmits data according to the provisions of the NR wireless protocol (New Radio wireless protocol, the wireless protocol standard in 5G communication technology). The NR wireless protocol defines how data is encapsulated, transmitted and processed in wireless communication, and the protocol stack program performs specific operations according to these provisions. The protocol stack program is divided into the user plane and the control plane, corresponding to the two planes of the NR wireless protocol: the NR wireless protocol is divided into the user plane (UserPlane, UP) and the control plane (Control Plane, CP), and the protocol stack program is also divided into these two parts accordingly, which handle the transmission of user data and control signaling respectively.
[0096] Figure 4This is an overall network architecture diagram based on a pico base station in an embodiment of the present application. Figure 5 It is a network architecture of the user plane according to an embodiment of the present application, Figure 4 and Figure 5 The accompanying drawings are described as follows:
[0097] User plane (UP) protocol stack and the protocol used by user data;
[0098] The control plane (CP) protocol stack is the protocol cluster used for the control signaling transmission of the system;
[0099] SDAP layer (Service Data Adaptation Protocol) is the service data adaptation protocol layer;
[0100] PDCP layer (Packet Data Convergence Protocol) is the packet data convergence protocol layer;
[0101] RLC layer (Radio Link Control) is the radio link control layer;
[0102] MAC layer (Medium Access Control) is the medium access control layer;
[0103] PHY layer (Physical) is the physical layer;
[0104] UE (User Equipment) refers to the terminal device that can access the 5G network and enjoy 5G services in the 5G network;
[0105] AMF (Access and Mobility Management Function) is an access and mobility management function, which is a functional entity in the 5G core network;
[0106] gNB (next generation NodeB) is a type of 5G base station. In the 5G network, gNB is responsible for communicating with user equipment (UE) and providing wireless access services. gNB is also responsible for data transmission, processing and management, as well as connection and interaction with the core network.
[0107] RRC signaling (Radio Resource Control) is a protocol for controlling radio resources. In 5G networks, RRC signaling is used to establish and release the radio connection between the user equipment (UE) and the base station (such as gNB), as well as to configure, reconfigure and measure the radio resources of the UE;
[0108] The Uu air interface is the interface for wireless communication between user equipment (UE) and base stations (such as gNB) in 5G networks, responsible for transmitting user data and signaling data;
[0109] NGAP (Next Generation Application Protocol) is used in 5G networks for communication between base stations (such as gNB) and the core network;
[0110] SCTP signaling (Stream Control Transmission Protocol) is used in 5G networks to transmit control signaling data, such as communication between base stations and the core network, and signaling transmission between user equipment (UE) and base stations;
[0111] The NG-C interface is the control plane interface between the 5G core network and the base station (such as gNB), which is used to transmit control signaling, such as signaling transmission between the base station and the core network;
[0112] Non-access layer signaling is independent of the radio access layer (such as the physical layer, data link layer, etc.) between the user equipment (UE) and the base station (such as gNB) in the wireless communication system. It is mainly responsible for processing security-related signaling such as access control, authentication, authorization, encryption, etc. of the user equipment, and managing the user's mobility status. Non-access layer signaling is transmitted through a specific protocol stack, such as SCTP signaling between the core network and the base station;
[0113] UPF (User Plane Function) is an important functional entity in the 5G core network, which is mainly responsible for data forwarding and processing on the user plane.
[0114] like Figure 4 As shown, the dotted line indicates the flow of signaling data. Before initiating a service, a UE must first establish a signaling connection with the core network AMF, so the signaling process of the control plane must always precede the data flow of the user plane. After the UE undergoes non-access layer signaling processing such as authentication, authorization and encryption, it establishes a wireless signaling connection with the gNB through RRC signaling; the signaling data is encapsulated by PDCP and RLC, and after being processed by the MAC layer and PHY layer, it is sent to the gNB through the Uu air interface; after the gNB undergoes the same reverse processing as a UE, it is sent to NGAP; after being encapsulated into SCTP signaling, it is sent to AMF through the NG-C interface; after the AMF physical layer receives the data, it is decapsulated by SCTP and NGAP, and converted into 5G non-access layer signaling to be processed by AMF.
[0115] The solid line marks the user plane data flow. A UE's service data flow is transmitted from the UPF to the gNB through the NG-U interface, and then the NR user plane processing node sends the data to the UE according to the protocol modules SDAP, PDCP, RLC, MAC, and PHY.
[0116] Figure 5 It is a network architecture of the user plane according to the embodiment of the present application, such as Figure 5 As shown, the gNB base station communicates with the user equipment (UE).
[0117] In the multi-cell architecture, the pico base station needs to receive and process a large number of user-side data packets from multiple cells from the backhaul port, which requires the user plane to support a multi-threaded architecture. This architecture consists of an I / O scheduling thread (Dispatcher thread, i.e., main thread) and multiple branch threads (Worker threads). The Dispatcher thread is mainly responsible for obtaining data from all cells from the backhaul port, while each Worker thread processes the data of the corresponding cell. The following description is referred to as Dispatcher and Worker. The Dispatcher is responsible for receiving uplink and downlink user data packets and then putting them into the work queue (Queue) of the corresponding worker thread. Each worker thread takes out data packets from its own work queue in turn for processing. After processing, it sends messages to the outside as needed for subsequent processing.
[0118] The Dispatcher thread manages the memory blocks that store data. A memory block can be referred to as MBUF (MemoryBuffer). Initially, a memory area can be allocated according to the system specifications to create and maintain these MBUFs. The following data is used as an example: after the system starts, it applies to the operating system for 512MB of memory. 512MB = 512 * 1024 * 1024 = 536870912 (bytes). It is set that an MBUF occupies 2048 bytes, which is equivalent to a total of 536870912 / 2048 = 262144 (units) of MBUFs. In addition to the Dispatcher thread, the users of these MBUFs are The Worker thread also needs to use it, so the allocation rules for these MBUFs directly affect the processing performance of each thread. If they are evenly distributed, the number of MBUFs required will be different because each Worker thread processes a different amount of data. When a Worker thread processes a large amount of data, there will obviously be a problem of insufficient MBUFs, which will directly affect the processing performance of the cell. The number of MBUFs in the Worker thread with a small amount of data is obviously surplus and idle, and the maximum utilization rate is not achieved. To address this problem, the present application improves the utilization rate of the MBUF of the entire station and balances the number of available MBUFs in each cell, thereby optimizing the processing performance of the entire station.
[0119] The specific steps are as follows:
[0120] S301, the total MBUF table generated after the system is initialized is stored in the Dispatcher thread management, which can be called MAIN_POOL (i.e. main line memory pool), and the MBUF table that can be managed by each Worker thread is called LOCAL_POOL (i.e. branch line memory pool);
[0121] S302, each Worker thread needs certain rules and settings to apply for MBUF, which can be called "CACHE allocation method". Specifically, three threshold parameters need to be set, namely M_CACHE_MIN (i.e., the minimum threshold of the number of memory blocks), M_CACHE_MAX (i.e., the maximum threshold of the number of memory blocks), M_CACHE_DEFAULT (the default number of memory blocks) and the current number of available MBUFs CURRENT (i.e., available memory blocks). CURRENT is a dynamic value. These parameters are used to balance the number of MBUFs of each thread:
[0122] M_CACHE_MIN: Set the minimum number of MBUFs for LOCAL_POOL;
[0123] M_CACHE_MAX: Set the maximum number of MBUFs in LOCAL_POOL;
[0124] M_CACHE_DEFAULT: Set the default number of MBUFs initially requested after LOCAL_POOL is started;
[0125] CURRENT: The number of MBUFs currently available to each Worker thread.
[0126] S303, after each Worker thread is started, it first applies for the default M_CACHE_DEFAULT MBUF quantity from MAIN_POOL, and the applied MBUF needs to be removed from MAIN_POOL and transferred to LOCAL_POOL managed by the Worker thread.
[0127] S304, each Worker thread starts working and needs to use MBUF to store business data. Each time MBUF needs to be allocated, it first applies from its own LOCAL_POOL.
[0128] First, the number of available MBUFs in the LOCAL_POOL managed by the current Worker thread is determined. If it is lower than the M_CACHE_MIN number, the number of MBUFs (M_CACHE_DEFAULT-CURRENT) is requested from the MAIN_POOL managed by the Dispatcher thread, and then the specific number of MBUFs required is allocated for use by the Worker thread.
[0129] S305, when the Worker thread MBUF is used up and recycled, the number of available MBUFs in the LOCAL_POOL managed by the current Worker thread is determined. If it is greater than M_CACHE_MAX, the LOCAL_POOL managed by the current Worker thread needs to recycle (CURRENT-M_CACHE_DEFAULT) to MAIN_POOL.
[0130] S306, through the "CACHE allocation method" allocation and recovery mechanism of the above steps S304 and S305, it can be ensured that the number of MBUFs that each Worker thread can use fluctuates within a certain range, so that the data balance of each cell can be balanced.
[0131] This embodiment also provides a pico base station memory allocation device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0132] Figure 6 is a structural block diagram of a memory allocation device for a pico base station according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:
[0133] The initial setting module 10 is used to divide the memory area in the pico base station into multiple memory blocks.
[0134] The initial setting module 10 is also used to obtain a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks.
[0135] The memory evaluation module 20 is used to detect usage information of the memory blocks to be used stored in the split-line memory pool, and determine available memory blocks of the memory blocks to be used based on the usage information.
[0136] The memory allocation module 30 is used to generate a memory resource allocation result for the memory blocks based on a comparison result between the number of available memory blocks and a preset threshold value of the number of memory blocks.
[0137] The above-mentioned initial setting module 10 is also used for storing all memory blocks in the main line memory pool;
[0138] Based on the preset default number of memory blocks of the branch-line memory pool, the memory blocks to be allocated of the main-line memory pool are allocated to each branch-line memory pool and stored as memory blocks to be used.
[0139] The memory allocation module 30 is also used for the memory block quantity threshold including the minimum threshold of the memory block quantity;
[0140] When it is detected that the number of available memory blocks is lower than a minimum threshold of the number of memory blocks, allocatable memory blocks in the memory blocks to be allocated are determined, and the allocatable memory blocks are allocated to the line memory pool.
[0141] The memory evaluation module 20 is further configured to calculate the number of allocatable memory blocks according to the preset number of default memory blocks and the number of available memory blocks, and obtain allocatable memory blocks from the mainline memory pool based on the number of allocatable memory blocks.
[0142] The memory allocation module 30 is also used for the memory block quantity threshold including the maximum threshold of the memory block quantity;
[0143] When it is detected that the number of available memory blocks is higher than the maximum threshold of the number of memory blocks, reclaimed memory blocks are obtained from the available memory blocks, and the reclaimed memory blocks are allocated to the main line memory pool.
[0144] The memory allocation module 30 is further configured to calculate the number of recovered memory blocks according to the preset number of default memory blocks and the number of available memory blocks, and obtain the recovered memory blocks from the branch memory pool based on the number of recovered memory blocks.
[0145] The above-mentioned initial setting module 10 is also used to receive user data using the main thread, and the main thread is used to manage the memory blocks in the main line memory pool;
[0146] Based on the user address in the user data, the user data is placed in the corresponding work queue. Each work queue corresponds to a branch thread one by one. The branch thread is used to manage the memory blocks in the branch memory pool.
[0147] Based on the memory resource allocation result, the user data is stored in the memory block to be used by the branch thread.
[0148] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0149] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0150] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0151] S1, divides the memory area in the pico base station into multiple memory blocks.
[0152] S2, obtaining a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks.
[0153] S3, detecting usage information of the memory blocks to be used stored in the split line memory pool, and determining available memory blocks of the memory blocks to be used based on the usage information.
[0154] S4, generating a memory resource allocation result of the pico base station based on a comparison result between the number of available memory blocks and a preset memory block number threshold.
[0155] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0156] In addition, in combination with the memory allocation method for the pico base station in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any of the memory allocation methods for the pico base station in the above embodiment is implemented.
[0157] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0158] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A memory allocation method for a pico base station, characterized in that: include: Dividing the memory area in the pico base station into a plurality of memory blocks; Obtaining a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks; Detecting usage information of the memory block to be used stored in the split-line memory pool, and determining an available memory block of the memory block to be used based on the usage information; Based on the comparison result between the number of available memory blocks and a preset memory block number threshold, a memory resource allocation result of the pico base station is generated.
2. The memory allocation method of the pico base station according to claim 1, characterized in that: After obtaining the preset main line memory pool and branch line memory pool, the method further includes: All of the memory blocks are stored in the mainline memory pool; Based on the preset default number of memory blocks of the branch-line memory pool, the to-be-allocated memory blocks of the main-line memory pool are allocated to each of the branch-line memory pools and stored as the to-be-used memory blocks.
3. The memory allocation method of the pico base station according to claim 1, characterized in that: The generating a memory resource allocation result for the memory block based on a comparison result between the number of the available memory blocks and a preset threshold value of the number of memory blocks comprises: The memory block quantity threshold includes a minimum memory block quantity threshold; In the case where it is detected that the number of available memory blocks is lower than the minimum threshold of the number of memory blocks, allocatable memory blocks in the memory blocks to be allocated are determined, and the allocatable memory blocks are allocated to the split-line memory pool.
4. The memory allocation method of the pico base station according to claim 3, characterized in that: The determining of the allocatable memory blocks in the memory blocks to be allocated comprises: The number of the allocatable memory blocks is calculated according to the preset default number of memory blocks and the number of the available memory blocks, and the allocatable memory blocks are acquired from the main line memory pool based on the number of the allocatable memory blocks.
5. The memory allocation method of the pico base station according to claim 1, characterized in that: The method further comprises: The memory block quantity threshold includes a maximum memory block quantity threshold; When it is detected that the number of available memory blocks is higher than the maximum threshold of the number of memory blocks, reclaimed memory blocks in the available memory blocks are obtained, and the reclaimed memory blocks are allocated to the main line memory pool.
6. The memory allocation method of the pico base station according to claim 5, characterized in that: The obtaining of the reclaimed memory blocks in the available memory blocks comprises: The number of the recovered memory blocks is calculated according to the preset default number of memory blocks and the number of available memory blocks, and the recovered memory blocks are obtained from the split-line memory pool based on the number of recovered memory blocks.
7. The memory allocation method for a pico base station according to any one of claims 1 to 6, characterized in that: The method further comprises: Receiving user data using a main thread, wherein the main thread is used to manage the memory blocks in the main line memory pool; Based on the user address in the user data, the user data is placed in a corresponding work queue, each of the work queues corresponds to a shunt thread one-to-one, and the shunt thread is used to manage the memory blocks in the shunt memory pool; Based on the memory resource allocation result, the user data is stored in the memory block to be used by utilizing the branch thread.
8. A memory allocation device for a pico base station, characterized in that: include: An initial setting module, used for dividing the memory area in the pico base station into a plurality of memory blocks; The initial setting module is further used to obtain a preset mainline memory pool and a branch-line memory pool; wherein the mainline memory pool stores memory blocks to be allocated in the memory blocks, and the branch-line memory pool stores memory blocks to be used in the memory blocks; A memory evaluation module, used for detecting usage information of the memory blocks to be used stored in the split-line memory pool, and determining available memory blocks of the memory blocks to be used based on the usage information; The memory allocation module is used to generate a memory resource allocation result for the memory block based on a comparison result between the number of the available memory blocks and a preset memory block number threshold.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the pico base station memory allocation method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the pico base station memory allocation method described in any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Message communication method, device and apparatus, and readable storage medium
CN108958952A
Hardware resource scheduling method and device and hardware resource scheduling equipment
CN109614223A
Nonvolatile memory resource management method, computer equipment and storage medium
CN114840338A
Data processing method and device, base station and computer readable storage medium
CN118828917A
Resource allocation realization method and system, and centralized controller and base station
WO2017101458A1