A method, system, and electronic equipment for detecting platform time window conflicts based on interval trees.

CN122736127APending Publication Date: 2026-09-11CHINA RAILWAY TENTH GRP FOURTH ENG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610694859.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

在小规模排程场景下,该方法尚可应对,但随着生产规模的扩大,单个台座的累计占用记录可达数百甚至上千条,一次完整的全量排程需要进行数十万次冲突检测,采用线性遍历法将导致计算耗时长达数小时乃至数十小时,严重制约了排程系统的实用性和交互响应能力

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122736127A_ABST
    Figure CN122736127A_ABST
Patent Text Reader

Abstract

This invention relates to the field of industrial scheduling and intelligent manufacturing technology, specifically to a method, system, and electronic device for detecting platform time window conflicts based on interval trees. The method includes: acquiring a target platform identifier and a target time window; locating the corresponding target interval tree from a pre-built interval tree index based on the target platform identifier; using the target time window as a query interval and performing an overlapping interval query in the target interval tree; if the query result shows at least one historical time interval overlapping with the query interval, a time conflict is determined, and the current allocation is rejected; if the query result shows no historical time interval overlapping with the query interval, no time conflict is determined, the current allocation is allowed, and the target time window is inserted as a new node into the target interval tree. This invention reduces the time complexity of conflict detection from linear to logarithmic levels, thereby enabling scheduling systems to achieve minute-level rapid responses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial scheduling and intelligent manufacturing technology, and more specifically, to a method, system, and electronic device for detecting time window conflicts on pedestals based on interval trees. Background Technology

[0002] In the construction of large-scale projects such as bridges and railways, the large-scale production of precast beams is a crucial link. A beam fabrication yard typically needs to manage the production of hundreds or even nearly a thousand beams of different types simultaneously. These tasks must be completed sequentially on limited beam fabrication and storage platforms, while strictly adhering to various process time constraints. The core issue in precast beam production scheduling is how to rationally allocate platform resources and time windows for each beam while meeting various process constraints.

[0003] When allocating scheduling slots, scheduling systems must quickly and accurately detect whether a target slot is already occupied by another task within a target time period; this is known as time window conflict detection. Currently, the commonly used conflict detection method is linear traversal: for each target slot, the time windows of all its assigned tasks are checked one by one to determine if there is any time overlap. This method has a time complexity of O(n), where n is the number of tasks already assigned to that slot. While this method is adequate for small-scale scheduling scenarios, as production scales up, the cumulative occupancy records for a single slot can reach hundreds or even thousands. A complete full scheduling operation requires hundreds of thousands of conflict checks, and using linear traversal would result in computation times of several hours or even tens of hours, severely limiting the practicality and interactive responsiveness of the scheduling system. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a platform time window conflict detection method, system, and electronic device based on interval trees, which reduces the time complexity of conflict detection from linear to logarithmic levels, thereby enabling scheduling systems to achieve minute-level rapid response.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: A platform time window conflict detection method based on interval tree, comprising: In response to a request to assign a target platform to a beam to be scheduled, the target platform identifier and the target time window are obtained, including the start time and the end time. Based on the target pedestal identifier, the corresponding target interval tree is located from the pre-built interval tree index. The interval tree index is used to record the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied. The historical time intervals do not overlap with each other. Use the target time window as the query interval and perform overlapping interval queries in the target interval tree; If the query result shows that there is at least one historical time interval that overlaps with the query interval, it is determined to be a time conflict and the current allocation is rejected; If the query result shows that there is no historical time interval that overlaps with the query interval, it is determined that there is no time conflict, the current allocation is allowed, and the target time window is inserted as a new node into the target interval tree.

[0006] This invention introduces an interval tree data structure into the time window conflict detection of precast beam platforms. Compared with the traditional linear traversal method, which requires comparing all historical occupied intervals one by one, this invention significantly reduces the time complexity of a single conflict detection from O(n) to O(log n), making it more suitable for the real-time response requirements in large-scale scheduling scenarios.

