WO2022120522A1 - Procédé et dispositif d'attribution d'espace mémoire et support de stockage - Google Patents

Procédé et dispositif d'attribution d'espace mémoire et support de stockage Download PDF

Info

Publication number
WO2022120522A1
WO2022120522A1 PCT/CN2020/134258 CN2020134258W WO2022120522A1 WO 2022120522 A1 WO2022120522 A1 WO 2022120522A1 CN 2020134258 W CN2020134258 W CN 2020134258W WO 2022120522 A1 WO2022120522 A1 WO 2022120522A1
Authority
WO
WIPO (PCT)
Prior art keywords
subspace
memory
memory space
target
space
Prior art date
Application number
PCT/CN2020/134258
Other languages
English (en)
Chinese (zh)
Inventor
沈桂旭
刘延昭
董岚
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN202080067360.7A priority Critical patent/CN114556309A/zh
Priority to PCT/CN2020/134258 priority patent/WO2022120522A1/fr
Publication of WO2022120522A1 publication Critical patent/WO2022120522A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Definitions

  • Embodiments of the present invention relate to the technical field of memory allocation, and in particular, to a memory space allocation method, device, and storage medium.
  • memory allocation when performing a memory allocation operation, memory allocation may be performed in a memory linked list manner or a bit map manner.
  • memory allocation operation when the memory allocation operation is performed in the form of a memory linked list, due to the existence of an internal linked list structure, part of the memory space to be allocated is occupied.
  • the internal allocation, release and merging algorithms themselves will also have a certain running overhead. Therefore, the above-mentioned memory allocation method cannot be applied to a resource-sensitive system, which greatly affects the efficiency of memory allocation.
  • the memory allocation method of Bitmap mainly allocates memory for continuous space, and cannot guarantee mutual exclusion between allocated memory spaces. Even normal data operation operations cannot be realized.
  • the embodiments of the present invention provide a memory space allocation method, device, and storage medium, which can realize memory allocation operations for discrete memory spaces, and support memory allocation operations for multiple mutually exclusive spaces, with small resource information occupation and high memory allocation efficiency. , for resource-sensitive platforms.
  • a first aspect of the embodiments of the present invention provides a method for allocating memory space, including:
  • At least one target memory space corresponding to the memory allocation request is determined, the target memory space is in an unallocated state, and any two target memory spaces in the at least one target memory space are in an unallocated state. mutual exclusion between spaces;
  • the memory allocation request determine at least one target subspace below each target memory space in the at least one target memory space, the target subspace is in an unallocated state, and any target subspace in the at least one target subspace is in an unallocated state.
  • the two subspaces are mutually exclusive.
  • a device for allocating memory space including:
  • a processor for running a computer program stored in the memory to achieve:
  • At least one target memory space corresponding to the memory allocation request is determined, the target memory space is in an unallocated state, and any two target memory spaces in the at least one target memory space are in an unallocated state. mutual exclusion between spaces;
  • the memory allocation request determine at least one target subspace below each target memory space in the at least one target memory space, the target subspace is in an unallocated state, and any target subspace in the at least one target subspace is in an unallocated state.
  • the two subspaces are mutually exclusive.
  • a computer-readable storage medium is provided, where the storage medium is a computer-readable storage medium, and program instructions are stored in the computer-readable storage medium, and the program instructions are used to implement the above The method for allocating the memory space described in the first aspect.
  • the technical solution provided by the embodiments of the present invention effectively realizes that the memory allocation can be flexibly performed on the discrete memory space. Specifically, by obtaining the memory allocation request for the discrete memory space, the memory allocation request can be obtained and allocated based on the memory allocation request. The corresponding target memory space and the target subspace located at the lower level of the target memory space are requested, and the obtained target memory space and the target subspace are mutually exclusive. Since there is no internal linked list structure, the required occupation of data resources is effectively reduced. The size of the space is beneficial to improve the efficiency of memory allocation, so that the method is suitable for memory allocation of resource-sensitive systems, and further improves the practicability and scope of application of the method.
  • FIG. 1 is a schematic structural diagram of a memory space provided in the prior art
  • FIG. 2 is a schematic diagram of a memory linked list when memory allocation is performed for a continuous memory space provided in the prior art
  • FIG. 3 is a schematic flowchart of a method for allocating memory space according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a discretized memory space provided by an embodiment of the present invention including multiple memory spaces;
  • FIG. 5 is a schematic diagram of a memory space including multiple subspaces according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of determining at least one target memory space corresponding to the memory allocation request in the discretized memory space according to an embodiment of the present invention
  • FIG. 7 is a schematic flowchart of determining at least one target subspace below each target memory space in the at least one target memory space according to the memory allocation request according to an embodiment of the present invention
  • FIG. 8 is a schematic flowchart of another method for allocating memory space provided by an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of determining division configuration information for performing a space division operation on a memory space according to the memory allocation request according to an embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of another method for allocating memory space provided by an embodiment of the present invention.
  • FIG. 11 is a schematic flowchart 1 of a method for allocating memory space provided by an application embodiment of the present invention.
  • FIG. 12 is a second schematic flowchart of a method for allocating memory space provided by an application embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of an apparatus for allocating a memory space according to an embodiment of the present invention.
  • connection herein includes any direct and indirect means of connection. Therefore, if it is described herein that a first device is connected to a second device, it means that the first device can be directly connected to the second device or indirectly connected to the second device through another device.
  • common memory spaces include: code area, static area, heap, stack, etc.
  • code area and static area can be stored in a static manner.
  • the heap and stack can be stored dynamically, and the memory space can be allocated and released dynamically during the running of the program.
  • the stack area is automatically allocated and released by the compiler. It is mainly used to store temporary variables and local variables.
  • the heap area is generally allocated and released by the programmer. During the program operation, you can dynamically apply for a memory space of a specified size or release space. .
  • the dynamic memory allocation (memory allocation, malloc for short) method can be used for memory allocation.
  • the specific implementation principle is to maintain a memory linked list, as shown in Figure 2.
  • the memory linked list can be Including: metadata area (meta data) and data area (data), the metadata area is used to record the size, occupancy status and linked list pointer and other information of the data block, data is the data area, used to store related data.
  • the free data area in the memory linked list can be searched for allocation.
  • Another way to easily realize memory allocation is to divide the memory space into subspace blocks, and then provide each subspace block with a 1-bit identification bit, so that a bit map can be formed.
  • the identification bits (0, 1) corresponding to the space block are used to record the occupancy of the entire memory space.
  • Table 1 below the memory space can be divided into n subspace blocks. If the flag bit "0" indicates idle and the flag bit "1" indicates occupation, it can be seen from Table 1 below that the fourth subspace of the above memory space The block and the fifth subspace block are occupied. At this time, the above occupied subspace block cannot be occupied, and other subspace blocks are in an idle state, so that other subspace blocks can be allocated.
  • Bitmap's memory allocation method can efficiently implement memory allocation operations with a small footprint.
  • Bitmap's memory allocation method mainly allocates memory for continuous space, and cannot guarantee the allocated memory.
  • the memory spaces are mutually exclusive. At this time, when using the allocated memory space for data operation, data operation errors are likely to occur, and even normal data operation operations cannot be realized.
  • the vector storage space has the following characteristics: it consists of multiple independent space blocks (blocks), the internal addresses of each block are continuous, and the addresses between any two blocks are discrete. Each operand in the vector operation comes from different blocks, resulting in a new address space allocation requirement: allocate multiple blocks of block-level mutual exclusion space at the same time.
  • the present embodiment provides a memory space allocation method, device, and storage medium, wherein the allocation method obtains a memory allocation request for the discretized memory space, and then determines at least one unidentified memory space in the discretized memory space based on the memory allocation request.
  • the allocated target memory space, and any two target memory spaces in at least one target memory space are mutually exclusive.
  • At least one target memory space is determined, since the target memory space can include at least one subspace, after the memory allocation is obtained After the request, at least one unallocated target subspace located under each target memory space may be determined based on the memory allocation request, and any two obtained subspaces are mutually exclusive.
  • the above technical solution provided in this embodiment effectively realizes that memory allocation can be performed on discrete memory spaces flexibly, and is suitable for obtaining the target memory space corresponding to the memory allocation request and the target subspace located at the lower level of the target memory space.
  • the target memory space and the target subspace are mutually exclusive. Since there is no internal linked list structure that needs to occupy the memory space, the size of the space occupied by the data resources is effectively reduced, which is beneficial to improve the efficiency of memory allocation, so that the method
  • the memory allocation suitable for resource-sensitive systems further improves the practicability and scope of the method.
  • FIG. 3 is a schematic flowchart of a method for allocating memory space provided by an embodiment of the present invention; with reference to FIG. 3 , this embodiment provides a method for allocating memory space, and the execution body of the method may be a memory space allocation method. It can be understood that the allocation device for the memory space can be implemented as software or a combination of software and hardware. Specifically, the method can include:
  • Step S301 Obtain a memory allocation request for the discretized memory space.
  • Step S302 In the discretized memory space, determine at least one target memory space corresponding to the memory allocation request, the target memory space is in an unallocated state, and any two target memory spaces in the at least one target memory space are mutually exclusive .
  • Step S303 According to the memory allocation request, determine at least one target subspace below each target memory space in the at least one target memory space, the target subspace is in an unallocated state, and there is a gap between any two subspaces in the at least one target subspace. mutually exclusive.
  • Step S301 Obtain a memory allocation request for the discretized memory space.
  • the discretized memory space may include multiple independent space blocks (blocks), as shown in FIG. 4 , the multiple independent space blocks may include: block0, block1, block2...blockN, and the above-mentioned blocks of each block
  • the internal addresses are continuous, and the addresses between any two blocks are discrete.
  • a memory allocation request can be generated. It can be understood that the above-mentioned memory allocation request can be generated in an allocation device for implementing a memory space allocation operation, or, the above-mentioned memory allocation The request may be generated in a third device, wherein the third device is connected in communication with the allocation device, and the allocation device can obtain the memory allocation request for the discretized memory space through the third device.
  • an acquisition method for a memory allocation request may be: a user may input an operation to the allocation device to generate a memory allocation request according to the execution operation; or, another acquisition method for a memory allocation request may be: the user may An operation is performed on the input of the third device, so that the third device can generate a memory allocation request, and then send the memory allocation request to the allocation device, so that the allocation device can accurately obtain the memory allocation request.
  • the space blocks included in the discretized memory space may correspond to different memory allocation states, and the memory allocation states may include: used to identify that the space block is in an unallocated idle state and used to identify that the space block is in an already allocated state.
  • the assigned occupancy status The memory allocation request obtained above is used to determine a space block in an idle state that meets the requirements in the discretized memory space, so that a corresponding data processing operation is performed for the allocated space block.
  • the above data processing operation may include: Data write operations, data read operations, data delete operations, etc.
  • Step S302 In the discretized memory space, determine at least one target memory space corresponding to the memory allocation request, the target memory space is in an unallocated state, and any two target memory spaces in the at least one target memory space are mutually exclusive .
  • the discrete memory space may be analyzed and processed based on the memory allocation request to determine at least one target memory space corresponding to the memory allocation request.
  • the address information in each target memory space in the at least one target memory space is continuous, and there is a gap between any two target memory spaces in the at least one target memory space.
  • the address information is discrete; in addition, the determined target memory space may be in an unallocated state, and any two target memory spaces in at least one target memory space are mutually exclusive, so as to correspond to the determined unallocated target memory space data manipulation operations.
  • this embodiment does not limit the specific implementation of determining at least one target memory space corresponding to the memory allocation request, and those skilled in the art can set according to specific application requirements and design requirements, for example: when determining the memory allocation request After that, the size of the request space corresponding to the memory allocation request can be determined; then the allocation state corresponding to each memory space in the discretized memory space can be determined, and based on the allocation state corresponding to each memory space, in the discretized memory space , the unallocated memory space that satisfies the requested space size can be determined based on the memory allocation request, and then the above-mentioned memory space is determined as at least one target memory space corresponding to the memory allocation request, thereby effectively realizing at least one target memory space. The exact reliability of a target memory space to be determined.
  • Step S303 According to the memory allocation request, determine at least one target subspace below each target memory space in the at least one target memory space, the target subspace is in an unallocated state, and there is a gap between any two subspaces in the at least one target subspace. mutually exclusive.
  • the lower layer of each target memory space may also include one or more target subspaces.
  • the target memory space block0 may include multiple subspace blocks
  • the target memory space block1 also includes Multiple subspace blocks may be included
  • the target memory space blockN may also include multiple subspace blocks.
  • the allocation state of the subspace included in the above target memory space may include an idle state and an occupied state.
  • an allocation state identifier for identifying the subspace may be set for the subspace, for example , when the subspace is in an idle state, the allocation status flag of the subspace can be determined to be "0"; when the subspace is in an occupied state, the allocation status flag of the subspace can be determined to be "1"; of course, Those skilled in the art may also use other allocation status identifiers to identify the allocation status of the subspace, which will not be repeated here.
  • different target memory space requirements may be included for different memory allocation requests, and different target memory spaces may be determined for different target memory space requirements, and in different target memory spaces, memory allocation requests may also include Different sized subspace requirements corresponding to different memory allocation requests. Therefore, after the memory allocation request is obtained, at least one target subspace below each target memory space in the at least one target memory space may be determined based on the memory allocation request, and the determined at least one target subspace may be in an unallocated state , and any two subspaces in the at least one target subspace are mutually exclusive, thereby effectively ensuring the accuracy and reliability of determining at least one target subspace below each target memory space in the at least one target memory space.
  • the memory allocation request for the discretized memory space is obtained, and at least one target memory space corresponding to the memory allocation request is determined in the discretized memory space, and then according to the memory allocation request Determine at least one target subspace below each target memory space in at least one target memory space, thereby effectively realizing memory allocation to discrete memory spaces flexibly, and obtaining the target memory space corresponding to the memory allocation request and the target memory space located in the target memory space.
  • the target subspace at the lower level of the memory space is mutually exclusive between the obtained target memory space and the target subspace, which is conducive to reducing the size of the space occupied by data resources and improving the efficiency of memory allocation, so that this method can be suitable for It is suitable for resource- and performance-sensitive system platforms, which further improves the practicability and applicability of the method.
  • determining at least one target memory space corresponding to a memory allocation request in a discretized memory space may include:
  • Step S601 Obtain a memory mutual exclusion table based on the memory allocation request, where the memory mutual exclusion table includes: the memory space to be allocated in the discretized memory space and the space allocation status of the memory space to be allocated.
  • Step S602 In the discretized memory space, determine at least one target memory space corresponding to the memory allocation request according to the memory mutual exclusion table.
  • the discretized memory space may correspond to a memory mutual exclusion table, and the memory mutual exclusion table may include the to-be-allocated memory space in the discretized memory space and the space allocation state of the to-be-allocated memory space.
  • the memory mutex table corresponding to the discretized memory space can be stored in a static area or a dynamic area, so that after the memory allocation request is obtained, by accessing the above-mentioned static area or dynamic area
  • the memory mutex table corresponding to the discretized memory space can be obtained.
  • the memory mutex table may be temporarily generated variable information, and after the memory allocation request is obtained, the memory mutex table may be temporarily generated based on the memory allocation request, so as to perform a comparison based on the generated memory mutex table. The corresponding memory allocation operation. It can be understood that after the memory allocation operation is completed, the generated memory mutex table can be deleted or discarded.
  • the specific acquisition method for the memory mutual exclusion table is not limited to the above-mentioned implementation methods, and those skilled in the art can also use other methods to obtain the memory mutual exclusion table, as long as the memory mutual exclusion table can be guaranteed.
  • the accuracy and reliability obtained can be obtained.
  • At least one target memory space corresponding to the memory allocation request may be determined according to the memory mutual exclusion table.
  • determining at least one target memory space corresponding to the memory allocation request according to the memory mutex table may include: determining the size of the request space corresponding to the memory allocation request; in the discretized memory space , identify at least one unallocated memory space corresponding to the size of the requested space according to the preset allocation order; determine the at least one unallocated memory space determined above as at least one target memory space corresponding to the memory allocation request .
  • the memory allocation request can be analyzed and processed to determine the size of the requested space corresponding to the memory allocation request.
  • the size of the requested space corresponds to the memory allocation requirement. It is understandable that, Different memory allocation requirements can correspond to different request space sizes.
  • At least one unallocated memory space corresponding to the requested space size can be identified in the discretized memory space according to the preset allocation order. It can be understood that the at least one memory space corresponding to The space size can be greater than or equal to the requested space size.
  • the determined at least one unallocated memory space may be determined as the at least one target memory space corresponding to the memory allocation request, thereby effectively guaranteeing the at least one target memory space The accuracy and reliability of the determination.
  • the discretized memory space includes: space A, space B, space C, and space D.
  • the memory mutual exclusion corresponding to the discretized memory space can be determined based on the memory allocation request.
  • the memory mutual exclusion table may include: space A, space B, space C, and space D, and space allocation states corresponding to space A, space B, space C, and space D respectively. It is assumed that the space allocation state of space A is occupied state, the space allocation state of space B is idle state, the space allocation state of space C is idle state, and the space allocation state of space D is occupied state.
  • the size of the requested space corresponding to the memory allocation request can be determined.
  • the size of the requested space corresponds to the two memory spaces to be allocated
  • the above-mentioned discrete memory spaces can be analyzed in a preset order.
  • it can be identified that at least one unallocated memory space corresponding to the requested space size can include space B and space C, and then space B and space C can be determined as at least one target corresponding to the memory allocation request memory space, thereby effectively ensuring the accurate reliability of determining at least one target memory space.
  • the memory mutual exclusion table is obtained through the memory allocation request, and then in the discretized memory space, at least one target memory space corresponding to the memory allocation request is determined according to the memory mutual exclusion table, which not only ensures that the at least one target memory space is The accuracy and reliability of memory space determination.
  • the memory mutex table can be stored in a static storage area or a dynamic storage area, or the memory mutex table can also be a temporary variable, it is necessary to determine at least one based on the memory mutex table.
  • the resource space occupied by the memory mutex table at this time is small, which is beneficial to improve the memory allocation efficiency and further improves the practicability of the method.
  • the method in this embodiment may further include: in the discretized memory space, when at least one unallocated memory space corresponding to the size of the requested space is not identified, generating a memory space for identifying a memory space allocation failure the first prompt message.
  • the discretized memory space when there is no memory space corresponding to the size of the requested space in the memory allocation request in the discretized memory space, at least one target memory space cannot be identified in the discretized memory space.
  • a message for identifying memory space allocation failure can be generated.
  • the first prompt information is used to prompt the user that the memory space allocation operation at this time has failed through the first prompt information.
  • the discretized memory space includes: space A, space B, space C, and space D.
  • the memory mutual exclusion corresponding to the discretized memory space can be determined based on the memory allocation request.
  • Table, the memory mutual exclusion table can include: space A, space B, space C and space D and space allocation status corresponding to space A, space B, space C and space D respectively, assuming the space allocation status of space A In the occupied state, the space allocation state of the space B is the idle state, the space allocation state of the space C is the idle state, and the space allocation state of the space D is the occupied state.
  • the size of the requested space corresponding to the memory allocation request can be determined.
  • the size of the requested space corresponds to the three memory spaces to be allocated, at this time, the above-mentioned discrete memory spaces can be allocated in a preset order.
  • it can be determined that there is no unallocated at least one memory space corresponding to the size of the requested space in the discretized memory space.
  • the first prompt information for identifying the memory space allocation failure can be generated, and the generated first prompt information can be sound prompt information, light prompt information, information prompt information, etc. etc., so that the user can know in time that the memory allocation operation has failed at this time through the first prompt information, which further improves the flexibility and reliability of the method.
  • the method in this embodiment may further include: performing an operation on at least one target memory space included in the memory mutual exclusion table The space allocation state of the space is reset to identify the space allocation state of at least one target memory space as an unallocated state.
  • the memory space included in the discretized memory space when a memory allocation operation is performed, at least one target memory space corresponding to the memory allocation request can be obtained, and then based on the determined target memory space can be obtained.
  • the memory space performs the corresponding data operation operation, and after the data operation operation is completed, the target memory space corresponding to the data operation operation can be released.
  • the The space allocation state of the included at least one target memory space is reset to identify the space allocation state of the at least one target memory space as an unallocated state, so that the next time a memory allocation request is obtained, all in the memory allocation request can be based on the memory allocation request.
  • the memory space in the unallocated state is used for memory allocation operations, thereby helping to improve the quality and efficiency of memory allocation operations.
  • FIG. 7 is a schematic flowchart of determining at least one target subspace under each target memory space in at least one target memory space according to a memory allocation request according to an embodiment of the present invention; on the basis of the above embodiment, continue to refer to FIG. 7
  • this embodiment does not limit the specific implementation manner for determining at least one target subspace, and those skilled in the art can set it according to specific application requirements and design requirements.
  • the request to determine at least one target subspace below each target memory space in the at least one target memory space may include:
  • Step S701 Obtain a subspace lookup table based on the memory allocation request, where the subspace lookup table includes: the subspace to be allocated and the subspace allocation status of the subspace to be allocated.
  • Step S702 According to the subspace lookup table, determine at least one target subspace under each target memory space in the at least one target memory space, the target subspace is in an unallocated state, and any two subspaces in the at least one target subspace are determined. mutually exclusive.
  • the memory space requirements corresponding to the memory allocation request may include space allocation requirements for the target memory space and subspace allocation requirements for the subspace located at the lower level of the target memory space.
  • the subspace lookup table corresponding to the memory space included in the discretized memory space may be stored in a static region or a dynamic region. In this way, after the memory allocation request is obtained, the subspace lookup table corresponding to the memory space included in the discretized memory space can be obtained by accessing the above-mentioned static area or dynamic area.
  • the subspace lookup table may be temporarily generated variable information, and after the memory allocation request is obtained, the temporarily generated subspace lookup table may be determined based on the memory allocation request. Specifically, the size of the space region corresponding to the subspace lookup table may be smaller than or equal to the size of the space region of the corresponding target memory space. It can be understood that, after the memory allocation operation is completed, the generated subspace lookup table can be deleted or discarded.
  • the specific acquisition method of the subspace lookup table is not limited to the above-mentioned implementation methods, and those skilled in the art can also obtain the subspace lookup table in other ways, as long as it can ensure that the subspace lookup table is performed.
  • the accuracy and reliability obtained can be obtained.
  • each target memory space in the at least one target memory space at least one target subspace below each target memory space in the at least one target memory space can be determined according to the subspace lookup table , the determined target subspace may be in an unallocated state, and any two subspaces in at least one target subspace are mutually exclusive.
  • determining at least one target subspace below each target memory space in the at least one target memory space may include: determining the size of the request subspace corresponding to the memory allocation request; In each target memory space in the memory space, use a bit search method according to the subspace lookup table to identify at least one unallocated subspace corresponding to the size of the requested subspace; The space is determined to be at least one target subspace corresponding to the memory allocation request.
  • the memory allocation request can be analyzed and processed to determine the size of the request subspace corresponding to the memory allocation request, and then the size of each target memory space in the at least one target memory space can be determined.
  • a bit search method is used to identify at least one unallocated subspace corresponding to the requested subspace size; it can be understood that the space size corresponding to at least one subspace may be greater than or equal to the requested subspace. Subspace size.
  • the determined unallocated at least one subspace can be determined as the at least one target subspace corresponding to the memory allocation request, thereby effectively ensuring that the at least one target subspace is not allocated to the at least one target subspace.
  • the accuracy and reliability of the determination is the case where the unallocated at least one subspace is determined.
  • a target memory space in the discretized memory space may include subspace a1, subspace a2, subspace a3, and subspace a4 to be allocated.
  • the subspace lookup table may include: subspace a1, subspace a2, subspace a3 and subspace a4 to be allocated, and subspace a1, subspace a2 respectively , the subspace allocation status of subspace a3 and subspace a4, assuming that the subspace allocation status of subspace a1 is occupied, the subspace allocation status of subspace a2 is idle, and the subspace allocation status of subspace a3 is idle state, the subspace allocation state of the subspace a4 is the occupied state.
  • the size of the requested subspace corresponding to the memory allocation request can be determined.
  • the size of the requested subspace corresponds to the two subspaces to be allocated, it can be identified that the size of the requested subspace corresponds to the size of the requested space.
  • the allocated at least one subspace can include subspace a2 and subspace a3, and then the subspace a2 and subspace a3 can be determined as at least one target subspace corresponding to the memory allocation request, thereby effectively ensuring that the at least one target subspace is The accuracy and reliability of the determination of the space.
  • the method in this embodiment may further include: when at least one target subspace below each target memory space in the at least one target memory space is not determined according to the subspace lookup table, generating a subspace for identifying the subspace The second prompt message for space allocation failure.
  • second prompt information for identifying the failure of subspace allocation can be generated to pass the second prompt message to inform the user that the memory allocation operation for the subspace at this time has failed.
  • the target memory space includes subspace a1, subspace a2, subspace a3, and subspace a4 to be allocated.
  • the corresponding discretized memory space can be determined based on the memory allocation request.
  • the subspace lookup table of the Corresponding subspace allocation status assuming that the subspace allocation status of subspace a1 is occupied, the subspace allocation status of subspace a2 is idle, the subspace allocation status of subspace a3 is idle, and the subspace of subspace a4
  • the allocation state is the occupied state.
  • the size of the requested subspace corresponding to the memory allocation request can be determined.
  • the size of the requested subspace corresponds to the three subspaces to be allocated, at this time, there is no subspace related to the request in the target memory space.
  • at least one unallocated subspace corresponding to the size of the space and then it can be determined that the subspace allocation operation fails, and second prompt information for identifying the failure of subspace allocation can be generated, and the generated second prompt information can be a sound prompt information, lighting prompt information, information prompt information, etc., so that the user can know in time that the subspace memory allocation operation has failed at this time through the second prompt information, which further improves the flexibility and reliability of the method.
  • the method in this embodiment may further include: searching the subspace lookup table for The subspace allocation status flag of the included at least one target subspace is set to indicate that the subspace allocation status of the at least one target subspace is an allocated state.
  • At least one target subspace below each target memory space in the at least one target memory space can be determined. Afterwards, a corresponding data operation operation is performed based on the determined at least one target subspace, and after the data operation operation is completed, the target subspace corresponding to the data operation operation has been occupied.
  • the subspace allocation status flag of at least one target subspace included in the subspace lookup table may be set to identify the subspace allocation of the at least one target subspace The state is allocated, so that when the next memory allocation request is obtained, the memory allocation operation can be performed on other subspaces in the unallocated state based on the memory allocation request, which is beneficial to improve the quality and efficiency of the memory allocation operation.
  • FIG. 8 is a schematic flowchart of another method for allocating memory space provided by an embodiment of the present invention; on the basis of the above-mentioned embodiment, and continuing to refer to FIG. 8 , before acquiring a subspace lookup table based on a memory allocation request, this
  • the method in an embodiment may also include:
  • Step S801 According to the memory allocation request, determine the division configuration information for performing the space division operation on the memory space.
  • the memory allocation request can be analyzed and processed to determine the division configuration information for performing the space division operation on the memory space.
  • the division configuration information may include at least one of the following: the number of divisions: , divide the area size, divide the address information. It can be understood that the number of divisions corresponding to the memory space, the size of the divided area, and the specific values corresponding to the divided address information can be adjusted according to different application scenarios and application requirements.
  • different partition configuration information may correspond to different memory partition operations.
  • the partition configuration information includes the number of partitions
  • the memory space can be equally divided based on the number of partitions, thereby A subspace satisfying the above-mentioned number of divisions can be obtained.
  • the division configuration information includes the size of the division area
  • the memory space may be divided based on the size of the division area, so as to obtain multiple subspaces satisfying the size of the division area.
  • the division configuration information includes division address information
  • the memory space may be divided based on the division address information, so that multiple subspaces satisfying the foregoing division address information can be obtained.
  • the division configuration information for performing the space division operation on the memory space may be configured by the user for the memory space, and after the division configuration information is configured, the division configuration information may be stored in a preset area. After the memory allocation request is obtained, the preset area can be accessed based on the memory allocation request, so that the division configuration information for performing the space division operation on the memory space can be obtained accurately and effectively.
  • the division configuration information may not only include the above-defined configuration information, and those skilled in the art may set it according to specific application requirements and design requirements.
  • the division configuration information may also include the processing data size. After the processing data size is obtained, the memory space can be divided based on the divided address information, so that the utilization of the memory space can be maximized while satisfying the data processing operation.
  • the memory space can be divided based on the data with the largest amount of data.
  • the above-mentioned memory space can be divided by the above-mentioned data size, so that each The size of the divided subspace is 4k, which can avoid the waste of memory space while taking into account the data processing efficiency.
  • Step S802 Divide the memory space into multiple subspaces based on the division configuration information, and generate a subspace lookup table corresponding to the multiple subspaces.
  • the memory space may be divided into multiple subspaces based on the division configuration information.
  • the size of the space regions corresponding to the multiple subspaces included in the same memory space may be the same or different.
  • the size of the space regions corresponding to the multiple subspaces included in the same memory space may be the same.
  • a subspace lookup table corresponding to the multiple subspaces may be generated for the multiple subspaces, and the subspace lookup table may include: the subspace to be allocated and the subspace of the subspace to be allocated Allocation state to implement memory allocation operations based on subspace lookup tables.
  • the division configuration information for performing the space division operation on the memory space is determined through the memory allocation request, and then the memory space is divided into multiple subspaces based on the division configuration information , which effectively realizes that the memory space can be divided into multiple different subspaces according to different application scenarios and application requirements, and the subspace lookup table corresponding to the multiple subspaces can be generated, and then it is convenient to use the subspace lookup table.
  • Performing memory allocation operations further improves the practicability and applicability of the method.
  • FIG. 9 is a schematic flowchart of determining division configuration information for performing a space division operation on a memory space according to a memory allocation request according to an embodiment of the present invention.
  • the specific implementation method for determining the division configuration information used to perform the space division operation on the memory space is not limited, and those skilled in the art can set it according to specific application scenarios and design requirements.
  • the division configuration information for determining the space division operation for the memory space may include:
  • Step S901 Obtain at least one operation data length corresponding to the memory allocation request.
  • the memory allocation request can be analyzed and processed, so that at least one operation data length corresponding to the memory allocation request can be obtained.
  • the data size of the operand corresponding to the data operation processing operation is obtained.
  • this embodiment does not limit the specific implementation of acquiring the length of at least one operation data corresponding to the memory allocation request, and those skilled in the art can set it according to specific application requirements and design requirements.
  • the memory allocation request may include an operation data length, and by performing a feature extraction operation on the memory allocation request, at least one operation data length corresponding to the memory allocation request can be obtained.
  • mapping relationships between different memory allocation requests and operation data lengths are preset, and after the memory allocation request is acquired, at least one operation corresponding to the memory allocation request can be determined based on the above mapping relationship Data length.
  • Step S902 In at least one operation data length, obtain the maximum target operation data length.
  • Step S903 Based on the target operation data length, determine the division configuration information for performing the space division operation on the memory space.
  • determining the division configuration information for performing the space division operation on the memory space may include: obtaining the total area size of the memory space; Based on the ratio between the total area size and the target operation data length, the number of divisions used for the space division operation of the memory space is determined.
  • the division configuration information includes the division quantity
  • the total area size of the memory space can be obtained, and then the The ratio between the total area size and the target operation data length, and then the above ratio can be analyzed and processed to determine the number of divisions used for space division operations on the memory space.
  • performing analysis processing on the comparison value and determining the number of divisions used for performing the space division operation on the memory space may include: performing an upward rounding operation on the comparison value, and then determining the number after performing the rounding operation as the number used for performing the space division operation on the memory space. The number of divisions of the space for the space division operation, thereby effectively ensuring the accuracy and reliability of determining the number of divisions.
  • At least one operation data length corresponding to the memory allocation request is obtained, and then the maximum target operation data length is obtained from the at least one operation data length, and the target operation data length is determined based on the target operation data length.
  • the division configuration information (the division quantity) of the space division operation thereby effectively ensuring the accuracy and reliability of obtaining the division quantity in the division configuration information.
  • Figure 10 is a schematic flowchart of another method for allocating memory space provided by an embodiment of the present invention; on the basis of any of the above-mentioned embodiments, and continuing to refer to Figure 10, the method in this embodiment may also include:
  • Step S1001 Obtain a memory release request.
  • Step S1002 Determine the memory space to be released and the subspace to be released in the memory space according to the memory release request.
  • Step S1003 Release the memory space and the subspace.
  • a memory release operation can be performed on the memory space, and a memory release request can be generated and obtained at this time, and the memory release request is used to perform the data operation operation on the memory space.
  • the memory space is released.
  • the memory release request may be analyzed and processed to determine the memory space to be released and the subspace located in the memory space to be released corresponding to the memory release request.
  • a release operation can be performed on the determined memory space and subspace, so that other data operation operations can be performed based on the released memory space and subspace, which further improves the practicability of the memory allocation method.
  • the method in this embodiment may further include:
  • Step S1101 Reset the space allocation state of the released memory space in the memory mutual exclusion table corresponding to the memory space to identify the released memory space as an unallocated state;
  • the space allocation of the released memory space in the memory mutex table corresponding to the memory space can be performed.
  • the state is reset to identify the released memory space as an unallocated state, so that memory allocation operations can be performed on the unallocated memory space during subsequent data operation operations or memory allocation operations, which is conducive to improving space utilization.
  • the stability and reliability of the method are further improved.
  • Step S1102 Set the subspace allocation state of the released subspace in the subspace lookup table corresponding to the subspace to identify the released subspace as an unallocated state.
  • the subspace of the released subspace in the subspace corresponding to the subspace can be searched.
  • the space allocation state is set to identify the released subspace as an unallocated state, so that memory allocation operations can be performed on the unallocated subspace during subsequent data operation operations or memory allocation operations, which is conducive to improving the space availability.
  • the utilization rate is further improved, and the stable reliability of the method is further improved.
  • this application embodiment provides a memory allocation method for a double-layer space, which can perform a memory allocation operation for a discretized space.
  • the method can be suitable for resource- and performance-sensitive systems or platforms. Specifically, the method may include the following steps:
  • Step 1 Get a memory allocation request for the discretized memory space.
  • the discretized memory space may be a double-layered space structure, that is, the discretized memory space may include one or more memory space blocks, and the multiple memory spaces may be: block0, block1, block2...blockN, each Each memory space may include a plurality of subspaces; and, each of the above blocks may be an independent storage unit, whose internal addresses are continuous, and the addresses between each block are discrete.
  • each vector operand corresponds to a different block. In the process of allocating vector operands, it is necessary to ensure mutual exclusion between the allocated blocks.
  • a memory allocation operation can be performed on the block and one or more subspaces located in the lower layer of the block based on the memory allocation request, so that the method can realize the block level of the memory space and multiple subspaces located in the lower layer of the memory space.
  • Mutually exclusive subspaces perform memory allocation operations at the same time.
  • this method can also provide a configuration interface of subspace granularity, so that before performing the memory allocation operation, the partition granularity of each block can be configured according to the data processing requirements through the above configuration interface.
  • the configuration interface may include the following:
  • the granularity configuration interface "void set_unit_length(size_t byte_len)" is used to configure the length of the subspace in the block, and the unit can be byte.
  • the block layer releases the interface "void free_block(void*ptr_block)", which is used to release the block where the ptr_block is located.
  • the subspace allocation interface "bool malloc_subspace(size_t len, void*ptr_s)" is used to allocate a subspace with a single block length of len. After the allocation is successful, assign ptr_s as the address of the subspace and return "True” "; after the allocation fails, assign "NULL” and return "False”.
  • the subspace allocation interface "bool malloc_subspace(size_t len1, void*ptr_s1, size_t len2, void*ptr_s2)" is used to allocate two blocks of mutually exclusive subspaces of length len1 and len2 at the same time. After the allocation is successful, Then assign ptr_s1 and ptr_s2 as the address of the subspace, and return "True”; after the allocation fails, assign "NULL” and return "False”.
  • the subspace allocation interface "bool malloc_subspace(size_t len1, void*ptr_s1, size_t len2, void*ptr_s2, size_t len3, void*ptr_s3)" is used to allocate three blocks of length len1, len2, len3 at the same time.
  • Subspace allocation interface "bool malloc_subspace(size_t len1, void*ptr_s1, size_t len2, void*ptr_s2, size_t len3, void*ptr_s3, size_t len4, void*ptr_s4)", used to allocate four blocks of length len1 at the same time , len2, len3, len4 block mutually exclusive subspace, after successful allocation, assign ptr_s1, ptr_s2, ptr_s3, ptr_s4 as the address of the subspace, and return "True”; after the allocation fails, assign "NULL", and returns "False”.
  • the subspace allocation interface "void free_subspace(void*ptr_s, size_t unit_num)" is used to release unit_num blocks of subspaces starting from ptr_s to realize the release operation of the subspace.
  • the corresponding memory mutex table and subspace lookup table can be allocated for each block application according to the granularity of division.
  • the memory mutex table is used to record the Occupancy
  • the subspace lookup table is used to record the occupancy of at least one subspace included in the lower layer of each block.
  • "0" may be used to indicate that the memory space or subspace is in an unoccupied state
  • "1" may be used to indicate that the memory space or subspace is in an occupied state.
  • the subspace lookup table when performing a memory allocation operation on the block layer space, can be used to find unoccupied blocks in all subspaces, and then a memory allocation operation can be performed on the above-mentioned unoccupied blocks. After the memory allocation operation is performed on the block, the identifiers in the subspace lookup table can be flipped as a whole. It can be understood that the above memory allocation operation satisfies the requirement of mutual exclusion of blocks, and can provide a pre-order when the memory is released. Setting the interface to reset the lookup table of the entire block is conducive to completing the block release operation.
  • a bit search can be performed through the subspace lookup table, so that space allocation and release operations can be implemented; in some instances, this embodiment provides the simultaneous allocation of multiple blocks
  • the implementation method of the exclusive subspace can support simultaneous allocation operations of up to 4 subspaces.
  • Step 2 Based on the memory allocation request, use the memory mutual exclusion table to find at least one target memory space corresponding to the memory allocation request.
  • the preset pointer blocki can be controlled to point to block0 based on the memory allocation request, that is, the unoccupied memory space is searched from blcok0.
  • blocki can be determined as a target memory space.
  • Step 3 After obtaining the target memory space, the subspace lookup table can be used to determine at least one target subspace below the target memory space, and the determined at least one target subspace is the unoccupied subspace that meets the requirements. space.
  • Step 4 After finding a free target subspace, the allocation operation of the next subspace can be continued in the memory mutex table and subspace lookup table where the target subspace is located.
  • Step 5 Until all the subspaces that need to perform the memory allocation operation are found to complete the allocation operation, the allocation is ended, and the mutex table is reset.
  • step 2 blocki is in the allocated state in this space allocation process, or, if the free space of blocki in step 3 is insufficient, move to the next block to search again. If moving to the end of the block still cannot meet the memory allocation requirements, the space allocation operation fails. At this time, the memory allocation operation can be ended, and the mutex table and the currently allocated space can be released.
  • a bitwise search method can be used to find the subspace corresponding to the memory allocation request.
  • the method may include the following steps:
  • Step S11 Determine all the subspaces to be searched according to the size and granularity of the space requirement, and initialize the bit search pointer bit mask used for the subspace search operation.
  • the bit mask can be determined to be 0b11111111.
  • Step S12 Under the condition that the bit mask does not exceed the lookup table length (total space size) of the block, it can be determined whether the current subspace interval is available according to the lookup table, reference bits and "&bit mask". If the identification bit of the subspace is "0", it indicates that the subspace is in an allocatable state, and the allocation table of the subspace can be set to complete the memory allocation operation.
  • Step S13 If the identification bit of the subspace is "1", it indicates that the subspace is in an unallocable state, and the bit mask is shifted to the left by one bit, and the free subspace memory is continued to be searched.
  • the method in this embodiment may further include a memory release operation.
  • a memory release operation for the discrete memory space, there may be corresponding two release methods of block release as a whole and subspace release.
  • the block corresponding to the input parameter address can be determined, and then the memory release operation is performed on the block determined above, and the lookup table of the block is reset as a whole.
  • the memory release operation is performed on the subspace, the subspace to be released can be determined by the provided subspace starting address and the number of released particles, and the memory release operation can be performed on the determined subspace.
  • the memory allocation method provided by this application embodiment effectively realizes that the memory allocation can be flexibly performed on the discrete memory space. Specifically, by obtaining the memory allocation request for the discrete memory space, the memory allocation request can be obtained based on the memory allocation request.
  • the target memory space corresponding to the allocation request and the target subspace located at the lower level of the target memory space are mutually exclusive.
  • the obtained target memory space and the target subspace are mutually exclusive. Since there is no internal linked list structure, the required data resources are effectively reduced.
  • the size of the occupied space is conducive to improving the efficiency of memory allocation, so that the method is suitable for memory allocation of resource-sensitive systems, and the practicability and application scope of the method are further improved.
  • FIG. 13 is a schematic structural diagram of an apparatus for allocating memory space provided by an embodiment of the present invention. with reference to FIG. 13 , this embodiment provides an apparatus for allocating memory space, and the apparatus for allocating memory space is used to execute the corresponding device shown in FIG. 3 .
  • the memory space allocation method specifically, the allocation device may include:
  • the processor 11 is used for running the computer program stored in the memory 12 to realize:
  • the target memory space determines at least one target memory space corresponding to the memory allocation request, the target memory space is in an unallocated state, and any two target memory spaces in the at least one target memory space are mutually exclusive;
  • At least one target subspace below each target memory space in the at least one target memory space is determined, the target subspace is in an unallocated state, and any two subspaces in the at least one target subspace are mutually exclusive.
  • the structure of the apparatus for allocating memory space may further include a communication interface 13 for enabling the apparatus for allocating memory space to communicate with other devices or a communication network.
  • the address information in each target memory space in the at least one target memory space is continuous, and the address information between any two target memory spaces in the at least one target memory space is discrete.
  • the processor 11 when the processor 11 determines at least one target memory space corresponding to the memory allocation request in the discretized memory space, the processor 11 may be configured to perform: acquiring the memory mutex table based on the memory allocation request,
  • the memory mutual exclusion table includes: the memory space to be allocated in the discretized memory space and the space allocation status of the memory space to be allocated; in the discretized memory space, at least one memory allocation request corresponding to the memory allocation request is determined according to the memory mutual exclusion table. target memory space.
  • the processor 11 when the processor 11 is in the discretized memory space and determines at least one target memory space corresponding to the memory allocation request according to the memory mutex table, the processor 11 may be configured to execute: determine the memory allocation request The corresponding request space size; in the discretized memory space, identify at least one unallocated memory space corresponding to the requested space size according to the preset allocation order; determine the above determined unallocated at least one memory space as At least one target memory space corresponding to the memory allocation request.
  • the processor 11 in this embodiment may be used to execute: in the discretized memory space, when at least one unallocated memory space corresponding to the size of the requested space is not identified, generate a memory space for identifying the memory The first prompt message for space allocation failure.
  • the processor 11 in this embodiment may be configured to perform: The space allocation state of the target memory space is reset to identify the space allocation state of at least one target memory space as an unallocated state.
  • the processor 11 when the processor 11 determines, according to the memory allocation request, at least one target subspace below each target memory space in the at least one target memory space, the processor 11 may be configured to execute: obtain the subspace based on the memory allocation request A space lookup table, the subspace lookup table includes: the subspace to be allocated and the subspace allocation status of the subspace to be allocated; according to the subspace lookup table, determine at least one target subspace below each target memory space in the at least one target memory space space, the target subspace is unallocated, and any two subspaces in at least one target subspace are mutually exclusive.
  • the processor 11 when the processor 11 determines, according to the subspace lookup table, at least one target subspace below each target memory space in the at least one target memory space, the processor 11 may be configured to perform: determining and requesting a memory allocation The corresponding requested subspace size; in each target memory space in at least one target memory space, use a bit search method according to the subspace lookup table to identify at least one unallocated subspace corresponding to the requested subspace size ; Determine at least one unallocated subspace determined above as at least one target subspace corresponding to the memory allocation request.
  • the size of the space region corresponding to the subspace lookup table is less than or equal to the size of the space region of the corresponding target memory space.
  • the processor 11 in this embodiment is configured to execute: when at least one target subspace below each target memory space in the at least one target memory space is not determined according to the subspace lookup table, generate a Second prompt information identifying failure of subspace allocation.
  • the processor 11 in this embodiment is configured to execute:
  • the subspace allocation status flag of the at least one target subspace included in the subspace is set to indicate that the subspace allocation status of the at least one target subspace is an allocated state.
  • the processor 11 in this embodiment is configured to perform: according to the memory allocation request, determine division configuration information for performing a space division operation on the memory space; based on the memory allocation request; The division configuration information divides the memory space into a plurality of subspaces, and generates a subspace lookup table corresponding to the plurality of subspaces.
  • the division configuration information includes at least one of the following: division quantity, division area size, division address information.
  • the space regions corresponding to multiple subspaces included in the same memory space have the same size or different sizes.
  • the processor 11 determines the division configuration information for performing a space division operation on the memory space according to the memory allocation request
  • the processor 11 is configured to execute: acquiring at least one operation data corresponding to the memory allocation request length; in at least one operation data length, the maximum target operation data length is obtained; based on the target operation data length, the division configuration information for performing the space division operation on the memory space is determined.
  • the division configuration information includes: the number of divisions; when the processor 11 determines the division configuration information for performing a space division operation on the memory space based on the target operation data length, the processor 11 is configured to execute: obtain the memory space The total area size of ; based on the ratio between the total area size and the target operation data length, determine the number of divisions used for space division operations on the memory space.
  • the processor 11 in this embodiment is configured to perform: acquiring a memory release request; determining the memory space to be released and the subspace to be released in the memory space according to the memory release request; release operation.
  • the processor 11 in this embodiment is configured to perform: reset the space allocation state of the released memory space in the memory mutex table corresponding to the memory space , to identify the released memory space as unallocated; set the subspace allocation status of the released subspace in the subspace lookup table corresponding to the subspace to identify the released subspace as unallocated .
  • the apparatus shown in FIG. 13 can execute the method of the embodiment shown in FIG. 3-FIG. 12. For parts not described in detail in this embodiment, reference may be made to the related description of the embodiment shown in FIG. 3-FIG. 12. For the execution process and technical effect of the technical solution, refer to the descriptions in the embodiments shown in FIG. 3 to FIG. 12 , which will not be repeated here.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by an electronic device, which includes the memory space allocation method involved in executing the method embodiment shown in FIG. 3-FIG. 12 above. program.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer processor (processor) to perform all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System (AREA)

