Hierarchical aggregated resource distributed state consistency method, system and storage medium

CN122964085APending Publication Date: 2026-10-23ZHEJIANG RURAL COMMERCIAL DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611434025.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

现有资源调度方案多采用分步执行的处理模式,通过多次数据库操作依次完成容量扣减与状态更新,依赖分布式锁机制规避并发冲突,在高并发调度场景下锁等待时长显著增加,事务执行链路长,且中间状态易受异常干扰,频繁出现资源超卖、扣减结果与预期不符等一致性问题,无法兼顾调度效率与数据准确性

Benefits of technology

本发明通过单条数据库更新语句完成时隙实例的容量扣减、状态跃迁与版本号递增,依托行级锁定机制与预设更新约束条件保障操作的原子性,结合受影响行数与实例集长度的一致性校验机制,可精准确认全部目标实例的操作生效状态,从数据库执行层面规避并发调度下的数据异常,确保资源容量扣减与状态变更全程一致。整套调度操作在单一事务内闭环执行,操作链路清晰可控,能够有效保障调度事务的完整性与可靠性,降低状态不一致带来的业务风险,提升资源调度的执行稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964085A_ABST
    Figure CN122964085A_ABST
Patent Text Reader

Abstract

The application discloses a hierarchical aggregation resource distributed state consistency method and system and a storage medium, and comprises the following steps: receiving a resource scheduling request containing a target resource identifier, a scheduling time range and a scheduling quantity, querying a preset resource topology relationship table to determine a resource type, and obtaining a corresponding target time slot instance set; completing capacity deduction and state transition through a single database update statement, and completing consistency verification through the number of affected rows returned by the database; after the verification is passed, performing bidirectional topology linkage according to the resource type, updating the time slot instance state of the hierarchical aggregation associated resource, writing a scheduling record and submitting a transaction, and further comprising a corresponding resource release and state backtracking mechanism; the application guarantees scheduling consistency by means of database atomic operation and row-level locking, realizes state linkage synchronization of hierarchical aggregation resources, can effectively avoid resource overselling and state inconsistency problems in a distributed scene, and improves the reliability and execution efficiency of resource scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of distributed resource scheduling technology, specifically involving a method, system, and storage medium for distributed state consistency of hierarchical aggregated resources. Background Technology

[0002] With the increasing prevalence of distributed system architectures and the growing demand for refined resource operation, resource scheduling scenarios with hierarchical aggregation characteristics are becoming more common. These resources involve hierarchical relationships between aggregate and atomic units, and a single scheduling operation must simultaneously cover the state changes of the target resource and its associated hierarchical resources. Existing resource scheduling solutions mostly adopt a step-by-step execution mode, completing capacity deduction and state updates sequentially through multiple database operations. They rely on distributed lock mechanisms to avoid concurrency conflicts. In high-concurrency scheduling scenarios, lock waiting time increases significantly, transaction execution chains are long, and intermediate states are susceptible to anomalies, frequently resulting in consistency issues such as resource overselling and discrepancies between deduction results and expectations. This makes it impossible to balance scheduling efficiency and data accuracy.

[0003] For cross-level state linkage of hierarchical aggregated resources, existing technologies generally adopt asynchronous-synchronous processing methods. This results in significant delays in updating the state of associated resources, easily leading to mismatches between upper and lower level resources. This can result in anomalies where aggregated resources are already occupied, but subordinate atomic resources can still be scheduled. In the resource release and state rollback stages, existing solutions use simplistic logic to determine the availability of hierarchical resources, failing to accurately match the state correspondence between aggregated and atomic units. This can easily cause scheduling conflicts due to erroneous resource release, or low utilization due to the inability to reclaim and reuse resources in a timely manner, making it difficult to ensure the continuous consistency of resource states across the entire chain. Summary of the Invention

[0004] Based on the aforementioned background and the problems existing in the prior art, this invention proposes a method, system, and storage medium for distributed state consistency of hierarchical aggregated resources. This method effectively solves the state consistency problem of hierarchical aggregated resources in distributed scheduling scenarios, avoids anomalies such as resource overselling and cross-level state mismatch, and ensures the atomicity and accuracy of resource capacity reduction and state changes. Another objective of this invention is to improve the efficiency of hierarchical aggregated resource scheduling and state synchronization through a combination of atomic database updates and bidirectional topology linkage, enabling precise control and efficient reuse of resource states in high-concurrency scenarios, and supporting refined resource operation and management.

[0005] To achieve these objectives and other advantages of the present invention, a method, system, and storage medium for hierarchical aggregated resource distributed state consistency are provided.

[0006] To achieve the above objectives, this invention provides a hierarchical aggregated resource distributed state consistency method, comprising the following steps: Receive a resource scheduling request, the resource scheduling request including the target resource identifier, scheduling time range and scheduling quantity; The target resource is queried from a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; Based on the scheduling time range, query the target time slot instance set corresponding to the target resource identifier from the preset target instance table; The target time slot instance set is deducted from its capacity and transitioned to a new state using a single database update statement, and the number of affected rows returned by the database is checked for consistency with the length of the target time slot instance set. If the verification passes, bidirectional topology linkage is executed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, write it into the scheduling record, and commit the transaction.

[0007] As one possible implementation, the method of reducing the capacity and transitioning the state of the target time slot instance set using a single database update statement includes the following steps: Use the number of schedules as the deduction base; The single database update statement is constructed by using the instance identifier of each time slot instance in the target time slot instance set as the row-level locking range, and the current state of each time slot instance as the available state and the current available capacity not less than the deduction base as the update constraint condition. In the single database update statement, the available capacity of each time slot instance is assigned as the difference between the current available capacity and the deduction base, and the status of each time slot instance is set according to the difference, and an increment operation is performed on the existing version number of each time slot instance. Execute the single database update statement and obtain the number of affected rows returned by the database.

[0008] As one possible implementation, the consistency check between the number of affected rows returned by the database and the length of the target time slot instance set includes the following steps: If the number of affected rows is equal to the length, then it is determined that the capacity reduction is fully effective on the target time slot instance set, and the consistency check is confirmed to be passed; If the number of affected rows is less than the length, it is determined that there are undeducted time slot instances in the target time slot instance set, the consistency check fails, the current transaction is aborted, and all executed database operations are rolled back.

