A data storage method, device and equipment

CN115827250BActive Publication Date: 2026-10-30ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211706903.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-10-30
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

[0006]本发明提供了一种数据存储方法、装置及设备,用于解决传统流水线作业方式限制了数据的吞吐量以及适用场景受限的问题,通过资源预分配和动态分配结合的方式,提升了整体流水线的吞吐量,并扩展了适应场景

Benefits of technology

[0040]上述方法,通过采用资源预分配(即任务队列中的内存资源块)和动态分配(内存节点池中的资源)结合的方式,实现了对资源分配的自主优化,进而达到提升整体流水线吞吐量的效果,同时扩展了其适应场景,使其更适应于对任务节点资源占用快速变化的场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115827250B_ABST
    Figure CN115827250B_ABST
Patent Text Reader

Abstract

The application provides a data storage method, device and equipment, relates to the field of data processing, and the method comprises the following steps: after a task node receives a task processing instruction, it is determined that the states of the pointers in a target pointer queue are all non-empty; wherein, the pointer with the non-empty state indicates that the memory resource block in the data queue pointed by the pointer is used, and the data queue comprises at least one memory resource block; the task node sends a resource acquisition request to a memory node pool, so that when it is determined that the current resource can meet the resource acquisition request, the memory node pool feeds back a resource allocation pointer to the target pointer queue, and the resource allocation pointer points to the target resource allocated to the task node; and the task node stores the task data corresponding to the task processing instruction by using the target resource pointed by the resource allocation pointer. Through the combination of resource pre-allocation and dynamic allocation, the overall pipeline throughput is improved, and the method is suitable for more scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data storage method, apparatus, and device. Background Technology

[0002] With the continuous development of deep learning, network model compression technology has become increasingly mature, thereby reducing the complexity of individual models, making them occupy less memory, and increasing inference speed. This also makes it possible to solve complex problems through multi-model collaboration.

[0003] Currently, when encountering complex scenarios, they are often broken down into multiple interdependent sub-task nodes (i.e., models), with data flowing between each task node until the final calculation result is obtained.

[0004] In traditional pipeline operations, a fixed amount of memory resources are usually pre-allocated to each task node. When a task node needs to run, it first determines whether there are any free resources in its corresponding memory. If there are free resources, the output data is stored in the free resources and the relevant tasks are run. If there are no free resources, the task node stops running and waits for the data in its corresponding memory resources to be taken by the next node.

[0005] While the data storage method in the above-mentioned assembly line operation decouples the relationships between different task nodes, it limits the data throughput during the operation and has limited applicability to various scenarios. Summary of the Invention

[0006] This invention provides a data storage method, apparatus, and device to solve the problems of traditional assembly line operation methods limiting data throughput and applicable scenarios. By combining resource pre-allocation and dynamic allocation, the overall throughput of the assembly line is improved and the applicable scenarios are expanded.

[0007] In a first aspect, embodiments of this application provide a data storage method applied to any task node in a task processing system. The task processing system includes a memory node pool, multiple task nodes, a pointer queue corresponding to each task node, and a data queue corresponding to each task node. The method includes:

[0008] After receiving the task processing instruction, the task node determines that the pointers in the target pointer queue are all in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0009] The task node sends a resource acquisition request to the memory node pool. When the memory node pool determines that the current resources can satisfy the resource acquisition request, it returns a resource allocation pointer to the target pointer queue. The resource allocation pointer points to the target resource allocated to the task node.

[0010] The task node uses the target resource pointed to by the resource allocation pointer to store the task data corresponding to the task processing instruction.

[0011] As an optional implementation, the method further includes:

[0012] When a task node determines that there is a pointer with an empty state in the target pointer queue, it uses the memory resource block in the data queue pointed to by the pointer with the empty state to store the task data;

[0013] Among them, an empty pointer indicates that the memory resource block in the data queue pointed to by the pointer is not used.

[0014] As an optional implementation, the method further includes:

[0015] The task node receives the instruction information from the memory node pool and sends a resource acquisition request to the memory node pool again after a preset time interval.

[0016] The indication information is the feedback from the memory node pool when it determines that the current resources cannot satisfy the resource acquisition request.

[0017] Secondly, embodiments of this application provide another data storage method applied to a memory node pool in a task processing system. The task processing system includes a memory node pool, multiple task nodes, a pointer queue corresponding to each task node, and a data queue corresponding to each task node. The method includes:

[0018] The memory node pool receives resource acquisition requests sent by task nodes. The resource acquisition request is sent by the task node when it determines that all pointers in the target pointer queue are in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0019] When the memory node pool determines that the current resources in the memory node pool can satisfy the resource acquisition request, it sends a resource allocation pointer back to the target queue corresponding to the task node. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

[0020] As an optional implementation, the method further includes:

[0021] When the memory node pool determines that the current resources in the memory node pool cannot satisfy the resource acquisition request, it sends an indication message to the task node so that after receiving the indication message, the task node sends the resource acquisition request to the memory node pool again after a preset time interval.

[0022] As an optional implementation, the memory node pool feeds back a resource allocation pointer to the task node and then to the target queue corresponding to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction. The method further includes:

[0023] When the memory node pool determines that the data stored in the target resource is invalid, it removes the resource allocation pointer pointing to the target resource from the target pointer queue.

[0024] As an optional implementation, the memory node pool includes a priority queue that stores the priorities of multiple task nodes;

[0025] When the memory node pool receives resource acquisition requests from multiple task nodes, it determines whether the current resources in the memory node pool can satisfy the resource acquisition requests, including:

[0026] The memory node pool determines the priority of multiple task nodes based on a priority queue;

[0027] In descending order of priority, the memory node pool determines whether the amount of currently unallocated resources in the pool is sufficient to meet the resource acquisition requests of the task nodes.

[0028] The priority of each task node in the priority queue is determined based on the task node's execution time and the dependency relationship between the task node and other task nodes.

[0029] Thirdly, embodiments of this application provide a data storage device, the device comprising:

[0030] The first receiving module is used to determine, after receiving the task processing instruction, that the state of all pointers in the target pointer queue is non-empty; wherein, a pointer with a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is used, the target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block;

[0031] The sending module is used to send resource acquisition requests to the memory node pool, so that when the memory node pool determines that the current resources can satisfy the resource acquisition request, it will return a resource allocation pointer to the target pointer queue. The resource allocation pointer points to the target resource allocated to the task node.

[0032] The storage module is used to store task data corresponding to task processing instructions using the target resource pointed to by the resource allocation pointer.

[0033] Fourthly, embodiments of this application provide another data storage device, which includes:

[0034] The second receiving module is used to receive resource acquisition requests sent by the task node. The resource acquisition request is sent by the task node when it determines that the pointers in the target pointer queue are all non-empty. A pointer with a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is used. The target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0035] The feedback module is used to send a resource allocation pointer to the target queue corresponding to the task node when it is determined that the current resources in the memory node pool can meet the resource acquisition request. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

[0036] Fifthly, embodiments of this application provide a data storage device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any step of the data storage method in the first aspect described above.

[0037] In a sixth aspect, embodiments of this application provide a data storage device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any step of the data storage method in the second aspect described above.

[0038] In a seventh aspect, embodiments of this application provide a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement any step of the data storage methods in the first and second aspects described above.

[0039] Eighthly, embodiments of this application provide a computer program product, including a computer program stored in a computer-readable storage medium; when a processor of a memory access device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the memory access device to perform any step in the data storage method of the first and second aspects described above.

[0040] The above method achieves autonomous optimization of resource allocation by combining resource pre-allocation (i.e., memory resource blocks in the task queue) and dynamic allocation (resources in the memory node pool), thereby improving the overall pipeline throughput. At the same time, it expands its applicable scenarios, making it more suitable for scenarios where the resource usage of task nodes changes rapidly. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a schematic diagram of an assembly line operation in a related technology;

[0043] Figure 2 This is a schematic diagram of the structure of a task processing system provided in an embodiment of this application;

[0044] Figure 3 A flowchart illustrating a data storage method provided in an embodiment of this application;

[0045] Figure 4 A flowchart illustrating another data storage method provided in an embodiment of this application;

[0046] Figure 5 A schematic flowchart of a data storage device provided in an embodiment of this application;

[0047] Figure 6 A schematic flowchart of another data storage device provided in the embodiments of this application;

[0048] Figure 7 A schematic diagram of a data storage device provided in an embodiment of this application;

[0049] Figure 8 This is a schematic diagram of another data storage device provided in an embodiment of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the present invention will be described in further detail below with reference to the accompanying drawings.

[0051] The application scenarios described in this application are for the purpose of more clearly illustrating the technical solutions of this application, and do not constitute a limitation on the technical solutions provided in this application. Those skilled in the art will understand that with the emergence of new application scenarios, the technical solutions provided in this application are also applicable to similar technical problems. In the description of this application, unless otherwise stated, "multiple" means two or more.

