A zero allocation memory transaction rollback method and system for cascading production-oriented

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

Patent Information

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

AI Technical Summary

Technical Problem

[0008]为此,本发明所要解决的技术问题在于提供一种面向级联排产的零分配内存事务性回滚方法及系统,以解决多级物料与产能级联扣减中频繁动态内存申请、垃圾回收停顿剧烈以及行锁等待高昂的技术问题,实现基于物理共享内存、微秒级收敛的原位无损回滚

Benefits of technology

[0051]本申请采用追踪记录倒序遍历配合共享内存原位数值加回机制完成级联回滚,全部运算仅在共享内存中执行,不产生任何磁盘读写I/O开销,整套多级BOM全链路回滚计算开销控制在10微秒以内。依托超高速回滚能力,可支撑大规模、高频次What-If模拟排产沙箱推演,每次试算失败均可瞬时撤销全部临时资源占用,实现秒级推演响应闭环,大幅提升计划人员多方案对比测算效率,适配多订单、多层级物料复杂排产仿真场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
Patent Text Reader

Abstract

This invention discloses a zero-allocation memory transactional rollback method and system for cascaded production scheduling. The rollback method first allocates a fixed-capacity global allocation tracking buffer in physically contiguous memory; then, it performs a depth-first search recursively consuming resources along the multi-level BOM topology, writing miniature records generated by resource changes into the corresponding type of tracking buffer vector during trial deductions or updates; if a constraint conflict occurs at any level during the depth-first search, the order delivery link verification is deemed to have failed, and a physical reverse in-situ rollback transaction operator is initiated to restore the resource state to its initial state before the current CTP execution, completing the zero-allocation memory transactional rollback. This application uses reverse traversal of tracking records combined with a shared memory in-situ addition mechanism to complete cascaded rollback, achieving a second-level simulation response, significantly improving the efficiency of multi-scheme comparison and calculation for planners, and adapting to multi-order, multi-level material scheduling simulation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-level material requirements planning (MRP) technology. Specifically, it relates to a zero-allocation memory transactional rollback method and system for cascaded production scheduling. Background Technology

[0002] In discrete manufacturing supply chain planning and scheduling (such as Capable-to-Promise (CTP) multi-level cascaded production scheduling), the computing engine must perform a large number of "trial deductions and status rollbacks" calculations frequently to determine whether a new customer order can be delivered on time. For a complex discrete industrial finished product (such as a high-end supercomputing server or precision wafer testing equipment) containing 15 to 20 levels of BOM (Bill of Materials), when the sales window receives a large customer order and executes CTP (Capable-to-Promise) production scheduling, the computing engine needs to start from the final finished product and perform depth-first recursive elimination down the multi-level BOM topology tree, performing trial deductions on the available quantity (ATP, Available-to-Promise) of hundreds of sub-material nodes at a specific time point, while also deducting the capacity of critical equipment occupied by the production process.

[0003] Multi-level BOM cascading resource consumption exhibits strong physical kitting constraints, displaying a typical "weakest link" effect: during deep recursive scheduling, a shortage of time-sharing inventory of any level of sub-materials or depletion of capacity of critical equipment will cause the entire finished product scheduling path to fail. To avoid the erroneous locking of temporarily occupied inventory and capacity resources during trial calculations, the system must perform a complete transaction rollback on all tentative deductions and resource occupancy generated by the current order at all levels of parent materials, sub-materials, and process equipment. This ensures that the global inventory and capacity status are completely restored to the initial clean state before scheduling, guaranteeing data consistency across multiple high-frequency What-If calculations.

[0004] The existing scheduling engine suffers from two major architectural performance bottlenecks when handling this high-frequency cascading trial calculation and transaction rollback scenario, making it unable to support large-scale, high-concurrency CTP verification of BOMs with depths of 5 to 20 layers:

[0005] First, the dynamic creation of recursive snapshots triggers massive GC pauses. Traditional Java / C# scheduling engines, to implement failure rollback, need to dynamically create snapshot objects and historical backups in each level of BOM recursive iteration to save resource values ​​before deduction. In large-scale order scheduling scenarios, this mechanism instantly generates hundreds of millions of temporary garbage objects, continuously triggering frequent garbage collection pauses, severely dragging down overall solution efficiency and preventing the system from achieving millisecond-level response times.

[0006] Second, database transaction mechanisms introduce extremely high I / O and lock contention overhead. Existing solutions that rely on relational databases to handle trial deductions and transaction rollbacks will generate high-frequency physical disk writes (WAL logs) and row-level transaction lock contention, thus extending the originally instantaneous sandbox simulation to hours, which is completely unable to meet the high-frequency, second-level, and repeatedly trial-and-error What-If simulation scheduling requirements of industrial sites.

[0007] Therefore, there is an urgent need for a zero-memory transactional rollback method and system for cascaded production scheduling to solve the technical problems of frequent dynamic memory requests, severe garbage collection pauses, and high row lock waiting costs in multi-level material and capacity cascaded deductions, and to achieve in-situ lossless rollback based on physical shared memory and microsecond-level convergence. Summary of the Invention