[0007] As a preferred option, each node in the interval tree also stores the maximum end time of all historical time intervals in the subtree rooted at that node.

[0008] This invention maintains the maximum end time attribute of the subtree at each node. Without actually visiting the subtree nodes, it can determine whether there are intervals in the subtree that may overlap with the query interval through a single numerical comparison. When the overall maximum end time of a subtree is earlier than the start time of the query interval, the end time of all intervals in the subtree is earlier than the start time of the query interval, and they cannot overlap. Therefore, the entire subtree can be pruned and skipped. Compared with the traditional linear traversal method, this greatly reduces the number of searches and improves search efficiency. With the cooperation of some judgment methods, each conflict detection only needs to visit the nodes related to the query interval to quickly locate the historical occupied intervals (historical time intervals) that overlap with the query interval.

[0009] As a preferred approach, starting from the root node, perform the following query steps: If the start time of the query interval is less than the end time of the historical time interval stored by the current node, and the end time of the query interval is greater than the start time of the historical time interval stored by the current node, then it is determined that the historical time interval stored by the current node overlaps with the query interval, and the historical time interval is recorded. If the left subtree of the current node exists and its maximum end time is less than the start time of the query interval, then skip the query of the left subtree; otherwise, recursively query the left subtree. If the start time of the historical time interval stored in the current node is not greater than the end time of the query interval, and the right subtree of the current node exists, then the right subtree is queried recursively.

[0010] Preferably, the maximum end time stored in each affected node is updated from bottom to top along the insertion path.

[0011] This invention ensures the correctness of query results in dynamic insertion scenarios by updating the maximum end time attribute. Specifically, for each node on the path, its original stored maximum end time is compared with the end time of the newly inserted node; if the latter is larger, the new value is used. This update operation has a time complexity of O(log n) and does not affect the overall algorithm efficiency.

[0012] Preferably, this method is applied to a precast beam production scheduling system, where the support platform includes a beam fabrication platform and a beam storage platform; for beam storage platforms with multi-layer beam storage capacity, the method further includes: An independent interval tree is constructed for each beam storage layer of the beam storage platform, and the mapping relationship between the platform identifier and layer number and the corresponding interval tree is recorded in the interval tree index; When allocating a time window for any storage layer of a beam storage platform, the corresponding target interval tree is located from the interval tree index based on the target platform identifier and the target layer number.

[0013] This invention provides a more suitable solution for the actual working conditions of precast beam production sites. For each storage layer of the same multi-layered storage platform where the storage status is independent and does not interfere with each other, an independent interval tree is established to store the historical time intervals of the corresponding storage layer. The interval tree index uses a combination of platform identifier and layer number as the mapping basis. When allocating a time window for a certain storage layer, the system quickly locates the dedicated interval tree for conflict detection, avoiding misjudgments caused by mixing the occupied intervals of different levels in the same interval tree. This achieves refined management of multi-layered platform resources and ensures the independent judgment of the occupancy status between layers.

[0014] The present invention also provides a platform time window conflict detection system based on interval tree, which includes: The request receiving module is used to obtain the target platform identifier and the target time window in response to the request to allocate a target platform for the beam to be scheduled. The index management module is used to maintain the interval tree index. The interval tree index records the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied. The historical time intervals do not overlap with each other. The conflict query module is used to obtain the target interval tree from the index management module based on the target pedestal identifier, and perform overlapping interval queries in the target interval tree with the target time window as the query interval. The conflict determination module is used to determine whether there is a time conflict based on the query results: if there is at least one historical time interval that overlaps with the query interval, the allocation is rejected; if there is no overlap, the allocation is allowed. The tree update module is used to insert the target time window as a new node into the target interval tree when it is determined that there is no time conflict.

