A same-node ATP supply and demand balance consumption method and system based on time domain parallel prefix and divide and conquer

CN122948183APending Publication Date: 2026-10-20AIPISHI TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611233706.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

由于现有的算法无法在同一个物料节点内进行并发消纳,当大量的线程并发计算不同成品的 BOM 展开与扣减时,它们会同时向这几个通用物料节点的时序库存数组写入扣减量,引发灾难性的行级锁冲突或线程阻塞,甚至导致系统假死

Benefits of technology

[0068]本发明采用Blelloch多核并行前缀扫描架构,依托具备结合律的复合区间合并算子打破时序递推强依赖,将全时域库存、ATP 可承诺量的整体计算复杂度压缩至O(logN),使本申请的消纳平衡系统运算性能随CPU核心数量提升而实现近线性加速,充分释放多核服务器硬件算力,大幅缩短大规模时序数据的处理耗时。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure QLYQS_9
    Figure QLYQS_9
  • Figure SMS_116
    Figure SMS_116
Patent Text Reader

Abstract

This invention discloses a method and system for balancing supply and demand of ATP (Automatic Guided Product) at the same node based on temporal parallel prefix sum divide-and-conquer. The method first extracts supply and demand data and constructs supply and demand time-series arrays. Next, it constructs a temporal divide-and-conquer interval tree and configures an interval merging operator that satisfies the associative law. Then, it performs parallel computation on the supply and demand time-series arrays to obtain the cumulative demand and supply curves across the entire time domain. Next, it calculates the expected available inventory for all time-series nodes in batches using the initial inventory, cumulative demand curve, and cumulative supply curve. Finally, it calculates the ATP commitment amount for the corresponding material node on a time-period basis based on the expected available inventory, achieving parallel supply and demand balancing at the same material node. This application not only fully releases the computing power of multi-core server hardware and shortens the processing time of large-scale time-series data, but also supports the stable operation of scenarios involving synchronous ATP sourcing for massive orders.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent scheduling and enterprise management technology. Specifically, it is a method and system for balancing the supply and demand of ATP at the same node based on time-domain parallel prefix sum divide-and-conquer. Background Technology

[0002] In supply chain planning and advanced production scheduling (APS) of manufacturing enterprises, Available-to-Promise (ATP) and Demand-Supply Matching are core and frequently used underlying calculation operators. This calculation primarily occurs at a specific SKU (Stock Keeping Unit). On a future rolling planning timeline, the system uses the current inventory at that node and the supply in transit for each time period, in a linear sequence, to deduct and absorb the actual customer demand at each time point, thereby calculating the projected on-hand / projected available balance and the amount of ATP available for future new order commitments.

[0003] Existing supply chain planning theories and commercial APS products share a common understanding: single-SKU time-series ATP (Action-Action-Induced) calculations exhibit strong temporal causal dependencies, allowing only serial computation and preventing multi-threaded parallel acceleration within material nodes. This mechanism creates a significant computational bottleneck in multi-core hardware architectures, becoming a critical weakness severely restricting supply chain computing performance in the multi-core CPU era. Specifically, it suffers from the following two core defects:

[0004] First, the time-series recursive link is strongly coupled, resulting in low computational efficiency and wasted hardware resources. The expected water level OnHand[t] at any time t depends strictly on the inventory balance at the previous time t-1, the supply at the current time Supply[t], and the demand at the current time Demand[t]. Its state recursive equation is as follows:

[0005] The inventory balance at any given time depends entirely on the calculation results of the previous period, forming an irreversible serial calculation chain. To calculate the inventory balance for day 100, the calculation engine must sequentially calculate the data of the previous 99 days, with the output of the previous step serving as the input for the next, forming a serial chain. If a rolling plan is adopted for 365 days a year and a scenario with millions of supply and demand orders, calculations must be performed sequentially over time. It is impossible to split the task and distribute it to multiple cores for parallel processing, resulting in long-term idle computing power of server cores. A single full supply and demand calculation can take tens of minutes.

[0006] Secondly, in ultra-large-scale discrete manufacturing, certain common standard parts or raw materials (such as common resistors and capacitors in semiconductor manufacturing, and common fasteners in precision assembly) are frequently called by thousands of superior materials in the Bill of Materials (BOM), generating extremely dense time-series supply and demand flows. Since existing algorithms cannot perform concurrent processing within the same material node, when a large number of threads concurrently calculate the BOM expansion and deduction of different finished products, they will simultaneously write deduction amounts to the time-series inventory arrays of these common material nodes, causing catastrophic row-level lock conflicts or thread blocking, and even leading to system freezes.