[0008] Therefore, the technical problem to be solved by the present invention is to provide a zero-allocation memory transactional rollback method and system for cascaded production scheduling, so as to solve the technical problems of frequent dynamic memory requests, severe garbage collection pauses and high row lock waiting costs in multi-level material and capacity cascaded deduction, and to achieve in-situ lossless rollback based on physical shared memory and microsecond-level convergence.

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

[0010] A zero-memory memory-based transactional rollback method for cascading production includes the following steps:

[0011] Step P1: Allocate a global allocation trace buffer of fixed capacity in physical contiguous memory, and divide the global allocation trace buffer into multiple trace buffer vectors;

[0012] Step P2: Perform depth-first search recursive resource elimination along the multi-level BOM topology, and write the miniature record generated by the resource change into the corresponding type of tracking buffer vector when performing trial deduction or update;

[0013] Step P3: During the depth-first search process, if a constraint conflict occurs at any level, the order delivery link verification is determined to have failed. The physical reverse in-situ rollback transaction operator is then initiated. The physical reverse in-situ rollback transaction operator reverses all micro-records corresponding to the current order, restoring the resource state to the initial state before this CTP execution, and completing the zero-allocation memory transaction rollback.

[0014] In the above-mentioned zero-allocation memory transactional rollback method for cascaded production scheduling, in step P1, the global allocation tracking buffer is divided into five independent tracking buffer vectors, namely material tracking vector, capacity tracking vector, material substitution tracking vector, quota tracking vector, and procurement and production scheduling ratio balancing tracking vector.

[0015] When the engine starts, the global tracking buffer pre-allocates continuous underlying physical memory to the peak capacity of the business for each of the five tracking buffer vectors at once, so as to prevent the tracking buffer vectors from performing memory reallocation copying during the scheduling iteration process.

[0016] In the aforementioned zero-allocation memory transactional rollback method for cascaded production, in step P1, the change records stored in each group of tracking buffer vectors are all flat fixed-length tracking structures; and each tracking structure locates the corresponding resource array in shared memory through the resource physical index and the time slice day index, and records the amount of change temporarily deducted or allocated through the numerical field.

[0017] The above-mentioned zero-memory transactional rollback method for cascaded production scheduling includes a material tracking vector that stores a material deduction tracking structure, which includes the material's physical index in the time-sharing inventory array, the time slice day index, and the temporary deduction quantity.

[0018] The capacity tracking vector stores the capacity occupancy tracking structure, which includes the physical index of equipment resources in the global capacity array, the time slice day index, and the temporary capacity occupancy hours.

[0019] The material substitution tracking vector stores a dynamic substitution tracking structure, which includes an original material index, a substitute material index, a time slice day index, an original demand quantity, an actual deducted substitution quantity, and a dynamic substitution ratio factor; the dynamic substitution ratio factor is used to verify the upper limit constraint of incomplete substitution.

[0020] The quota tracking vector stores a rigid quota occupancy tracking structure, which includes a rigid quota pool physical index, a time slice day index, and a temporary quota occupancy quantity.

[0021] The procurement and production scheduling ratio balancing tracking vector storage contains the procurement and production scheduling ratio balancing tracking structure, which includes a procurement and production scheduling balancing group physical index, a time slice day index, a supplier and factory index, and temporarily allocated procurement and production quantities.

[0022] The specific process of step P2 in the above-mentioned zero-memory transactional rollback method for cascading production is as follows:

[0023] During the depth-first search traversal of the multi-level BOM topology and cross-factory substitution sourcing process, when performing trial deductions for material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory are directly deducted or updated.

[0024] Each time a resource update is completed, a miniature record body containing only the information of this change is generated and appended to the corresponding tracking buffer vector in the global tracking buffer manager according to the resource type.

[0025] The above-mentioned zero-allocation memory transactional rollback method for cascading production includes in-situ resource updates and record writes, which include:

[0026] ① In-situ deduction of materials and capacity: Locate the storage unit corresponding to the time-sharing inventory array in shared memory through the material physical index and time slice day index, subtract the current demand quantity from the original inventory value in the unit and overwrite it into the original storage unit to complete the in-situ deduction of materials; After the deduction is completed, a material tracking record is generated and appended to the material tracking buffer vector.

[0027] The storage unit corresponding to the capacity array in the shared memory is located by using the physical index of equipment resources and the day index of time slices. The original available working hours in the unit are subtracted from the temporary working hours occupied this time and written over the original storage unit to complete the in-situ deduction of capacity, generate a capacity occupancy tracking record, and append it to the capacity tracking buffer vector.

[0028] ② Material Substitution and Incomplete Substitution Verification: Based on the preset dynamic substitution conversion ratio, the inventory array of substitute materials is deducted in place; the maximum allowable upper limit constraint for incomplete substitution is set, and the cumulative substitution consumption in this allocation is verified to exceed the upper limit.

[0029] If the substitution limit is not exceeded, a substitution tracking record is generated and appended to the material substitution tracking vector; if the cumulative substitution amount after allocation exceeds the maximum substitution limit, the order delivery link verification is deemed to have failed.