[0009] As one possible implementation, if the verification passes, bidirectional topology linkage is performed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, including the following steps: If the resource type is an aggregation unit, then the atomic units belonging to the target resource are queried according to the resource topology table; According to the scheduling time range, query the first associated time slot instance set corresponding to the atomic unit, set the available capacity of each time slot instance in the first associated time slot instance set to 0, and set the state of each time slot instance in the first associated time slot instance set to unschedulable state. If the resource type is an atomic unit, then the aggregation unit to which the target resource belongs is queried according to the resource topology table; According to the scheduling time range, query the second associated time slot instance set corresponding to the aggregation unit, set the available capacity of each time slot instance in the second associated time slot instance set to 0, and set the status of each time slot instance in the second associated time slot instance set to unschedulable state.

[0010] As one possible implementation method, it also includes resource release and rollback methods, the specific steps of which are as follows: Parse the resource release request to obtain the identifier of the resource to be released and the list of time slot instances to be released; Restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource topology table is queried based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier; If the type of resource to be released is an aggregate unit, then query all its atomic units according to the resource topology relationship table, and restore the time slot instances in all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. If the resource to be released is an atomic unit, then perform a remaining availability aggregation determination, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

[0011] As one possible implementation, if the resource to be released is an atomic unit, then performing a remaining availability aggregation determination, and restoring or maintaining the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result, includes the following steps: The aggregate unit to which the atomic unit belongs is obtained according to the resource topology table; Query the third associated time slot instance set of other atomic units under the same aggregation unit, excluding the atomic unit, within the time range corresponding to the release request; Perform a remaining availability aggregation determination for each time slot instance in the third associated time slot instance set: If the available capacity of each time slot instance in the third associated time slot instance set is greater than 0 and the status is available, then the determination result is true; otherwise, the determination result is false. If the determination result is true, the corresponding time slot instance of the aggregation unit within the time range is restored to an available state, and the source semantic field is cleared. If the determination result is false, the corresponding time slot instance of the aggregation unit within the time range remains in an unschedulable state, and a time slot instance that is still in an unschedulable state is selected from the third associated time slot instance set, inheriting its occupancy source, locking purpose and locking remarks semantic fields.

[0012] As one possible implementation, selecting a time slot instance that is still in an unschedulable state from the third associated time slot instance set and inheriting its occupancy source, locking purpose, and locking remarks semantic fields specifically includes: From the third associated time slot instance set, time slot instances whose current state is unschedulable are selected to form a candidate instance set; According to the preset inheritance priority order, the target reference instance is determined from the candidate instance set, wherein the inheritance priority order is that user reservation takes precedence over management lock, and management lock takes precedence over system linkage occupancy. The values ​​of the occupancy source, locking purpose, and locking remarks fields of the target reference instance are copied to the corresponding fields of the time slot instance corresponding to the aggregation unit, and the instance identifier of the target reference instance is written into the time slot instance corresponding to the aggregation unit as a backtracking association index.

[0013] A hierarchical aggregated resource distributed state consistency system, characterized in that it is used to implement the hierarchical aggregated resource distributed state consistency method described in any one of the above claims, the system comprising: The request receiving module is used to receive resource scheduling requests, wherein the resource scheduling request includes a target resource identifier, a scheduling time range, and a scheduling quantity; The resource type identification module is used to query a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; The time slot query module is used to query the target time slot instance set corresponding to the target resource identifier from the preset target instance table based on the scheduling time range; The atomic deduction module is used to deduct capacity and transition state of the target time slot instance set through a single database update statement, and to verify the consistency between the number of affected rows returned by the database and the length of the target time slot instance set. The topology linkage module is used to perform bidirectional topology linkage according to the resource type if the verification passes, so as to update the time slot instance status of the associated resources that have a hierarchical aggregation relationship with the target resource, write the scheduling record and commit the transaction.

[0014] Hierarchical aggregated resource distributed state consistency system also includes: The release request parsing module is used to parse resource release requests to obtain the identifier of the resource to be released and the list of time slot instances to be released; The release recovery module is used to restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource type determination module is used to query the resource topology table based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier to be released; The aggregation release module is used to query all atomic units of the resource topology relationship table if the type of the resource to be released is an aggregation unit, and restore the time slot instances in the all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. The state backtracking module is used to perform a remaining availability aggregation determination if the type of the resource to be released is an atomic unit, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

[0015] The present invention has at least the following beneficial effects: This invention completes capacity reduction, state transition, and version number increment of time slot instances using a single database update statement. Relying on row-level locking mechanisms and preset update constraints to ensure the atomicity of the operation, and combined with a consistency check mechanism for the number of affected rows and the instance set length, it can accurately confirm the effective status of all target instances. This avoids data anomalies under concurrent scheduling at the database execution level, ensuring consistency throughout the resource capacity reduction and state change process. The entire scheduling operation is executed in a closed loop within a single transaction, with a clear and controllable operation chain. This effectively guarantees the integrity and reliability of the scheduling transaction, reduces business risks caused by state inconsistencies, and improves the execution stability of resource scheduling.

[0016] This invention achieves bidirectional topology linkage based on preset resource topology relationships, enabling synchronous updates of the state of associated resources under hierarchical aggregation relationships. This ensures precise correspondence between the time-slot states of aggregation units and atomic units, achieving synchronous changes in the state of resources across all levels. The accompanying resource release and rollback mechanism performs differentiated processing for different resource types, precisely controlling the state recovery of aggregation units through remaining availability aggregation judgment logic. This ensures accurate rollback of the state across all levels after resource release, improving resource reuse efficiency. The entire solution is adaptable to resource scheduling needs in high-concurrency scenarios, simplifies the state management logic of hierarchical resources, and provides stable and reliable technical support for the refined operation of hierarchical aggregated resources.

[0017] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description

[0018] Figure 1 This is a schematic flowchart of the method of the present invention; Figure 2 This is a functional block diagram of the system of the present invention. Detailed Implementation