[0052] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.

[0053] With the continuous development of deep learning, network model compression technology has become increasingly mature, thereby reducing the complexity of individual models, making them occupy less memory, and increasing inference speed. This also makes it possible to solve complex problems through multi-model collaboration.

[0054] For computing resources, more models can make full use of them, and multi-model collaboration can greatly improve the utilization rate of computing resources. However, for memory resources, different memory allocation methods will have a great impact on the throughput of the solution. How to allocate memory resources has become an urgent problem to be solved.

[0055] Currently, when encountering complex scenarios, they are often broken down into multiple interdependent sub-task nodes (i.e., models), with data flowing between each task node until the final calculation result is obtained.

[0056] Figure 1 This is a schematic diagram of an assembly line operation in a related technology. For example... Figure 1 As shown, in traditional pipeline operations, a fixed amount of memory resources are typically pre-allocated to each task node. This memory resource exists in the form of a data queue, with each task node corresponding to one data queue. This data queue includes at least one slot (a pre-allocated memory resource of a fixed size). Adjacent task nodes interact with each other through the data queue.

[0057] When a task node needs to run, it first checks whether there are any unused slots in its corresponding data queue. If so, it takes data from one slot in its input data queue (i.e., the data queue corresponding to its parent task node) to run the relevant task and saves the result in the output queue. At this time, its input queue will add one unused slot, and its output queue will add one used slot. If there are no unused slots, the task node stops running and waits for the data in its corresponding data queue to be taken by the next task node.

[0058] The above is a typical pipeline operation method. Although it decouples the relationship between task nodes through data queues, allowing different task nodes to run in parallel, it limits the data throughput during the operation and has limited applicability to various scenarios.

[0059] To address the aforementioned issues, this application proposes a data storage method. This method, applied to a task processing system, improves the overall pipeline throughput and expands its applicability by combining resource pre-allocation and dynamic allocation.

[0060] Figure 2 This is a schematic diagram of a task processing system provided in an embodiment of this application, such as... Figure 2 As shown, the task processing system includes a memory node pool, multiple task nodes, a pointer queue corresponding to each task node, and a data queue corresponding to each task node.

[0061] The following uses a task processing system with a single task node as an example to introduce the memory node pool, the pointer queue corresponding to the task node, and the data queue corresponding to the task node in the task processing system. Specifically:

[0062] The data queue stores pre-allocated memory resources, which are fixed-size resources allocated manually during the initialization of the task processing system and corresponding to the task nodes. The data queue includes at least one slot, with each slot corresponding to the same amount of resources; that is, each slot corresponds to one memory resource block. The number of slots can be manually set and changed.

[0063] It should be noted that, since the task processing system provided in this application embodiment is a combination of resource pre-allocation and dynamic allocation, the data queue is only set up to prevent a large number of requests generated during the initial run of the pipeline operation. As a buffer for the data flow, the size of the data queue corresponding to each task node only needs to be roughly estimated and does not need to be calculated in detail as in related technologies.

[0064] The pointer queue stores pointers to output data and / or memory resources in the memory node pool. The length of the pointer queue is variable, with a minimum length equal to the length of the data queue. In this case, the pointer queue contains multiple pointers that correspond one-to-one with slots in the data queue.

[0065] Within the minimum length range, pointers have two states: null and non-null. A non-null pointer points to the memory address of the corresponding slot in the data queue, indicating that the slot it points to has been used; a null pointer indicates that the slot it points to has not been used.

[0066] When all slots in the data queue are in use, meaning all pointers within the minimum length range are not null, a task node requests resources from the memory node pool when it needs to process a task. If the memory node pool allocates resources to the task node, it adds a non-null pointer to the pointer queue (hereinafter referred to as the resource allocation pointer for easy distinction). This pointer points to the resource allocated by the memory node pool, and the length of the pointer queue increases. That is, if a pointer exceeding the minimum length of the queue exists, its state must be non-null, pointing to a memory address in the memory node pool.

[0067] The memory node pool contains pre-allocated memory resources (i.e., pre-allocated memory resources of a fixed size), memory management tools, and a priority queue.

[0068] Among them, the memory management tool is mainly used to package, allocate and reclaim the memory resources requested by the task nodes. Since the source of the request is each task node, and the memory size requested by each task node is relatively fixed (that is, the basic unit of the resource requested by each node is the same, such as the basic unit is a memory resource block), memory allocation and fragmentation management are relatively easy.