[0030] ③ Rigid quota deduction verification: Locate the corresponding position in the quota balance array in memory through the quota pool index and time slice day index, perform in-place deduction operation, and directly overwrite the original memory position with the result;

[0031] If the quota balance after deduction does not meet the constraints, the order delivery link verification is deemed to have failed; if the quota balance is sufficient, a quota tracking record is generated and appended to the quota tracking buffer vector.

[0032] ④ Procurement and production scheduling ratio balancing allocation logic: Locate the procurement and production scheduling ratio balancing accumulator through the physical index of the procurement and production scheduling balancing group, the supplier and factory index, and the time slice day index, and update the temporary accumulator value; verify the allocation ratio deviation based on the updated accumulator value, and generate procurement and production scheduling ratio balancing tracking records and write them into the procurement and production scheduling ratio balancing tracking vector.

[0033] In the zero-memory transactional rollback method for cascading production described above, step P3 will determine that the order delivery link verification has failed and will initiate a physical reverse in-situ rollback transaction operator if any of the following conflicts occur:

[0034] ① Insufficient material inventory;

[0035] ② Insufficient available equipment capacity;

[0036] ③ The amount used exceeds the rigid distribution quota;

[0037] ④ The factory's procurement allocation ratio exceeds the upper limit of the allowable deviation.

[0038] In the aforementioned zero-memory transactional rollback method for cascading production scheduling, step P3, the specific process of the physical reverse in-situ rollback transaction operator reversing the traversal of all micro-records corresponding to the current order, is as follows: Following the DFS (Depth-First Search) writing order from front to back and from top to bottom, the records in each tracking buffer vector are read in reverse; and based on the physical index and time slice day index of the record, physical values ​​are restored in-situ on the time-sharing inventory array, capacity array, quota balance array, and purchasing and production scheduling ratio accumulator corresponding to the shared memory.

[0039] ① Material inventory restoration: During the trial calculation phase, the inventory value is reduced by the required quantity. During the rollback phase, the reduced quantity is added back to restore the inventory value before the trial calculation.

[0040] ② Capacity restoration: During the trial calculation phase, the occupied working hours are deducted from the capacity, and during the rollback phase, the occupied working hours are added back to restore the usable capacity of the equipment;

[0041] ③ Restoration of Substitute Materials and Substitution Relationships: Read the substitution tracking records, add up the consumption quantity on the one hand, and restore the original demand amount, cumulative substitution amount and dynamic substitution ratio parameters on the other hand, and completely cancel the current substitution allocation operation;

[0042] ④ Rigid quota restoration: During the trial calculation phase, the allocated quantity of quota is reduced, and during the rollback phase, the allocated quantity is added back to restore the available balance of the quota pool under the corresponding time slice;

[0043] ⑤ Restoration of the Procurement and Production Scheduling Ratio Accumulator: During the trial calculation phase, the allocated output is superimposed for ratio verification. During the rollback phase, the temporary allocated output is deducted, and the original cumulative allocation value of the procurement and production scheduling balance group is restored.

[0044] The above-mentioned zero-allocation memory transactional rollback method for cascading production, when a valid resource consumption path is obtained through depth-first search traversal, reads all temporary trial deduction records stored in the global allocation tracking buffer and converts the temporary deduction records into the final confirmation deduction results in batches;

[0045] The rights confirmation and deduction results are written into the columnar physical database through an independent high-speed direct data pipeline, and the rights confirmation and deduction results are simultaneously pushed to the front-end management and control platform for visualization through streaming transmission.

[0046] A zero-allocation memory transactional rollback system for cascaded production, used to implement the aforementioned zero-allocation memory transactional rollback method, includes:

[0047] The memory allocation module is used to request a global allocation tracking buffer of fixed capacity in physically contiguous memory, and to divide the global allocation tracking buffer into multiple tracking buffer vectors;

[0048] The depth-first execution module is used to perform a depth-first search recursive resource consumption along the multi-level BOM topology. When performing trial deductions or updates on material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, it directly performs in-situ deductions or updates on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory, and writes the micro record generated by the resource change into the corresponding type of tracking buffer vector.

[0049] The reverse rollback and restoration module is used to initiate a physical reverse in-situ rollback transaction operator when the order delivery link verification is determined to have failed. The physical reverse in-situ rollback transaction operator reads the miniature record in each tracking buffer vector in reverse and performs physical value in-situ restoration on the time-sharing inventory array, capacity array, quota balance array and procurement and production scheduling ratio accumulator to restore the resource status to the initial state before this CTP execution and complete the zero-allocation memory transaction rollback.

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

[0051] This application employs a reverse traversal of tracking records combined with a shared memory in-situ value addition mechanism to complete cascading rollback. All calculations are performed solely in shared memory, incurring no disk I / O overhead. The entire multi-level BOM end-to-end rollback calculation overhead is controlled within 10 microseconds. Leveraging its ultra-high-speed rollback capability, it supports large-scale, high-frequency What-If simulation scheduling sandbox exercises. Each failed trial calculation can instantly undo all temporary resource occupation, achieving a second-level simulation response loop. This significantly improves the efficiency of multi-scheme comparison and calculation for planners, adapting to complex scheduling simulation scenarios involving multiple orders and multi-level materials.