[0019] To clearly illustrate the present invention and make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, so that those skilled in the art can implement the invention based on the description. The technology of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] Example 1: A hierarchical aggregation resource distributed state consistency method, such as Figure 1 As shown, it includes the following steps: Receive a resource scheduling request, the resource scheduling request including the target resource identifier, scheduling time range and scheduling quantity; The target resource is queried from a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; Based on the scheduling time range, query the target time slot instance set corresponding to the target resource identifier from the preset target instance table; The target time slot instance set is deducted from its capacity and transitioned to a new state using a single database update statement, and the number of affected rows returned by the database is checked for consistency with the length of the target time slot instance set. If the verification passes, bidirectional topology linkage is executed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, write it into the scheduling record, and commit the transaction.

[0021] This invention also includes a resource release and backtracking method, the specific steps of which are as follows: Parse the resource release request to obtain the identifier of the resource to be released and the list of time slot instances to be released; Restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource topology table is queried based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier; If the type of resource to be released is an aggregate unit, then query all its atomic units according to the resource topology relationship table, and restore the time slot instances in all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. If the resource to be released is an atomic unit, then perform a remaining availability aggregation determination, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

[0022] The above steps comprehensively cover the entire link state management logic of hierarchical aggregated resources, from scheduling and occupancy to release and backtracking. A consistency guarantee system for the resource state across all levels is constructed based on database atomic operations and a two-way topology linkage mechanism. The following sections provide detailed explanations of the specific execution methods, internal processing logic, and data flow rules for each step.

[0023] Receive a resource scheduling request, the resource scheduling request including the target resource identifier, scheduling time range and scheduling quantity; In this embodiment, a resource scheduling service interface is deployed based on a general network communication protocol. The interface defines a fixed order and data type for request message fields. After the business system fills in the scheduling requirements according to the agreed field order, it initiates a network request to the interface. Upon receiving the network request from the interface, the server reads the complete request message content and parses the message segment by segment according to the agreed field division rules, extracting three items: the target resource identifier, the scheduling time range, and the scheduling quantity. Each of the three extracted items undergoes a validity check. The character length and encoding rules of the target resource identifier match the unified resource identifier specification within the system. The scheduling time range includes a clear start and end time point, with the end time point being later than the start time point. The scheduling quantity is an integer greater than 0. After all three items pass the validity check, the target resource identifier, scheduling time range, and scheduling quantity are integrated into a complete resource scheduling request and written into the context of the current scheduling transaction for direct invocation by subsequent processes.

[0024] This invention ensures the consistency of scheduling request format through a unified interface and standardized message structure, and intercepts requests with abnormal format or invalid content in advance through field-level validity checks, ensuring that the input data obtained in subsequent processes is accurate and compliant, providing a stable and reliable starting input for the entire resource scheduling process, and avoiding deviations in subsequent processing caused by abnormal request data.

[0025] The target resource is queried from a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; In this embodiment, the target resource identifier is obtained from the current scheduling transaction context. The target resource identifier is used as the matching condition to query the preset resource topology relationship table. The preset resource topology relationship table stores the identifier information of all resources and the associated records of the corresponding resource types. The resource type values ​​are divided into two types: aggregate unit and atomic unit. The record that completely matches the target resource identifier is located in the resource topology relationship table. The resource type information in the record is extracted and the extracted resource type is saved to the running data of the current scheduling transaction for subsequent topology linkage process calls.

[0026] This invention enables rapid location and extraction of resource types through a preset resource topology table. The matching logic is clear and fixed, and the resource type corresponding to the target resource can be accurately obtained, providing a clear classification and judgment basis for subsequent hierarchical aggregation operations.

[0027] Based on the scheduling time range, query the target time slot instance set corresponding to the target resource identifier from the preset target instance table; In this embodiment, the system reads the target resource identifier and scheduling time range from the context of the current scheduling transaction, and uses both of these as query filtering conditions for the target instance table.

[0028] The preset target instance table stores time slot instance records for all resources. Each time slot instance record contains six fields: resource identifier, time slot start time, time slot end time, available capacity, current status, and instance identifier.

[0029] The system sends a query command to the database targeting the target instance table. After receiving the command, the database locates the target instance table, iterates through the resource identifier field of all records in the table, and extracts a subset of records that are completely consistent with the target resource identifier.

[0030] Within the obtained subset of records, the database continues to traverse the time slot start time and time slot end time fields of each record, filtering out all records whose time slot start time is no earlier than the start time of the scheduling time range and whose time slot end time is no later than the end time of the scheduling time range.

[0031] The database integrates the time slot instance records that meet all the filtering conditions into a set, which is the target time slot instance set. The database returns the target time slot instance set to the system, and the system stores the target time slot instance set in the context of the current scheduling transaction as the execution object of subsequent capacity deduction operations.

[0032] This invention accurately locates the target time slot instance corresponding to the time period through dual filtering of resource identifier and time slot range. The pre-defined fields of the target instance table are clearly defined and uniform. The query process relies on the database's native traversal and matching mechanism to execute. The output results are stable and reproducible, and can provide accurate and complete operation objects for subsequent capacity deduction and consistency verification.

[0033] The target time slot instance set is deducted from its capacity and transitioned to a new state using a single database update statement. The consistency between the number of affected rows returned by the database and the length of the target time slot instance set is then verified, including the following steps: Use the number of schedules as the deduction base; The single database update statement is constructed by using the instance identifier of each time slot instance in the target time slot instance set as the row-level locking range, and the current state of each time slot instance as the available state and the current available capacity not less than the deduction base as the update constraint condition. In the single database update statement, the available capacity of each time slot instance is assigned as the difference between the current available capacity and the deduction base, and the status of each time slot instance is set according to the difference, and an increment operation is performed on the existing version number of each time slot instance. Execute the single database update statement and obtain the number of affected rows returned by the database.

[0034] If the number of affected rows is equal to the length, then it is determined that the capacity reduction is fully effective on the target time slot instance set, and the consistency check is confirmed to be passed; If the number of affected rows is less than the length, it is determined that there are undeducted time slot instances in the target time slot instance set, the consistency check fails, the current transaction is aborted, and all executed database operations are rolled back.

[0035] In this embodiment, the system reads the number of schedules that have completed legality verification from the context of the current scheduling transaction, and directly sets the number of schedules as the deduction base for this capacity deduction operation. The deduction base is a fixed capacity value that needs to be deducted for each time slot instance that meets the update conditions. This value remains consistent throughout this update operation and will not be adjusted differently for individual time slot instances.