[0069] The priority queue stores the priorities of all task nodes in the task processing system. In some embodiments, the priority queue can store the priorities of the pointer queues corresponding to each task node to record the priorities of the task nodes. The priorities in the priority queue are variable.

[0070] It should be noted that when the task processing system includes only one task node, the priority queue does not need to be included in the memory node pool.

[0071] Figure 3 This is a flowchart illustrating a data storage method provided in an embodiment of this application; as shown below. Figure 3 As shown in the figure, this application provides a data storage method, which is applied to any task node in a task processing system, and specifically includes the following steps:

[0072] Step 301: After receiving the task processing instruction, determine that the states of all pointers in the target pointer queue are not empty;

[0073] Among them, a pointer with a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is used, the target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0074] After receiving the task processing instruction, the task node first determines whether there are any pointers in the target pointer queue corresponding to the task node that are empty, that is, whether there are any unused memory resource blocks (i.e., slots) in its corresponding data queue. If it is determined that the pointers in the target pointer queue are all non-empty, that is, all memory resource blocks in its corresponding data queue have been used, then the subsequent step of requesting resources from the memory node pool is executed.

[0075] If a task node determines that there is a pointer with an empty state in the target pointer queue, that is, there is an unused memory resource block in its corresponding data queue, then the task data is stored in the memory resource block in the data queue pointed to by the pointer with an empty state; where an empty pointer indicates that the memory resource block in the data queue pointed to by the pointer is not used.

[0076] Step 302: Send a resource acquisition request to the memory node pool;

[0077] When a task node determines that all pointers in the target pointer queue are not empty, it means that all memory resource blocks in its corresponding data queue have been used. It then sends a resource acquisition request to the memory node pool, requesting the resource pool to allocate the requested resource. When the memory node pool determines that the current resources can satisfy the resource acquisition request, it sends a resource allocation pointer back to the target pointer queue. The resource allocation pointer points to the target resource allocated to the task node.

[0078] In practice, the resource acquisition request carries the identifier of the task node and the amount of resources requested by the task node, such as several memory resource blocks, so that the memory node pool can determine the task node that sent the resource acquisition request based on the identifier of the task node, and determine whether the target resources can be allocated to the task node based on the amount of resources requested by the task node.

[0079] Step 303: Use the target resource pointed to by the resource allocation pointer to store the task data corresponding to the task processing instruction.

[0080] When the task node memory node pool feeds back the resource allocation pointer to the target pointer queue corresponding to the task node, it uses the resource pointed to by the resource allocation pointer to store the task data corresponding to the task processing instruction and executes the task corresponding to the task processing instruction.

[0081] The above method achieves autonomous optimization of resource allocation by combining resource pre-allocation (i.e., memory resource blocks in the task queue) and dynamic allocation (resources in the memory node pool), thereby improving the overall pipeline throughput. At the same time, it expands its applicable scenarios, making it more suitable for scenarios where the resource usage of task nodes changes rapidly.

[0082] In practice, when a task node sends a resource acquisition request to the memory node pool, the memory node pool determines that the current resources in the pool cannot satisfy the request and sends an indication message to the task node. After receiving the indication message, the task node sends the resource acquisition request again after a preset time interval. The indication message, sent by the memory node pool when it determines that the current resources cannot satisfy the request, indicates that the task node cannot currently allocate resources to it.

[0083] In some embodiments, the above indication information can be in the form of a null pointer. It should be noted that when the indication information is a null pointer, the memory node pool only sends the null pointer to the task node to indicate that resources cannot be allocated to it at present, and does not add the null pointer to its corresponding pointer queue.

[0084] Figure 4 A flowchart illustrating another data storage method provided in this application embodiment; as shown Figure 4 As shown in the figure, this application embodiment provides another data storage method, applied to the memory node pool of a task processing system, specifically including the following steps:

[0085] Step 401: The memory node pool receives resource acquisition requests sent by task nodes;

[0086] The resource acquisition request is sent by a task node when all pointers in the target pointer queue are in a non-empty state, meaning the task node has determined that all memory resource blocks in its corresponding data queue have been used. A non-empty pointer indicates that the memory resource block in the data queue it points to is in use. The target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0087] In some embodiments, the resource acquisition request carries the identifier of the task node and the amount of resources requested by the task node, such as several memory resource blocks. When the memory node pool receives the resource acquisition request, it determines the task node that sent the resource acquisition request based on the identifier of the task node carried in the resource acquisition request, and determines the resources to be allocated based on the amount of resources requested by the task node carried in the resource acquisition request.