Abstract

Procédé et dispositif d'attribution d'espace mémoire et support de stockage. Le procédé consiste : à acquérir une demande d'attribution de mémoire pour des espaces mémoire individuels ; à déterminer un ou plusieurs espaces mémoire cibles, correspondant à la demande d'attribution de mémoire, parmi les espaces mémoire individuels, lesdits espaces mémoire cibles étant dans un état non attribué et deux espaces mémoire cibles quelconques desdits espaces mémoire cibles étant mutuellement exclusifs ; et selon la demande d'attribution de mémoire, à déterminer un ou plusieurs sous-espaces cibles au niveau d'une couche inférieure de chaque espace mémoire cible desdits espaces mémoire cibles, lesdits sous-espaces cibles étant dans un état non attribué et deux sous-espaces quelconques desdits sous-espaces cibles étant mutuellement exclusifs. Selon la solution technique fournie par le présent mode de réalisation, une attribution de mémoire souple peut être réalisée efficacement sur des espaces mémoire individuels, les espaces mémoire cibles obtenus sont mutuellement exclusifs et les sous-espaces cibles obtenus sont également mutuellement exclusifs, de telle sorte que la taille de l'espace occupé par les ressources de données est efficacement réduite et l'amélioration de l'efficacité d'attribution de mémoire est facilitée.
PCT/CN2020/134258 2020-12-07 2020-12-07 Procédé et dispositif d'attribution d'espace mémoire et support de stockage WO2022120522A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080067360.7A CN114556309A (zh) 2020-12-07 2020-12-07 内存空间的分配方法、装置及存储介质
PCT/CN2020/134258 WO2022120522A1 (fr) 2020-12-07 2020-12-07 Procédé et dispositif d'attribution d'espace mémoire et support de stockage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/134258 WO2022120522A1 (fr) 2020-12-07 2020-12-07 Procédé et dispositif d'attribution d'espace mémoire et support de stockage