[0036] The system iterates through the target time slot instance set, extracts the instance identifier corresponding to each time slot instance in the set, and uses all instance identifiers as the row-level locking range for a single database update statement. The instance identifier corresponds to the primary key field of the target instance table. Row-level locking is achieved by writing all instance identifiers into the matching conditions of the update statement, applying a lock only to the matched database rows, without expanding the locking range. The system simultaneously sets the update constraints for this update statement, including two judgment rules that must be met simultaneously. The first rule is that the current state value of the time slot instance is completely consistent with the preset value of the available state. The second rule is that the current available capacity value of the time slot instance is greater than or equal to the value of the deduction base. Records that do not meet either rule will not be modified. The system combines the row-level locking range and the update constraints to concatenate and generate a complete single database update statement. This statement only points to the target instance table and is a single executable database update instruction throughout, without being split into multiple statements for execution.

[0037] In the field assignment logic of a single database update statement, the system sets update rules for three types of fields: available capacity, status, and version number. The available capacity field performs capacity deduction processing on each eligible time slot instance. The deducted value is consistent with the deduction base, and the result directly overwrites the available capacity field written to that record. The value deduction processing is completed synchronously within the database. The status field switches synchronously based on the value after available capacity deduction. When the available capacity value after deduction is greater than 0, it retains the preset value corresponding to the available status. When the available capacity value after deduction is equal to 0, it is modified to the preset value corresponding to the unschedulable status. The status switching logic is embedded within the single update statement and is completed synchronously with the available capacity update, requiring no additional queries or secondary update operations. The version number field performs value increment processing on each eligible time slot instance. The increment is a fixed value of 1, and the incremented value directly overwrites the original field value. This is used to mark the number of status changes for that time slot instance, serving as the basis for data version tracking.

[0038] The system submits the completed single database update statement to the database. After receiving the statement, the database locates all corresponding data rows based on the instance identifier matching conditions in the statement. It applies an exclusive row-level lock to all located data rows. After locking, the data rows within the locked range cannot be modified by other concurrent transactions. The database verifies the update constraints row by row. For data rows that fully meet the conditions, it synchronously updates the available capacity, status, and version number fields. For data rows that do not meet the conditions, it does not perform any modifications and skips them directly. After the database completes the processing of all locked rows, it counts the total number of data rows whose fields were actually modified in this statement, and returns this total number as the number of affected rows to the system in integer form.

[0039] The system receives the number of affected rows returned by the database, synchronously counts the total number of time slot instances contained in the target time slot instance set, and determines this total number as the length of the target time slot instance set. The system compares the value of the number of affected rows with the value of the length of the target time slot instance set. If the two values ​​are completely equal, it is determined that the capacity deduction has been fully effective on the target time slot instance set, the consistency check passes, and the check result is stored in the context of the current scheduling transaction as a prerequisite for subsequent topology linkage processes. If the value of the number of affected rows is less than the value of the length of the target time slot instance set, it is determined that there are time slot instances in the target time slot instance set that have not been deducted, the consistency check fails, the system immediately suspends all subsequent processes of the current scheduling transaction, sends a transaction rollback instruction to the database, and after receiving the instruction, the database undoes all database modification operations executed in this transaction, restores all fields of all relevant data rows to their original state before the transaction started, and releases all applied row-level locks.

[0040] This invention achieves integrated atomic execution of capacity deduction, state transition, and version number increment using a single database update statement. It isolates concurrent operations using an exclusive row-level locking mechanism, pre-verifies the legality of the deduction through built-in update constraints, and completes full-scale validity verification by accurately comparing the number of affected rows with the instance set length. If verification fails, all data is restored through database transaction rollback. The entire process is executed under transaction protection, ensuring that deduction operations for all target time slot instances take effect or roll back simultaneously. This effectively avoids resource overselling and partial deduction anomalies, ensuring the accuracy and consistency of resource state changes. Furthermore, the single-statement execution mode reduces the number of interactions between the system and the database, improving the efficiency of scheduling.

[0041] If the verification passes, bidirectional topology linkage is performed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, write to the scheduling record and commit the transaction, including the following steps: If the resource type is an aggregation unit, then the atomic units belonging to the target resource are queried according to the resource topology table; According to the scheduling time range, query the first associated time slot instance set corresponding to the atomic unit, set the available capacity of each time slot instance in the first associated time slot instance set to 0, and set the state of each time slot instance in the first associated time slot instance set to unschedulable state. If the resource type is an atomic unit, then the aggregation unit to which the target resource belongs is queried according to the resource topology table; According to the scheduling time range, query the second associated time slot instance set corresponding to the aggregation unit, set the available capacity of each time slot instance in the second associated time slot instance set to 0, and set the status of each time slot instance in the second associated time slot instance set to unschedulable state.

[0042] In this embodiment, the system reads the resource type that has been determined from the context of the current scheduling transaction. When the resource type is an aggregation unit, the system queries the preset resource topology table with the target resource identifier as the matching condition for the superior resource. Each subordinate record in the resource topology table contains two fields: the superior aggregation unit identifier and the subordinate atomic unit identifier. The system traverses all subordinate records in the table and compares the character content of the superior aggregation unit identifier field with the target resource identifier one by one. The system extracts the subordinate atomic unit identifiers from all records where the character content is completely matched, thus obtaining all atomic units belonging to the target resource.

[0043] The system reads the scheduling time range from the current scheduling transaction context and uses it together with all extracted atomic unit identifiers as query conditions to query the target instance table. The database filters out all time slot instance records whose resource identifiers belong to the extracted atomic unit identifier set, and whose time slot start time is no earlier than the start time of the scheduling time range and whose time slot end time is no later than the end time of the scheduling time range. The records that meet the conditions are integrated into the first associated time slot instance set, and then all data rows corresponding to the instance set are synchronously updated. The available capacity field of each record is set to 0, and the status field of each record is set to the fixed value corresponding to the unschedulable state. All update operations are performed within the current scheduling transaction.

[0044] The system reads the resource types that have been determined from the context of the current scheduling transaction. When the resource type is an atomic unit, it queries the preset resource topology table with the target resource identifier as the matching condition for subordinate resources. The database traverses all subordinate records in the table and compares the character content of the subordinate atomic unit identifier field with the target resource identifier one by one. It extracts the parent aggregation unit identifier from the records where the character content matches completely to obtain the aggregation unit to which the target resource belongs.