[0007] Current industry optimization methods are limited to peripheral solutions such as cross-material parallel computing, database buffering, segmented lock isolation, and hardware cluster expansion. These methods can only distribute the computing pressure of different SKUs and cannot solve the fundamental problems of serial computing and high-concurrency write conflicts within the same material node. They cannot reduce the computational complexity of timing simulation, nor can they fundamentally alleviate lock contention failures of general materials.

[0008] In summary, existing technologies, limited by the technical biases of traditional time-series computing, cannot break the serial causal dependence of ATP supply and demand, resulting in drawbacks such as low computing power utilization, high computational latency, and poor system stability. Therefore, there is an urgent need for a time-domain parallel prefix sum divide-and-conquer method and system for ATP supply and demand balancing at the same node, to overcome the bottleneck of traditional serial computing, significantly improve ATP computational efficiency and concurrency while ensuring data computation accuracy, and meet the core requirements of intelligent scheduling in high-end manufacturing. Summary of the Invention

[0009] Therefore, the technical problem to be solved by the present invention is to provide a method and system for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide and conquer, so as to break through the bottleneck of traditional serial computing, and significantly improve the ATP computing efficiency and concurrency capability while ensuring the accuracy of data calculation, so as to meet the core needs of intelligent scheduling in high-end manufacturing.

[0010] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0011] A time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node includes the following steps:

[0012] Step P1: For a single material node SKU, extract the supply data and demand data for each time period of the entire planning cycle, and construct the supply time series array and demand time series array based on the supply data and demand data;

[0013] Step P2: Construct a time-domain divide-and-conquer interval tree based on the supply time series array and the demand time series array, and configure an interval merging operator that satisfies the associative law;

[0014] Step P3: Using the time-domain divide-and-conquer interval tree and interval merging operator, perform parallel operations on the supply time series array and the demand time series array to obtain the demand accumulation curve and supply accumulation curve in the entire time domain.

[0015] Step P4: Combine the beginning inventory, demand accumulation curve and supply accumulation curve to calculate the expected available inventory for all time-series nodes in batches to eliminate the time-by-time serial recursion constraint.

[0016] Step P5: Based on the estimated available inventory, calculate the ATP commitment quantity of the corresponding material node for each time period to achieve parallel supply and demand balance of the same material node.

[0017] In the above-mentioned time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node, in step P1, the supply time series array and the demand time series array are constructed in contiguous physical memory.

[0018] In the above-mentioned method for ATP supply and demand balance at the same node based on temporal parallel prefix sum divide-and-conquer, in step P2, the temporal divide-and-conquer interval tree is a binary time segment tree. When constructing the binary time segment tree, the entire planning cycle is divided into multiple non-overlapping time intervals. The leaf nodes of the binary time segment tree correspond to a single time period, and the parent nodes at each level correspond to continuous multi-time period intervals obtained by merging the sub-intervals.

[0019] In the aforementioned time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance reduction at the same node, step P2 involves each CPU core concurrently calculating the local reduction state within its assigned time interval and extracting two key feature values:

[0020] A. Local supply surplus vector , where, for any value , quantity This represents the maximum redundant supply that the i-th station can allocate to external locations within the current interval.

[0021] B. Local Demand Gap Vector , where, for any value , quantity This indicates the demand gap that the i-th station cannot absorb within the current interval;

[0022] Local supply surplus vector and local demand gap vector In this context, K represents the number of factories and distribution centers participating in the collaboration.

[0023] In the above-mentioned method for ATP supply and demand balance at the same node based on temporal parallel prefix sum divide and conquer, step P3 uses the Blech parallel prefix scan algorithm based on multi-core parallelism to perform parallel computation and solve the problem in O(logN) steps, obtaining the cumulative demand curve Cumulative_Demand and the cumulative supply curve Cumulative_Supply.

[0024] The Blelloch parallel prefix scan algorithm includes two stages of control logic:

[0025] Phase 1 is the Up-Sweep bottom-up reduction phase: the time series array is grouped into pairs, and the values ​​of the grouped intervals are merged and summarized upward to the corresponding parent node through multi-threaded concurrency, thus constructing an implicit binary time series tree. Finally, the root node stores the overall summary data of the entire time series interval.

[0026] Phase 2 is the Down-Sweep distribution phase: the initial offset value of the root node is set to 0, the offset is passed down layer by layer from top to bottom, and the offset is exchanged and superimposed with the values ​​of the left subtree nodes. The temporal prefix sums corresponding to each time period are obtained in parallel.