[0052] This application covers the entire lifecycle from buffer initialization to DFS traversal, deduction tracking, and reverse rollback. It pre-allocates a contiguous block of physical shared memory only once at startup, and does not add or release heap memory during operation, with no dynamic memory allocation or destruction operations. This completely avoids the garbage collection (GC) stuttering and computing power fluctuations caused by the frequent creation and destruction of inventory / capacity allocation objects in traditional APS systems, significantly increasing the continuous processing throughput of a single CPU core and resulting in smoother operation in high-concurrency batch order simulation scenarios.

[0053] This application adopts an in-situ reverse overwrite design. All tentative temporary deduction operations for orders are executed in an orderly manner based on pre-allocated shared memory read-only partitions. Resource modifications are isolated in an independent transaction tracking buffer and are only uniformly persisted during the final confirmation and storage phase. Rollback operations do not require preempting resource row locks, reducing large-scale lock contention from the root. It supports multiple orders and multiple users to conduct simulations in parallel, significantly improving the system's concurrency capacity.

[0054] This application's tracking and recording system deeply integrates multi-dimensional business rules, including LLC (Low-Level Code) rigid quota pool management, multi-factory procurement balancing ratios, dynamic material substitution conversion factors, and incomplete substitution limits. Every temporary resource change is synchronously bound to its corresponding constraint status. When any constraint is violated during DFS traversal, the reverse rollback engine can completely undo all temporary changes to inventory, capacity, quotas, substitutions, and procurement allocations across all levels of the current order's entire BOM chain within microseconds. In complex cascading production scheduling scenarios involving multiple factories, distribution centers, and material substitutions, it ensures the complete restoration of various resource states and business constraint values ​​in memory, maintaining strong consistency between global production scheduling data and business rules, and eliminating issues such as local data residues and constraint status corruption. Attached Figure Description

[0055] Figure 1 This is a flowchart of a zero-allocation memory transactional rollback method for cascading production according to the present invention. Detailed Implementation

[0056] Example 1: This example discloses a zero-allocation memory transactional rollback method for cascading production, such as... Figure 1 As shown, it includes the following steps:

[0057] Step P1: Allocate a fixed-size global allocation trace buffer in physically contiguous memory. The global allocation trace buffer is divided into multiple trace buffer vectors. The global allocation trace buffer completely prohibits dynamic memory allocation during runtime (such as C++'s new / delete or Java's heap memory instantiation) during the scheduling and elimination iteration, thereby eliminating memory fragmentation and garbage collection pauses at the underlying level.

[0058] To adapt to complex business scenarios in the supply chain, such as multi-factory substitution sourcing, rigid quota control at LLC (Low-Level Code) decoupling points, procurement and production scheduling ratio restrictions, and dynamic material substitution, the buffer, in addition to recording basic material and capacity deductions, also includes dynamic substitution tracking, rigid quota tracking, and procurement and production scheduling ratio balancing tracking structures. Specifically, the global allocation tracking buffer is divided into five independent tracking buffer vectors: material tracking vector, capacity tracking vector, material substitution tracking vector, quota tracking vector, and procurement and production scheduling ratio balancing tracking vector.

[0059] When the engine starts, the global tracking buffer pre-allocates continuous underlying physical memory to the peak capacity of the business for each of the five tracking buffer vectors at once, so as to prevent the tracking buffer vectors from performing memory reallocation copying during the scheduling iteration process.

[0060] The change records stored in each group of tracking buffer vectors are all flat, fixed-length tracking structures; and each tracking structure locates the corresponding resource array in shared memory through the resource physical index and the time slice day index, and records the amount of change temporarily deducted or allocated through the numerical field.

[0061] The material tracking vector stores a material deduction tracking structure, which includes the material's physical index in the time-sharing inventory array, the time slice day index, and the temporary deduction quantity.

[0062] The capacity tracking vector stores the capacity occupancy tracking structure, which includes the physical index of equipment resources in the global capacity array, the time slice day index, and the temporary capacity occupancy hours.

[0063] The material substitution tracking vector stores a dynamic substitution tracking structure, which includes an original material index, a substitute material index, a time slice day index, an original demand quantity, an actual deducted substitution quantity, and a dynamic substitution ratio factor; the dynamic substitution ratio factor is used to verify the upper limit constraint of incomplete substitution.

[0064] The quota tracking vector stores a rigid quota occupancy tracking structure, which includes a rigid quota pool physical index, a time slice day index, and a temporary quota occupancy quantity.

[0065] The procurement and production scheduling ratio balancing tracking vector storage contains the procurement and production scheduling ratio balancing tracking structure, which includes a procurement and production scheduling balancing group physical index, a time slice day index, a supplier and factory index, and temporarily allocated procurement and production quantities.

[0066] In the C++ computing kernel, the data structure is defined as a flat, contiguous array:

[0067] Material deduction tracking structure:

[0068]

[0069] Capacity utilization tracking structure:

[0070]

[0071] Dynamic substitution tracking structure (records substitution ratio and incomplete substitution limits):

[0072]