[0045] The system reads the scheduling time range from the current scheduling transaction context and uses the extracted aggregation unit identifier as the query condition to query the target instance table. The database filters out all time slot instance records that have resource identifiers that are completely consistent with aggregation unit identifiers, and whose time slot start time is no earlier than the start time of the scheduling time range and whose time slot end time is no later than the end time of the scheduling time range. The records that meet the conditions are integrated into a second associated time slot instance set, and then all data rows corresponding to the instance set are synchronously updated. The available capacity field of each record is set to 0, and the status field of each record is set to a fixed value corresponding to the unschedulable state. All update operations are performed within the current scheduling transaction.

[0046] This invention determines the topology linkage logic corresponding to the resource type and accurately locates associated resources with hierarchical aggregation relationships based on a preset resource topology relationship table. It also filters the associated time slot instance set for the corresponding time period by combining the scheduling time range and synchronously executes capacity and status updates. This ensures that the resource status of the aggregation unit and the atomic unit are completely corresponding within the same time period, avoiding scheduling anomalies caused by mismatch between the resource status of upper and lower layers. Furthermore, all linkage update operations are completed within the same transaction, ensuring the atomicity and consistency of hierarchical resource status changes.

[0047] This invention also includes a resource release and backtracking method, the specific steps of which are as follows: Parse the resource release request to obtain the identifier of the resource to be released and the list of time slot instances to be released; In this embodiment, the system receives resource release requests initiated by external business systems through a preset resource release service interface. The request message adopts a fixed structured data format, and the message is divided into independent resource identifier fields and time slot instance list fields according to an agreed field order. The start and end positions, data types, and storage rules of the two fields all follow the system's unified message communication specifications. After receiving the complete request message, the system splits the message content according to preset field boundary rules. First, it locates the start and end positions of the resource identifier field, extracts the complete character content stored within the field range, and determines this content as the resource identifier to be released. The system continues to locate the start and end positions of the time slot instance list field, splits the content within the field range according to preset list item separator characters, extracts the time slot instance identifier corresponding to each list item, and integrates all the extracted instance identifiers in the original order within the message to form a time slot instance list to be released. The system performs format validity checks on the extracted resource identifiers to be released. The verification rule is that the character encoding matches the system's unified resource identifier encoding standard, and the character length is within the preset identifier length range. If the verification fails, the current release process is terminated and a format error message is returned. The system performs a format validity check on the extracted list of time slot instances to be released. The validation rules are that each instance identifier in the list must match the encoding format of the primary key field of the target instance table, and there must be no duplicate instance identifier entries in the list. If the validation fails, the current release process is terminated and a format error message is returned. After both the resource identifiers to be released and the list of time slot instances to be released pass the validity checks, the system stores both pieces of data in the context storage area of ​​the current resource release transaction for direct use in subsequent resource capacity recovery and status backtracking processes.

[0048] This invention ensures the standardization and reproducibility of the request parsing process through a unified message format and fixed field splitting rules. It intercepts invalid release requests in advance through two-dimensional format validity checks, and can accurately and stably output the identifier of the resource to be released and the list of time slot instances to be released. This provides a precise target location basis for subsequent resource recovery operations, avoids the problem of incorrect resource release or incorrect release objects caused by parsing deviations, and ensures the accuracy and reliability of the resource release process.

[0049] Restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; In this embodiment, the system reads the list of time slot instances to be released from the context of the current resource release transaction, and retrieves the historical scheduling record corresponding to the resource occupation of this time. The system extracts the capacity value deducted in this scheduling operation from the scheduling record and uses this value as the base value for this capacity recovery.

[0050] The system uses the instance identifier of each instance in the list of time slot instances to be released as the matching condition to locate the corresponding data row in the target instance table and applies an exclusive row-level lock to all matching data rows.

[0051] The system performs an available capacity recovery operation on each locked data row, adding the currently stored available capacity value of the data row to the recovery baseline value, and using the result as the recovered available capacity, overwriting the available capacity field written to that data row.

[0052] The system performs a status update based on the available capacity value after each data row is restored. When the available capacity value after restoration is greater than 0, the status field of the data row is set to a fixed value corresponding to the available status.

[0053] When the available capacity value after recovery is equal to 0, the status field of the data row is kept at the fixed value corresponding to the unschedulable state, and no state switching operation is performed.

[0054] All available capacity restoration and status update operations for all time slot instances are performed within the current resource release transaction. The updated temporary data is retained with the transaction and will be committed uniformly after the subsequent processes are completed.

[0055] The beneficial effects are that by matching historical scheduling records to determine the baseline value for capacity recovery, the accuracy of the restored capacity is ensured. By relying on exclusive row-level locks to isolate concurrent modification conflicts and by combining the value judgment rules of the available capacity after recovery to synchronously update the instance status, the capacity reset and status adaptation of the instance to be released can be accurately completed. This provides accurate basic data for the status backtracking of subsequent hierarchical aggregated resources, ensuring the accuracy and reliability of single resource instance release operations.

[0056] The resource topology table is queried based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier; In this embodiment, the system reads the identifier of the resource to be released from the context storage area of ​​the current resource release transaction. This identifier is used as the unique matching condition for querying the resource topology table. Each record in the resource topology table corresponds to an independent resource entity. Each record has two fixed fields: resource identifier and resource type. The value of the resource type field only includes two types: aggregate unit and atomic unit. After receiving the query condition, the database locates the resource topology table and reads the content of the resource identifier field of each record in the table row by row. It performs a character-by-character consistency comparison with the identifier of the resource to be released. During the database comparison process, when the content of the resource identifier field of a certain record is exactly the same as the identifier of the resource to be released, the traversal comparison operation in the table is stopped, and the corresponding value of the resource type field in the record is extracted. The database returns the extracted resource type value to the system. The system determines this value as the resource type to be released corresponding to the identifier of the resource to be released. The system writes the resource type to be released into the context storage area of ​​the current resource release transaction as the basis for determining the subsequent execution of differentiated release logic.

[0057] This invention ensures the standardization of resource type identification through a fixed table structure and limited field values, eliminates matching errors by using a character-by-character consistency comparison matching rule, and achieves a stable query process by relying on the database's native traversal mechanism. It can accurately output the resource type corresponding to the resource to be released, providing a reliable basis for judgment for the differentiated release and status backtracking operations of subsequent hierarchical aggregated resources.