[0027] The aforementioned method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer is defined mathematically by the following formula:

[0028] ;

[0029] in, This is the global cumulative demand vector up to time period t, representing the total demand of all stations from time period 1 to time period t;

[0030] The global cumulative demand vector up to time period t-1 represents the total demand of all stations from time period 1 to time period t-1;

[0031] Let t be the demand vector for time period t, and each component of the vector corresponds to the current material demand of each collaborative site.

[0032] ;

[0033] in, This is the global cumulative supply vector up to time period t, representing the total supply of all stations from time period 1 to time period t;

[0034] This is the global cumulative supply vector up to time period t-1, representing the total supply of all stations from time period 1 to time period t-1;

[0035] The supply vector is defined for time period t, and each component of the vector corresponds to the current material supply at each coordinating site.

[0036] The above-mentioned method for ATP supply and demand balance at the same node based on temporal parallel prefix sum divide and conquer, wherein during the Up-Sweep hierarchical reduction and merging process, when merging two adjacent time intervals, the left interval L with a preceding time sequence and the right interval R with a following time sequence, simultaneously executes the supply and demand offsetting before and after the time sequence and multi-threaded concurrent solution of the material allocation substitution conversion relationship between each collaborative site;

[0037] The interval merging operation is defined as ⊕, and the merged interval is represented as L⊕R. This composite interval merging operation satisfies the associative law as a whole. For any station i, the interval supply and demand vector merging calculation is completed through the matching surplus supply merging formula and demand gap merging formula.

[0038] The formula for merging local surplus supply is:

[0039] (3);

[0040] in, The total surplus material quantity at station j after merging the left and right intervals;

[0041] Let J be the amount of surplus material at station j within the right interval R.

[0042] Let J be the amount of surplus material at station j within the left interval L.

[0043] Let i be the material shortage at station i within the right interval R.

[0044] This is a set of sub-level / destination sites that can receive materials allocated by site j;

[0045] This refers to the corresponding allocation coefficient or substitution efficiency coefficient.

[0046] The formula for merging local demand gaps is:

[0047] (4);

[0048] in, The total material shortage at station i after the left and right time intervals are merged;

[0049] Let i be the material shortage at station i within the left interval L;

[0050] Let i be the material shortage at station i within the right interval R.

[0051] Let J be the amount of surplus material at station j within the left interval L.

[0052] The set of parent / source sites that can allocate materials to site i;

[0053] This refers to the corresponding allocation coefficient or substitution efficiency coefficient.

[0054] In the above-mentioned time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node, in step P4, after parallel computation to obtain the supply accumulation curve and the demand accumulation curve, multi-threaded concurrent difference calculation is performed on all time-series nodes to instantly output the theoretical reservoir water level vector of multiple stations in the entire time domain.

[0055] The theory states that the reservoir water level vector represents the expected available inventory at each time node in step P4. Furthermore, the actual absorption volume for each time period is derived using double-ended prefix sums and closed-form expressions. and gap quantity :

[0056] (5);

[0057] (6);

[0058] (7);

[0059] (8);

[0060] in, Initial static inventory vector, Let be the global cumulative supply vector up to time period t. As of the date The global cumulative supply vector for a given period. Let be the global cumulative demand vector up to time period t. As of the date The global cumulative demand vector for a given period. Let be the vector of the actual quantity of materials consumed in time period t. Let be the vector of unmet demand gap in time period t. Let be the vector of expected available inventory levels for time period t. Let be the vector of committable quantities for time period t.

[0061] The aforementioned method for balancing the supply and demand of ATP on the same node based on temporal parallel prefix sum divide and conquer operates in a contiguous memory segment pre-allocated during the initialization phase. The local operational state of each CPU core resides in a thread-specific flat structure array pre-allocated during the initialization phase, with different thread storage areas isolated from each other and buffer lines aligned. There is no runtime heap memory allocation during the reduction phase, and zero-contention high-throughput parallel computation can be achieved without any thread synchronization locks.

[0062] A time-domain parallel prefix sum divide-and-conquer system for ATP supply and demand balancing at the same node, used to implement the aforementioned supply and demand balancing method, includes:

[0063] The data extraction and array construction module is used to extract supply and demand data and construct supply time series arrays and demand time series arrays.

[0064] The computation and solution module is used to execute the Blelloch parallel prefix scan algorithm. It relies on the time-domain divide-and-conquer interval tree and interval merging operator to perform parallel computation in O(logN) steps to obtain the demand accumulation curve and the supply accumulation curve.