[0088] Step 402: When the memory node pool determines that the current resources in the memory node pool can satisfy the resource acquisition request, it sends a resource allocation pointer back to the task node and sends it to the target queue corresponding to the task node.

[0089] After receiving a resource acquisition request from a task node, the memory node pool evaluates whether resources can be allocated to it based on information such as the current resource status in the memory node pool, the task node that sent the resource acquisition request, and the resources requested by the task node.

[0090] If the memory node pool determines that the current resources in the pool can satisfy the resource acquisition request, it determines the target resource to be allocated to the task node and feeds back a resource allocation pointer to the target resource queue corresponding to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction. The resource allocation pointer points to the target resource allocated to the task node.

[0091] If the memory node pool determines that the current resources in the memory node pool cannot satisfy the resource acquisition request, it sends an indication message to the task node so that after receiving the indication message, the task node sends the resource acquisition request to the memory node pool again after a preset time interval.

[0092] The above method achieves autonomous optimization of resource allocation through dynamic resource allocation, thereby improving the overall pipeline throughput. Furthermore, the dynamic allocation of resources to task nodes is more flexible and better suited to scenarios where task node resource usage changes rapidly.

[0093] In some embodiments, after step 402 above, where the memory node pool feeds back a resource allocation pointer to the task node and the target queue corresponding to the task node, so that the task node uses the target resource to store the task data corresponding to the received task processing instruction, the following steps are also performed in this embodiment:

[0094] When the memory node pool determines that the data stored in the target resource is invalid, it removes the resource allocation pointer pointing to the target resource from the target pointer queue.

[0095] That is, when a task node uses the target resource to store the task data corresponding to the task processing instruction, and the memory node pool detects that the data stored in the target resource has become invalid, it uses the memory management tool to reclaim the resource. At the same time, it deletes the resource allocation pointer pointing to the target resource from the target pointer queue of the task node. When the next task node of the task node obtains the data stored in the target resource, it changes the state of the data stored in the target resource to invalid.

[0096] In some embodiments, the memory node pool includes a priority queue that stores the priorities of all task nodes in the task processing system.

[0097] When the memory node pool receives resource acquisition requests from multiple task nodes in step 401 above, the memory node pool determines whether the current resources in the memory node pool can satisfy the resource acquisition requests, including:

[0098] The memory node pool determines the priority of multiple task nodes based on a priority queue;

[0099] In descending order of priority, the memory node pool determines whether the amount of currently unallocated resources in the pool is sufficient to meet the resource acquisition requests of the task nodes.

[0100] The priority of each task node in the priority queue is determined based on the task node's execution time and the dependency relationship between the task node and other task nodes.

[0101] The runtime mentioned above refers to the time taken for the task node to complete its task. The shorter the runtime, the less likely the data flow is to be blocked at that task node, and therefore the priority of that task node can be appropriately lowered. In other words, the shorter the runtime of a task node, the lower its corresponding priority.

[0102] The above-mentioned dependency relationship refers to the upstream and downstream relationship between this task node and other task nodes. The priority of downstream nodes can be appropriately increased compared to upstream nodes. That is, the more upstream nodes a task node has, the higher its priority.

[0103] The above method, by setting the priority of dynamic allocation, increases human intervention in dynamic resource allocation, making its resource allocation more rational.

[0104] The data storage method provided in this application combines resource pre-allocation and dynamic allocation, which complement each other and are applicable to more scenarios. Since it no longer assumes that the resource occupation of task nodes is relatively fixed, there is no need to accurately calculate the pre-allocated resources of each task node, making it more suitable for scenarios where the resource occupation of task nodes changes rapidly. At the same time, priority settings are made for resource allocation, which can flexibly and reasonably manage resource allocation, thereby improving the overall throughput of the pipeline.

[0105] Based on the same disclosed concept, this application also provides a data storage device. Since this device is the same as the device in the method of this application, and the principle of the device in solving the problem is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0106] Figure 5Please refer to the schematic diagram of a data storage device provided in the embodiments of this application. Figure 5 This application provides a data storage device, which includes:

[0107] The first receiving module 501 is used to determine, after receiving a task processing instruction, that the states of all pointers in the target pointer queue are non-empty; wherein, a pointer with a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used, the target pointer queue is a pointer queue corresponding to the task node, and the data queue includes at least one memory resource block;