[0058] If the type of resource to be released is an aggregate unit, then query all its atomic units according to the resource topology relationship table, and restore the time slot instances in all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. In this embodiment, the system reads the type of resource to be released from the context of the current resource release transaction. When the type of resource to be released is an aggregation unit, the hierarchical resource release process corresponding to the aggregation unit is initiated. The system uses the identifier of the resource to be released as the matching condition for the upper-level aggregation unit to send a query request to the database for the resource topology relationship table. Each subordinate record in the resource topology relationship table fixedly contains two fields: the identifier of the upper-level aggregation unit and the identifier of the subordinate atomic unit, used to record the hierarchical relationship between the aggregation unit and the atomic units. The database traverses all subordinate records in the table, comparing the character content of the upper-level aggregation unit identifier field with the identifier of the resource to be released row by row. It extracts the identifiers of the subordinate atomic units from all records with complete character matching, and integrates them to obtain all atomic units belonging to the aggregation unit to be released. The system traverses each instance identifier in the list of time slot instances to be released, reading the time slot start time and time slot end time of the corresponding record in the target instance table one by one. The system determines the time interval covered by this release operation based on the time intervals corresponding to all time slot instances to be released. The system uses the time period range and the set of all atomic unit identifiers as joint query conditions to initiate a query on the target instance table. After receiving the request, the database filters out all time slot instance records whose resource identifiers belong to the set of all atomic unit identifiers and whose time slot start and end times are completely consistent with the corresponding time periods in the list of time slot instances to be released, forming a candidate recovery instance set. Then, a dual-condition filtering is performed on the candidate set, and both filtering rules must be met simultaneously. The first condition is that the current state of the instance is completely consistent with the preset value of the unschedulable state. The second condition is that the value of the instance's occupancy source semantic field is marked as linked occupancy. Instances that meet all the rules are time slot instances that are unschedulable due to linked occupancy. The system performs a state recovery operation on all the target instances obtained by filtering, modifying the state field of the corresponding record to the fixed value corresponding to the available state, and clearing the occupancy source semantic field in the record. All state recovery operations are performed within the current resource release transaction, and the updated temporary data is retained with the transaction and submitted uniformly after the entire release process is completed.

[0059] This invention relies on a resource topology table to accurately locate all atomic units under an aggregation unit. It matches related instances in the same time period with the corresponding time period in the list of time slot instances to be released. Through dual filtering rules of status and occupancy source, it accurately locates time slot instances that are unschedulable due to linked occupancy. It only performs status restoration on instances that meet the conditions, which can avoid erroneously restoring resource instances that are not linked to the resource, ensuring the accuracy of status backtracking of subordinate atomic units when the aggregation unit is released, and ensuring that the status of the upper and lower layers of the hierarchical aggregation resources always corresponds consistently.

[0060] If the resource to be released is an atomic unit, then perform a remaining availability aggregation determination, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result, including the following steps: The aggregate unit to which the atomic unit belongs is obtained according to the resource topology table; Query the third associated time slot instance set of other atomic units under the same aggregation unit, excluding the atomic unit, within the time range corresponding to the release request; Perform a remaining availability aggregation determination for each time slot instance in the third associated time slot instance set: If the available capacity of each time slot instance in the third associated time slot instance set is greater than 0 and the status is available, then the determination result is true; otherwise, the determination result is false. If the determination result is true, the corresponding time slot instance of the aggregation unit within the time range is restored to an available state, and the source semantic field is cleared. If the determination result is false, the corresponding time slot instance of the aggregation unit within the time range remains in an unschedulable state, and a time slot instance that is still in an unschedulable state is selected from the third associated time slot instance set, inheriting its occupancy source, locking purpose and locking remarks semantic fields.

[0061] Select a time slot instance that is still in an unschedulable state from the third associated time slot instance set, and inherit its occupancy source, locking purpose, and locking remarks semantic fields, specifically including: From the third associated time slot instance set, time slot instances whose current state is unschedulable are selected to form a candidate instance set; According to the preset inheritance priority order, the target reference instance is determined from the candidate instance set, wherein the inheritance priority order is that user reservation takes precedence over management lock, and management lock takes precedence over system linkage occupancy. The values ​​of the occupancy source, locking purpose, and locking remarks fields of the target reference instance are copied to the corresponding fields of the time slot instance corresponding to the aggregation unit, and the instance identifier of the target reference instance is written into the time slot instance corresponding to the aggregation unit as a backtracking association index.

[0062] In this embodiment, the system reads the identifier of the atomic unit to be released from the current resource release transaction context, uses this identifier as a matching condition for subordinate resources to query the resource topology relationship table. Each subordinate record in the resource topology relationship table contains two fixed fields: the identifier of the superior aggregation unit and the identifier of the subordinate atomic unit, which are used to record the hierarchical subordinate correspondence between the two. The database traverses all subordinate records in the table, compares the character content of the subordinate atomic unit identifier field with the character content of the atomic unit identifier to be released row by row, and extracts the superior aggregation unit identifier from the record whose character content matches completely, thus obtaining the aggregation unit to which the atomic unit belongs.

[0063] The system uses the obtained aggregation unit identifier as the upper-level resource query condition, accesses the resource topology table again, extracts all atomic unit identifiers belonging to the aggregation unit, removes the atomic unit identifiers currently to be released, and obtains the set of other atomic unit identifiers belonging to the same aggregation unit. The system extracts the time range corresponding to this release request from the time period corresponding to the list of time slot instances to be released, and uses the set of other atomic unit identifiers and this time range as a joint filtering condition to access the target instance table. The database filters out all time slot instance records whose resource identifiers belong to the set of other atomic unit identifiers, and whose time slot start time is not earlier than the start time of the release time range and whose time slot end time is not later than the end time of the release time range. All records that meet the conditions are integrated into the third associated time slot instance set.

[0064] The system performs a residual availability check on each time slot instance in the third associated time slot instance set. The check has two rules that must be met simultaneously. The first rule is that the available capacity of the instance is greater than 0, and the second rule is that the current state value of the instance is completely consistent with the preset value of the available state. After the system completes the check on all instances in the set, if all instances meet both check rules, the result of the residual availability aggregation is true. If any instance in the set does not meet either check rule, the result of the residual availability aggregation is false.