[0065] The batch calculation module is used to calculate the expected available inventory for all time nodes in batches by combining the beginning inventory, the cumulative demand curve, and the cumulative supply curve.

[0066] The ATP calculation module is used to calculate the ATP commitment amount of the corresponding material node on a time-by-time basis based on the estimated available inventory.

[0067] The technical solution of the present invention achieves the following beneficial technical effects:

[0068] This invention adopts the Blellach multi-core parallel prefix scan architecture and relies on the composite interval merging operator with associative law to break the strong dependency of time-series recursion. It compresses the overall computational complexity of the full-time domain inventory and ATP commitment to O(logN), so that the computing performance of the absorption and balancing system of this application can achieve near-linear acceleration as the number of CPU cores increases, fully release the computing power of multi-core server hardware, and significantly shorten the processing time of large-scale time-series data.

[0069] This application uses a binary hierarchical reduction merging operator that satisfies the associative law to transform the supply and demand matching between different time periods into a dependency-free pure algebraic interval merging operation. All time intervals can be independently allocated to multi-core threads for parallel processing. The entire process does not require row-level exclusive locks or serial waiting processes, thus avoiding lock conflicts from the algorithm's underlying layer. This greatly improves the throughput of multiple concurrent requests and can support the stable operation of scenarios involving massive order synchronous ATP source query.

[0070] All binary merging operations in this application are performed on a contiguous block of memory pre-allocated during the program initialization phase. No dynamic memory allocation is generated during the Up-Sweep level reduction phase. The operation states of each CPU core are isolated and stored in a thread-local flat SoA array. Gap and surplus vectors of the same type are arranged continuously, which greatly improves the hit rate of the CPU's L1 and L2 caches. At the same time, it avoids multi-threaded global memory contention and high-frequency GC jitter, ensuring stable and controllable operation latency.

[0071] This application seamlessly integrates a multi-factory / DC parent-child substitution sourcing model into the segment tree merging operator, which combines the allocation ATP that originally required multiple serial calculations across multiple sites into a single segment tree prefix scan, achieving millisecond-level ATP commitments in a global multi-center inventory network. Attached Figure Description

[0072] Figure 1 This is a flowchart of a time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node, according to the present invention. Detailed Implementation

[0073] Example 1 discloses a time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node, such as... Figure 1 As shown, it includes the following steps:

[0074] Step P1: For a single material node SKU, extract the supply data and demand data for each time period of the entire planning cycle, and construct a supply time series array and a demand time series array in contiguous physical memory based on the supply data and demand data.

[0075] Step P2: Construct a time-domain divide-and-conquer interval tree based on the supply time-series array and the demand time-series array, and configure an interval merging operator that satisfies the associative law; the time-domain divide-and-conquer interval tree is a binary time-series segment tree; in actual supply chains, due to production anomalies or procurement delays, local time-series supply shortages (PAB level is negative) often occur. Furthermore, as manufacturing enterprises evolve towards multi-factory / multi-DC network architectures, the material availability commitment (ATP) is no longer limited to a single physical warehouse, but needs to be cascaded for sourcing and substitution among multiple cooperating factories and distribution centers. To achieve lock-free parallel allocation in complex multi-site, multi-level supply chain networks, this invention adopts a time-domain segment tree divide-and-conquer method combined with a multi-factory sourcing architecture for multi-threaded allocation. The entire planning cycle is divided into several non-overlapping time intervals, and a binary time-series segment tree is constructed accordingly (leaf nodes correspond to single days, and parent nodes correspond to continuous intervals over multiple days). Within each time interval, the local absorption state of each SKU node is no longer represented by a simple scalar, but is encoded as a vector structure spanning multiple sites. Each CPU core concurrently computes the local absorption state within its assigned time interval, extracting two key feature values:

[0076] A. Local supply surplus vector , where, for any value , quantity This represents the maximum redundant supply that the i-th station can allocate to external locations within the current interval.

[0077] B. Local Demand Gap Vector , where, for any value , quantity This indicates the demand gap that the i-th station cannot absorb within the current interval;

[0078] Local supply surplus vector and local demand gap vector In this context, K represents the number of factories and distribution centers participating in the collaboration. Directed alternative sourcing paths exist between multiple factories / distribution centers (such as supply flows from a parent factory to a child distribution center, or lateral transfers between warehouses at the same level). For a transfer path from source site j to destination site i, its transfer conversion rate is defined. (Represents logistics transportation costs or conversion efficiency). When performing time-domain elimination, each station in the system follows this cascaded substitution source-finding topology to perform state deduction.

