Intelligent sample bank dynamic allocation method and system fusing inspection data exchange
By unifying coding and constructing sample event chains, the association between the mother tube and the packaging tubes is restored, the upper and lower bounds of the available capacity are calculated, and task allocation is performed in conjunction with a constrained optimization model. This solves the accuracy and stability problems caused by event disorder and delay in sample allocation, and achieves efficient allocation of sample management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU RUIJIAN SOFTWARE TECHNOLOGY CO LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, during medical testing and biological sample management, sample-related events are prone to out-of-order processing, delayed status write-back, and missing events when exchanged between different systems. This results in incomplete sample associations and affects the accuracy and stability of sample allocation.
By unifying the encoding of sample event data, the association between the main tube and the packaging tube is restored, a sample event chain is constructed, and the upper and lower bounds of the available sample capacity are calculated. Task allocation is performed in combination with the minimum required volume and platform adaptation conditions, and a constraint optimization model is constructed to improve the accuracy and stability of the allocation.
Even when events arrive out of order or with delays, it can stably characterize sample availability, avoid duplicate commitments or over-conservatism, and improve the accuracy and stability of sample allocation.
Smart Images

Figure CN122158043A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical data processing technology, specifically to a method and system for dynamic allocation of intelligent sample banks that integrates test data exchange. Background Technology
[0002] In the process of medical testing and biosample management, the sample bank needs to interact with various business systems, such as laboratory information systems, test management systems, instrument middleware, and reporting systems, to support the entire process of sample management, from sample receipt, aliquoting, quality control, storage, and release to testing occupancy, testing release, retesting occupancy, and destruction. During this process, events related to the same sample are typically generated by different systems at different times and transmitted back to the sample bank system, thus forming a cross-system sample event data set.
[0003] In existing technologies, data exchange between systems often employs asynchronous transmission and phased write-back methods. This can lead to issues such as out-of-order arrival of sample-related events, delayed state write-back, and missing events when they reach the sample library system. Furthermore, after the packaging operation, the correspondence between the parent tube and the packaging tubes is not always fully recorded, or it may need to be supplemented in subsequent stages, resulting in incomplete or inconsistent relationships between samples. Under these circumstances, the sample library system receives only discrete event fragments, making it difficult to directly reflect the true overall state of the samples throughout the entire process.
[0004] In existing sample library management methods, samples are typically merged based on currently received event information to determine whether they can be used for subsequent detection tasks, and then allocated accordingly. However, due to the out-of-order arrival of events and incomplete correlations, processing based solely on local event information can easily lead to related events of the same sample not being correctly merged, or the correlation between the parent tube and the packaging tube not being effectively utilized. This results in an incomplete sample event chain and affects the accuracy of subsequent status judgments.
[0005] Furthermore, existing technologies typically characterize sample availability using deterministic remaining volume or inventory status and allocate testing tasks accordingly. However, when critical precursor events have not yet fully arrived, the true available sample capacity is uncertain: on the one hand, the available sample capacity may be overestimated due to pending testing or retesting events, leading to duplicate commitments; on the other hand, conservative processing of samples may be adopted due to the inability to confirm the preceding status, reducing sample utilization efficiency. In addition, when late or supplementary events arrive, existing methods often require extensive recalculation of the completed allocation results, affecting the stability of the allocation process.
[0006] Therefore, it is necessary to improve the above-mentioned technical problems in the existing technology in order to improve the accuracy and stability of sample allocation. Summary of the Invention
[0007] To address the technical problems mentioned in the background section, the purpose of this application is to provide a method, system, electronic device, storage medium, and program product for the dynamic allocation of an intelligent sample library that integrates test data exchange.
[0008] According to a first aspect of this application, a method for dynamic allocation of an intelligent sample library that integrates test data exchange is provided, comprising the following steps: S1 acquires sample event data from the laboratory information system, inspection management system, instrument middleware, reporting system and sample bank system, and uniformly encodes the events of sample receipt, dispensing, quality control, warehousing, warehousing, testing occupation, testing release, retesting occupation and destruction to obtain a standardized set of sample events; S2, the standardized sample event set is merged according to sample identifier and order information, and the association between the mother tube and the sub-packaging tube is restored by combining time proximity, consistency of volume change and connection relationship between previous and subsequent events. The association relationship is used to integrate the related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. S3, calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. S4 divides the interval capacity into hard occupancy capacity and soft occupancy capacity, and inputs the hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be assigned, sample retention constraints, platform adaptation conditions, timeliness requirements and rollback costs into the constraint optimization model to obtain the task allocation result.
[0009] According to a second aspect of this application, a smart sample bank dynamic allocation system integrating test data exchange is provided, the system comprising: The event standardization module is used to acquire sample event data from laboratory information systems, testing management systems, instrument middleware, reporting systems, and sample bank systems. It uniformly encodes events such as sample receipt, dispensing, quality control, warehousing, warehousing, testing occupancy, testing release, retesting occupancy, and destruction to obtain a standardized set of sample events. The association recovery and chain construction module is used to merge standardized sample event sets according to sample identifiers and order information, and restore the association between the mother tube and the sub-packaging tube by combining time proximity, consistency of volume change and connection relationship between previous and subsequent events. The association relationship is used to integrate related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. The interval capacity determination module is used to calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. The dynamic allocation module is used to divide the interval capacity into hard occupancy capacity and soft occupancy capacity. The hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be allocated, sample retention constraints, platform adaptation conditions, time requirements and rollback costs are input into the constraint optimization model to obtain the task allocation result.
[0010] According to a third aspect of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any of the preceding methods.
[0011] According to a fourth aspect of this application, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.
[0012] According to a fifth aspect of this application, a program product is provided, the program product being a computer program product, the computer program product comprising a computer program that, when executed by a processor, implements the method as described in any of the preceding claims.
[0013] Compared with existing technologies, this application introduces the causal completeness represented by the arrival status of key precursor events on the basis of the sample event chain, and expands the available sample capacity from a deterministic single value to an interval capacity with upper and lower bounds. On this basis, it further divides it into hard placeholder capacity and soft placeholder capacity, and constructs a constraint optimization model for task allocation by combining minimum demand volume, sample retention constraints, platform adaptation conditions, timeliness requirements and rollback costs. Thus, even when there is out-of-order or delayed event arrival, it can still stably represent the sample availability and achieve reasonable allocation, effectively avoiding the problems of duplicate commitments or excessive conservatism caused by incomplete information, and improving the accuracy and stability of sample allocation. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating a dynamic allocation method for an intelligent sample library that integrates test data exchange, as provided in an embodiment of this application.
[0016] Figure 2 This is a schematic diagram of the structure of an intelligent sample library dynamic allocation system 200 that integrates test data exchange, provided in an embodiment of this application.
[0017] Figure 3 This is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0019] It should be noted that in clinical testing and sample bank management, the test tube corresponding to the original collected sample is usually used as the master tube. After sample collection, depending on the needs of different testing projects, it is often necessary to separate a portion of the sample from the master tube into multiple aliquot tubes for use on different testing platforms or in different testing processes. Therefore, in actual operations, one master tube usually corresponds to multiple aliquot tubes, and each aliquot tube may subsequently undergo independent operations such as warehousing, retrieval, testing occupancy, testing release, or retesting, thus forming multiple parallel but interconnected sample flow paths.
[0020] like Figure 1 As shown in the figure, this application discloses a method for dynamic allocation of an intelligent sample library that integrates test data exchange. The method includes the following steps: S1 acquires sample event data from the laboratory information system, inspection management system, instrument middleware, reporting system and sample bank system, and uniformly encodes the events of sample receipt, dispensing, quality control, warehousing, warehousing, testing occupation, testing release, retesting occupation and destruction to obtain a standardized set of sample events; In this step, the present invention is applied to a sample management terminal, server, or integrated management platform connected to a laboratory information system, a testing management system, an instrument middleware, a reporting system, and a sample bank system. The aforementioned terminal or platform continuously receives sample-related event data from different business systems and uniformly converts heterogeneous events from different sources into standardized event records that are calculable, comparable, and traceable, so as to facilitate subsequent sample merging, correlation recovery, event chain construction, and dynamic allocation processing.
[0021] Specifically, the above sample event data includes information such as sample number, order number, application project, collection time, sample receipt time, dispensing time, sample tube number, mother tube number, dispensing tube number, event occurrence time, event type, volume change information, storage location, detection platform identifier, detection release marker, retest recall marker, and destruction marker.
[0022] The event types include at least sample receipt events, packaging events, quality control events, warehousing events, outbound events, testing occupancy events, testing release events, retesting occupancy events, and destruction events. Because different systems have different field formats, naming rules, time granularity, and write-back methods, after receiving the above event data, it is necessary to perform field mapping, time format standardization, event type normalization, volume unit standardization, and identifier field standardization processing to obtain a standardized set of sample events.
[0023] Unified coding can include: assigning a unified event identifier to each event record; marking the source system of the event; mapping business actions in each system to preset standard event categories; and uniformly defining the direction of volume change, such as recording volume increase as positive change and volume deduction, occupation or destruction as negative change.
[0024] S2, the standardized sample event set is merged according to sample identifier and order information, and the association between the mother tube and the sub-packaging tube is restored by combining time proximity, consistency of volume change and connection relationship between previous and subsequent events. The association relationship is used to integrate the related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. After obtaining the standardized set of sample events, it is necessary to further determine whether the sample events in different systems belong to the same sample flow process and restore the correspondence between the master tube and the dispensing tube. In actual testing operations, events such as sample receipt, dispensing, warehousing, testing occupancy, testing release, and retesting calls for the same sample are usually recorded in different systems, and the relationship between the master tube and the dispensing tube may have omissions, delayed write-backs, or inconsistencies in the records. Therefore, this step first merges the sample events, then restores the association between the master tube and the dispensing tube by combining time, volume, and process constraints, and on this basis, constructs a sample event chain to facilitate subsequent continuous analysis of the sample status.
[0025] In some embodiments, the standardized sample event set is merged according to sample identifier and order information, and the association between the mother tube and the packaging tube is restored by combining time proximity, consistency of volume change, and connection relationship between preceding and subsequent events, including: S21, Perform preliminary clustering of sample events in different systems based on sample identifiers and order information; In multi-system scenarios, directly determining the correspondence between the master tube and the dispensing tube for each of the full sample events is not only computationally intensive but also prone to incorrect association of events from different orders, batches, or samples. Therefore, in this step, events in the standardized sample event set are first initially merged based on sample identifiers and order information to form several candidate event sets. In other words, the events are first limited to a smaller range using sample identifiers and order information, and then subsequent association recovery is performed within that range.
[0026] The sample identifier can include at least one of the following: sample number, barcode number, test tube number, master tube number, dispensing tube number, and internal serial number; the order information can include at least one of the following: test request number, project request number, patient identifier, batch number, and submission time. In practice, an order-level event set can be constructed first based on the order information, and then further merged within each order-level event set based on the sample identifier. For situations where encoding methods differ across systems, pre-processing of field mapping, number normalization, alias replacement, or prefix / suffix cleaning can be performed to improve the consistency of subsequent clustering results.
[0027] S22, determine the temporal proximity based on the time interval between sample events in the same cluster, determine the consistency of volume change based on the matching relationship between the volume deduction, dispensing, remaining and release amounts corresponding to the sample events, and determine the connection relationship between previous and subsequent events based on the process constraints between the sample receiving, dispensing, quality control, warehousing, warehousing, detection occupation, detection release, retest occupation and destruction events. In this step, within the same initial cluster, it is necessary to further determine whether there is a real correlation between candidate mother tube events and candidate packaging tube events. To this end, this step constructs judgment indicators from three dimensions: time, volume, and process, namely, temporal proximity, consistency of volume changes, and the connection between preceding and subsequent events. These three indicators together constitute the multidimensional constraints for matching mother tube events and packaging tube events.
[0028] First, regarding temporal proximity, the occurrence times of candidate parent tube events and candidate dispensing tube events within the same cluster can be extracted, and the time difference between them can be calculated. Then, this time difference is compared with a preset time window to obtain the temporal proximity. For example, dispensing events typically occur after sample receipt or initial warehousing, and the detection occupancy events corresponding to dispensing tubes typically occur after dispensing is completed. Therefore, reasonable time windows can be set for different event type combinations based on historical business statistics. When the time difference between a parent tube event and a dispensing tube event falls within the corresponding time window, the temporal proximity is considered high; when the time difference significantly exceeds the reasonable window range, the temporal proximity is considered low. Furthermore, temporal proximity can be divided into high, medium, and low levels based on the magnitude of the time difference, or mapped to continuous scoring values.
[0029] It should be understood that temporal proximity is used to characterize the degree of closeness between two events in terms of business time sequence. Its role is to filter out candidate event pairs that are continuous in time, and to avoid misjudging events that span batches, cycles, or even orders as having a parent-subsidiary relationship simply because of the similarity of local fields.
[0030] Secondly, regarding the consistency of volume changes, the consistency of volume relationships between candidate events can be verified based on the volume change chain. Specifically, the volume reduction corresponding to the candidate mother tube event and the dispensing amount, remaining amount, and release amount corresponding to the candidate dispensing tube event are extracted, and a sample volume evolution relationship chain is constructed. This volume evolution relationship chain includes at least three levels of matching relationships: (1) the matching relationship between the mother tube volume reduction and the dispensing amount of each corresponding dispensing tube; (2) the matching relationship between the occupancy and release amount of the dispensing tube in the subsequent detection occupancy and detection release process; and (3) the matching relationship between the remaining amount recorded by the mother tube or dispensing tube at a certain point in time and the theoretical remaining amount calculated based on the historical volume changes.
[0031] For example, if a main tube records a volume reduction at a certain point in time, and two dispensing tubes record dispensing amounts around the same time, the difference between the main tube's volume reduction and the sum of the dispensing amounts from the two dispensing tubes can be compared. Another example is if a dispensing tube experiences both detection of occupancy and detection of release, and the previously recorded occupancy and subsequent release amounts can be compared to see if there is a significant contradiction. Yet another example is that the theoretical remaining amount can be calculated sequentially from the dispensing amount, occupancy amount, and release amount, and compared with the remaining amount recorded by the system. If all the above differences are within the preset tolerance range, the consistency of volume change can be considered valid; if any key relationship deviates significantly, the matching confidence of the corresponding candidate event pair is reduced, or it is directly determined that it does not meet the volume consistency condition.
[0032] It should be understood that volume change consistency is used to characterize the degree of physical self-consistency of different events in the process of sample volume evolution. Its role is to ensure that the correlation between the parent tube and the dispensing tube is not only similar in time, but also reasonable in terms of volume flow. By introducing a complete closed-loop constraint of volume deduction, dispensing volume, remaining volume, and release volume, the bias caused by judging based solely on local volume information can be avoided, thereby improving the accuracy and stability of the parent-dispensing tube correlation recovery.
[0033] Secondly, regarding the sequential relationships between events, event flow constraint rules can be pre-constructed to describe the legitimate sequential relationships between events such as sample receipt, packaging, quality control, warehousing, outbound, testing occupation, testing release, retesting occupation, and destruction. In specific implementation, a flow constraint table can be established between event types. For example, sample receipt can precede packaging, packaging can precede the testing occupation event corresponding to the packaging tube, warehousing can precede outbound or testing occupation, testing occupation can precede testing release, testing release can precede retesting occupation, and destruction occurs at the end of the sample flow process. Afterward, the event type combinations and their time order of candidate event pairs are validated. When two events satisfy the pre-defined flow constraints, the sequential relationship between the events is determined to be valid; when their order violates the business process logic, it is determined to be a process conflict. For cases where there is a write-back out-of-order situation but the business process itself is valid, it can also be marked by process priority to provide a basis for subsequent sorting and rearrangement.
[0034] It should be understood that the connection between preceding and subsequent events is used to characterize the logical consistency between candidate events in the business process. Its role is to eliminate candidate event combinations that are close in time or even partially matched in size, but cannot be valid in the business process, thereby avoiding interference with the associated recovery caused by abnormal order due to asynchronous system write-back, manual supplementation, or delayed synchronization.
[0035] S23, based on the time proximity, the consistency of volume change, and the connection between preceding and subsequent events, match the mother tube event and the packaging tube event to obtain the association between the mother tube and the packaging tube.
[0036] In this step, based on the aforementioned temporal proximity, volume change consistency, and sequential event connections, candidate mother tube events and candidate packaging tube events within the same cluster are comprehensively matched to restore the actual correspondence between the mother tube and the packaging tube. It is understood that a candidate event pair is only considered to have a valid association if it satisfies the temporal proximity condition, the volume change consistency constraint, and the logical flow of the process.
[0037] In practice, matching conditions or scoring rules can be set for time proximity, consistency of volume change, and connection between preceding and following events, and then the determination of whether to establish an association is made based on the comprehensive judgment result. For example, when the time proximity reaches a preset threshold, the consistency of volume change is established, and the connection between preceding and following events is established, the association between the mother tube and the sub-tube is directly established; for multiple candidate sub-tubes that simultaneously meet the basic conditions, the optimal association combination can be selected according to the comprehensive matching score. For scenarios where one mother tube corresponds to multiple sub-tubes, this application allows the establishment of a one-to-many association; for complex situations involving multiple sub-packaging, batch write-back, or different testing platforms occupying different areas, the corresponding association can be restored according to the sub-packaging time point, sub-packaging volume segmentation, or testing purpose.
[0038] In some embodiments, the associated relationships are used to integrate related events of the same parent tube and its sub-tubes and connect them in chronological order to obtain a sample event chain, including: S24. Based on the relationship between the mother tube and the dispensing tube, determine the set of associated dispensing tubes corresponding to the same mother tube, and classify the sample receiving event, dispensing event, quality control event, warehousing event, outbound event, detection occupation event, detection release event, retest occupation event and destruction event corresponding to the mother tube and associated dispensing tubes into the same associated sample set; Although the mother tube and the dispensing tubes appear as different test tubes in terms of physical carriers, they essentially originate from the same original sample. Subsequent detection usage, release, retesting, and even destruction all collectively affect the overall availability of this original sample resource. If the mother tube events and each dispensing tube event are still stored separately and analyzed in isolation, it will still be impossible to grasp the overall state evolution of this group of related samples throughout the entire process. Therefore, it is necessary to further develop a set of related samples based on the existing relationships.
[0039] Specifically, based on the association between the parent tube and the sub-tubes, a set of associated sub-tubes corresponding to the same parent tube is determined. This set of associated sub-tubes refers to the collection of all sub-tubes generated from the same parent tube or those determined in step S23 to have a valid correspondence with that parent tube. If a parent tube corresponds to only one sub-tube, the set of associated sub-tubes contains only one sub-tube; if a parent tube corresponds to multiple sub-tubes, the set includes all sub-tubes with a valid matching relationship to that parent tube. For cases involving multiple repackaging, batch repackaging, or sub-tubes generated sequentially within different time windows, multiple sub-tubes can be grouped into the same set of associated sub-tubes based on the repackaging time, repackaging volume segmentation, or testing purpose, according to the same parent tube origin.
[0040] After determining the associated repackaging tube set, the sample receiving event, repackaging event, quality control event, warehousing event, outbound event, testing occupation event, testing release event, retest occupation event, and destruction event corresponding to the mother tube and associated repackaging tubes are grouped into the same associated sample set.
[0041] Among them, the sample receipt event is used to characterize the starting point of the sample entering the system processing flow; the dispensing event is used to characterize the behavior of transferring volume resources from the main tube to one or more dispensing tubes; the quality control event is used to characterize whether the sample meets the subsequent use conditions; the warehousing event and the outbound event are used to characterize the switching between the inventory state and the call state of the sample; the detection occupancy event and the detection release event are used to characterize the use and release of the sample during the detection process; the retest occupancy event is used to characterize the situation where the sample is called again after the initial detection due to review, additional items or abnormal results; and the destruction event is used to characterize the termination of the sample circulation.
[0042] By unifying these events into the same set of related samples, it is possible to transform the local state records that were originally scattered in different systems into a complete set of events surrounding the same related sample entity.
[0043] For example, after receiving the sample, a master tube completes its initial storage and is subsequently aliquoted into two dispensing tubes. The first dispensing tube is occupied by the biochemical platform and then released, while the second dispensing tube is occupied by the immunoassay platform and subsequently triggers a retest. The master tube itself still retains a certain volume of sample. In this case, analyzing only the detection occupancy event of a single dispensing tube only yields a partial picture. However, by establishing a set of associated samples, all events corresponding to the master tube, the first dispensing tube, and the second dispensing tube can be included, thus comprehensively reflecting the circulation of the same original sample under multiple carrier, multiple platform, and multiple application conditions.
[0044] S25. Sort the events in the associated sample set according to the time of occurrence of the events. When there are time conflict events, rearrange the conflict events according to the process priority between event types, and connect the sorted events in sequence to obtain a sample event chain that reflects the sample flow process.
[0045] While the associated sample set has clearly defined the scope of events, it is still merely a summary of which events a single associated sample entity is involved in; it cannot directly reflect the chronological relationship and state progression logic of these events within the business process. Therefore, it is necessary to sort, resolve conflicts, and chain the events in the associated sample set.
[0046] Specifically, events in the associated sample set are sorted according to their occurrence time to form an initial time series. The event occurrence time can be a standardized time field that has been uniformly encoded and retained, such as a preset priority field from the event business occurrence time, system reception time, and write-back time. In general, sorting based on event occurrence time can obtain a reasonable sequence of events; for example, sample receipt events usually precede warehousing events, packaging events usually precede the detection occupancy events corresponding to the packaging tubes, and detection release events usually follow the corresponding detection occupancy events.
[0047] However, in scenarios involving asynchronous data exchange across multiple systems, simply relying on the time field for sorting may not fully reflect the actual business sequence. On one hand, the write-back time of different systems may not align with the actual time of the business transaction; on the other hand, some events may enter the system through supplementary recording, batch synchronization, or delayed transmission, leading to time conflicts. For example, a detection occupancy event for a certain packaging tube may be written to the system earlier than its corresponding packaging event, or a detection release event may enter the system later than a subsequent retest occupancy event due to delayed synchronization. For such time-conflicting events, directly sorting by the original time would disrupt the logical continuity of the event chain.
[0048] Therefore, when time-conflicting events occur, they need to be rearranged according to the process priority between event types. Process priority refers to the inherent hierarchical relationship between different event types within the business process. For example, sample receipt takes precedence over packaging, packaging takes precedence over the corresponding warehousing or testing occupancy events, testing occupancy takes precedence over testing release, testing release takes precedence over retesting occupancy, and destruction events are typically located at the end of the entire sample flow process. By pre-setting these process priorities, even if the write or return times of some events are reversed when time conflicts occur, their order can still be corrected according to business logic, thus making the final sorting result closer to the actual sample flow process.
[0049] After completing the time sorting and conflict rearrangement, the sorted events are sequentially connected to obtain a sample event chain reflecting the sample flow process. Sequential connection means organizing events in the same related sample set into a chain structure according to the corrected order, so that each event is positioned between specific preceding and succeeding events, thus continuously reflecting the evolution of the sample state at each stage. For example, a typical sample event chain can be represented sequentially as: sample receipt → warehousing → packaging → packaging tube warehousing → detection of occupancy → detection of release → retesting of occupancy → destruction. Of course, in different business scenarios, the specific chain may vary depending on the actual events present, but the core principle is that the event chain should maintain temporal continuity and consistency in business logic.
[0050] It should be understood that the sample event chain is used to reflect the complete state change process of the same associated sample entity from entering the system to finally leaving the system.
[0051] S3, calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. Even if the sample event chain has been constructed, some key precursor events in the chain may not have arrived due to reasons such as delayed write-back, supplementary recording, or batch synchronization. If the available capacity of the sample is calculated directly based on the currently seen events, two types of problems may occur: (1) some occupancy events that have not yet arrived are not included, resulting in an overestimation of the available capacity; (2) events that have not yet arrived but may release capacity are treated too conservatively, resulting in an underestimation of the available capacity. Therefore, this step first calculates the arrival status of key precursor events, then forms the causal completeness based on the arrival status, and further determines the upper and lower bounds of the available capacity of the sample, thereby expanding the current available state of the sample from a single-value representation to an interval capacity representation.
[0052] In some embodiments, the arrival status of key precursor events in the sample event chain is calculated to obtain the causal completeness of each sample event chain, and the upper and lower bounds of the available capacity of each sample are calculated accordingly, including: S31, for the current unassigned state in the sample event chain, determine the set of key precursor events corresponding to it, count the number of events that have arrived and the number of expected events in the set of key precursor events, and calculate the causal completeness. In this step, for the current unallocated state in the sample event chain, a set of key precursor events corresponding to it is determined. Key precursor events are those events that, once reached or not reached, directly affect the determination of the current sample's availability. For example, when a sample is about to be reallocated for detection, the key precursor events directly related to its current state typically include: detection occupancy events that have occurred but not yet fully released, detection release events that have occurred, retest occupancy events that have been triggered, confirmed destruction events, and other key state events related to the sample's volume resource pool.
[0053] It should be understood that events that only have a supplementary role in information display but do not substantially change the current available capacity of the sample can be excluded from the set of key precursor events.
[0054] After determining the set of key precursor events, the number of arrived events and the number of expected events in the set are further counted. Arrived events refer to events that have been received and uniformly encoded by the system at the current judgment point and have successfully entered the corresponding sample event chain. Expected events refer to events that, based on business rules, sample historical flow paths, and event chain structure, should theoretically have already occurred or should have been written back before the current state is formed. For example, if a detection occupancy event has occurred, a corresponding release event is usually expected to follow; if a retest task has been triggered, a retest occupancy event is usually expected to enter the chain.
[0055] Based on this, causal completeness is calculated. In practice, the ratio between the number of arrived events and the expected number of events can be used as the causal completeness. Alternatively, different weights can be assigned to different types of key precursor events to highlight the importance of certain events in state determination. For example, the impact of occupancy and destruction events on available capacity is usually stronger than that of general auxiliary state events, and therefore can be assigned higher weights. It should be understood that causal completeness characterizes the extent to which key precursor information related to the current pending allocation state has been closed.
[0056] S32, determine the lower bound of the available capacity of the sample based on the confirmed arrival of the detection occupancy event, detection release event, re-detection occupancy event and destruction event, and in combination with the causal integrity, and determine the upper bound of the available capacity of the sample based on the confirmed arrival of the event, the potential impact range of the non-arrival of the key precursor event and the causal integrity.
[0057] When determining the lower bound of available capacity, the sample volume is calculated based on the confirmed arrival of detection occupancy events, detection release events, retest occupancy events, and destruction events to obtain the initial available capacity result. Specifically, the volume corresponding to detection occupancy events and retest occupancy events is deducted, the volume corresponding to destruction events is deducted, and the volume corresponding to detection release events is replenished.
[0058] Based on this, the lower bound is further modified in conjunction with the aforementioned causal completeness. It is understood that a high causal completeness indicates that most critical precursor events have arrived, and the initial calculation results are highly reliable and can be directly used as the lower bound of available capacity. Conversely, a low causal completeness indicates that many critical precursor events have not yet arrived, requiring a conservative contraction of the initial results to avoid overestimating capacity due to potential unarrived occupancy events. For example, the lower bound of available capacity can be adjusted by deducting from the number or proportion of unarrived critical precursor events to obtain a more robust minimum available capacity.
[0059] When determining the upper bound of available capacity, in addition to the capacity formed by the confirmed arrival events, a comprehensive analysis is needed, taking into account the potential impact range of unarrived key precursor events and the aforementioned causal completeness. Specifically, for unarrived key precursor events, it is necessary to determine their potential increase or decrease in volume based on their event type, and to constrain this potential impact in conjunction with the causal completeness. It is understandable that when the causal completeness is high, the number of unarrived key precursor events is small, and their potential impact range is small, thus the difference between the upper and lower bounds of available capacity is small; when the causal completeness is low, the number of unarrived key precursor events is large, and their potential impact is more uncertain, thus requiring an expansion of the adjustment range of the upper bound of available capacity to cover possible capacity variation intervals.
[0060] For example, if the initial available capacity of a sample is calculated to be 240 μL, and the causal integrity is high, this value can be directly used as the lower bound, and the upper bound can be slightly increased only when there is a clear unreached release event. If the causal integrity is low, and there are multiple unreached detection release events and retest occupancy events, the potential increase and potential decrease can be estimated on this basis, thus forming a wider range.
[0061] S4 divides the interval capacity into hard occupancy capacity and soft occupancy capacity, and inputs the hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be assigned, sample retention constraints, platform adaptation conditions, timeliness requirements and rollback costs into the constraint optimization model to obtain the task allocation result.
[0062] Since available capacity is represented in interval form, with its lower bound defining the available portion and its upper bound reflecting the potential available space, directly allocating capacity as a single unit can easily lead to allocation conflicts or frequent rollbacks when events are delayed or the state is updated. Therefore, this step splits the interval capacity into hard-placement capacity and soft-placement capacity, and constructs a constrained optimization model under multiple constraints, thereby improving sample utilization efficiency while ensuring allocation stability.
[0063] In some embodiments, the interval capacity is divided into hard occupancy capacity and soft occupancy capacity. The hard occupancy capacity, soft occupancy capacity, and the minimum required volume, sample retention constraints, platform adaptation conditions, timeliness requirements, and rollback costs of the detection tasks to be assigned are input into a constraint optimization model to obtain the task allocation results, including: S41, the lower bound of the available capacity in the interval capacity is determined as the hard occupancy capacity, and the difference between the upper bound of the available capacity and the lower bound of the available capacity is determined as the soft occupancy capacity. In this step, the obtained interval capacity is structurally decomposed. The lower bound of the available capacity is the result after confirming the arrival of events and correcting for causal completeness. It can represent the portion of capacity that is stably available under the current information conditions and is not affected by subsequent delayed events. Therefore, it is determined as hard placeholder capacity. The difference between the upper bound and the lower bound of the available capacity reflects the uncertain capacity space caused by the absence of key precursor events. Whether this portion of capacity is available depends on the actual arrival of subsequent events. Therefore, it is determined as soft placeholder capacity.
[0064] The size of the soft occupancy capacity can be correlated with the degree of causal completeness. When the causal completeness is high, the number of missing key precursor events is small, their potential impact range is small, and the difference between the upper and lower bounds of the interval capacity is small, corresponding to a smaller soft occupancy capacity. Conversely, when the causal completeness is low, the number of missing key precursor events is large, their potential impact uncertainty is large, and the interval span increases, corresponding to an increase in the soft occupancy capacity. Thus, the soft occupancy capacity can reflect the degree of uncertainty of the current sample state.
[0065] Understandably, hard placeholder capacity is used to characterize capacity resources that can be stably allocated and do not require rollback adjustments after task allocation; soft placeholder capacity is used to characterize capacity resources that can be attempted to be utilized but are at risk, and need to be constrained by rollback costs during task allocation.
[0066] S42, for the detection tasks to be assigned, select samples that meet the platform adaptation conditions and timeliness requirements, and use the hard space capacity, soft space capacity, minimum required volume, sample retention constraints and rollback costs of the samples as input parameters of the constraint optimization model to construct a set of task allocation constraints and allocation schemes. In this step, the capacity information on the sample side and the demand information on the task side are modeled in a unified manner. Specifically, candidate samples are selected from the sample set based on platform compatibility conditions and timeliness requirements. Among them, platform compatibility conditions are used to limit the matching relationship between samples and detection equipment, such as different detection items corresponding to different instrument platforms, different test tube types, or different pretreatment requirements; timeliness requirements are used to limit whether the sample still has detection validity within the current time window, such as whether it has exceeded the stable storage time or whether it meets the emergency priority treatment requirements.
[0067] After obtaining candidate samples, a constrained optimization model is constructed using the hard space capacity, soft space capacity, minimum required volume on the task side, retention constraints, and rollback costs of each sample as input parameters. Specifically: the minimum required volume constrains the total volume of allocated samples to meet task execution requirements; the retention constraint limits the minimum volume of samples that must be retained after allocation to meet subsequent retesting or quality control needs; hard space capacity provides deterministically available resources; soft space capacity provides scalable resources; and rollback costs quantify the potential risks associated with using soft space capacity.
[0068] When constructing task allocation constraints, hard and soft placeholder capacities can be differentiated. For example, it can be required that at least a portion of the demand in the allocation scheme be met by hard placeholder capacity to ensure basic stability, while allowing the use of soft placeholder capacity for supplementation when rollback cost constraints are met. Furthermore, different usage weights or usage limits can be set for the soft placeholder capacity of different samples based on their importance, task priority, or causal completeness.
[0069] Based on this, multiple allocation schemes that satisfy the basic constraints can be generated by combining candidate samples, thus forming a set of allocation schemes.
[0070] S43, Solve the constrained optimization model. Under the conditions of satisfying the minimum required volume and the retention constraint, compare the rollback costs corresponding to different allocation schemes in the allocation scheme set to determine the task allocation result.
[0071] In this step, after constructing the allocation scheme set, each candidate allocation scheme is further evaluated and selected. Specifically, under the premise of meeting the minimum required volume and retention constraints, the rollback cost corresponding to each allocation scheme is calculated, and the schemes are ranked or compared based on the rollback cost.
[0072] Understandably, rollback costs reflect the adjustment costs incurred when allocation fails due to the absence of critical precursor events after using soft placeholder capacity. These costs may include reselecting samples, rescheduling detection tasks, delaying detection time, or impacting downstream processes. Therefore, the more soft placeholder capacity used, or the higher the uncertainty of the samples involved, the higher the corresponding rollback cost.
[0073] Furthermore, the rollback cost can be used as the optimization objective function, and the optimal allocation scheme can be selected by minimizing the rollback cost; alternatively, provided that the rollback cost does not exceed a preset threshold, the scheme with higher sample utilization or shorter task completion time can be prioritized. For allocation schemes built entirely on hard placeholder capacity, the rollback cost is usually low or zero, but it may not be able to fully utilize resources; while schemes that moderately introduce soft placeholder capacity, although carrying certain risks, can significantly improve sample utilization efficiency.
[0074] Therefore, by comparing the rollback costs of different allocation schemes, a trade-off can be struck between allocation stability and resource utilization, thereby determining the final task allocation result.
[0075] Reference Figure 2 As shown in the illustration, this application also provides an intelligent sample library dynamic allocation system 200 that integrates test data exchange, the system comprising: Event standardization module 10 is used to acquire sample event data from laboratory information system, inspection management system, instrument middleware, reporting system and sample library system, and uniformly encode events such as sample receipt, packaging, quality control, warehousing, warehousing, testing occupation, testing release, retesting occupation and destruction to obtain a standardized sample event set; The association recovery and chain construction module 20 is used to merge the standardized sample event set according to the sample identifier and order information, and restore the association between the mother tube and the sub-packaging tube by combining the time proximity, volume change consistency and the connection relationship between the preceding and following events. The association relationship is used to integrate the related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. The interval capacity determination module 30 is used to calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. The dynamic allocation module 40 is used to divide the interval capacity into hard occupancy capacity and soft occupancy capacity, and input the hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be allocated, sample retention constraints, platform adaptation conditions, time requirements and rollback costs into the constraint optimization model to obtain the task allocation result.
[0076] In some embodiments, the association recovery and chain building module 20 includes: The preliminary clustering unit 201 is used to perform preliminary clustering of sample events in different systems based on sample identifiers and order information; The association feature determination unit 202 is used to determine the temporal proximity based on the time interval between sample events in the same cluster, determine the consistency of volume change based on the matching relationship between the volume deduction, dispensing, remaining and release corresponding to the sample events, and determine the connection relationship between previous and subsequent events based on the previous and subsequent process constraints between the events of sample receipt, dispensing, quality control, warehousing, warehousing, detection occupation, detection release, retest occupation and destruction. The association matching unit 203 is used to match the mother tube event and the packaging tube event according to the time proximity, the consistency of volume change and the connection relationship between the preceding and following events, so as to obtain the association relationship between the mother tube and the packaging tube.
[0077] In some embodiments, the association recovery and chain building module 20 further includes: The associated sample set determination unit 204 is used to determine the associated sub-tube set corresponding to the same mother tube based on the association relationship between the mother tube and the sub-tube, and to classify the sample receiving event, sub-packaging event, quality control event, warehousing event, outbound event, detection occupation event, detection release event, retest occupation event and destruction event corresponding to the mother tube and the associated sub-tube into the same associated sample set; The event chain generation unit 205 is used to sort the events in the associated sample set according to the event occurrence time. When there are time conflict events, the conflict events are rearranged according to the process priority between event types, and the sorted events are connected in sequence to obtain a sample event chain that reflects the sample flow process.
[0078] In some embodiments, the interval capacity determination module 30 is configured to: For the current unassigned state in the sample event chain, determine the set of key precursor events corresponding to it, count the number of events that have arrived and the number of expected events in the set of key precursor events, and calculate the causal completeness. The lower bound of the available sample capacity is determined based on the confirmed arrival of detection occupancy events, detection release events, re-occupancy events, and destruction events, in conjunction with the causal integrity; and the upper bound of the available sample capacity is determined based on the confirmed arrival of events, the potential impact range of non-arrival of key precursor events, and the causal integrity.
[0079] In some embodiments, the dynamic allocation module 40 includes: The capacity partitioning unit 401 is used to determine the lower bound of the available capacity in the interval capacity as the hard occupancy capacity, and to determine the difference between the upper bound of the available capacity and the lower bound of the available capacity as the soft occupancy capacity. The model building unit 402 is used to screen samples that meet the platform adaptation conditions and timeliness requirements for the detection tasks to be assigned, and to use the hard space capacity, soft space capacity, minimum required volume, sample retention constraints and rollback costs of the samples as input parameters of the constraint optimization model to build a set of task allocation constraints and allocation schemes. The result determination unit 403 is used to solve the constraint optimization model. Under the condition of satisfying the minimum required volume and the retention constraint, it compares the rollback costs corresponding to different allocation schemes in the allocation scheme set and determines the task allocation result.
[0080] like Figure 3 As shown, this application embodiment also provides an electronic device 300, including a memory 302, a processor 301, and a computer program stored in the memory 302 and executable on the processor 301. When the processor 301 executes the program, it implements the method described in any of the preceding methods.
[0081] The electronic device can be a server, cloud platform node, laboratory information management terminal, or other computing device with data processing capabilities, used to realize the access, processing, and task allocation decision of multi-system sample event data. The memory 302 can be random access memory (RAM), read-only memory (ROM), flash memory, or other forms of non-volatile storage media, used to store computer programs and related intermediate data. The processor 301 can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device.
[0082] Optionally, the electronic device may also include a communication interface 303 for data interaction with a laboratory information system, a test management system, an instrument middleware, a reporting system, and a sample bank system; it may also include a bus structure 304 for connecting the processor 301, the memory 302, and the communication interface 303, thereby realizing data transmission and control.
[0083] This application also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.
[0084] This application also provides a program product, which is a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the method described in any of the preceding claims.
[0085] The above description is the preferred embodiment of this application. It should be noted that, for those skilled in the art, various improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A method for dynamic allocation of an intelligent sample library that integrates test data exchange, characterized in that, Includes the following steps: S1 acquires sample event data from the laboratory information system, inspection management system, instrument middleware, reporting system and sample bank system, and uniformly encodes the events of sample receipt, dispensing, quality control, warehousing, warehousing, testing occupation, testing release, retesting occupation and destruction to obtain a standardized set of sample events; S2, the standardized sample event set is merged according to sample identifier and order information, and the association between the mother tube and the sub-packaging tube is restored by combining time proximity, consistency of volume change and connection relationship between previous and subsequent events. The association relationship is used to integrate the related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. S3, calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. S4 divides the interval capacity into hard occupancy capacity and soft occupancy capacity, and inputs the hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be assigned, sample retention constraints, platform adaptation conditions, timeliness requirements and rollback costs into the constraint optimization model to obtain the task allocation result.
2. The method for dynamic allocation of an intelligent sample database for integrated test data exchange according to claim 1, characterized in that, The standardized sample event set is merged according to sample identifier and order information, and the association between the mother tube and the dispensing tube is restored by combining time proximity, consistency of volume change, and connection between successive events, including: S21, Perform preliminary clustering of sample events in different systems based on sample identifiers and order information; S22, determine the temporal proximity based on the time interval between sample events in the same cluster, determine the consistency of volume change based on the matching relationship between the volume deduction, dispensing, remaining and release amounts corresponding to the sample events, and determine the connection relationship between previous and subsequent events based on the process constraints between the sample receiving, dispensing, quality control, warehousing, warehousing, detection occupation, detection release, retest occupation and destruction events. S23, based on the time proximity, the consistency of volume change, and the connection between preceding and subsequent events, match the mother tube event and the packaging tube event to obtain the association between the mother tube and the packaging tube.
3. The method for dynamic allocation of an intelligent sample library with integrated test data exchange according to claim 2, characterized in that, By integrating related events of the same parent tube and its sub-tubes using the aforementioned relationships and connecting them in chronological order, a sample event chain is obtained, including: S24. Based on the relationship between the mother tube and the dispensing tube, determine the set of associated dispensing tubes corresponding to the same mother tube, and classify the sample receiving event, dispensing event, quality control event, warehousing event, outbound event, detection occupation event, detection release event, retest occupation event and destruction event corresponding to the mother tube and associated dispensing tubes into the same associated sample set; S25. Sort the events in the associated sample set according to the time of occurrence of the events. When there are time conflict events, rearrange the conflict events according to the process priority between event types, and connect the sorted events in sequence to obtain a sample event chain that reflects the sample flow process.
4. The method for dynamic allocation of an intelligent sample library for integrated test data exchange according to claim 1, characterized in that, Calculate the arrival status of key precursor events in the sample event chain to obtain the causal completeness of each sample event chain, and based on this, calculate the upper and lower bounds of the available capacity of each sample, including: S31, for the current unassigned state in the sample event chain, determine the set of key precursor events corresponding to it, count the number of events that have arrived and the number of expected events in the set of key precursor events, and calculate the causal completeness. S32, determine the lower bound of the available capacity of the sample based on the confirmed arrival of the detection occupancy event, detection release event, re-detection occupancy event and destruction event, and in combination with the causal integrity, and determine the upper bound of the available capacity of the sample based on the confirmed arrival of the event, the potential impact range of the non-arrival of the key precursor event and the causal integrity.
5. The method for dynamic allocation of an intelligent sample library for integrated test data exchange according to claim 1, characterized in that, The interval capacity is divided into hard occupancy capacity and soft occupancy capacity. The hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection tasks to be assigned, sample retention constraints, platform adaptation conditions, timeliness requirements, and rollback costs are input into the constraint optimization model to obtain the task allocation results, including: S41, the lower bound of the available capacity in the interval capacity is determined as the hard occupancy capacity, and the difference between the upper bound of the available capacity and the lower bound of the available capacity is determined as the soft occupancy capacity. S42, for the detection tasks to be assigned, select samples that meet the platform adaptation conditions and timeliness requirements, and use the hard space capacity, soft space capacity, minimum required volume, sample retention constraints and rollback costs of the samples as input parameters of the constraint optimization model to construct a set of task allocation constraints and allocation schemes. S43, Solve the constrained optimization model. Under the conditions of satisfying the minimum required volume and the retention constraint, compare the rollback costs corresponding to different allocation schemes in the allocation scheme set to determine the task allocation result.
6. A dynamic allocation system for an intelligent sample bank that integrates test data exchange, characterized in that, The system includes: The event standardization module is used to acquire sample event data from laboratory information systems, testing management systems, instrument middleware, reporting systems, and sample bank systems. It uniformly encodes events such as sample receipt, dispensing, quality control, warehousing, warehousing, testing occupancy, testing release, retesting occupancy, and destruction to obtain a standardized set of sample events. The association recovery and chain construction module is used to merge standardized sample event sets according to sample identifiers and order information, and restore the association between the mother tube and the sub-packaging tube by combining time proximity, consistency of volume change and connection relationship between previous and subsequent events. The association relationship is used to integrate related events of the same mother tube and its sub-packaging tubes and connect them in time order to obtain the sample event chain. The interval capacity determination module is used to calculate the arrival status of key precursor events in the sample event chain, obtain the causal completeness of each sample event chain, and calculate the upper and lower bounds of the available capacity of each sample to obtain the interval capacity. The dynamic allocation module is used to divide the interval capacity into hard occupancy capacity and soft occupancy capacity. The hard occupancy capacity, soft occupancy capacity, minimum required volume of the detection task to be allocated, sample retention constraints, platform adaptation conditions, time requirements and rollback costs are input into the constraint optimization model to obtain the task allocation result.
7. The intelligent sample library dynamic allocation system for integrated test data exchange according to claim 6, characterized in that, The association recovery and chain construction module includes: The preliminary clustering unit is used to perform preliminary clustering of sample events in different systems based on sample identifiers and order information; The association feature determination unit is used to determine the temporal proximity based on the time interval between sample events in the same cluster, determine the consistency of volume change based on the matching relationship between the volume deduction, dispensing, remaining and release amounts corresponding to the sample events, and determine the connection relationship between previous and subsequent events based on the process constraints between the sample receiving, dispensing, quality control, warehousing, warehousing, detection occupancy, detection release, retesting occupancy and destruction events. The association matching unit is used to match the mother tube event and the packaging tube event based on the time proximity, the consistency of the volume change, and the connection relationship between the preceding and following events, so as to obtain the association relationship between the mother tube and the packaging tube.
8. An electronic device, characterized in that, It includes 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 method as described in any one of claims 1-5.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.
10. A program product, characterized in that, The program product is a computer program product, which includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-5.