[0065] When the judgment result is true, the system uses the aggregation unit identifier and the time range corresponding to the release request as the matching condition to locate the time slot instance corresponding to the time period of the aggregation unit in the target instance table, modifies the status field of the time slot instance to the fixed value corresponding to the available status, and clears the occupancy source semantic field in the instance record. All field modification operations are executed within the current resource release transaction and officially take effect when the transaction is finally committed.

[0066] When the judgment result is false, the system locates the time slot instance of the aggregation unit in the target instance table within the time range corresponding to the release request, keeps the status field of the time slot instance at the fixed value corresponding to the unschedulable state, and does not perform a state switching operation.

[0067] The system iterates through each time slot instance record in the third associated time slot instance set, reads the status field value in each record, performs a character-by-character consistency comparison between the read status field value and the preset fixed value corresponding to the unschedulable state, extracts all time slot instances whose comparison results are completely consistent, and integrates these instances into a candidate instance set.

[0068] The system pre-sets the inheritance priority order for the three types of occupancy sources: user reservation corresponds to the highest priority level, management lock corresponds to the middle priority level, and system linkage occupancy corresponds to the lowest priority level. The sorting rules for the three priority levels are fixedly stored in the system configuration area.

[0069] The system reads the value of the occupancy source field of each instance record in the candidate instance set, matches the occupancy source value of each instance with the three preset values ​​one by one to obtain the priority level corresponding to each instance, and sorts all instances in the candidate instance set in descending order of priority level. When multiple instances are at the same priority level, the original order of the time slot instances in the third associated time slot instance set is maintained, and the instance at the top of the sorting results is selected as the target reference instance.

[0070] The system reads the complete values ​​of the three fields—Occupation Source, Lock Purpose, and Lock Remarks—from the target reference instance record. It then writes the values ​​of these three fields into the corresponding fields of the time slot instance in the aggregation unit. The write operation directly overwrites the original values ​​in the corresponding fields, ensuring that the field content is completely consistent with the target reference instance. The system also reads the instance identifier value of the target reference instance and writes it into the backtracking association index field of the time slot instance in the aggregation unit, which serves as the unique identifier for tracing the data source of this state inheritance operation.

[0071] This invention accurately locates the aggregate unit to which an atomic unit belongs and other atomic units at the same level through resource topology relationships. It then filters the time range corresponding to the release request to obtain a third set of associated time slot instances and performs a remaining availability aggregation determination. Based on the determination result, it performs either aggregate unit state restoration or state retention operations differently. This ensures that after a single atomic unit is released, the time slot state of the aggregate unit always corresponds consistently with the actual available state of all its subordinate atomic units, avoiding anomalies where the aggregate resource state does not match the actual resource capacity. When the determination result is false, a candidate instance set is constructed through state filtering to narrow down the target selection range, relying on user reservations. The three-level fixed inheritance priority rules of management locking and system linkage clearly define the selection logic of target reference instances, ensuring the uniqueness and reproducibility of the selection process. By copying all fields, it ensures that the semantic information of the aggregation unit time slot instance accurately corresponds to the highest priority occupancy reason of the subordinate atomic unit. At the same time, the backtracking association index is retained to make the source of state inheritance operations traceable. Under the premise of maintaining the unschedulable state of the aggregation unit, it can accurately transmit the occupancy semantic information and improve the operability of state changes. Moreover, all operations are executed within the resource release transaction, further ensuring the atomicity of hierarchical resource state changes and data consistency.

[0072] Example 2: A hierarchical distributed state consistency system for aggregated resources includes a scheduling execution subsystem and a resource release backtracking subsystem. The two subsystems share a common data layer containing a resource topology table and a target instance table. All data operations are guaranteed to be atomic through database transactions. Figure 2 As shown.

[0073] The scheduling and execution subsystem consists of a request receiving module, a resource type identification module, a time slot query module, an atomic deduction verification module, and a topology linkage module. The request receiving module is used to receive resource scheduling requests, wherein the resource scheduling request includes a target resource identifier, a scheduling time range, and a scheduling quantity; The resource type identification module is used to query a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; The time slot query module is used to query the target time slot instance set corresponding to the target resource identifier from the preset target instance table based on the scheduling time range; The atomic deduction module is used to deduct capacity and transition state of the target time slot instance set through a single database update statement, and to verify the consistency between the number of affected rows returned by the database and the length of the target time slot instance set. The topology linkage module is used to perform bidirectional topology linkage according to the resource type if the verification passes, so as to update the time slot instance status of the associated resources that have a hierarchical aggregation relationship with the target resource, write the scheduling record and commit the transaction.

[0074] The resource release backtracking subsystem consists of a release request parsing module, an instance recovery module, a release type determination module, an aggregated release module, and a status backtracking module. The release request parsing module is used to parse resource release requests to obtain the identifier of the resource to be released and the list of time slot instances to be released; The release recovery module is used to restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource type determination module is used to query the resource topology table based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier to be released; The aggregation release module is used to query all atomic units of the resource topology relationship table if the type of the resource to be released is an aggregation unit, and restore the time slot instances in the all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. The state backtracking module is used to perform a remaining availability aggregation determination if the type of the resource to be released is an atomic unit, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

[0075] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. It will be apparent to those skilled in the art that various modifications can be made to the above embodiments, and the general principles described herein can be applied to other embodiments without inventive effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.

Claims

1. A hierarchical aggregated resource distributed state consistency method, characterized in that, Includes the following steps: Receive a resource scheduling request, the resource scheduling request including the target resource identifier, scheduling time range and scheduling quantity; The target resource is queried from a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; Based on the scheduling time range, query the target time slot instance set corresponding to the target resource identifier from the preset target instance table; The target time slot instance set is deducted from its capacity and transitioned to a new state using a single database update statement, and the number of affected rows returned by the database is checked for consistency with the length of the target time slot instance set. If the verification passes, bidirectional topology linkage is executed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, write it into the scheduling record, and commit the transaction.