[0079] Step P3: Using the time-domain divide-and-conquer interval tree and interval merging operator, the supply time series array and demand time series array are solved in parallel to obtain the demand accumulation curve and supply accumulation curve in the entire time domain; the Belloch parallel prefix scan algorithm based on multi-core parallelism is used to calculate and solve in parallel in O(logN) steps to obtain the demand accumulation curve Cumulative_Demand and the supply accumulation curve Cumulative_Supply; This invention transforms the "cyclic cumulative causal chain" of time-series supply and demand calculation into algebraic operations that conform to the associative law, thereby breaking the time-series dependency.

[0080] The Blelloch parallel prefix scan algorithm includes two stages of control logic:

[0081] Phase 1 is the Up-Sweep bottom-up reduction phase: the time series array is grouped into pairs, and the values ​​of the grouped intervals are merged and summarized upward to the corresponding parent node through multi-threaded concurrency, thus constructing an implicit binary time series tree. Finally, the root node stores the overall summary data of the entire time series interval.

[0082] Phase 2 is the Down-Sweep distribution phase: the initial offset value of the root node is set to 0, the offset is passed down layer by layer from top to bottom, and the offset is exchanged and superimposed with the values ​​of the left subtree nodes. The temporal prefix sums corresponding to each time period are obtained in parallel.

[0083] The mathematical formulas for prefix sums and supply and demand are as follows:

[0084] ;

[0085] in, This is the global cumulative demand vector up to time period t, representing the total demand of all stations from time period 1 to time period t;

[0086] The global cumulative demand vector up to time period t-1 represents the total demand of all stations from time period 1 to time period t-1;

[0087] Let t be the demand vector for time period t, and each component of the vector corresponds to the current material demand of each collaborative site.

[0088] ;

[0089] in, This is the global cumulative supply vector up to time period t, representing the total supply of all stations from time period 1 to time period t;

[0090] This is the global cumulative supply vector up to time period t-1, representing the total supply of all stations from time period 1 to time period t-1;

[0091] The supply vector is defined for time period t, and each component of the vector corresponds to the current material supply at each coordinating site.

[0092] During the Up-Sweep hierarchical specification merging process, when merging two adjacent time intervals, the left interval L which is earlier in the time sequence and the right interval R which is later in the time sequence, the supply and demand deduction before and after the time sequence and the multi-threaded concurrent solution of the material allocation substitution conversion relationship between each collaborative site are executed simultaneously.

[0093] The interval merging operation is defined as ⊕, and the merged interval is represented as L⊕R. This composite interval merging operation satisfies the associative law as a whole. For any station i, the interval supply and demand vector merging calculation is completed through the matching surplus supply merging formula and demand gap merging formula.

[0094] The formula for merging local surplus supply is:

[0095] (3);

[0096] in, The total surplus material quantity at station j after merging the left and right intervals;

[0097] Let J be the amount of surplus material at station j within the right interval R.

[0098] Let J be the amount of surplus material at station j within the left interval L.

[0099] Let i be the material shortage at station i within the right interval R.

[0100] This is a set of sub-level / destination sites that can receive materials allocated by site j;

[0101] This refers to the corresponding allocation coefficient or substitution efficiency coefficient.

[0102] The formula for merging local demand gaps is:

[0103] (4);

[0104] in, The total material shortage at station i after the left and right time intervals are merged;

[0105] Let i be the material shortage at station i within the left interval L;

[0106] Let i be the material shortage at station i within the right interval R.

[0107] Let J be the amount of surplus material at station j within the left interval L.

[0108] The set of parent / source sites that can allocate materials to site i;

[0109] This refers to the corresponding allocation coefficient or substitution efficiency coefficient.

[0110] To ensure the mathematical correctness of multi-threaded divide-and-conquer computation under arbitrary concurrent partitioning and merging orders, this invention provides a rigorous algebraic proof that the above-mentioned merging operator satisfies the associative law:

[0111] Taking the simplified state of a dual-site system of factory A and distribution center B (with a one-way transfer coefficient of η) as an example, we will provide an algebraic proof of the associative law.

[0112] For a time interval, its state is represented as a vector tuple. ,in This represents the gap between the two stations. This represents the surplus capacity of both stations.

[0113] The merge operator ⊕ is defined as follows:

[0114] ;

[0115] The gap merging component is as follows:

[0116]

[0117] The surplus consolidation amount is:

[0118] ;

[0119] ;

[0120] We prove that for any three interval states , and Satisfies the associative law ;

[0121] Based on the aforementioned properties of the associative law of single sites, since factory A (the source) is independent, its gap and surplus components... and This is clearly true.