Publications (1)

Publication Number Publication Date
WO2022120522A1 true WO2022120522A1 (fr) 2022-06-16

Family

ID=81668400

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/134258 WO2022120522A1 (fr) 2020-12-07 2020-12-07 Procédé et dispositif d'attribution d'espace mémoire et support de stockage

Country Status (2)

Country Link
CN (1) CN114556309A (fr)
WO (1) WO2022120522A1 (fr)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617531A (zh) * 2022-11-16 2023-01-17 沐曦集成电路(上海)有限公司 一种快速检测离散资源的方法、装置、存储介质及设备
CN117311997A (zh) * 2023-11-29 2023-12-29 苏州元脑智能科技有限公司 一种计算芯片的内存管理方法、装置及计算芯片

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115933994B (zh) * 2023-01-09 2023-07-14 苏州浪潮智能科技有限公司 一种数据处理方法、装置、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040049650A1 (en) * 2002-09-11 2004-03-11 Jing Ling Dynamic memory allocation for packet interfaces
CN103455433A (zh) * 2013-08-19 2013-12-18 曙光信息产业股份有限公司 内存管理方法及系统
US20140095812A1 (en) * 2012-09-28 2014-04-03 Appli Inc. Obfuscating function resources while reducing stack consumption
CN104182356A (zh) * 2014-09-19 2014-12-03 深圳市茁壮网络股份有限公司 一种内存管理方法、装置及终端设备
CN106502918A (zh) * 2016-09-19 2017-03-15 上海华为技术有限公司 一种内存调度方法及装置
CN111475299A (zh) * 2020-04-03 2020-07-31 Oppo广东移动通信有限公司 内存分配方法、装置、存储介质及电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040049650A1 (en) * 2002-09-11 2004-03-11 Jing Ling Dynamic memory allocation for packet interfaces
US20140095812A1 (en) * 2012-09-28 2014-04-03 Appli Inc. Obfuscating function resources while reducing stack consumption
CN103455433A (zh) * 2013-08-19 2013-12-18 曙光信息产业股份有限公司 内存管理方法及系统
CN104182356A (zh) * 2014-09-19 2014-12-03 深圳市茁壮网络股份有限公司 一种内存管理方法、装置及终端设备
CN106502918A (zh) * 2016-09-19 2017-03-15 上海华为技术有限公司 一种内存调度方法及装置
CN111475299A (zh) * 2020-04-03 2020-07-31 Oppo广东移动通信有限公司 内存分配方法、装置、存储介质及电子设备

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617531A (zh) * 2022-11-16 2023-01-17 沐曦集成电路(上海)有限公司 一种快速检测离散资源的方法、装置、存储介质及设备
CN115617531B (zh) * 2022-11-16 2023-04-28 沐曦集成电路(上海)有限公司 一种快速检测离散资源的方法、装置、存储介质及设备
CN117311997A (zh) * 2023-11-29 2023-12-29 苏州元脑智能科技有限公司 一种计算芯片的内存管理方法、装置及计算芯片
CN117311997B (zh) * 2023-11-29 2024-02-23 苏州元脑智能科技有限公司 一种计算芯片的内存管理方法、装置及计算芯片