[0015] This invention enables the request receiving module to interact with the scheduling engine and parse key parameters in the allocation request; the index management module, as the core storage layer, maintains a global mapping from pedestal identifiers to interval trees, supporting rapid location of the corresponding interval tree, i.e., the target interval tree, based on the pedestal identifier; the conflict query module provides a query interface based on the overlapping interval query algorithm of the interval tree, using the target time window as the query interval, and performs overlapping interval queries in the target interval tree; after obtaining the final query result, the conflict determination module determines whether there is a time conflict based on the query result and returns the decision result to the scheduling engine; finally, the book update module performs node insertion and maximum end time update maintenance work after successful allocation.

[0016] As a preferred option, each node of the interval tree also stores the maximum end time of all historical time intervals in the subtree rooted at that node. The conflict query module prunes branches using the maximum end time during the query process to skip subtrees that cannot overlap.

[0017] Preferably, the time window conflict detection system of this platform also includes a serialization module for persisting the interval tree index to the storage medium and loading and reconstructing the interval tree index from the storage medium.

[0018] This invention, through a serialization module, completely persists the in-memory range tree index to storage media such as disk. Upon system restart, the index structure is quickly loaded and rebuilt, avoiding the need to rescan historical scheduling data to construct the range tree on each startup. This improves system availability and recovery speed. Preferably, the pedestal includes a beam storage pedestal with multi-layer beam storage capability; the index management module is also used to maintain an independent interval tree for each beam storage layer of the beam storage pedestal, and record the mapping relationship between the pedestal identifier and layer number and the corresponding interval tree in the interval tree index.

[0019] Through this invention, for the specific needs of multi-layer beam storage platforms, the index management module treats each beam storage layer as an independent resource unit and maintains a separate interval tree for it. In the index mapping, the combination of platform identifier and layer number is used as the mapping basis to ensure that the interval trees between different beam storage layers are isolated from each other.

[0020] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described pedestal time window conflict detection method based on interval tree.

[0021] In summary, this invention introduces the interval tree data structure into the platform time conflict detection, reducing the time complexity of the detection algorithm from O(n) to O(log n), which greatly improves the efficiency and response speed of large-scale precast beam scheduling. Attached Figure Description

[0022] Figure 1 This is a flowchart of the platform time window conflict detection method based on interval tree in this embodiment.

[0023] Figure 2 This is a schematic diagram of the interval tree query process in this embodiment.

[0024] Figure 3 This is a schematic diagram of the interval tree structure in this embodiment.

[0025] Figure 4 This is a block diagram of the pedestal time window conflict detection system based on interval tree in this embodiment. Detailed Implementation

[0026] To further understand the content of this invention, the invention will be described in detail with reference to the embodiments. It should be understood that the embodiments are merely illustrative and not limiting of the invention.

[0027] Example 1 like Figure 1 As shown, this embodiment provides a platform time window conflict detection method based on interval tree, which includes: In response to a request to assign a target platform to a beam to be scheduled, the target platform identifier and the target time window are obtained, including the start time and the end time. Based on the target pedestal identifier, the corresponding target interval tree is located from the pre-built interval tree index. The interval tree index is used to record the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied. The historical time intervals do not overlap with each other. Use the target time window as the query interval and perform overlapping interval queries in the target interval tree; If the query result shows that there is at least one historical time interval that overlaps with the query interval, it is determined to be a time conflict and the current allocation is rejected; If the query result shows that there is no historical time interval that overlaps with the query interval, it is determined that there is no time conflict, the current allocation is allowed, and the target time window is inserted as a new node into the target interval tree.

[0028] This embodiment introduces the interval tree data structure into the time window conflict detection of precast beam abutments. Compared with the traditional linear traversal method, which requires comparing all historical occupied intervals one by one, the time complexity of a single conflict detection is significantly reduced from O(n) to O(log n), thus making it more suitable for the real-time response requirements in large-scale scheduling scenarios.

[0029] In this embodiment, each node of the interval tree also stores the maximum end time of all historical time intervals in the subtree rooted at that node.