[0122] As for distribution center B, which is affected by the source allocation, its left-hand side... The merged gap components are:

[0123]

[0124] Right-hand The missing component, after expansion and simplification, is completely equal to the left-hand side.

[0125] This rigorous algebraic conclusion proves that, under a multi-factory parent-child substitution source-finding topology, the time-series supply-demand segment tree absorption operator still perfectly conforms to the associative law in a multi-dimensional vector space. This guarantees the algebraic correctness and consistency of cross-site / factory collaborative ATP during concurrent computation on multi-core processors.

[0126] Step P4: Combine the beginning inventory, demand accumulation curve and supply accumulation curve to calculate the expected available inventory for all time-series nodes in batches to eliminate the time-by-time serial recursion constraint.

[0127] After obtaining the cumulative supply and demand curves through parallel computation, multi-threaded concurrent interpolation is used to perform difference calculations on all time-series nodes, instantly outputting the theoretical in-storage water level vector across the entire time domain and multiple sites; this theoretical in-storage water level vector represents the expected available inventory at each time-series node in step P4. Furthermore, the actual absorption volume for each time period is derived using double-ended prefix sums and closed-form expressions. and gap quantity :

[0128] (5);

[0129] (6);

[0130] (7);

[0131] (8);

[0132] in, Initial static inventory vector, Let be the global cumulative supply vector up to time period t. As of the date The global cumulative supply vector for a given period. Let be the global cumulative demand vector up to time period t. As of the date The global cumulative demand vector for a given period. Let be the vector of the actual quantity of materials consumed in time period t. Let be the vector of unmet demand gap in time period t. Let be the vector of expected available inventory levels for time period t. Let be the vector of committable quantities for time period t.

[0133] Step P5: Based on the estimated available inventory, calculate the ATP commitment quantity of the corresponding material node for each time period to achieve parallel supply and demand balance of the same material node.

[0134] All time-series interval operations and binary hierarchical reduction and merging operations run in contiguous memory segments pre-allocated during the initialization phase; the local operational state corresponding to each CPU core resides in a thread-specific flat structure array (SoA) pre-allocated during the initialization phase; the physical storage areas of different threads are isolated from each other and cache line aligned; there is no runtime heap memory allocation during the reduction process; zero-contention high-throughput parallel operations can be achieved without any thread exclusive locks.

[0135] Taking the timing supply and demand of a general-purpose chip SKU_MCU in a factory during an 8-day planning cycle (Day 1 to Day 8) as an example, the parallel prefix sum and binary divide-and-conquer reduction process of the present invention is explained in detail.

[0136] 1. Initial Data Preparation

[0137] The daily supply and demand of SKU_MCU are shown in Table 1, with an initial inventory of 0.

[0138] Table 1. Raw Supply and Demand Data for Chip SKU_MCU (8-Day Cycle)

[0139]

[0140] 2. Leaf node initialization

[0141] At the leaf node level (depth 3) of the time-domain segment tree, the system initializes the local surplus Surplus and gap Deficit for each day's data.

[0142] The initialization formula is: if Net>=0, then Surplus=Net,Deficit=0; if Net<0, then Surplus=0,Deficit=-Net.

[0143] The initial states of each leaf node are shown in Table 2;

[0144] Table 2 Leaf Node (Level 3) Initial Surplus and Deficiit Reconciliation Table

[0145]

[0146] 3. Bottom-up parallel binary reduction merging

[0147] Step 1: Merge level 3 into level 2

[0148] Use multi-threading to concurrently merge adjacent leaf nodes:

[0149] node ;

[0150] Deficit = 0 + max(0, 30 - 60) = 0;

[0151] Surplus = 0 + max(0, 60 - 30) = 30;

[0152] node ;

[0153] Deficit = 0 + max(0, 0 - 140) = 0;

[0154] Surplus = 0 + max(0, 140 - 0) = 140;

[0155] node ;

[0156] Deficit = 60 + max(0, 0 - 0) = 60;

[0157] Surplus = 60 + max(0, 0 - 60) = 60;

[0158] node ;

[0159] Deficit = 60 + max(0, 0 - 0) = 60;

[0160] Surplus=140+max(0,0-60)=140;

[0161] The merged Level 2 data is shown in Table 3.

[0162] Table 3: Reconciliation of Merged Results for Intermediate Levels (Level 2) of the Segment Tree

[0163]

[0164] Step 2: Merge from level 2 to level 1

[0165] node ;

[0166] Deficit = 0 + max(0, 10 - 30) = 0;

[0167] Surplus=140+max(0,30-0)=170;

[0168] node ;