Also Published As

Publication number Publication date
CN114556309A (zh) 2022-05-27

Similar Documents

Publication Publication Date Title
WO2022120522A1 (fr) Procédé et dispositif d'attribution d'espace mémoire et support de stockage
US11082206B2 (en) Layout-independent cryptographic stamp of a distributed dataset
CN110663019B (zh) 用于叠瓦式磁记录(smr)的文件系统
WO2017107414A1 (fr) Procédé et dispositif d'opération de fichier
US8381230B2 (en) Message passing with queues and channels
KR102290540B1 (ko) 네임스페이스/스트림 관리
CN110858162B (zh) 内存管理方法及装置、服务器
WO2019001020A1 (fr) Procédé d'agencement d'espace de stockage, appareil et système basé sur un système distribué
CN103577345A (zh) 提高由多个系统共享的存储高速缓存灵活性的方法和结构
WO2011159495A2 (fr) Allocation hiérarchique pour dispositif de stockage de système de fichiers
US10824555B2 (en) Method and system for flash-aware heap memory management wherein responsive to a page fault, mapping a physical page (of a logical segment) that was previously reserved in response to another page fault for another page in the first logical segment
US10310986B1 (en) Memory management unit for shared memory allocation
JP7467593B2 (ja) リソース割振り方法、記憶デバイス、および記憶システム
CN107533435B (zh) 存储空间的分配方法及存储设备
WO2015085826A1 (fr) Procédé et appareil pour accéder à une ressource partagée
WO2024099448A1 (fr) Procédé et appareil de libération de mémoire, procédé et appareil de récupération de mémoire, dispositif informatique et support de stockage
CN107408132B (zh) 跨越多个类型的存储器移动分层数据对象的方法和系统
US20140289739A1 (en) Allocating and sharing a data object among program instances
CN113672171A (zh) 分布式对象存储方法、装置、系统和元数据服务器
US9697048B2 (en) Non-uniform memory access (NUMA) database management system
US10152258B1 (en) Big block allocation of persistent main memory
US11474938B2 (en) Data storage system with multiple-size object allocator for disk cache
CN107102898B (zh) 一种基于numa架构的内存管理、构建数据结构的方法及装置
US10168911B1 (en) Defragmentation of persistent main memory
CN114090249A (zh) 资源分配方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20964469

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20964469

Country of ref document: EP

Kind code of ref document: A1