[0030] In this embodiment, by maintaining the maximum end time attribute of the subtree at the given node, it is possible to determine whether there is a possible interval overlapping with the query interval in the subtree by a single numerical comparison without actually visiting the subtree node. When the overall maximum end time of a subtree is earlier than the start time of the query interval, the end time of all intervals in the subtree is earlier than the start time of the query interval, and no overlap is possible. Therefore, the entire subtree can be pruned and skipped. Compared with the traditional linear traversal method, this greatly reduces the number of searches and improves search efficiency. With the cooperation of some judgment methods, each conflict detection only needs to visit the node related to the query interval to quickly locate the historical occupied interval (historical time interval) that overlaps with the query interval.

[0031] like Figure 2 As shown, in this embodiment, starting from the root node, the following query steps are performed: If the start time of the query interval is less than the end time of the historical time interval stored by the current node, and the end time of the query interval is greater than the start time of the historical time interval stored by the current node, then it is determined that the historical time interval stored by the current node overlaps with the query interval, and the historical time interval is recorded. If the left subtree of the current node exists and its maximum end time is less than the start time of the query interval, then skip the query of the left subtree; otherwise, recursively query the left subtree. If the start time of the historical time interval stored in the current node is not greater than the end time of the query interval, and the right subtree of the current node exists, then the right subtree is queried recursively.

[0032] In this embodiment, the maximum end time stored in each affected node is updated from bottom to top along the insertion path.

[0033] This embodiment ensures the correctness of query results even when updating the maximum end time attribute, especially in dynamic insertion scenarios. Specifically, for each node on the path, its original stored maximum end time is compared with the end time of the newly inserted node; if the latter is larger, the new value is used instead. This update operation has a time complexity of O(log n) and does not affect the overall algorithm efficiency.

[0034] In this embodiment, the method is applied to a precast beam production scheduling system, and the platform includes a beam fabrication platform and a beam storage platform; for a beam storage platform with multi-layer beam storage capacity, the method further includes: An independent interval tree is constructed for each beam storage layer of the beam storage platform, and the mapping relationship between the platform identifier and layer number and the corresponding interval tree is recorded in the interval tree index; When allocating a time window for any storage layer of a beam storage platform, the corresponding target interval tree is located from the interval tree index based on the target platform identifier and the target layer number.

[0035] This embodiment provides a more suitable solution for the actual working conditions of precast beam production sites. For each storage layer of the same multi-layered storage platform where the storage status is independent and does not interfere with each other, an independent interval tree is established to store the historical time intervals of the corresponding storage layer. The interval tree index uses a combination of platform identifier and layer number as the mapping basis. When allocating a time window for a certain storage layer, the system quickly locates the dedicated interval tree for conflict detection to avoid misjudgment caused by mixing the occupied intervals of different levels in the same interval tree. This achieves refined management of multi-layered platform resources and ensures the independent judgment of the occupancy status between layers.

[0036] In this embodiment, the precast beam production scheduling system includes two types of platforms: beam fabrication platforms and beam storage platforms. During the initialization phase, the system creates an empty interval tree for each platform (or each beam storage layer for a platform with multi-layer beam storage capacity) and establishes an interval tree index. The interval tree index records the mapping relationship between platform identifiers and interval trees; for example, a hash mapping table can be used to implement this, allowing the corresponding interval tree to be located within a constant time based on the platform identifier. Each interval tree stores the historical time intervals during which the platform or beam storage layer has been occupied.

[0037] Each node in the interval tree stores a historical time interval, which includes a start time and an end time. The node also stores the maximum end time of all historical time intervals in the subtree rooted at that node. The historical time intervals stored in each node of the interval tree do not overlap. The interval tree is organized according to the start time of each interval; the start time of all intervals in the left subtree is less than the start time of the root node's interval, and the start time of all intervals in the right subtree is greater than the start time of the root node's interval.

[0038] like Figure 3 As shown, an exemplary interval tree structure is illustrated. Assume that the time intervals occupied by a certain platform in a certain month are [2,5], [7,9], [11,15], [17,20], [22,24], and [26,29]. After sorting by the start time of the intervals, the interval [17,20] is selected as the root node. The left subtree contains the intervals [2,5], [7,9], and [11,15] (all with start times less than 17), and the right subtree contains the intervals [22,24] and [26,29] (all with start times greater than 17).