[0169] Deficit = 60 + max(0, 60 - 60) = 60;

[0170] Surplus=140+max(0,60-60)=140;

[0171] The merged Level 1 data is shown in Table 4.

[0172] Table 4: Reconciliation of Merged Results for Intermediate Levels (Level 1) of the Segment Tree

[0173]

[0174] Step 3: Merge from level 1 to level 0 (root node)

[0175] root node ;

[0176] Deficit = 0 + max(0, 60 - 170) = 0;

[0177] Surplus=140+max(0,170-60)=250;

[0178] After the merger, the final surplus of the global coverage time domain [Day1, Day8] is 240 units, and the total gap is 0. This indicates that within the 8-day period, the demand of all orders can be perfectly and fully absorbed by the cumulative supply over these 8 days. Furthermore, the global calculation is now complete, and no row-level lock contention or serial backtracking has occurred.

[0179] Example 2: A time-domain parallel prefix sum divide-and-conquer system for ATP supply and demand balancing at the same node, used to implement the above-mentioned supply and demand balancing method, includes:

[0180] The data extraction and array construction module is used to extract supply and demand data and construct supply time series arrays and demand time series arrays.

[0181] The computation and solution module is used to execute the Blelloch parallel prefix scan algorithm. It relies on the time-domain divide-and-conquer interval tree and interval merging operator to perform parallel computation in O(logN) steps to obtain the demand accumulation curve and the supply accumulation curve.

[0182] The batch calculation module is used to calculate the expected available inventory for all time nodes in batches by combining the beginning inventory, the cumulative demand curve, and the cumulative supply curve.

[0183] The ATP calculation module is used to calculate the ATP commitment amount of the corresponding material node on a time-by-time basis based on the estimated available inventory.

[0184] The above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of the claims of this patent application.

Claims

1. A time-domain parallel prefix sum divide-and-conquer method for ATP supply and demand balance at the same node, characterized in that, Includes the following steps: Step P1: For a single material node SKU, extract the supply data and demand data for each time period of the entire planning cycle, and construct the supply time series array and demand time series array based on the supply data and demand data; Step P2: Construct a time-domain divide-and-conquer interval tree based on the supply time series array and the demand time series array, and configure an interval merging operator that satisfies the associative law; Step P3: Using the time-domain divide-and-conquer interval tree and interval merging operator, perform parallel operations on the supply time series array and the demand time series array to obtain the demand accumulation curve and supply accumulation curve in the entire time domain. Step P4: Combine the beginning inventory, demand accumulation curve and supply accumulation curve to calculate the expected available inventory for all time-series nodes in batches to eliminate the time-by-time serial recursion constraint. Step P5: Based on the estimated available inventory, calculate the ATP commitment quantity of the corresponding material node for each time period to achieve parallel supply and demand balance and consumption of the same material node.

2. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 1, characterized in that, In step P1, the supply timing array and the demand timing array are constructed in contiguous physical memory.

3. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 1, characterized in that, In step P2, the time-domain divide-and-conquer interval tree is a binary time-series segment tree. When constructing the binary time-series segment tree, the entire planning period is divided into multiple non-overlapping time intervals. The leaf nodes of the binary time-series segment tree correspond to a single time period, and the parent nodes at each level correspond to continuous multi-time period intervals obtained by merging the sub-intervals.

4. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 2, characterized in that, In step P2, each CPU core concurrently calculates the local absorption state within its assigned time interval and extracts two key feature values: A. Local supply surplus vector , where, for any value , quantity This represents the maximum redundant supply that the i-th station can allocate to external locations within the current interval. B. Local Demand Gap Vector , where, for any value , quantity This indicates the demand gap that the i-th station cannot absorb within the current interval; Local supply surplus vector and local demand gap vector In this context, K represents the number of factories and distribution centers participating in the collaboration.

5. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 1, characterized in that, In step P3, the Belloch parallel prefix scan algorithm based on multi-core parallelism is used to solve the problem in parallel within O(logN) steps, and the cumulative demand curve Cumulative_Demand and the cumulative supply curve Cumulative_Supply are obtained. The Blelloch parallel prefix scan algorithm includes two stages of control logic: Phase 1 is the Up-Sweep bottom-up reduction phase: the time series array is grouped into pairs, and the values ​​of the grouped intervals are merged and summarized upward to the corresponding parent node through multi-threaded concurrency, thus constructing an implicit binary time series tree. Finally, the root node stores the overall summary data of the entire time series interval. Phase 2 is the Down-Sweep distribution phase: the initial offset value of the root node is set to 0, the offset is passed down layer by layer from top to bottom, and the offset is exchanged and superimposed with the values ​​of the left subtree nodes. The temporal prefix sums corresponding to each time period are obtained in parallel.

6. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 5, characterized in that, The mathematical formulas for prefix sums and supply and demand are as follows: ; in, This is the global cumulative demand vector up to time period t, representing the total demand of all stations from time period 1 to time period t; The global cumulative demand vector up to time period t-1 represents the total demand of all stations from time period 1 to time period t-1; Let t be the demand vector for time period t, and each component of the vector corresponds to the current material demand of each collaborative site. ; in, This is the global cumulative supply vector up to time period t, representing the total supply of all stations from time period 1 to time period t; This is the global cumulative supply vector up to time period t-1, representing the total supply of all stations from time period 1 to time period t-1; The supply vector is defined for time period t, and each component of the vector corresponds to the current material supply at each coordinating site.

7. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 6, characterized in that, During the Up-Sweep hierarchical specification merging process, when merging two adjacent time intervals, the left interval L which is earlier in the time sequence and the right interval R which is later in the time sequence, the supply and demand deduction before and after the time sequence and the multi-threaded concurrent solution of the material allocation substitution conversion relationship between each collaborative site are executed simultaneously. The interval merging operation is defined as ⊕, and the merged interval is represented as L⊕R. This composite interval merging operation satisfies the associative law as a whole. For any station i, the interval supply and demand vector merging calculation is completed through the matching surplus supply merging formula and demand gap merging formula. The formula for merging local surplus supply is: (3); in, The total surplus material quantity at station j after merging the left and right intervals; Let J be the amount of surplus material at station j within the right interval R. Let J be the amount of surplus material at station j within the left interval L. Let i be the material shortage at station i within the right interval R. This is a set of sub-level / destination sites that can receive materials allocated by site j; This refers to the corresponding allocation coefficient or substitution efficiency coefficient. The formula for merging local demand gaps is: (4); in, The total material shortage at station i after the left and right time intervals are merged; Let i be the material shortage at station i within the left interval L; Let i be the material shortage at station i within the right interval R. Let J be the amount of surplus material at station j within the left interval L. The set of parent / source sites that can allocate materials to site i; This refers to the corresponding allocation coefficient or substitution efficiency coefficient.

8. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 7, characterized in that, In step P4, after parallel computation to obtain the supply accumulation curve and the demand accumulation curve, multi-threaded concurrent difference calculation is performed on all time-series nodes to instantly output the theoretical reservoir water level vector of multiple sites in the full time domain. The theory states that the reservoir water level vector represents the expected available inventory at each time node in step P4. Furthermore, the actual absorption volume for each time period is derived using double-ended prefix sums and closed-form expressions. and gap quantity : (5); (6); (7); (8); in, Initial static inventory vector, Let be the global cumulative supply vector up to time period t. As of the date The global cumulative supply vector for a given period. Let be the global cumulative demand vector up to time period t. As of the date The global cumulative demand vector for a given period. Let be the vector of the actual quantity of materials consumed in time period t. Let t be the vector of unmet demand gap. Let be the vector of expected available inventory levels for time period t. Let be the vector of committable quantities for time period t.

9. The method for balancing the supply and demand of ATP at the same node based on temporal parallel prefix sum divide-and-conquer as described in claim 1, characterized in that, All time-series interval operations and binary hierarchical reduction and merging operations run in contiguous memory segments pre-allocated during the initialization phase; the local operational states of each CPU core reside in thread-specific flat structure arrays pre-allocated during the initialization phase, with different thread storage areas isolated from each other and buffer lines aligned; there is no runtime heap memory allocation during the reduction phase, and zero-contention high-throughput parallel operations can be achieved without any thread synchronization locks.

10. A time-domain parallel prefix sum divide-and-conquer system for ATP supply and demand balancing at the same node, used to implement the supply and demand balancing method according to any one of claims 1-9, characterized in that, include: The data extraction and array construction module is used to extract supply and demand data and construct supply time series arrays and demand time series arrays. The computation and solution module is used to execute the Blelloch parallel prefix scan algorithm. It relies on the time-domain divide-and-conquer interval tree and interval merging operator to perform parallel computation in O(logN) steps to obtain the demand accumulation curve and the supply accumulation curve. The batch calculation module is used to calculate the expected available inventory for all time nodes in batches by combining the beginning inventory, the cumulative demand curve, and the cumulative supply curve. The ATP calculation module is used to calculate the ATP commitment amount of the corresponding material node on a time-by-time basis based on the estimated available inventory.