[0073] Rigid quota occupancy tracking structure (LLC decoupling point: distribution channel or large customer's rigid quota):

[0074]

[0075] Purchasing / Production Scheduling Ratio Balancing Tracking Structure (used to monitor purchasing and production scheduling ratio constraints across multiple factories):

[0076]

[0077] Global Tracking Buffer Manager:

[0078]

[0079] Step P2: Perform a depth-first search recursively to consume resources along the multi-level BOM topology, or perform substitution sourcing across multiple factories. When performing trial deductions or updates, write the micro-records generated by resource changes into the corresponding type of tracking buffer vector. Specifically, during the depth-first search traversing the multi-level BOM topology and cross-factory substitution sourcing, when performing trial deductions for material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, do not back up the entire database or copy any status tables. Instead, directly perform deductions or updates on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory.

[0080] Each time a resource update is completed, a miniature record containing only the information of this change is generated and appended to the corresponding tracing buffer vector in the global tracing buffer manager according to the resource type.

[0081] Specifically, in-situ resource updates and record writing include:

[0082] ① In-situ deduction of materials and capacity: Locate the storage unit corresponding to the time-sharing inventory array in shared memory through the material physical index and time slice day index, subtract the current demand quantity from the original inventory value in the unit and overwrite it into the original storage unit to complete the in-situ deduction of materials; After the deduction is completed, a material tracking record is generated and appended to the material tracking buffer vector.

[0083] The storage unit corresponding to the capacity array in the shared memory is located by using the physical index of equipment resources and the day index of time slices. The original available working hours in the unit are subtracted from the temporary working hours occupied this time and written over the original storage unit to complete the in-situ deduction of capacity, generate a capacity occupancy tracking record, and append it to the capacity tracking buffer vector.

[0084] The deduction logic is expressed as follows:

[0085] ;in, A two-dimensional array of time-sharing inventory; For material indexing; Index for time slices; This is a temporary deduction of quantity;

[0086] ② Material Substitution and Incomplete Substitution Verification: Based on the preset dynamic substitution conversion ratio, the inventory array of substitute materials is deducted in situ; a maximum allowable upper limit constraint for incomplete substitution is set, and the cumulative substitution consumption in this allocation is verified to ensure it does not exceed the upper limit; specifically:

[0087] If the substitution limit is not exceeded, a substitution tracking record is generated and appended to the physical substitution tracking vector; if the cumulative substitution amount after allocation exceeds the maximum substitution limit, the order delivery link verification is deemed to have failed; if a substitute material is used, it is deducted in place from substitute material B, with a substitution ratio of β. If incomplete substitution is encountered (the maximum substitutable limit is Cap), the current consumed substitution amount and ratio are recorded in the tracking vector and appended to temp_substitution_allocations (temporary substitution allocation record).

[0088] ③ Rigid quota deduction verification: Locate the corresponding position in the quota balance array in memory through the quota pool index and time slice day index, perform in-place deduction operation, and directly overwrite the original memory position with the result;

[0089] If the quota balance after deduction does not meet the constraints, the order delivery link verification is deemed to have failed; if the quota balance is sufficient, a quota tracking record is generated and appended to the quota tracking buffer vector.

[0090] Specifically, this means that when allocating quotas at LLC decoupling points, a hard constraint on distribution quotas must be met. If the quota is insufficient, an error will be reported and the allocation will be rolled back; if the quota is sufficient, it will be deducted from the quota array and added to temp_allotment_allocations (temporary quota allocation records).

[0091] ;in, Store in memory a two-dimensional array of the remaining available quotas for each quota pool divided by LLC each day; A unique digital index for the quota pool; Index for time slices; This is a temporary deduction of quantity;

[0092] ④ Procurement and Production Scheduling Balance Allocation Logic: The procurement and production scheduling balance accumulator is located using the physical index of the procurement and production scheduling balance group, the supplier and factory index, and the time slice day index, and a temporary accumulator value is updated. Based on the updated accumulator value, the allocation ratio deviation is checked, and procurement and production scheduling ratio tracking records are generated and written into the procurement and production scheduling balance tracking vector. Specifically, the production output allocated to each factory is recorded, and the accumulator value is updated in the procurement group tracking array to determine the allocation deviation, and the record is appended to temp_purchasing_allocations (temporary procurement allocation record).

[0093] Step P3: During the depth-first search, if a constraint conflict occurs at any level, the order delivery link verification is deemed to have failed. A physical reverse in-situ rollback transaction operator is then initiated. This operator reverse-traverses all micro-records corresponding to the current order, restoring the resource state to its initial state before the current CTP execution, thus completing a zero-memory memory-allocated transaction rollback. After the rollback, only the valid record counter within the tracking vector is reset; the underlying pre-allocated physical memory is retained throughout the process and not released. The buffer can be directly reused for the next order simulation, saving the time spent repeatedly allocating and releasing large blocks of memory, further reducing the basic performance loss of a single trial calculation, and continuously maintaining low-latency operation characteristics.

[0094] Specifically, if any of the following conflicts occur, the order delivery link verification will be deemed to have failed, and the physical reverse in-situ rollback transaction operator will be initiated:

[0095] ① Insufficient material inventory;

[0096] ② Insufficient available equipment capacity;

[0097] ③ The amount used exceeds the rigid distribution quota;

[0098] ④ The factory's procurement allocation ratio exceeds the upper limit of the allowable deviation.

[0099] The specific process of the physical reverse in-situ rollback transaction operator reversing the traversal of all micro-records corresponding to the current order is as follows: Following the DFS (Depth-First Search) writing order from front to back and from top to bottom, the records in each tracking buffer vector are read in reverse; and based on the physical index and time slice day index of the record, physical values ​​are restored in-situ on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator corresponding to the shared memory.

[0100] ① Material Inventory Restoration: During the trial calculation phase, inventory is reduced by the required quantity. During the rollback phase, the reduced quantity is added back to restore the inventory value to its pre-trial calculation state; this is represented as:

[0101] ;in, A two-dimensional array of time-sharing inventory; For material indexing; Index for time slices; This is a temporary deduction of quantity;

[0102] ② Capacity Restoration: During the trial calculation phase, the occupied labor hours are deducted from the capacity; during the rollback phase, the occupied labor hours are added back to restore the available capacity of the equipment; expressed as:

[0103] ; A two-dimensional array pre-allocated in shared memory; A digital index for equipment and production capacity resources; Index for time slices; This is a temporary deduction of quantity;

[0104] ③ Restoration of Substitute Materials and Substitution Relationships: Read the substitution tracking records (temp_substitution_allocations), add up the consumed quantity on one hand, and restore the original demand amount, cumulative substitution occupied amount and dynamic substitution ratio parameters on the other hand, and completely cancel the current substitution allocation operation;

[0105] ④ Rigid Quota Restoration: During the trial calculation phase, the allocated quota is reduced, and during the rollback phase, the allocated quota is added back to restore the available balance of the quota pool for the corresponding time slice; expressed as:

[0106] ;in, Store in memory a two-dimensional array of the remaining available quotas for each quota pool divided by LLC each day; A unique digital index for the quota pool; Index for time slices; This is a temporary deduction of quantity;

[0107] ⑤ Restoration of Procurement and Production Scheduling Proportion Accumulator: During the trial calculation phase, the allocated output is superimposed for proportion verification. During the rollback phase, the temporarily allocated output is deducted, restoring the original cumulative allocation value of the procurement and production scheduling balance group. The `clear()` function is used to directly clear the counters of all elements within the tracking vectors. Since the tracking vectors have pre-allocated physical memory, clearing the counters only moves the boundary pointers and does not release any heap memory, completing the transactional restoration within 1 microsecond.

[0108] When a valid resource consumption path is obtained through depth-first search traversal, all temporary trial deduction records stored in the global allocation tracking buffer are read, and the temporary deduction records are batched and converted into the final rights confirmation deduction results.

[0109] The rights confirmation and deduction results are written to an embedded columnar physical database via an independent high-speed direct data pipeline, and simultaneously pushed to the front-end management platform for visualization via streaming. During the trial calculation phase, all deductions are only stored in a memory tracking buffer. Only after the entire delivery path has passed verification are the rights confirmation data converted in batches and written to the embedded columnar database in batches via a high-speed pipeline. In this example, the embedded columnar database is a DuckDB columnar database. If the simulation fails, the buffer is directly rolled back and cleared, with no invalid intermediate data written to the disk. This significantly reduces the random write I / O pressure on the database, extends the lifespan of the storage device, and reduces database transaction log redundancy.

[0110] This embodiment takes the multi-level BOM cascaded production of "supercomputing supporting heat sink" (Finished Good, Level 0) during Day 5 delivery as an example to deduce how to perform in-situ transaction rollback when the bottom layer material is missing.

[0111] 1. Initial state and BOM dependency

[0112] The system preloads the BOM topology from Level 0 to Level 15 into memory. The initial resource states of some key nodes and machines on Day 4 and Day 5 are shown in Table 1.

[0113] Table 1 Initial Available Quantities and Capacity Reconciliation for Key Nodes

[0114]

[0115] 2. Depth-priority connection attempt to deduct

[0116] Order requirement: Deliver 20 sets of radiators on Day 5.

[0117] The solver performs a depth-down search and in-situ deduction, with additional checks for rigid quotas and incomplete substitution constraints. The appended records are shown in Table 2.

[0118] Table 2. Cascaded Deduction Process and Tracking Buffer Record Table

[0119]

[0120] In step 5, although the inventory of the substitute Gel_B is sufficient, the incomplete replacement limit is triggered (Cap=1 bottle, which means that Gel_B can only replace 1.5 bottles of consumption). The remaining 1 bottle shortfall cannot be made up by replacement, so the system determines that the cascading has failed and triggers a rollback.

[0121] 3. Reverse in-situ rollback process

[0122] The reverse rollback engine is activated, traversing the temporary tracking vector in reverse and restoring the state. The control process is shown in Table 3.

[0123] Table 3 Reconciliation Statement for Reverse In-situ Add-back and State Restoration

[0124]

[0125] After performing the reverse addition in Table 3, the system calls the following code to reset the tracking vector pointer:

[0126]

[0127] The entire rollback process took only 0.72 microseconds, without triggering any physical disk writes. All data in the physical shared memory was completely restored to its clean state before Day 5 production, with no lock contention remaining.

[0128] Example 2: A zero-allocation memory transactional rollback system for cascaded production, used to implement the above-mentioned zero-allocation memory transactional rollback method, includes:

[0129] The memory allocation module is used to request a global allocation tracking buffer of fixed capacity in physically contiguous memory, and to divide the global allocation tracking buffer into multiple tracking buffer vectors;

[0130] The depth-first execution module is used to perform a depth-first search recursive resource consumption along the multi-level BOM topology. When performing trial deductions or updates on material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, it directly performs in-situ deductions or updates on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory, and writes the micro record generated by the resource change into the corresponding type of tracking buffer vector.

[0131] The reverse rollback and restoration module is used to initiate a physical reverse in-situ rollback transaction operator when the order delivery link verification is determined to have failed. The physical reverse in-situ rollback transaction operator reads the miniature record in each tracking buffer vector in reverse and performs physical value in-situ restoration on the time-sharing inventory array, capacity array, quota balance array and procurement and production scheduling ratio accumulator to restore the resource status to the initial state before this CTP execution and complete the zero-allocation memory transaction rollback.

[0132] 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 zero-allocation memory transactional rollback method for cascading production, characterized in that, Includes the following steps: Step P1: Allocate a global allocation trace buffer of fixed capacity in physical contiguous memory, and divide the global allocation trace buffer into multiple trace buffer vectors; Step P2: Perform depth-first search recursive resource elimination along the multi-level BOM topology, and write the miniature record generated by the resource change into the corresponding type of tracking buffer vector when performing trial deduction or update; Step P3: During the depth-first search process, if a constraint conflict occurs at any level, the order delivery link verification is determined to have failed. The physical reverse in-situ rollback transaction operator is then initiated. The physical reverse in-situ rollback transaction operator reverses all micro-records corresponding to the current order, restoring the resource state to the initial state before this CTP execution, and completing the zero-allocation memory transaction rollback.

2. The zero-allocation memory transactional rollback method for cascading production as described in claim 1, characterized in that, In step P1, the global allocation tracking buffer is divided into five independent tracking buffer vectors, namely material tracking vector, capacity tracking vector, material substitution tracking vector, quota tracking vector, and procurement and production scheduling ratio balancing tracking vector. When the engine starts, the global tracking buffer pre-allocates continuous underlying physical memory to the peak capacity of the business for each of the five tracking buffer vectors at once, so as to prevent the tracking buffer vectors from performing memory reallocation copying during the scheduling iteration process.

3. A zero-allocation memory transactional rollback method for cascading production according to claim 2, characterized in that, In step P1, the change records stored in each group of tracking buffer vectors are all flat fixed-length tracking structures; and each tracking structure locates the corresponding resource array in shared memory through the resource physical index and the time slice day index, and records the change amount temporarily deducted or allocated through the numerical field.

4. A zero-allocation memory transactional rollback method for cascading production according to claim 2, characterized in that, The material tracking vector stores a material deduction tracking structure, which includes the material's physical index in the time-sharing inventory array, the time slice day index, and the temporary deduction quantity. The capacity tracking vector stores the capacity occupancy tracking structure, which includes the physical index of equipment resources in the global capacity array, the time slice day index, and the temporary capacity occupancy hours. The material substitution tracking vector stores a dynamic substitution tracking structure, which includes an original material index, a substitute material index, a time slice day index, an original demand quantity, an actual deducted substitution quantity, and a dynamic substitution ratio factor; the dynamic substitution ratio factor is used to verify the upper limit constraint of incomplete substitution. The quota tracking vector stores a rigid quota occupancy tracking structure, which includes a rigid quota pool physical index, a time slice day index, and a temporary quota occupancy quantity. The procurement and production scheduling ratio balancing tracking vector storage contains the procurement and production scheduling ratio balancing tracking structure, which includes a procurement and production scheduling balancing group physical index, a time slice day index, a supplier and factory index, and temporarily allocated procurement and production quantities.

5. A zero-allocation memory transactional rollback method for cascading production according to claim 1, characterized in that, The specific process of step P2 is as follows: During the depth-first search traversal of the multi-level BOM topology and cross-factory substitution sourcing process, when performing trial deductions for material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory are directly deducted or updated. Each time a resource update is completed, a miniature record body containing only the information of this change is generated and appended to the corresponding tracking buffer vector in the global tracking buffer manager according to the resource type.

6. A zero-allocation memory transactional rollback method for cascading production according to claim 5, characterized in that, In-situ resource updates and record writing include: ① In-situ deduction of materials and capacity: Locate the storage unit corresponding to the time-sharing inventory array in shared memory through the material physical index and time slice day index, subtract the current demand quantity from the original inventory value in the unit and overwrite it into the original storage unit to complete the in-situ deduction of materials; After the deduction is completed, a material tracking record is generated and appended to the material tracking buffer vector. The storage unit corresponding to the capacity array in the shared memory is located by using the physical index of equipment resources and the day index of time slices. The original available working hours in the unit are subtracted from the temporary working hours occupied this time and written over the original storage unit to complete the in-situ deduction of capacity, generate a capacity occupancy tracking record, and append it to the capacity tracking buffer vector. ② Material Substitution and Incomplete Substitution Verification: Based on the preset dynamic substitution conversion ratio, the inventory array of substitute materials is deducted in place; the maximum allowable upper limit constraint for incomplete substitution is set, and the cumulative substitution consumption in this allocation is verified to exceed the upper limit. If the substitution limit is not exceeded, a substitution tracking record is generated and appended to the material substitution tracking vector; if the cumulative substitution amount after allocation exceeds the maximum substitution limit, the order delivery link verification is deemed to have failed. ③ Rigid quota deduction verification: Locate the corresponding position in the quota balance array in memory through the quota pool index and time slice day index, perform in-place deduction operation, and directly overwrite the original memory position with the result; If the quota balance after deduction does not meet the constraints, the order delivery link verification is deemed to have failed; if the quota balance is sufficient, a quota tracking record is generated and appended to the quota tracking vector. ④ Procurement and production scheduling ratio balancing allocation logic: Locate the procurement and production scheduling ratio balancing accumulator through the physical index of the procurement and production scheduling balancing group, the supplier and factory index, and the time slice day index, and update the temporary accumulator value; verify the allocation ratio deviation based on the updated accumulator value, and generate procurement and production scheduling ratio tracking records and write them into the procurement and production scheduling ratio balancing tracking vector.

7. A zero-allocation memory transactional rollback method for cascading production according to claim 6, characterized in that, In step P3, if any of the following conflicts occur, the order delivery link verification is deemed to have failed, and the physical reverse in-situ rollback transaction operator is initiated: ① Insufficient material inventory; ② Insufficient available equipment capacity; ③ The amount used exceeds the rigid distribution quota; ④ The factory's procurement allocation ratio exceeds the upper limit of the allowable deviation.

8. A zero-allocation memory transactional rollback method for cascading production according to claim 7, characterized in that, In step P3, the specific process of the physical reverse in-situ rollback transaction operator reversing all micro-records corresponding to the current order is as follows: Following the order of DFS writing from front to back and from top to bottom, the records in each tracking buffer vector are read in reverse; and based on the physical index and time slice day index of the record, physical values ​​are restored in-situ on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator corresponding to the shared memory. ① Material inventory restoration: During the trial calculation phase, the inventory value is reduced by the required quantity. During the rollback phase, the reduced quantity is added back to restore the inventory value before the trial calculation. ② Capacity restoration: During the trial calculation phase, the occupied working hours are deducted from the capacity, and during the rollback phase, the occupied working hours are added back to restore the usable capacity of the equipment; ③ Restoration of Substitute Materials and Substitution Relationships: Read the substitution tracking records, add up the consumption quantity on the one hand, and restore the original demand amount, cumulative substitution amount and dynamic substitution ratio parameters on the other hand, and completely cancel the current substitution allocation operation; ④ Rigid quota restoration: During the trial calculation phase, the allocated quantity of quota is reduced, and during the rollback phase, the allocated quantity is added back to restore the available balance of the quota pool under the corresponding time slice; ⑤ Restoration of the Procurement and Production Scheduling Ratio Accumulator: During the trial calculation phase, the allocated output is superimposed for ratio verification. During the rollback phase, the temporary allocated output is deducted, and the original cumulative allocation value of the procurement and production scheduling balance group is restored.

9. A zero-allocation memory transactional rollback method for cascading production according to claim 1, characterized in that, When a valid resource consumption path is obtained through depth-first search traversal, all temporary trial deduction records stored in the global allocation tracking buffer are read, and the temporary deduction records are batched and converted into the final rights confirmation deduction results. The rights confirmation and deduction results are written into the columnar physical database through an independent high-speed direct data pipeline, and the rights confirmation and deduction results are simultaneously pushed to the front-end management and control platform for visualization in a streaming mode.

10. A zero-allocation memory transactional rollback system for cascaded production, used to implement the zero-allocation memory transactional rollback method according to any one of claims 1-9, characterized in that, include: The memory allocation module is used to request a global allocation tracking buffer of fixed capacity in physically contiguous memory, and to divide the global allocation tracking buffer into multiple tracking buffer vectors; The depth-first execution module is used to perform a depth-first search recursive resource consumption along the multi-level BOM topology. When performing trial deductions or updates on material nodes, equipment capacity, substitute materials, quota pools, and procurement and production scheduling ratios, it directly performs in-situ deductions or updates on the time-sharing inventory array, capacity array, quota balance array, and procurement and production scheduling ratio accumulator in the pre-allocated physical shared memory, and writes the micro record generated by the resource change into the corresponding type of tracking buffer vector. The reverse rollback and restoration module is used to initiate a physical reverse in-situ rollback transaction operator when the order delivery link verification is determined to have failed. The physical reverse in-situ rollback transaction operator reads the miniature record in each tracking buffer vector in reverse and performs physical value in-situ restoration on the time-sharing inventory array, capacity array, quota balance array and procurement and production scheduling ratio accumulator to restore the resource status to the initial state before this CTP execution and complete the zero-allocation memory transaction rollback.