[0039] In the left subtree, the root node is the interval [7,9], its left child is [2,5] (start time 2 < 7), and its right child is [11,15] (start time 11 > 7). In the right subtree, the root node is the interval [26,29], and its left child is [22,24] (start time 22 < 26).

[0040] The maximum end time for each node is calculated as follows: the maximum end time for leaf node [2,5] is 5; the maximum end time for leaf node [11,15] is 15; the maximum end time for leaf node [22,24] is 24; the maximum end time for node [7,9] is max(9,5,15)=15; the maximum end time for node [26,29] is max(29,24)=29; and the maximum end time for root node [17,20] is max(20,15,29)=29.

[0041] like Figure 4 As shown, this embodiment also provides a platform time window conflict detection system based on interval trees, which includes: The request receiving module is used to obtain the target platform identifier and the target time window in response to the request to allocate a target platform for the beam to be scheduled. The index management module is used to maintain the interval tree index. The interval tree index records the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied. The historical time intervals do not overlap with each other. The conflict query module is used to obtain the target interval tree from the index management module based on the target pedestal identifier, and perform overlapping interval queries in the target interval tree with the target time window as the query interval. The conflict determination module is used to determine whether there is a time conflict based on the query results: if there is at least one historical time interval that overlaps with the query interval, the allocation is rejected; if there is no overlap, the allocation is allowed. The tree update module is used to insert the target time window as a new node into the target interval tree when it is determined that there is no time conflict.

[0042] In this embodiment, the request receiving module interacts with the scheduling engine to parse key parameters in the allocation request; the index management module, as the core storage layer, maintains a global mapping from pedestal identifiers to interval trees, supporting quick location of the corresponding interval tree, i.e., the target interval tree, based on the pedestal identifier; the conflict query module provides a query interface based on the overlapping interval query algorithm of the interval tree, using the target time window as the query interval, and performs overlapping interval queries in the target interval tree; after obtaining the final query result, the conflict determination module determines whether there is a time conflict based on the query result and returns the decision result to the scheduling engine; finally, after successful allocation, the book update module performs node insertion and maximum end time update maintenance work.

[0043] In this embodiment, each node of the interval tree also stores the maximum end time of all historical time intervals in the subtree rooted at that node; when querying, the conflict query module uses the maximum end time to prune the tree to skip subtrees that cannot overlap.

[0044] In this embodiment, the time window conflict detection system of this platform also includes a serialization module, which is used to persist the interval tree index to the storage medium and load and reconstruct the interval tree index from the storage medium.

[0045] In this embodiment, the pedestal includes a beam storage pedestal with multi-layer beam storage capability; the index management module is also used to maintain an independent interval tree for each beam storage layer of the beam storage pedestal, and record the mapping relationship between the pedestal identifier and layer number and the corresponding interval tree in the interval tree index.

[0046] In this embodiment, for the specific needs of multi-layer beam storage platforms, the index management module treats each beam storage layer as an independent resource unit and maintains a separate interval tree for it. In the index mapping, the combination of platform identifier and layer number is used as the mapping basis to ensure that the interval trees between different beam storage layers are isolated from each other.

[0047] In this embodiment, when the scheduling engine needs to allocate a target pedestal to a beam to be scheduled for a certain hole, it initiates an allocation request. The request receiving module responds to the request by obtaining the target pedestal identifier and the target time window. The target time window includes the start time and the end time. The time window preferably adopts the definition of a left-closed and right-open interval, that is, the start time is included but the end time is not included, so as to allow adjacent tasks to be seamlessly connected and maximize the pedestal utilization efficiency.

[0048] Based on the obtained target pedestal identifier, the corresponding target interval tree is located from the pre-built interval tree index. Using the target time window as the query interval, an overlapping interval query is performed in the target interval tree.