[0108] Sending module 502 is used to send a resource acquisition request to the memory node pool, so that when the memory node pool determines that the current resources can satisfy the resource acquisition request, it will feed back a resource allocation pointer to the target pointer queue, and the resource allocation pointer points to the target resource allocated to the task node;

[0109] The storage module 503 is used to store task data corresponding to the task processing instruction using the target resource pointed to by the resource allocation pointer.

[0110] Optionally, the storage module 503 is further configured to: when it is determined that there is a pointer with an empty state in the target pointer queue, use the memory resource block in the data queue pointed to by the pointer with an empty state to store the task data; wherein, the pointer with an empty state indicates that the memory resource block in the data queue pointed to by the pointer is not used.

[0111] Optionally, the storage module 503 is further configured to receive indication information from the memory node pool and, after a preset time interval, send a resource acquisition request to the memory node pool again; wherein, the indication information is provided by the memory node pool when it determines that the current resources cannot satisfy the resource acquisition request.

[0112] This application also provides another data storage device. Figure 6 For a schematic diagram of another data storage device provided in the embodiments of this application, please refer to... Figure 6 This application provides a data storage device, which includes:

[0113] The second receiving module 601 is used to receive a resource acquisition request sent by a task node. The resource acquisition request is sent by the task node when it determines that the pointers in the target pointer queue are all in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is a pointer queue corresponding to the task node. The data queue includes at least one memory resource block.

[0114] The feedback module 602 is used to, when it is determined that the current resources in the memory node pool can satisfy the resource acquisition request, feed back a resource allocation pointer to the target queue corresponding to the task node. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

[0115] Optionally, the feedback module 602 is further configured to: when it is determined that the current resources in the memory node pool cannot satisfy the resource acquisition request, provide feedback indication information to the task node so that after receiving the indication information, the task node sends the resource acquisition request to the memory node pool again after a preset time interval.

[0116] Optionally, the feedback module 602 is used to feed back the resource allocation pointer to the target queue corresponding to the task node so that the task node can use the target resource to store the task data corresponding to the received task processing instruction. It is also used to: delete the resource allocation pointer pointing to the target resource from the target pointer queue when it is determined that the data stored in the target resource is invalid.

[0117] Optionally, the memory node pool mentioned above includes a priority queue, which stores the priorities of multiple task nodes;

[0118] Optionally, when receiving resource acquisition requests from multiple task nodes, the feedback module 602 is used to determine whether the current resources in the memory node pool can satisfy the resource acquisition request, including: determining the priority of multiple task nodes according to the priority queue; and determining whether the amount of currently unallocated resources in the memory node pool can satisfy the resource acquisition request of the task nodes in descending order of priority; wherein, the priority of each task node in the priority queue is determined based on the running time of the task node and the dependency relationship between the task node and other task nodes.

[0119] Based on the same disclosed concept, this application also provides a data storage device. Since this device is the same as the device in the method of this application, and the principle of the device in solving the problem is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0120] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0121] In some possible implementations, the device according to this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the steps in the data storage methods according to the various exemplary embodiments of this application described above.

[0122] The following reference Figure 7 The device 700 according to this embodiment of the present application is described. Figure 7 The device 700 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0123] like Figure 7 As shown, device 700 is presented in the form of a general-purpose device. Components of device 700 may include, but are not limited to: at least one processor 701, at least one memory 702, and a bus 703 connecting different system components (including memory 702 and processor 701). The memory stores program code, which, when executed by the processor, causes the processor to perform the following steps:

[0124] Upon receiving the task processing instruction, it is determined that the pointers in the target pointer queue are all in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block.

[0125] Send a resource acquisition request to the memory node pool so that when the memory node pool determines that the current resources can satisfy the resource acquisition request, it will return a resource allocation pointer to the target pointer queue. The resource allocation pointer points to the target resource allocated to the task node.

[0126] Use the target resource pointed to by the resource allocation pointer to store the task data corresponding to the task processing instruction.

[0127] Bus 703 represents one or more of several bus architectures, including a memory bus or memory controller, peripheral bus, processor, or a local bus using any of the various bus architectures.

[0128] The memory 702 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 7021 and / or cache memory 7022, and may further include read-only memory (ROM) 7023.

