Dynamic resource allocation method, device, electronic device, and medium for storage array
By dynamically adjusting the granularity dimensions in the shared resource tree, the conflict between storage chip allocation capabilities and package cache capabilities in the mixed scenarios of fixed packet length, long and short packets is solved, and the memory resource utilization and package allocation capabilities are improved, and the memory resource utilization and package allocation capabilities are adapted to different business scenarios. need.
Patent Information
- Application Number
- CN202311632527.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-11-30
AI Technical Summary
In the scenarios where fixed packet length, long and short packet mixing, ultra-long or ultra-short packets are prone to long periods, it is difficult to effectively adapt to the conflict between storage chip allocation capabilities and packet caching capabilities, resulting in performance degradation.
Using the dynamic resource allocation method, the granularity dimensions of the first resource allocation unit and the second resource allocation unit in the shared resource tree are dynamically adjusted, and the appropriate granularity dimensions are determined according to the length of the data to be processed, so as to realize the optimal allocation of memory resources.
It improves the memory resource utilization and packet allocation capabilities of the packet storage management unit in the network processor, solves the conflict between storage chip allocation capabilities and packet cache capabilities under fixed granularity, and adapts to the needs of different business scenarios.
Smart Images

Figure CN117971113B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device, and medium for dynamic resource allocation of a storage array. Background Art
[0002] A network processor is a programmable device that provides computing power for network devices. It is a communication network chip that can complete various tasks such as route lookup, protocol classification, message processing, and firewalls. In terms of computing power, a network processor with multiple microcode processors and hardware coprocessors can perform some standard operations on memory operations, routing table lookup algorithms, congestion control, and active queue management. As an important unit module in the network processor, the packet storage management unit PacketBuffer needs to carry functions such as fast write and read management of high-speed and large-flow data packets, and optimize the allocation and release management of storage array resources. This can improve the adaptability and processing efficiency of the packet storage management unit for mixed services such as long and short packets, help improve memory utilization efficiency, reduce latency, and increase the overall bandwidth of the system.
[0003] In the related art, in order to cope with the burst of long and short packets, a compromise granularity size is selected. For example, according to the probability density of the balance of long and short packet traffic, a middle byte length is selected, for example, 256B, 512B, etc., to avoid the requirements of two extreme scenarios and balance the storage slice allocation capacity and the packet cache capacity. However, this method cannot solve the conflict between the storage slice allocation capacity and the packet cache capacity. If the actual traffic probability code changes, for example, there are only super long packets for a period of time, and only super short packets for another period of time, then the fixed granularity size cannot adapt well to the external user needs, and performance degradation is bound to occur. Therefore, how to improve the memory resource utilization and packet allocation capacity of the memory array of the packet storage management unit in the network processor under changing scenarios such as fixed packet length, mixed long and short packets, and long-term bursts of super long or super short packets is a problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a dynamic resource allocation method, device, electronic device, and medium for a storage array, which improves the memory resource utilization and packet allocation capability of a memory array of a packet storage management unit in a network processor under changing scenarios such as fixed packet length, mixed long and short packets, and long-term bursts of ultra-long or ultra-short packets.
[0005] In order to achieve the above objectives, the embodiments of the present disclosure provide the following technical solutions:
[0006] In a first aspect, an embodiment of the present disclosure provides a method for dynamic resource allocation of a storage array, the method comprising:
[0007] Receive a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user;
[0008] For the data length of the data to be processed of each target user, at least one shared resource tree is determined according to the data length of the data to be processed, and dynamic resource allocation is performed on the data to be processed through the at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit.
[0009] As an optional implementation of the embodiment of the present disclosure, the allocating resources to the data to be processed by using the at least one shared resource tree includes:
[0010] For each shared resource tree, determining a first granularity dimension of the first resource allocation unit and / or a second granularity dimension of the second resource allocation unit according to the data length of the data to be processed;
[0011] Resources are allocated to the data to be processed according to the first granularity dimension and / or the second granularity dimension.
[0012] As an optional implementation of the embodiment of the present disclosure, for each shared resource tree, determining the first granularity dimension of the first resource allocation unit and / or the second granularity dimension of the second resource allocation unit according to the data length of the data to be processed includes:
[0013] Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit;
[0014] When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit;
[0015] When the data length of the to-be-processed data is greater than the second preset data length, a second granularity dimension of the second resource allocation unit is determined.
[0016] As an optional implementation of the embodiment of the present disclosure, the first resource allocation unit includes: a first root state node, a first intermediate state node, and a first bottom state node, and the second resource allocation unit includes: a second root state node, a second intermediate state node, and a second bottom state node;
[0017] The allocating resources to the data to be processed according to the first granularity dimension and / or the second granularity dimension includes:
[0018] Allocate a first allocatable free pointer of the first resource allocation unit to the target user according to the first granularity dimension, and modify state information of a first underlying state node corresponding to the first allocatable free pointer, as well as state information of a first intermediate state node and state information of a first root state node corresponding to the state information of the first underlying state node;
[0019] and / or;
[0020] According to the second granularity dimension, the second allocatable free pointer of the second resource allocation unit is allocated to the target user, and the state information of the second underlying state node corresponding to the second allocatable free pointer, as well as the state information of the second intermediate state node and the state information of the second root state node corresponding to the state information of the second underlying state node are modified.
[0021] As an optional implementation of the embodiment of the present disclosure, the status information of the first root status node is determined by the status information of a first preset number of first intermediate status nodes, and the status information of the first intermediate status node is determined by the status information of a second preset number of first bottom-level status nodes; the status information of the second root status node is determined by the status information of a third preset number of second intermediate status nodes, and the status information of the second intermediate status node is determined by the status information of a fourth preset number of second bottom-level status nodes.
[0022] As an optional implementation of the embodiment of the present disclosure, the status information of the first root status node is determined by the status information of a first preset number of first intermediate status nodes, and the status information of the first intermediate status node is determined by the status information of a second preset number of first bottom-level status nodes; the status information of the second root status node is determined by the status information of a third preset number of second intermediate status nodes, and the status information of the second intermediate status node is determined by the status information of a fourth preset number of second bottom-level status nodes.
[0023] As an optional implementation of the embodiment of the present disclosure, the method further includes:
[0024] When the data length of the to-be-processed data changes, the first granularity dimension of the target shared resource tree and / or the second granularity dimension cannot satisfy the resource allocation condition;
[0025] The first granularity dimension and / or the second granularity dimension of the target shared resource tree are reconfigured so that the first granularity dimension and / or the second granularity dimension meet the resource allocation condition.
[0026] In a second aspect, an embodiment of the present disclosure provides a dynamic resource allocation device for a storage array, comprising:
[0027] A receiving module, configured to receive a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user;
[0028] An allocation module is used to determine at least one shared resource tree according to the data length of the data to be processed for each target user, and dynamically allocate resources to the data to be processed through the at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit.
[0029] As an optional implementation of the embodiment of the present disclosure, the allocation module includes:
[0030] a determining unit, configured to determine, for each shared resource tree, a first granularity dimension of the first resource allocation unit and / or a second granularity dimension of the second resource allocation unit according to a data length of the data to be processed;
[0031] An allocation unit is used to allocate resources to the data to be processed according to the first granularity dimension and / or the second granularity dimension.
[0032] As an optional implementation of the embodiment of the present disclosure, the determining unit is specifically configured to:
[0033] Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit;
[0034] When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit;
[0035] When the data length of the to-be-processed data is greater than the second preset data length, a second granularity dimension of the second resource allocation unit is determined.
[0036] As an optional implementation of the embodiment of the present disclosure, the first resource allocation unit includes: a first root state node, a first intermediate state node, and a first bottom state node, and the second resource allocation unit includes: a second root state node, a second intermediate state node, and a second bottom state node;
[0037] The allocation unit is specifically used for:
[0038] Allocate a first allocatable free pointer of the first resource allocation unit to the target user according to the first granularity dimension, and modify state information of a first underlying state node corresponding to the first allocatable free pointer, as well as state information of a first intermediate state node and state information of a first root state node corresponding to the state information of the first underlying state node;
[0039] and / or;
[0040] According to the second granularity dimension, the second allocatable free pointer of the second resource allocation unit is allocated to the target user, and the state information of the second underlying state node corresponding to the second allocatable free pointer, as well as the state information of the second intermediate state node and the state information of the second root state node corresponding to the state information of the second underlying state node are modified.
[0041] As an optional implementation of the embodiment of the present disclosure, the status information of the first root status node is determined by the status information of a first preset number of first intermediate status nodes, and the status information of the first intermediate status node is determined by the status information of a second preset number of first bottom-level status nodes; the status information of the second root status node is determined by the status information of a third preset number of second intermediate status nodes, and the status information of the second intermediate status node is determined by the status information of a fourth preset number of second bottom-level status nodes.
[0042] As an optional implementation of the embodiment of the present disclosure, the traversal direction of the first allocatable free pointer is from the low address to the high address of the first bottom-level state node; the traversal direction of the second allocatable free pointer is from the high address to the low address of the second bottom-level state node;
[0043] The device further comprises an updating module, wherein the updating module is configured to:
[0044] Traversing from a low address to a high address of the first bottom-level state node, updating the first allocatable free pointer and the first boundary pointer, and updating the first allocatable resource range of the first resource allocation unit according to the first boundary pointer;
[0045] and / or;
[0046] Traverse from the high address to the low address of the second bottom-level state node, update the second allocatable free pointer and the second boundary pointer, and update the second allocatable resource range of the second resource allocation unit according to the second boundary pointer.
[0047] As an optional implementation of the embodiment of the present disclosure, the device further includes: a reset module, wherein the reset module is used to:
[0048] When the data length of the to-be-processed data changes, the first granularity dimension of the target shared resource tree and / or the second granularity dimension cannot satisfy the resource allocation condition;
[0049] The first granularity dimension and / or the second granularity dimension of the target shared resource tree are reconfigured so that the first granularity dimension and / or the second granularity dimension meet the resource allocation condition.
[0050] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the dynamic resource allocation method for the storage array described in the first aspect or any embodiment of the first aspect is implemented.
[0051] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the dynamic resource allocation method for a storage array as described in the first aspect or any one of the embodiments of the first aspect.
[0052] The dynamic resource allocation method of the storage array provided by the present disclosure receives a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user; for the data length of the to-be-processed data of each target user, at least one shared resource tree is determined according to the data length of the to-be-processed data, and dynamic resource allocation is performed on the to-be-processed data through at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit. For scenarios with data length changes such as fixed packet length, mixed long and short packets, and ultra-long or ultra-short packet lengths, the balance between memory resource utilization and packet allocation capacity is achieved by adjusting the first granularity dimension of the first resource allocation unit and the second granularity dimension of the second resource allocation unit of the shared resource tree, thereby resolving the conflict between the storage slice allocation capacity and the packet cache capacity in the case of fixed granularity dimensions. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0055] Figure 1A A schematic diagram of a typical structure of reading and writing a storage management array in a network processor in one embodiment;
[0056] Figure 1B One of the typical structural schematic diagrams of a RAM array unit implemented based on a storage slice resource pool in one embodiment;
[0057] Figure 1C The second typical structural diagram of a RAM array unit implemented based on a storage slice resource pool in one embodiment;
[0058] Figure 2 A schematic diagram of a flow chart of a method for dynamic resource allocation of a storage array in one embodiment;
[0059] Figure 3 One of the typical structures of a RAM array unit implemented based on a dynamic granularity shared resource tree of a storage slice in one embodiment;
[0060] Figure 4 The second typical structure of a RAM array unit implemented based on a dynamic granularity shared resource tree of a storage slice in one embodiment;
[0061] Figure 5 A schematic diagram of a flow chart of a storage slice shared resource tree runtime in one embodiment;
[0062] Figure 6 The third typical structure of a RAM array unit implemented based on a dynamic granularity shared resource tree of a storage slice in one embodiment;
[0063] Figure 7 This is a fourth typical structure of a RAM array unit implemented based on a dynamic granularity shared resource tree of a storage slice in one embodiment;
[0064] Figure 8 A schematic diagram of a typical structure of a storage management array in a network processor in one embodiment;
[0065] Fig. 9 It is one of the structural schematic diagrams of a dynamic resource allocation device of a storage array in one embodiment;
[0066] Fig.10 The second structural diagram of a dynamic resource allocation device for a storage array in one embodiment;
[0067] Fig.11 It is a schematic diagram of the structure of the electronic device described in the embodiment of the present disclosure. DETAILED DESCRIPTION
[0068] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0069] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0070] In the embodiments of the present disclosure, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present disclosure should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In addition, in the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" refers to two or more.
[0071] Reference Figure 1A As shown, Figure 1A The diagram is a read-write structure diagram of the storage management array in the network processor, and its typical structure consists of multi-channel write users, multi-channel read users, a write arbitration management unit, a read arbitration management unit, and a packet storage array. It can be understood that the packet storage array is the packet storage management unit mentioned above. Among them, in the network processor, the multi-channel write users can be but not limited to the packet input management unit, the packet processor engine unit, the internal memory transfer engine unit, etc.; the multi-channel read users can be but not limited to the packet output management unit, the packet processor engine unit, the internal memory transfer engine unit, etc. Refer to Figure 1A As shown in FIG. 1 , the typical process for a write user to write a data packet into a storage array is generally to send a write request and a write data packet to a write arbitration unit. After the write arbitration unit responds to the write request, it opens a write channel in the array according to the write request parameters and writes the write data packet into a storage unit in the storage management array. The write request parameters include the length of the data to be written and the priority of the data packet. Figure 1AAs shown, the typical process for a read user to read a data packet out of a packet storage array is generally to send a read request to a read arbitration unit module. After the read arbitration unit responds to the read request, it opens a certain read channel in the packet storage array according to the read request parameters and returns the read packet data to the read user. The read request parameters include but are not limited to the read data length, the read data pointer sequence number, and the read data offset.
[0072] Figure 1A In the example, the packet storage array is a RAM (Random Access Memory) storage array. The RAM storage array has a total of 8 independent storage unit areas. Figure 1B-Figure 1C , Figure 3 , Figure 4 , Figure 6 , Figure 7 It is an expansion of each opposing storage unit structure diagram, and the example defines that the number of storage slices in each storage unit slice is 256, and they are numbered one by one from 0 to 255. The gray-filled squares in the figure represent the resources that have been allocated and occupied in the resource tree, and the unfilled squares represent the unallocated resources in the resource tree, or the free resources that have been used and released.
[0073] Reference Figure 1B As shown, Figure 1B It is a typical structure of a RAM array unit based on a storage slice resource pool. The storage slice hardware resources are implemented with a dual-port RAM structure, and the resource pool number tag is composed of a FIFO (first in first out) hardware circuit. In the initial state, the resource pool number tags are sorted in the order of 1-256. When receiving a dynamic memory allocation request from the arbitration control unit, the FIFO resource pool reads out a storage slice number and hands it over to the control unit. The control unit uses the obtained storage slice number as the address and writes the data to the corresponding resource slice of the corresponding storage space. When the user finishes reading the data and needs to clear the resources, the arbitration control unit will issue a memory release command to put the resource tag back into the FIFO resource pool, that is, the label of the resource block just released will be written to the end of the FIFO status tag pool.
[0074] Figure 1CThe typical structure of the RAM array unit implemented based on the storage slice resource tree. The storage slice hardware resources are also implemented with a dual-port RAM structure. The allocation and release mark of the hardware resources are managed by the resource tree structure. In the resource tree management structure, each resource node has its own corresponding storage status information. 1 is used to indicate that the storage resource is allocated, and 0 is used to indicate that the storage resource is idle. For all 256 resource nodes, it can be divided into 3 levels of management. The third level is all 256 resource nodes. One upper management node is constructed with every 16 resource nodes, so there are 16 status nodes in the second level. Similarly, one upper management node is constructed for the 16 status nodes of the second level. There is only one status node in the first level, which is the root node marked by the resource tree. The allocation of the storage slice resource tree adopts the tree search algorithm, starting from the root node of the tree and searching downward. If the root node state is that there are idle resources, enter the second-level node search, search the second-level nodes one by one, and after finding the second-level idle node with the smallest number, expand and deeply explore the second-level node, that is, find the third-level node. The third-level node is already the most basic node at the bottom level. Once found, it will obtain the actual available resources and hand over the resources to the arbitration control unit for use. The control unit uses the obtained storage slice number as the address to write the data to the corresponding resource slice of the corresponding storage space. When the user finishes reading the data and needs to clear the resources, the arbitration control unit will issue a Free memory command, which will modify the status information of the third-level node and simultaneously update it to the second-level node and the first-level root node.
[0075] Figure 1B and Figure 1C The resource management structures of Figure 1B The hardware implementation structure is simple, consisting of FIFO+RAM. The storage status number information is fully expanded, the resource number is given to the user for use and return, and the allocation and release of resource units corresponds to a read and write of FIFO. Therefore, the ability to simultaneously allocate and release resource units can be achieved at every moment. Figure 1C The structure of the resource pool structure requires traversing the root node to the third-level node on the resource tree each time a resource unit is allocated. The logical judgment process is more complex than that of the resource pool structure. The tree structure is characterized by being able to more accurately grasp the actual resource allocation status of the resource pool, because the third-level status node has saved the information of all nodes in the resource pool.
[0076] In actual business scenarios, network processors may encounter mixed scenarios such as ultra-short packets of 64B and ultra-long packets of more than 9600B, and may encounter scenarios where multiple write user ports write data packets at the same time, and one read user port reads all data packets, or one write user port writes data packets and multiple read user ports mirror and output data packets. Therefore, the packet length ratio can reach 9600B:64B=150:1. If it is assumed that the total RAM array storage space that PacketBuffer can manage is 9600B*256=2457600B, then according to the maximum granularity of 9600B, it can be divided into 256 storage slices, according to the minimum granularity of 64B, it can be divided into 256*150=38400 storage slices, according to the granularity of 256B, it can be divided into 9600 storage slices, and according to the granularity of 1024B, it can be divided into 2400 storage slices.
[0077] If the minimum granularity of 64B is used, packets of any length will not cause allocation fragmentation. However, for long packets, such as 9600B long packets that come in suddenly, 150 storage granule applications need to be made. Regardless of whether a resource pool or a resource tree is used to implement memory allocation and release, the requirements for storage slice allocation capability are 150 times higher than the maximum granularity, which requires a huge cost. In addition, a large amount of resources are required to manage storage slice status information or storage slice number information.
[0078] If the maximum granularity of 9600B is used for division, only one storage granule application is required for packets of any length, and only the minimum resources are required to manage the storage slice status information or storage slice number information. However, other packets less than 9600B in length will cause a certain amount of resource waste. If ultra-short packets are always bursting, the actual utilization rate of storage array resources is only 1 / 150, and the internal packet cache capacity of the entire network processor is also reduced by 150 times. If the network processor core needs to process complex services such as packet order preservation and requires a large delay, insufficient packet cache capacity will cause a sharp decline in system performance.
[0079] In the usual design, in order to cope with the burst of long and short packets, a compromise granularity size is selected. For example, according to the probability density of the long and short packet traffic balance, a medium byte length such as 256B, 512B, etc. is selected to avoid the requirements of two extreme scenarios and obtain a compromise between the storage slice allocation capacity and the packet cache capacity. However, while making a compromise, it only obtains a relative balance and cannot fundamentally solve the conflict between the storage slice allocation capacity and the packet cache capacity. If the actual traffic probability code changes, for example, there are only super long packets for a short period of time, and only super short packets for a period of time, then the fixed granularity size cannot adapt well to the external user needs, and performance degradation is inevitable.
[0080] In the prior art, the design and implementation of storage arrays has a single feature and can normally cope with ordinary packet lengths. Once the business changes to mixed packet lengths and various ultra-long or ultra-short packet lengths, the storage array's adaptability is insufficient, and it is not easy to achieve a good balance between storage slice allocation capability and packet cache capability.
[0081] To solve the above problem, the present disclosure proposes a method for dynamic resource allocation of a storage array, the method comprising the following steps S21-S22:
[0082] S21. Receive a resource allocation request sent by at least one target user.
[0083] Each resource request carries the data length of the data to be processed by each target user. The target users include: write users and read users.
[0084] S22. For each target user, determine at least one shared resource tree according to the data length of the data to be processed, and dynamically allocate resources to the data to be processed through the at least one shared resource tree.
[0085] Each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; a first granularity dimension of the first resource allocation unit is less than or equal to a second granularity dimension of the second resource allocation unit.
[0086] Specifically, refer to Figure 3 As shown, Figure 3 This is a typical structure of a RAM array unit implemented based on a dynamic granularity shared resource tree of a storage slice in an embodiment of the present disclosure. Figure 1C On the basis of, different granularity dimension marks are used to divide it into two groups A and B for implementation. Both pictures have status marks of all tree nodes. The two pictures are superimposed to form Figure 3 . Assume that the storage slice represented by each blue node has a minimum granularity of 64B, and a RAM has a total of 256 minimum granularities, that is, the RAM block size is 64B*256. The actual blue physical memory usage is mapped with the minimum granularity and recorded as the A group tag. Take another granularity of 512B, and use 8 minimum granularities as units to map the actual blue physical memory, and record it as the B group tag. In this way, the A group tag has a total of 256 bits of status information, and the B group tag has a total of 32 bits of status information.
[0087] In some embodiments, the above step (allocating resources for the data to be processed through the at least one shared resource tree) can be implemented as follows:
[0088] A. For each shared resource tree, determine a first granularity dimension of the first resource allocation unit and / or a second granularity dimension of the second resource allocation unit according to the data length of the data to be processed.
[0089] Optionally, the above step A (determining, for each shared resource tree, the first granularity dimension of the first resource allocation unit and / or the second granularity dimension of the second resource allocation unit according to the data length of the data to be processed) can be implemented as follows:
[0090] Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit;
[0091] When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit;
[0092] When the data length of the to-be-processed data is greater than the second preset data length, a second granularity dimension of the second resource allocation unit is determined.
[0093] Among them, the first preset data length and the second preset data length can be selected according to the actual application scenario. For example, the first preset data length can be 64B, 128B, 256B, etc., and the second preset length can be 9600B, etc. There is no specific restriction on the values of the first preset data length and the second preset data length.
[0094] Specifically, within a preset time period, when the data length of the data to be processed is less than the first preset data length, the resource allocation request is determined to be a small-granularity request, thereby determining the first granularity dimension of the first resource allocation unit. When the data length of the data to be processed is greater than the first preset data length, and less than the second preset data length, the resource allocation request is determined to be a mixed-granularity request, thereby determining the first granularity dimension of the first resource allocation unit, and the second granularity dimension of the second resource allocation unit. When the data length of the data to be processed is greater than the second preset data length, the resource allocation request is determined to be a large-granularity request, thereby determining the second granularity dimension of the second resource allocation unit.
[0095] Exemplarily, when the data length of the data to be processed is 3B, the first granularity dimension can be determined to be 1B; when the data length of the data to be processed is 9B, the first granularity dimension can be determined to be 1B and the second granularity dimension can be determined to be 8B; when the data length of the data to be processed is 64B, the second granularity dimension can be determined to be 16B.
[0096] B. Allocate resources for the data to be processed according to the first granularity dimension and / or the second granularity dimension.
[0097] Optionally, the first resource allocation unit includes: a first root state node, a first intermediate state node, and a first bottom state node, and the second resource allocation unit includes: a second root state node, a second intermediate state node, and a second bottom state node.
[0098] Among them, the status information of the first root status node is determined by the status information of the first intermediate status nodes of a first preset number, and the status information of the first intermediate status node is determined by the status information of the second bottom-level status nodes of a second preset number; the status information of the second root status node is determined by the status information of the second intermediate status nodes of a third preset number, and the status information of the second intermediate status node is determined by the status information of the second bottom-level status nodes of a fourth preset number.
[0099] For example, assume that the states of all nodes in each resource tree are represented by three groups of registers, S1[0:0], S2[15:0], and S3[255:0], respectively. There is one first-level root node, and its state is represented by register S1[0:0]. There are 16 second-level nodes, and their states are represented by S2[15:0]. There are 256 second-level nodes, and their states are represented by S3[255:0]. The hardware circuit for state update is:
[0100] S1=&(S2), that is, S1 is the AND of the 16 1-bit input signals of S2.
[0101] S2[i]=&(S3[i*16+15:i*16]), where i=0-15, i.e., each state bit of S2 is the AND of the 16 state bit signals corresponding to S3.
[0102] The total number of state tables of each shared resource tree is 16+1=17, that is, composed of AND circuits with 16 inputs and 1 output.
[0103] The above step B (allocating resources for the data to be processed according to the first granularity dimension and / or the second granularity dimension) can be implemented as follows:
[0104] Allocate a first allocatable free pointer of the first resource allocation unit to the target user according to the first granularity dimension, and modify state information of a first underlying state node corresponding to the first allocatable free pointer, as well as state information of a first intermediate state node and state information of a first root state node corresponding to the state information of the first underlying state node;
[0105] and / or;
[0106] According to the second granularity dimension, the second allocatable free pointer of the second resource allocation unit is allocated to the target user, and the state information of the second underlying state node corresponding to the second allocatable free pointer, as well as the state information of the second intermediate state node and the state information of the second root state node corresponding to the state information of the second underlying state node are modified.
[0107] The traversal direction of the first allocatable free pointer is from the low address to the high address of the first bottom-level status node; the traversal direction of the second allocatable free pointer is from the high address to the low address of the second bottom-level status node.
[0108] For example, for a shared resource tree, two groups of labels A and B on the third-level bottom tree nodes are assigned two groups of pointers, such as Figure 4 As shown. They are Min_free_pointer_A and Max_bound_pointer_A of group A and Min_free_pointer_B and Max_bound_pointer_B of group B. These two groups of pointers represent the minimum allocatable free pointers of groups A and B, as well as the maximum bound pointers. Because it is a shared resource tree, it is compatible with receiving memory allocation and release requests of two different granularity dimensions. In the following figures and texts, for the sake of simplicity, Min_free_pointer_A and Max_bound_pointer_A are abbreviated as Min_A and Max_A, and Min_free_pointer_B and Max_bound_pointer_B are abbreviated as Min_B and Max_B.
[0109] Further, traverse from the lower address to the higher address of the first bottom state node, update the first allocatable free pointer and the first boundary pointer, and update the first allocatable resource range of the first resource allocation unit according to the first boundary pointer;
[0110] and / or;
[0111] Traverse from the high address to the low address of the second bottom-level state node, update the second allocatable free pointer and the second boundary pointer, and update the second allocatable resource range of the second resource allocation unit according to the second boundary pointer.
[0112] Reference Figure 5As shown, at the same moment, the shared resource tree can only receive a certain type of malloc request from Group A or Group B. The malloc request response is completed at the next clock after receiving the request, the allocated pointer address is returned, and the node status is updated. At the next moment, the status pointer of this group is updated to complete the processing of this request. Therefore, after a certain group receives a Malloc request, it takes 2 clks to complete this processing. The specific processing details are as follows.
[0113] Exemplarily, when a small-granularity request is received, resource allocation is performed from Group A. The resource pointed to by Min_A is quickly allocated directly, and at the same time, the status information of this resource is modified from the free state to the malloced state, and the corresponding bit information becomes 1, indicating that the resource has been allocated. At the same time, the status bit information of the secondary node and the primary node on the tree associated with this tertiary node is updated. At the next clock moment, it is necessary to traverse the status of the updated tertiary node of the tree, update the Min_A pointer, and at the same time compare Min_A and Max_A. If Min_A > Max_A, then update the value of Max_A to the address value pointed to by Min_A. If there are 256 resource granules in the tertiary node, the address information corresponding to the pointers of Min_A and Max_A can be represented by 8-bit data. In summary, a resource allocation cycle of Group A is two clks, where the first clk is used to allocate resources and update the tree node status information, and the second clk is used to traverse the new tree status, update the Min_A and Max_A pointers, and readjust the coverage range [0~Max_A] of the status node mask of Group A.
[0114] Exemplarily, when a large-granularity request is received, resource allocation is performed from Group B. The resource pointed to by Min_B is quickly allocated directly, and at the same time, the status information of this resource is modified from the free state to the malloced state, and the corresponding bit information becomes 1, indicating that the resource has been allocated. At the same time, the status bit information of the secondary node and the primary node on the tree associated with this tertiary node is updated. At the next clock moment, it is necessary to traverse the status of the updated tertiary node of the tree, update the Min_B pointer, and at the same time compare Min_B and Max_B. If Min_B < Max_B, then update the value of Max_B to the address value pointed to by Min_B. If there are 256 resource granules in the tertiary node, the address information corresponding to the pointers of Min_B and Max_B can be represented by 8-bit data. In summary, a resource allocation cycle of Group B is two clks, where the first clk is used to allocate resources and update the tree node status information, and the second clk is used to traverse the new tree status, update the Min_B and Max_B pointers, and readjust the coverage range [Max_B~255] of the status node mask of Group B.
[0115] Since Group A and Group B share the resource tree simultaneously, it is stipulated that the initial values of Min_A and Max_A in Group A are both 0. When traversing the nodes, an incremental search scan is performed from the lower address to the higher address of the resource node address. When an available node is found, the search stops and the Min_A and Max_A pointers are updated. It is stipulated that the initial values of Min_B and Max_B in Group B are both 255. When traversing the nodes, a decremental search scan is performed from the higher address to the lower address of the resource node address. When an available node is found, the search stops and the Min_B and Max_B pointers are updated. During the process of reallocation and update, the pointers of Group A and Group B are gradually approaching each other. Therefore, the Max_A and Max_B pointers, as boundary protection pointers, respectively protect the Min_A and Min_B pointers from going out of bounds during the dynamic search process. That is, the search range of the Min_A pointer is [0~Max_B], and the search range of the Min_B pointer is [Max_A~255]. The relationship between Max_A and Max_B is Max_B >= Max_A. If it is judged that after updating Max_A or Max_B, the situation of Max_B < Max_A will occur, then this update will be stopped, indicating that the boundaries of Group A and Group B have collided and the boundaries cannot be moved any further.
[0116] In an actual business scenario, if there is a long-term burst of short-packet traffic, the arbitration control unit will continuously apply for small-granularity resource slices from the shared resource tree, and will always receive Malloc requests from Group A. After a period of time, the state of the shared resource tree will evolve into a situation similar to Figure 6 this scenario, and at this time the shared resource tree can be regarded as having been converted into a resource tree with a granularity of 1.
[0117] In an actual business scenario, if there is a long-term burst of long-packet traffic, the arbitration control unit will continuously apply for large-granularity resource slices from the shared resource tree, and will always receive Malloc requests from Group B. After a period of time, the state of the shared resource tree will evolve into a situation similar to Figure 7 this scenario, and at this time the shared resource tree can be regarded as having been converted into a resource tree with a granularity of 8.
[0118] Therefore, the shared resource tree can automatically adapt to the actual business traffic in the actual scenario, and dynamically convert into a pure small-granularity resource tree, a pure large-granularity resource tree, or a resource tree with coexistence of both granularities.
[0119] For the conventional memory allocation of the resource tree, in the usual hardware implementation, each allocation instruction may take 2 clock cycles. If it is required to be implemented in 1 clock cycle, the requirement for the circuit design complexity will increase significantly. Refer to Figure 8As shown, in the shared resource tree structure proposed by the present invention, the two groups AB can allocate any particle dimensions without affecting each other. If the particle dimensions of the same size are allocated, then relative to the conventional single-particle dimension tree, it is equivalent to splitting a tree into two dynamic trees with ping-pong processing capabilities. In this way, under the condition of basically the same circuit design complexity, the ability of the hybrid tree structure of the present invention to respond to allocation instructions can reach twice the capacity of a conventional tree. If the dimensional parameters of the two groups AB are different, for the scenario of mixed long and short packets, one hybrid tree can achieve the effect of ping-pong processing. If there are only simple long packets or short packets at this time, its processing capacity will drop to the equivalent of a single-dimensional resource tree scenario. But the good news is that there is more than one resource tree in the memory array. If there are 8 resource trees in the entire array, the solution of the present invention is adopted, and 8 dual-dimensional hybrid resource trees can realize a memory allocation method with 16 dimensional parameters. From the perspective of the entire tree group structure, it can be adapted in a larger range.
[0120] The memory truth unit is managed through a mixed granular dimension memory tree structure. Each independent tree can adapt to external traffic and can automatically evolve into a simple dimension tree or a two-dimensional mixed ping-pong tree, which can double the response capability. In this way, no matter how the external business scenario changes, the memory array management unit can quickly evolve the tree and tree group structure that best suits the external business scenario, so that the processing efficiency remains constant and will not decrease.
[0121] The embodiment of the present disclosure should be used. The dynamic resource allocation method of the storage array provided by the present disclosure receives a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user; for the data length of the to-be-processed data of each target user, at least one shared resource tree is determined according to the data length of the to-be-processed data, and dynamic resource allocation is performed on the to-be-processed data through at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit. For scenarios with data length changes such as fixed packet length, mixed long and short packets, and ultra-long or ultra-short packet lengths, the balance between memory resource utilization and packet allocation capacity is achieved by adjusting the first granularity dimension of the first resource allocation unit and the second granularity dimension of the second resource allocation unit of the shared resource tree, thereby resolving the conflict between the storage slice allocation capacity and the packet cache capacity in the case of fixed granularity dimensions.
[0122] In some embodiments, when the data length of the to-be-processed data changes, the first granularity dimension of the target shared resource tree and / or the second granularity dimension cannot satisfy the resource allocation condition;
[0123] The first granularity dimension and / or the second granularity dimension of the target shared resource tree are reconfigured so that the first granularity dimension and / or the second granularity dimension meet the resource allocation condition.
[0124] Specifically, refer to Fig. 9 As shown in the figure, the hybrid dynamic resource tree is completely consistent in physical memory structure, and all of them are RAM units with the same number of memory particles (256 in this article). The control structure manages the hybrid tree through the AB group node state bitmap and 4 state pointers, with the same algorithm. For different dimension parameters, only the algorithm parameters have changed. Therefore, its control structure hardware circuit can be unified, and the internal control structure can be reloaded and updated only by changing the external dimension parameters. It is very suitable for dynamic load adjustment of trees in the management of hybrid tree groups, resetting trees with unsuitable preset parameters and low packet allocation utilization, and reallocating particle dimensions, and dynamically reconfiguring and reloading trees. In this way, the entire tree group has extremely high flexibility, can automatically adapt to polymorphic business requirements, and allow each tree to change with the changes in the scene form, maximizing the overall benefits of tree group allocation and memory management.
[0125] exist Fig. 9 In the example, the tree number 7, which was initially allocated with large dimension parameters A=8 and B=32, was basically unable to allocate packet request instructions under the impact of long-term short packet traffic, and the idle rate of this unit was high. The tree group overall management unit will first lock the request of the array according to the current scenario, suspend all new resource allocation instructions for the array, and reset the array after all packets in the array are released, and set the AB dimension parameters to 2 and 2. At this time, the request lock of the array is released, and tree 7 is put back into work. After reloading, tree 7 is reborn and becomes a hybrid ping-pong tree with the same parameter dimensions in the current scenario.
[0126] For the mixed tree group control scheme, if the two parameter dimensions of each tree are distributed in a differentiated manner, it has better adaptability to mixed packet lengths. However, under the long-term impact of a specific single packet length, it will eventually evolve into 8 simple trees of a single dimension, which can be dynamically adapted, but the efficiency is not the highest. The most efficient scenario is 8 ping-pong balanced trees of the same dimension, and both AB groups work at the same time, which can be equivalent to 16 simple trees in terms of processing response capability. As a result of the actual evolution, the response capability should be between the processing capabilities of 8 and 16 simple trees. If the two parameter dimensions of each tree adopt an equal parameter distribution method, each matching tree will immediately reach the maximum ping-pong tree processing capacity, but after the packet length changes, the frequency of tree overload will change. In actual use, you can combine business scenarios to try and verify the combination of multiple mixed parameters to find a better solution.
[0127] In one embodiment, Fig.10 As shown, a dynamic resource allocation device 300 for a storage array is provided, which is applied to a host machine equipped with a hardware acceleration card, and includes:
[0128] The receiving module 1010 is used to receive a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user;
[0129] The allocation module 1020 is used to determine at least one shared resource tree according to the data length of the data to be processed for each target user, and dynamically allocate resources to the data to be processed through the at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit.
[0130] As an optional implementation of the embodiment of the present disclosure, the allocation module 1020 includes:
[0131] a determining unit, configured to determine, for each shared resource tree, a first granularity dimension of the first resource allocation unit and / or a second granularity dimension of the second resource allocation unit according to a data length of the data to be processed;
[0132] An allocation unit is used to allocate resources to the data to be processed according to the first granularity dimension and / or the second granularity dimension.
[0133] As an optional implementation of the embodiment of the present disclosure, the determining unit is specifically configured to:
[0134] Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit;
[0135] When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit;
[0136] When the data length of the to-be-processed data is greater than the second preset data length, a second granularity dimension of the second resource allocation unit is determined.
[0137] As an optional implementation of the embodiment of the present disclosure, the first resource allocation unit includes: a first root state node, a first intermediate state node, and a first bottom state node, and the second resource allocation unit includes: a second root state node, a second intermediate state node, and a second bottom state node;
[0138] The allocation unit is specifically used for:
[0139] Allocate a first allocatable free pointer of the first resource allocation unit to the target user according to the first granularity dimension, and modify state information of a first underlying state node corresponding to the first allocatable free pointer, as well as state information of a first intermediate state node and state information of a first root state node corresponding to the state information of the first underlying state node;
[0140] and / or;
[0141] According to the second granularity dimension, the second allocatable free pointer of the second resource allocation unit is allocated to the target user, and the state information of the second underlying state node corresponding to the second allocatable free pointer, as well as the state information of the second intermediate state node and the state information of the second root state node corresponding to the state information of the second underlying state node are modified.
[0142] As an optional implementation of the embodiment of the present disclosure, the status information of the first root status node is determined by the status information of a first preset number of first intermediate status nodes, and the status information of the first intermediate status node is determined by the status information of a second preset number of first bottom-level status nodes; the status information of the second root status node is determined by the status information of a third preset number of second intermediate status nodes, and the status information of the second intermediate status node is determined by the status information of a fourth preset number of second bottom-level status nodes.
[0143] As an optional implementation of the embodiment of the present disclosure, the traversal direction of the first allocatable free pointer is from the low address to the high address of the first bottom-level state node; the traversal direction of the second allocatable free pointer is from the high address to the low address of the second bottom-level state node;
[0144] The device further comprises an updating module, wherein the updating module is configured to:
[0145] Traversing from a low address to a high address of the first bottom-level state node, updating the first allocatable free pointer and the first boundary pointer, and updating the first allocatable resource range of the first resource allocation unit according to the first boundary pointer;
[0146] and / or;
[0147] Traverse from the high address to the low address of the second bottom-level state node, update the second allocatable free pointer and the second boundary pointer, and update the second allocatable resource range of the second resource allocation unit according to the second boundary pointer.
[0148] As an optional implementation of the embodiment of the present disclosure, the device further includes: a reset module, wherein the reset module is used to:
[0149] When the data length of the to-be-processed data changes, the first granularity dimension of the target shared resource tree and / or the second granularity dimension cannot satisfy the resource allocation condition;
[0150] The first granularity dimension and / or the second granularity dimension of the target shared resource tree are reconfigured so that the first granularity dimension and / or the second granularity dimension meet the resource allocation condition.
[0151] Applying the embodiments of the present disclosure, the dynamic resource allocation device of the storage array provided by the present disclosure receives a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user; for the data length of the to-be-processed data of each target user, at least one shared resource tree is determined according to the data length of the to-be-processed data, and dynamic resource allocation is performed on the to-be-processed data through at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit. For scenarios with data length changes such as fixed packet length, mixed long and short packets, and ultra-long or ultra-short packet lengths, the balance between memory resource utilization and packet allocation capacity is achieved by adjusting the first granularity dimension of the first resource allocation unit and the second granularity dimension of the second resource allocation unit of the shared resource tree, thereby resolving the conflict between the storage slice allocation capacity and the packet cache capacity in the case of fixed granularity dimensions.
[0152] The specific definition of the dynamic resource allocation device of the storage array can be found in the definition of the dynamic resource allocation method of the storage array mentioned above, which will not be repeated here. Each module in the above-mentioned dynamic resource allocation device of the storage array can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor of the electronic device in the form of hardware, or can be stored in the processor of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0153] The present disclosure also provides an electronic device, Fig.11 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Fig.11As shown, the electronic device provided in this embodiment includes: a memory 111 and a processor 112, the memory 111 is used to store a computer program; the processor 112 is used to execute the steps executed in any embodiment of the dynamic resource allocation method for the storage array provided in the above method embodiment when calling the computer program. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a dynamic resource allocation method for a storage array is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the computer device, or an external keyboard, touchpad or mouse.
[0154] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0155] In one embodiment, the dynamic resource allocation device for the storage array provided by the present disclosure can be implemented in the form of a computer. The computer program can be used in the following manner: Fig.11 The memory of the electronic device can store various program modules constituting the dynamic resource allocation device of the storage array of the electronic device.
[0156] The embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the dynamic resource allocation method for the storage array provided in the above method embodiment is implemented.
[0157] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0158] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0159] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0160] Computer readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0161] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0162] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for dynamic resource allocation of a storage array, characterized in that: The method comprises: receiving a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user; For each target user, the data length of the data to be processed is determined according to the data length of the data to be processed, and dynamic resource allocation is performed on the data to be processed through the at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; a first granularity dimension of the first resource allocation unit is less than or equal to a second granularity dimension of the second resource allocation unit; The allocating resources to the data to be processed through the at least one shared resource tree includes: Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit; When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit; When the data length of the to-be-processed data is greater than the second preset data length, determining a second granularity dimension of the second resource allocation unit; Resources are allocated to the data to be processed according to the first granularity dimension and / or the second granularity dimension.
2. The method according to claim 1, characterized in that The first resource allocation unit includes: a first root state node, a first intermediate state node, and a first bottom state node; the second resource allocation unit includes: a second root state node, a second intermediate state node, and a second bottom state node; The allocating resources to the data to be processed according to the first granularity dimension and / or the second granularity dimension includes: Allocate a first allocatable free pointer of the first resource allocation unit to the target user according to the first granularity dimension, and modify state information of a first underlying state node corresponding to the first allocatable free pointer, as well as state information of a first intermediate state node and state information of a first root state node corresponding to the state information of the first underlying state node; and / or; According to the second granularity dimension, the second allocatable free pointer of the second resource allocation unit is allocated to the target user, and the state information of the second underlying state node corresponding to the second allocatable free pointer, as well as the state information of the second intermediate state node and the state information of the second root state node corresponding to the state information of the second underlying state node are modified.
3. The method according to claim 2, characterized in that The status information of the first root status node is determined by the status information of a first preset number of first intermediate status nodes, and the status information of the first intermediate status node is determined by the status information of a second preset number of first bottom-level status nodes; the status information of the second root status node is determined by the status information of a third preset number of second intermediate status nodes, and the status information of the second intermediate status node is determined by the status information of a fourth preset number of second bottom-level status nodes.
4. The method according to claim 2, characterized in that: The traversal direction of the first allocatable free pointer is from the low address to the high address of the first bottom state node; the traversal direction of the second allocatable free pointer is from the high address to the low address of the second bottom state node; The method further comprises: Traversing from a low address to a high address of the first bottom-level state node, updating the first allocatable free pointer and the first boundary pointer, and updating the first allocatable resource range of the first resource allocation unit according to the first boundary pointer; and / or; Traverse from the high address to the low address of the second bottom-level state node, update the second allocatable free pointer and the second boundary pointer, and update the second allocatable resource range of the second resource allocation unit according to the second boundary pointer.
5. The method according to claim 1, characterized in that The method further comprises: When the data length of the to-be-processed data changes, the first granularity dimension of the target shared resource tree and / or the second granularity dimension cannot satisfy the resource allocation condition; The first granularity dimension and / or the second granularity dimension of the target shared resource tree are reconfigured so that the first granularity dimension and / or the second granularity dimension meet the resource allocation condition.
6. A dynamic resource allocation device for a storage array, characterized in that: include: A receiving module, configured to receive a resource allocation request sent by at least one target user; wherein each resource request carries the data length of the to-be-processed data of each target user; The allocation module is used to determine at least one shared resource tree according to the data length of the data to be processed of each target user, and dynamically allocate resources to the data to be processed through the at least one shared resource tree; wherein each resource sharing tree includes: a first resource allocation unit and a second resource allocation unit; the first granularity dimension of the first resource allocation unit is less than or equal to the second granularity dimension of the second resource allocation unit; The allocation module is specifically used for: Within a preset time period, when the data length of the to-be-processed data is less than a first preset data length, determining a first granularity dimension of the first resource allocation unit; When the data length of the to-be-processed data is greater than the first preset data length and less than the second preset data length, determining a first granularity dimension of the first resource allocation unit and a second granularity dimension of the second resource allocation unit; When the data length of the to-be-processed data is greater than the second preset data length, determining a second granularity dimension of the second resource allocation unit; Resources are allocated to the data to be processed according to the first granularity dimension and / or the second granularity dimension.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the dynamic resource allocation method for the storage array according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the dynamic resource allocation method for the storage array according to any one of claims 1 to 5 is implemented.