[0049] Overlapping interval queries start from the root node of the target interval tree and recursively execute the following query steps: First, determine whether the historical time interval stored in the current node overlaps with the query interval. The criteria for overlap are: the start time of the query interval is less than the end time of the historical time interval stored in the current node, and the end time of the query interval is greater than the start time of the historical time interval stored in the current node. If this condition is met, it is determined to be an overlap, and the historical time interval is recorded.

[0050] Next, process the left subtree. If the left subtree of the current node exists, and the maximum end time of the left subtree is less than the start time of the query interval, it means that the end time of all intervals in the left subtree is earlier than the start time of the query interval, and there cannot be overlapping intervals. Therefore, prune the left subtree and skip the query on the left subtree. Otherwise, recursively execute the above query steps on the left subtree.

[0051] Finally, process the right subtree. If the start time of the historical time interval stored in the current node is not greater than the end time of the query interval, and the right subtree of the current node exists, it means that there may be intervals in the right subtree that overlap with the query interval. Recursively perform the above query steps on the right subtree. If the start time of the historical time interval stored in the current node is greater than the end time of the query interval, then according to the property of the interval tree being sorted by start time, the start times of all intervals in the right subtree are all greater, and they also cannot overlap. Therefore, prune the right subtree and skip the query on the right subtree.

[0052] Specifically, such as Figure 2 As shown, starting from the root node, we first take the root node as the current node: The first step is to access the current node and determine whether the historical time interval stored in the current node overlaps with the query interval. The conditions for overlap are: the start time of the query interval is less than the end time of the historical time interval stored in the current node, and the end time of the query interval is greater than the start time of the historical time interval stored in the current node. If these conditions are met, it is determined that the historical time interval stored in the node overlaps with the query interval, and the historical time interval is recorded. If these conditions are not met, it is not recorded. The second step is to process the left subtree. First, determine if the left subtree of the current node exists. If it does, further check if the maximum end time of the left subtree is less than the start time of the query interval. If the maximum end time of the left subtree is less than the start time of the query interval, it means that the end time of all intervals in the left subtree is earlier than the start time of the query interval, and there cannot be overlapping intervals. Therefore, pruning is performed, and the query of the left subtree is skipped. If the maximum end time of the left subtree is not less than the start time of the query interval, then the left subtree needs to be queried. At this point, the root node of the left subtree is taken as the new current node, and the query process of the first and second steps above is recursively executed. If the left subtree does not exist, skip the query for the left subtree. The third step is to process the right subtree. It determines whether the current node's right subtree exists (i.e., whether there is a right subtree to be queried besides the right subtrees that have already been queried or pruned). If the right subtree exists, it further determines whether the start time of the current node's interval is not greater than the end time of the query interval. If the start time of the current node's interval is greater than the end time of the query interval, then according to the property of the interval tree being sorted by start time, the start times of all intervals in the right subtree are greater, and they cannot overlap. Therefore, pruning is performed, and the query of the right subtree is skipped. Otherwise, if the right subtree exists and the start time of the current node's interval is not greater than the end time of the query interval, it means that there may be intervals in the right subtree that overlap with the query interval, and the right subtree needs to be queried. At this point, the root node of the right subtree is taken as the new current node, and the query process of the first, second and third steps above is recursively executed. If the right subtree to be queried does not exist, skip the query for the right subtree and proceed to the next step; The fourth step is to determine whether the current node is the root node. If the current node is not the root node, continue backtracking to the parent node and take the parent node of the current node as the new current node, recursively returning to the third step (i.e., processing the right subtree of the parent node) to continue execution. If the current node is the root node, it means that the query traversal of the entire tree has been completed, and the node range of all records is output as the query result, and the process ends.

[0053] This embodiment achieves efficient pruning of subtrees that cannot overlap by comparing the maximum end time attribute and the interval start time. During the query process, only local nodes that may overlap with the query interval need to be visited, and most irrelevant subtrees are skipped directly, thus stabilizing the query time complexity at the O(log n) level.

[0054] based on Figure 3 The interval tree shown, taking the query interval [8,10] as an example, the specific process is as follows: The query starts from the root node [17,20] and uses the root node as the current node.