[0129] The memory 702 may also include a program / utility 7025 having a set (at least one) of program modules 7024, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0130] Device 700 can also communicate with one or more external devices 704 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with device 700, and / or with any device that enables device 700 to communicate with one or more other devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 705. Furthermore, device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 706. As shown, network adapter 706 communicates with other modules used with device 700 via bus 703. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0131] Optionally, the processor is further configured to: when it is determined that there is a pointer with an empty state in the target pointer queue, use the memory resource block in the data queue pointed to by the pointer with an empty state to store the task data; wherein, the pointer with an empty state indicates that the memory resource block in the data queue pointed to by the pointer is not used.

[0132] Optionally, the processor is further configured to: receive indication information from the memory node pool, and after a preset time interval, send a resource acquisition request to the memory node pool again; wherein the indication information is fed back by the memory node pool when it determines that the current resource cannot satisfy the resource acquisition request.

[0133] This application also provides a data storage device, which will be referred to below. Figure 8 To describe the device 800 according to this embodiment of the present application. Figure 8 The device 800 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0134] like Figure 8As shown, device 800 is presented in the form of a general-purpose device. Components of device 800 may include, but are not limited to: at least one processor 801, at least one memory 802, and a bus 803 connecting different system components (including memory 802 and processor 801). The memory stores program code, which, when executed by the processor, causes the processor to perform the following steps:

[0135] Receive resource acquisition requests sent by task nodes. The resource acquisition request is sent by the task node when it determines that the pointers in the target pointer queue are all in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is the pointer queue corresponding to the task node. The data queue includes at least one memory resource block.

[0136] When it is determined that the current resources in the memory node pool can satisfy the resource acquisition request, a resource allocation pointer is fed back to the task node and sent to the target queue corresponding to the task node. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

[0137] Bus 803 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or a local bus using any of the various bus structures.

[0138] The memory 802 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 8021 and / or cache memory 8022, and may further include read-only memory (ROM) 8023.

[0139] The memory 802 may also include a program / utility 8025 having a set (at least one) of program modules 8024, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0140] Device 800 can also communicate with one or more external devices 804 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with device 800, and / or with any device that enables device 800 to communicate with one or more other devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 805. Furthermore, device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 806. As shown, network adapter 806 communicates with other modules used with device 800 via bus 803. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0141] Optionally, the processor described above is also used for:

[0142] When it is determined that the current resources in the memory node pool cannot satisfy the resource acquisition request, an indication message is sent back to the task node so that after receiving the indication message, the task node sends the resource acquisition request to the memory node pool again after a preset time interval.

[0143] Optionally, the processor described above is used to feed back a resource allocation pointer to the task node and the target queue corresponding to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction, and is further used to:

[0144] When it is determined that the data stored in the target resource is invalid, the resource allocation pointer pointing to the target resource is removed from the target pointer queue.

[0145] Optionally, the memory node pool includes a priority queue, which stores the priorities of multiple task nodes;

[0146] When receiving resource acquisition requests from multiple task nodes, the aforementioned processor determines whether the current resources in the memory node pool can satisfy the resource acquisition requests, including:

[0147] The memory node pool determines the priority of multiple task nodes based on a priority queue;

[0148] In descending order of priority, the memory node pool determines whether the amount of currently unallocated resources in the pool is sufficient to meet the resource acquisition requests of the task nodes.

[0149] The priority of each task node in the priority queue is determined based on the task node's execution time and the dependency relationship between the task node and other task nodes.

[0150] In some possible implementations, various aspects of the data storage method provided in this application can also be implemented in the form of a program product, which includes program code that, when the program product is run on a computer device, causes the computer device to perform the steps in a data storage method according to various exemplary embodiments of this application as described above.

[0151] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0152] The monitoring program product of the embodiments of this application can be a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a device. However, the program product of this application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0153] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0154] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0155] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device or server. In cases involving remote devices, the remote device can be connected to the user device via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external device (e.g., via the Internet using an Internet service provider).

[0156] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0157] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0158] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0159] This application is described with reference to flowchart illustrations and block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block and / or block in the flowchart illustrations and block diagrams, as well as combinations of blocks and processes in the flowchart illustrations and block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and boxes Figure 1 The function specified in one or more boxes.