2. The hierarchical aggregated resource distributed state consistency method according to claim 1, characterized in that, The process of reducing capacity and transitioning state of the target time slot instance set using a single database update statement includes the following steps: Use the number of schedules as the deduction base; The single database update statement is constructed by using the instance identifier of each time slot instance in the target time slot instance set as the row-level locking range, and the current state of each time slot instance as the available state and the current available capacity not less than the deduction base as the update constraint condition. In the single database update statement, the available capacity of each time slot instance is assigned as the difference between the current available capacity and the deduction base, and the status of each time slot instance is set according to the difference, and an increment operation is performed on the existing version number of each time slot instance. Execute the single database update statement and obtain the number of affected rows returned by the database.

3. The hierarchical aggregation resource distributed state consistency method according to claim 1, characterized in that, The process of verifying the consistency between the number of affected rows returned by the database and the length of the target time slot instance set includes the following steps: If the number of affected rows is equal to the length, then it is determined that the capacity deduction is fully effective on the target time slot instance set, and the consistency check is confirmed to be passed; If the number of affected rows is less than the length, it is determined that there are undeducted time slot instances in the target time slot instance set, the consistency check fails, the current transaction is aborted, and all executed database operations are rolled back.

4. The hierarchical aggregated resource distributed state consistency method according to claim 1, characterized in that, If the verification passes, bidirectional topology linkage is performed according to the resource type to update the time slot instance status of associated resources that have a hierarchical aggregation relationship with the target resource, including the following steps: If the resource type is an aggregation unit, then the atomic units belonging to the target resource are queried according to the resource topology table; According to the scheduling time range, query the first associated time slot instance set corresponding to the atomic unit, set the available capacity of each time slot instance in the first associated time slot instance set to 0, and set the state of each time slot instance in the first associated time slot instance set to unschedulable state. If the resource type is an atomic unit, then the aggregation unit to which the target resource belongs is queried according to the resource topology table; According to the scheduling time range, query the second associated time slot instance set corresponding to the aggregation unit, set the available capacity of each time slot instance in the second associated time slot instance set to 0, and set the status of each time slot instance in the second associated time slot instance set to unschedulable state.

5. The hierarchical aggregated resource distributed state consistency method according to any one of claims 1-4, characterized in that, It also includes resource release and rollback methods, with the following specific steps: Parse the resource release request to obtain the identifier of the resource to be released and the list of time slot instances to be released; Restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource topology table is queried based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier; If the type of resource to be released is an aggregate unit, then query all its atomic units according to the resource topology relationship table, and restore the time slot instances in all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. If the resource to be released is an atomic unit, then perform a remaining availability aggregation determination, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

6. The hierarchical aggregated resource distributed state consistency method according to claim 5, characterized in that, If the resource to be released is an atomic unit, then a remaining availability aggregation determination is performed, and the time slot instance state of the aggregation unit to which the atomic unit belongs is restored or maintained according to the determination result, including the following steps: The aggregate unit to which the atomic unit belongs is obtained according to the resource topology table; Query the third associated time slot instance set of other atomic units under the same aggregation unit, excluding the atomic unit, within the time range corresponding to the release request; Perform a remaining availability aggregation determination for each time slot instance in the third associated time slot instance set: If the available capacity of each time slot instance in the third associated time slot instance set is greater than 0 and the status is available, then the determination result is true; otherwise, the determination result is false. If the determination result is true, the corresponding time slot instance of the aggregation unit within the time range is restored to an available state, and the source semantic field is cleared. If the determination result is false, the corresponding time slot instance of the aggregation unit within the time range remains in an unschedulable state, and a time slot instance that is still in an unschedulable state is selected from the third associated time slot instance set, inheriting its occupancy source, locking purpose and locking remarks semantic fields.

7. The hierarchical aggregated resource distributed state consistency method according to claim 6, characterized in that, The step of selecting a time slot instance that is still in an unschedulable state from the third associated time slot instance set, and inheriting its occupancy source, locking purpose, and locking remarks semantic fields, specifically includes: From the third associated time slot instance set, time slot instances whose current state is unschedulable are selected to form a candidate instance set; According to the preset inheritance priority order, the target reference instance is determined from the candidate instance set, wherein the inheritance priority order is that user reservation takes precedence over management lock, and management lock takes precedence over system linkage occupancy. The values ​​of the occupancy source, locking purpose, and locking remarks fields of the target reference instance are copied to the corresponding fields of the time slot instance corresponding to the aggregation unit, and the instance identifier of the target reference instance is written into the time slot instance corresponding to the aggregation unit as a backtracking association index.

8. A hierarchical aggregated resource distributed state consistency system, characterized in that, The system for implementing the hierarchical aggregated resource distributed state consistency method according to claims 1-4 includes: The request receiving module is used to receive resource scheduling requests, wherein the resource scheduling request includes a target resource identifier, a scheduling time range, and a scheduling quantity; The resource type identification module is used to query a preset resource topology table based on the target resource identifier to determine the resource type corresponding to the target resource; The time slot query module is used to query the target time slot instance set corresponding to the target resource identifier from the preset target instance table based on the scheduling time range; The atomic deduction module is used to deduct capacity and transition state of the target time slot instance set through a single database update statement, and to verify the consistency between the number of affected rows returned by the database and the length of the target time slot instance set. The topology linkage module is used to perform bidirectional topology linkage according to the resource type if the verification passes, so as to update the time slot instance status of the associated resources that have a hierarchical aggregation relationship with the target resource, write the scheduling record and commit the transaction.

9. The hierarchical aggregated resource distributed state consistency system as described in claim 8, characterized in that, The system also includes: The release request parsing module is used to parse resource release requests to obtain the identifier of the resource to be released and the list of time slot instances to be released; The release recovery module is used to restore the available capacity of each time slot instance in the list of time slot instances to be released, and update the status of each time slot instance according to the restored available capacity; The resource type determination module is used to query the resource topology table based on the resource identifier to be released to determine the type of resource to be released corresponding to the resource identifier to be released; The aggregation release module is used to query all atomic units of the resource topology relationship table if the type of the resource to be released is an aggregation unit, and restore the time slot instances in the all atomic units that are in the same time period as the list of time slot instances to be released and that are unschedulable due to linkage occupation to an available state. The state backtracking module is used to perform a remaining availability aggregation determination if the type of the resource to be released is an atomic unit, and restore or maintain the time slot instance state of the aggregation unit to which the atomic unit belongs based on the determination result.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.