[0055] Step 1: Access node [17,20]. The start time of the query interval is 8, which is less than its end time 20, but the end time of the query interval is 10, which is not greater than its start time 17. Therefore, the root node interval [17,20] does not overlap with the query interval [8,10], and this node is not recorded. Execute the second step: process the left subtree. The left subtree of node [17,20] exists (root is [7,9]), and the maximum end time of the left subtree, 15, is not less than the start time of the query interval, 8. Therefore, it is necessary to query the left subtree, take the left child node [7,9] as the new current node, and recursively return to the first step.

[0056] For node [7,9], perform the first step: access node [7,9]. The query interval start time 8 is less than its end time 9, and the query interval end time 10 is greater than its start time 7. It is determined that the node interval overlaps with the query interval, and the interval [7,9] is recorded. For node [7,9], perform the second step: process the left subtree. The left subtree of node [7,9] exists (root is [2,5]), but the maximum end time of the left subtree is 5, which is less than the start time of the query interval 8. Therefore, perform the pruning operation and skip the query on the left subtree. For node [7,9], perform the third step: process the right subtree. The right subtree of node [7,9] exists (root is [11,15]), and the start time 7 of node [7,9] is not greater than the end time 10 of the query interval. Therefore, the right subtree needs to be queried. Take the right child node [11,15] as the new current node and recursively return to the first step.

[0057] For node [11,15], perform the first step: visit node [11,15]. Its interval start time 11 is greater than the query interval end time 10, so they do not overlap and the node is not recorded.

[0058] For node [11,15], perform the second step: process the left subtree. Since the left subtree of node [11,15] does not exist, skip it. For node [11,15], perform the third step: process the right subtree. The right subtree of node [11,15] does not exist, so skip it. For node [11,15], perform the fourth step: since the current node is not the root node, backtrack upwards to the parent node [7,9], and set the parent node [7,9] as the new current node, recursively returning to the third step (processing the right subtree of the parent node); since the right subtree query of node [7,9] has been completed, continue to perform the fourth step: since the current node is not the root node, backtrack upwards to the root node [17,20], and set the root node as the new current node, recursively returning to the third step; For the root node [17,20], perform the third step: process the right subtree. The root node [17,20] has a right subtree (root [26,29]) that has not been queried and has not been pruned. The start time of the root node is 17, which is greater than the end time of the query interval is 10. Therefore, perform the pruning operation and skip the query of the right subtree. For the root node [17,20], perform the fourth step: the current node is the root node, and the query traversal of the entire tree is complete. Output the node range of all records as the query result, i.e., the range [7,9]. The query has ended.

[0059] In this embodiment, the entire query process utilizes the comparison between the maximum end time attribute and the interval start time, skipping the traversal of the left subtree [2,5] and the right subtree [26,29], and only visiting the root node [17,20], node [7,9] and node [11,15], thus efficiently finding the historical occupied interval that overlaps with the query interval.

[0060] This embodiment also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described pedestal time window conflict detection method based on interval tree.

[0061] The electronic device can be a standalone server, industrial control computer, or a computing node embedded in the existing information management system of the beam fabrication yard. The memory stores the computer program and the serialized interval tree index data generated during its execution. When the processor executes the program, it sequentially completes operations such as interval tree index initialization, conflict detection query, node insertion, and update, following the steps of the above method embodiment.

[0062] It is readily understood that those skilled in the art can combine, split, or reorganize the embodiments provided in this application to obtain other embodiments, all of which do not exceed the protection scope of this application.

[0063] The present invention and its embodiments have been described above illustratively. This description is not restrictive, and the embodiments shown are only part of the embodiments of the present invention. The actual structure is not limited thereto. Therefore, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the present invention, they should all fall within the protection scope of the present invention.

Claims