[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and boxes Figure 1 The steps of the function specified in one or more boxes.

[0162] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0163] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data storage method, characterized in that, The method is applied to any task node in a task processing system, wherein the task processing system includes a memory node pool, multiple task nodes, a pointer queue corresponding to each task node, and a data queue corresponding to each task node. After receiving the task processing instruction, the task node determines that the pointers in the target pointer queue are all in a non-empty state; wherein, a pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is in use, the target pointer queue is the pointer queue corresponding to the task node, and the data queue includes at least one memory resource block; The task node sends a resource acquisition request to the memory node pool, so that when the memory node pool determines that the current resources can satisfy the resource acquisition request, it feeds back a resource allocation pointer to the target pointer queue, and the resource allocation pointer points to the target resource allocated to the task node. The task node uses the target resource pointed to by the resource allocation pointer to store task data corresponding to the task processing instruction.

2. The method according to claim 1, characterized in that, The method also includes: When the task node determines that there is a pointer with an empty state in the target pointer queue, it uses the memory resource block in the data queue pointed to by the pointer with an empty state to store the task data; The null pointer indicates that the memory resource block in the data queue pointed to by the pointer is not used.

3. The method according to claim 1 or 2, characterized in that, The method also includes: The task node receives the instruction information fed back by the memory node pool, and after a preset time interval, sends a resource acquisition request to the memory node pool again. The indication information is provided by the memory node pool when it determines that the current resources cannot satisfy the resource acquisition request.

4. A data storage method, characterized in that, A memory node pool is applied to a task processing system, the task processing system including a memory node pool, multiple task nodes, a pointer queue corresponding to each task node, and a data queue corresponding to each task node. The method includes: The memory node pool receives a resource acquisition request sent by a task node. The resource acquisition request is sent by the task node when it determines that all pointers in the target pointer queue are in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is a pointer queue corresponding to the task node. The data queue includes at least one memory resource block. When the memory node pool determines that the current resources in the memory node pool can satisfy the resource acquisition request, it feeds back a resource allocation pointer to the target queue corresponding to the task node. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

5. The method according to claim 4, characterized in that, The method also includes: When the memory node pool determines that the current resources in the memory node pool cannot satisfy the resource acquisition request, it sends an indication message to the task node, so that after receiving the indication message, the task node sends the resource acquisition request to the memory node pool again after a preset time interval.

6. The method according to claim 4, characterized in that, The method further includes: after the memory node pool feeds back a resource allocation pointer to the task node and the target queue corresponding to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction, the method also includes: When the memory node pool determines that the data stored in the target resource is invalid, it removes the resource allocation pointer pointing to the target resource from the target pointer queue.

7. The method according to any one of claims 4 to 6, characterized in that, The memory node pool includes a priority queue, which stores the priorities of the plurality of task nodes; When the memory node pool receives resource acquisition requests from multiple task nodes, the memory node pool determines whether the current resources in the memory node pool can satisfy the resource acquisition requests, including: The memory node pool determines the priority of the plurality of task nodes according to the priority queue; In descending order of priority, the memory node pool determines whether the amount of currently unallocated resources in the memory node pool is sufficient to meet the resource acquisition requests of the task nodes. The priority of each task node in the priority queue is determined based on the running time of the task node and the dependency relationship between the task node and other task nodes.

8. A data storage device, characterized in that, The device includes: The first receiving module is used to determine, after receiving a task processing instruction, that the states of all pointers in the target pointer queue are non-empty; wherein, a pointer with a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used, the target pointer queue is a pointer queue corresponding to the task node, and the data queue includes at least one memory resource block; The sending module is used to send a resource acquisition request to the memory node pool, so that when the memory node pool determines that the current resources can satisfy the resource acquisition request, it will return a resource allocation pointer to the target pointer queue, and the resource allocation pointer points to the target resource allocated to the task node. The storage module is used to store task data corresponding to the task processing instruction using the target resource pointed to by the resource allocation pointer.

9. A data storage device, characterized in that, The device includes: The second receiving module is used to receive a resource acquisition request sent by a task node. The resource acquisition request is sent by the task node when it determines that the pointers in the target pointer queue are all in a non-empty state. A pointer in a non-empty state indicates that the memory resource block in the data queue pointed to by the pointer is being used. The target pointer queue is a pointer queue corresponding to the task node. The data queue includes at least one memory resource block. The feedback module is used to, when it is determined that the current resources in the memory node pool can satisfy the resource acquisition request, feed back a resource allocation pointer to the target queue corresponding to the task node. The resource allocation pointer points to the target resource allocated to the task node, so that the task node can use the target resource to store the task data corresponding to the received task processing instruction.

10. A data storage device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Direct memory access method, device, special computing chip and heterogeneous computing system

    CN110515872A

  • Task processing method and device

    CN113157404A