1. A platform time window conflict detection method based on interval tree, characterized in that, include: In response to a request to assign a target platform to a beam to be scheduled, the target platform identifier and a target time window are obtained, the target time window including a start time and an end time; Based on the target pedestal identifier, the corresponding target interval tree is located from the pre-constructed interval tree index. The interval tree index is used to record the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied. The historical time intervals do not overlap with each other. Using the target time window as the query interval, perform an overlapping interval query in the target interval tree; If the query result shows that there is at least one historical time interval that overlaps with the query interval, it is determined to be a time conflict and the allocation is rejected. If the query result shows that there is no historical time interval overlapping with the query interval, it is determined that there is no time conflict, the current allocation is allowed, and the target time window is inserted as a new node into the target interval tree.

2. The platform time window conflict detection method based on interval tree according to claim 1, characterized in that: At each node of the interval tree, the maximum end time of all historical time intervals in the subtree rooted at that node is also stored.

3. The platform time window conflict detection method based on interval tree according to claim 2, characterized in that, The step of using the target time window as the query interval and performing an overlapping interval query in the target interval tree includes: Starting from the root node, execute the following query steps: If the start time of the query interval is less than the end time of the historical time interval stored by the current node, and the end time of the query interval is greater than the start time of the historical time interval stored by the current node, then it is determined that the historical time interval stored by the current node overlaps with the query interval, and the historical time interval is recorded. If the left subtree of the current node exists and its maximum end time is less than the start time of the query interval, then skip the query of the left subtree; otherwise, recursively query the left subtree. If the start time of the historical time interval stored in the current node is not greater than the end time of the query interval, and the right subtree of the current node exists, then the right subtree is queried recursively.

4. The platform time window conflict detection method based on interval tree according to claim 2, characterized in that, After inserting the target time window as a new node into the target interval tree, the method further includes: Update the maximum end time stored in each affected node from bottom to top along the insertion path.

5. The platform time window conflict detection method based on interval tree according to claim 1, characterized in that, The method is applied to a precast beam production scheduling system, wherein the platform includes a beam fabrication platform and a beam storage platform; for a beam storage platform with multi-layer beam storage capacity, the method further includes: An independent interval tree is constructed for each beam storage layer of the beam storage platform, and the mapping relationship between the platform identifier and layer number and the corresponding interval tree is recorded in the interval tree index; When a time window is allocated to any storage layer of the beam storage platform, the corresponding target interval tree is located from the interval tree index according to the target platform identifier and the target layer number.

6. A platform time window conflict detection system based on interval tree, characterized in that, include: The request receiving module is used to obtain the target platform identifier and the target time window in response to the request to allocate a target platform for the beam to be scheduled. The index management module is used to maintain the interval tree index, which records the mapping relationship between the pedestal identifier and the interval tree. The interval tree includes multiple nodes, and each node stores the historical time interval in which the pedestal is occupied, and the historical time intervals do not overlap with each other. The conflict query module is used to obtain the target interval tree from the index management module according to the target pedestal identifier, and perform overlapping interval query in the target interval tree with the target time window as the query interval. The conflict determination module is used to determine whether there is a time conflict based on the query results: if there is at least one historical time interval that overlaps with the query interval, the allocation is rejected; if there is no overlap, the allocation is allowed. The tree update module is used to insert the target time window as a new node into the target interval tree when it is determined that there is no time conflict.

7. The platform time window conflict detection system based on interval tree according to claim 6, characterized in that: At each node of the interval tree, the maximum end time of all historical time intervals in the subtree rooted at that node is also stored. The conflict query module prunes branches using the maximum end time during the query process to skip subtrees that cannot overlap.

8. The platform time window conflict detection system based on interval tree according to claim 6, characterized in that, Also includes: A serialization module is used to persist the interval tree index to a storage medium, and to load and reconstruct the interval tree index from the storage medium.

9. The platform time window conflict detection system based on interval tree according to claim 6, characterized in that: The platform includes a beam storage platform with multi-layer beam storage capacity; The index management module is also used to maintain an independent interval tree for each beam storage layer of the beam storage platform, and to record the mapping relationship between the platform identifier and layer number and the corresponding interval tree in the interval tree index.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.