Multi-parameter collaborative optimization and control method for solution preparation workstation
By constructing a cross-task time conflict tensor and a time gradient field, optimizing the solution preparation time point, and combining the historical costs of the executors, the problems of task conflict and unreasonable resource scheduling in the hospital solution preparation workstation were solved, achieving balanced control of solution preparation time and efficiency improvement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE FIRST MEDICAL CENT CHINESE PLA GENERAL HOSPITAL
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-02
AI Technical Summary
The existing scheduling and management methods for hospital infusion workstations lack detailed analysis of the time characteristics of infusion tasks, resulting in uneven workload of infusion personnel, unreasonable resource allocation, and affecting infusion efficiency and medication safety. In particular, task conflicts and resource competition are prone to occur during peak periods.
By constructing a cross-task time conflict tensor, identifying conflict coupling patterns, calculating coupling strength, generating a time gradient field, applying time offsets, optimizing the liquid preparation time point, and combining the historical task switching time costs of the executors, a task allocation scheme is generated, and the allocation scheme with the minimum total time cost is selected.
It achieves balanced control of solution preparation time, reduces execution delays and error risks, improves the overall throughput and reliability of solution preparation, makes full use of pharmacists' professional skills, and improves the efficiency of medical resource allocation.
Smart Images

Figure CN122135909A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated drug dispensing technology, and in particular to a method for multi-parameter collaborative optimization and control of a liquid dispensing workstation. Background Technology
[0002] With the rapid development of modern medical services and the increasing demand for refined management, hospital infusion preparation stations, as the core operational unit of hospital pharmacies, undertake critical medical support tasks such as prescription drug preparation, intravenous infusion preparation, and chemotherapy drug dispensing. Hospital infusion preparation stations need to mix and prepare various drugs in precise proportions according to doctors' orders or prescriptions, following strict operating procedures to meet patients' individualized treatment needs. With the increase in patient visits, the diversification of prescription types, and the increasing demands for special drug preparation, hospital infusion preparation stations face the challenge of handling a large number of concurrent infusion preparation tasks during peak periods. Especially in environments where multiple pharmacists work together, how to scientifically allocate infusion preparation time, avoid resource conflicts, improve infusion preparation efficiency, and ensure medication safety has become a key technical problem that urgently needs to be solved in hospital pharmacy services.
[0003] Existing hospital dispensing workstation scheduling and management methods still have some shortcomings. Traditional hospital dispensing systems mostly adopt a simple first-come-first-served or department-based batch processing approach, lacking detailed analysis of the time characteristics of dispensing tasks. This leads to problems such as excessive workload for dispensing staff and long waiting times for patients to pick up their medications during peak periods. Current technology cannot effectively identify time conflicts and resource competition between different prescription dispensing tasks, especially lacking optimization methods for resource scheduling in the preparation of drugs requiring special operations. Most hospital dispensing systems do not fully consider pharmacists' individual expertise and task switching time costs, resulting in unreasonable allocation of human resources and failure to fully utilize professional skills. When a large number of prescriptions arrive at the dispensing center within a specific time period, current technology lacks a scientific task distribution mechanism, easily leading to excessive workload for pharmacists during some periods and relatively idle time during others, affecting overall dispensing efficiency and drug preparation quality. These problems are particularly prominent in large medical institutions, seriously hindering further improvement in the quality of hospital pharmacy services and the improvement of patients' medical experience. Summary of the Invention
[0004] This invention provides a method for multi-parameter collaborative optimization and control of a liquid preparation workstation, which can solve the problems in the prior art.
[0005] A first aspect of this invention provides a method for multi-parameter collaborative optimization and control of a solution preparation workstation, comprising: Obtain the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; calculate and generate multiple predetermined liquid preparation time points based on the raw material delivery time information and the liquid preparation time interval sequence. Construct cross-task time conflict tensors for multiple predetermined solution preparation time points, extract conflict coupling patterns between different tasks through tensor decomposition, calculate the coupling strength of each conflict coupling pattern, identify task pairs with coupling strength exceeding a preset coupling threshold, construct the time gradient field of predetermined solution preparation time points in the task pairs, apply time offset based on the time gradient field, and obtain the optimized solution preparation time point. Calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, extract the dense center point of the dense time distribution region and perform radial diffusion operation to generate a solution preparation time control scheme. Extract the time cost matrix of historical task switching for executors, perform convolution operation between the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. A reminder instruction is sent to the personnel responsible for the task assignment.
[0006] In one optional embodiment, a cross-task temporal conflict tensor is constructed for multiple predetermined solution preparation time points. Conflict coupling patterns between different tasks are extracted through tensor decomposition. The coupling strength of each conflict coupling pattern is calculated, and task pairs whose coupling strength exceeds a preset coupling threshold are identified, including: Obtain the task identifier, timestamp, and executor identifier corresponding to each predetermined solution preparation time point. Discretize the timestamp according to the preset time granularity to obtain the time index sequence. Construct a three-dimensional coordinate space with task dimension, time dimension, and personnel dimension. Map each predetermined solution preparation time point to the corresponding coordinate position in the three-dimensional coordinate space. Calculate the solution preparation point density at each coordinate position as the tensor element value to generate a cross-task time conflict tensor. Tensor rank decomposition is performed on the cross-task time conflict tensor to extract the task feature subspace, time feature subspace and personnel feature subspace. The feature embedding vector of each task is obtained from the task feature subspace. The vector inner product of any two feature embedding vectors after projection onto the time feature subspace is calculated. The vector inner product is used as the coupling strength of the corresponding task pair. Construct a coupling strength matrix, perform threshold filtering on the coupling strength matrix, extract the matrix position indices where the matrix element values exceed a preset coupling threshold, and determine the corresponding task pairs based on the matrix position indices.
[0007] In one optional embodiment, constructing a time gradient field for predetermined solution preparation time points in the task pair, and applying a time offset based on the time gradient field to obtain the optimized solution preparation time point includes: Extract the predetermined solution preparation time point sequence of each task in the task pair, construct the density distribution function of the predetermined solution preparation time point sequence on the time axis, and perform gradient calculation to obtain the time gradient field. Identify the time region with the largest gradient value in the time gradient field, determine the conflict core region, and calculate the time center coordinates of the conflict core region to obtain the disturbance reference point. Traverse each predetermined solution preparation time point in the task pair, calculate the time distance of each predetermined solution preparation time point relative to the disturbance reference point, perform a vector cross product operation between the time distance and the gradient value of the time gradient field at the corresponding position to generate a disturbance direction vector, and determine the offset direction of each predetermined solution preparation time point based on the disturbance direction vector. The task calculates the overlap of predetermined solution preparation time points within the core conflict area, multiplies the overlap with the gradient peak of the disturbance reference point to obtain the disturbance intensity factor, and applies a time offset to each predetermined solution preparation time point based on the disturbance intensity factor and the offset direction to generate optimized solution preparation time points.
[0008] In one optional embodiment, the distribution entropy value of the optimized solution preparation time point is calculated. When the distribution entropy value is lower than a preset entropy threshold, the dense center points of the dense time distribution region are extracted, and a radial diffusion operation is performed to generate a solution preparation time control scheme, including: The time axis is divided into multiple time windows according to the solution preparation cycle. The number of optimized solution preparation time points in each time window is counted. The proportion of the number of optimized solution preparation time points in each time window to the total number is calculated to construct a time window probability distribution vector. The entropy value of the time window probability distribution vector is calculated to obtain the distribution entropy value. When the distribution entropy value is lower than the preset entropy threshold, a two-dimensional density heat map of the optimized solution preparation time point on the time axis is constructed. The expansion kernel size is determined according to the density peak value. Each position point in the two-dimensional density heat map is traversed. With the current position point as the center, the maximum density value of the neighboring pixels within the expansion kernel size range is searched and replaced with the density value of the current position point until all position points are completed. Connected regions are extracted, and the area value of each connected region is calculated. Connected regions with an area value exceeding the preset area threshold are selected as dense time distribution regions, and the corresponding geometric center is extracted as the dense center point. Based on the radial repulsion force value constructed by the dense center point, the optimized solution preparation time point is driven to diffuse radially until the time interval reaches a state of equilibrium, thereby generating a solution preparation time control scheme.
[0009] In one optional embodiment, a radial repulsion force value is constructed based on dense center points, driving the optimized solution preparation time point to diffuse radially until the time interval reaches an equilibrium state, generating a solution preparation time control scheme including: Calculate the time distance between each optimized solution preparation time point and the dense center point within the dense time distribution area; determine the target time interval based on the time span of the dense time distribution area and the number of optimized solution preparation time points; and construct the radial repulsion force value of each optimized solution preparation time point based on the time deviation between the time distance and the target time interval. The diffusion direction and diffusion amplitude are determined based on the radial repulsion force value at each optimized solution preparation time point. Optimized solution preparation time points located before the dense center point are shifted forward, and optimized solution preparation time points located after the dense center point are shifted backward. The time positions of each optimized solution preparation time point are adjusted according to the diffusion direction and the diffusion amplitude. The deviation between the time interval of each optimized solution preparation time point and the adjacent optimized solution preparation time point after adjustment and the target time interval is calculated. When all deviations are less than the preset deviation threshold, it is determined that an equilibrium state has been reached, and a solution preparation time control scheme is generated.
[0010] In one optional embodiment, the time cost matrix of historical task switching for executors is extracted. The time interval between adjacent tasks in the liquid preparation time control scheme is convolved with the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor. The allocation scheme with the minimum total time cost is selected, and the task allocation result is generated, including: Extract historical task records of each executor, identify the task type combination formed by the preceding and following task types between two adjacent tasks, extract the task switching start time and task switching end time corresponding to each task type combination, calculate the switching time by the time difference between the task switching start time and task switching end time, and fill the switching time into the corresponding position of the time cost matrix according to the correspondence between the preceding and following task types. Extract the task type and task execution time corresponding to each optimized solution preparation time point from the solution preparation time control scheme. Arrange the task types according to the order of task execution times to construct a task type sequence. Extract the preceding and following task types of adjacent positions in the task type sequence. Find the corresponding switching time value in the time cost matrix. Extract the time interval corresponding to adjacent tasks in the task type sequence. Perform convolution operation on each switching time value and the corresponding time interval and accumulate them to obtain the total time cost. Iterate through the sequence of personnel and task types to select the task allocation result with the lowest total time cost.
[0011] In one optional embodiment, the time intervals corresponding to adjacent tasks in the task type sequence are extracted, and the switching time values are convolved with the corresponding time intervals and summed to obtain the total time cost, which includes: A time interval vector is constructed based on the time interval. The historical completion rate data of the executors corresponding to each time interval in the time interval vector is statistically analyzed. The historical completion rate data records the ratio of the number of times the executor successfully completed task switching under the time interval condition to the total number of times. The reciprocal of the historical completion rate data is used as the time interval correction factor. Extract the switching time value corresponding to the adjacent task type in the task type sequence from the time cost matrix, construct the switching time vector, and perform element-wise multiplication operation on each switching time value in the switching time vector and the time interval at the corresponding position to obtain the initial convolution vector; The modified convolution vector is obtained by multiplying each element value in the initial convolution vector with the corresponding time interval correction factor. The total time cost of undertaking the task type sequence is obtained by summing all the element values in the modified convolution vector.
[0012] A second aspect of the present invention provides a multi-parameter collaborative optimization and control system for a solution preparation workstation, comprising: The time information unit is used to acquire the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; based on the raw material delivery time information and the liquid preparation time interval sequence, multiple predetermined liquid preparation time points are calculated and generated. The time conflict unit is used to construct cross-task time conflict tensors for multiple predetermined solution preparation time points. Through tensor decomposition, conflict coupling patterns between different tasks are extracted, the coupling strength of each conflict coupling pattern is calculated, task pairs with coupling strength exceeding a preset coupling threshold are identified, a time gradient field for predetermined solution preparation time points in the task pair is constructed, and a time offset is applied based on the time gradient field to obtain the optimized solution preparation time point. The control scheme unit is used to calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, the dense center point of the dense time distribution area is extracted and radial diffusion operation is performed to generate a solution preparation time control scheme. The task allocation unit is used to extract the time cost matrix of historical task switching of the executor, perform convolution operation on the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. The reminder instruction unit is used to send reminder instructions to the personnel performing the tasks based on the task assignment results.
[0013] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0015] In this embodiment of the invention, a cross-task time conflict tensor is used to model multiple predetermined solution preparation time points, which can systematically characterize the complex conflict relationships of different tasks in the time dimension. Tensor decomposition technology can deeply extract hidden conflict coupling patterns and quantify their coupling strength, thereby accurately identifying the task pairs with the most severe conflicts. The distribution entropy value of the optimized time points is calculated, providing a quantitative indicator for evaluating the uniformity of the time distribution. When the distribution is too concentrated, the center of the dense area is automatically identified and a radial diffusion operation is performed, which can reasonably disperse the densely stacked tasks on the timeline, generating a solution preparation time control scheme with a more balanced time distribution and stronger executability, effectively avoiding execution This approach addresses the excessive congestion of medical resources within a given timeframe. By introducing a historical task switching time cost matrix for executors and convolving the task intervals in the control plan with individual cost characteristics, the total time cost required for each person to execute a specific task sequence can be accurately predicted. The allocation scheme with the minimum total cost is selected, achieving optimal matching between tasks and executors. This fully considers individual operating habits and efficiency differences, making task allocation more personalized and rational. Overall, it reduces manual intervention, lowers the risk of execution delays or errors due to time conflicts and improper allocation, improves the overall throughput and reliability of solution preparation, and provides strong support for the efficient scheduling of medical resources. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the multi-parameter collaborative optimization and control method for the solution preparation workstation according to an embodiment of the present invention. Figure 2 A flowchart for optimizing the solution preparation point based on the time gradient field. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0019] Figure 1 This is a flowchart illustrating the multi-parameter collaborative optimization and control method for the solution preparation workstation according to an embodiment of the present invention. Figure 1 As shown, the method includes: Obtain the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; calculate and generate multiple predetermined liquid preparation time points based on the raw material delivery time information and the liquid preparation time interval sequence. Construct cross-task time conflict tensors for multiple predetermined solution preparation time points, extract conflict coupling patterns between different tasks through tensor decomposition, calculate the coupling strength of each conflict coupling pattern, identify task pairs with coupling strength exceeding a preset coupling threshold, construct the time gradient field of predetermined solution preparation time points in the task pairs, apply time offset based on the time gradient field, and obtain the optimized solution preparation time point. Calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, extract the dense center point of the dense time distribution region and perform radial diffusion operation to generate a solution preparation time control scheme. Extract the time cost matrix of historical task switching for executors, perform convolution operation between the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. A reminder instruction is sent to the personnel responsible for the task assignment.
[0020] In one optional embodiment, a cross-task temporal conflict tensor is constructed for multiple predetermined solution preparation time points. Conflict coupling patterns between different tasks are extracted through tensor decomposition. The coupling strength of each conflict coupling pattern is calculated, and task pairs whose coupling strength exceeds a preset coupling threshold are identified, including: Obtain the task identifier, timestamp, and executor identifier corresponding to each predetermined solution preparation time point. Discretize the timestamp according to the preset time granularity to obtain the time index sequence. Construct a three-dimensional coordinate space with task dimension, time dimension, and personnel dimension. Map each predetermined solution preparation time point to the corresponding coordinate position in the three-dimensional coordinate space. Calculate the solution preparation point density at each coordinate position as the tensor element value to generate a cross-task time conflict tensor. Tensor rank decomposition is performed on the cross-task time conflict tensor to extract the task feature subspace, time feature subspace and personnel feature subspace. The feature embedding vector of each task is obtained from the task feature subspace. The vector inner product of any two feature embedding vectors after projection onto the time feature subspace is calculated. The vector inner product is used as the coupling strength of the corresponding task pair. Construct a coupling strength matrix, perform threshold filtering on the coupling strength matrix, extract the matrix position indices where the matrix element values exceed a preset coupling threshold, and determine the corresponding task pairs based on the matrix position indices.
[0021] In one specific implementation, multiple process tasks often experience time conflicts. To effectively identify and quantify these conflicts, it is necessary to structure the predetermined solution preparation time points and obtain three key attribute information for each predetermined solution preparation time point: a task identifier to distinguish different solution preparation process projects, a timestamp to accurately record the predetermined execution time of the solution preparation point, and an executor identifier corresponding to the process personnel number responsible for the solution preparation operation. Considering that timestamps are usually stored in a high-precision format, direct use would lead to excessively sparse data space; therefore, a discretization processing strategy is adopted. Time granularity parameters are set according to actual business needs, for example, setting the time granularity to 5 minutes, dividing the continuous time axis into several discrete time slots. Each timestamp is categorized and mapped according to its time slot, generating an integer time index sequence, thus converting the original timestamps accurate to the second into discrete time index values.
[0022] Based on the processed data, a three-dimensional tensor representation framework is established. In this framework, the task dimension corresponds to the set of all solution preparation process tasks, the time dimension corresponds to the discretized time index range, and the personnel dimension corresponds to the set of all executors. The Cartesian product space formed by these three dimensions creates a complete three-dimensional coordinate system. Each predetermined solution preparation time point is mapped to a unique coordinate position in the three-dimensional coordinate space according to its task identifier, time index, and personnel identifier. During the mapping process, the number of solution preparation points falling into the same coordinate position is counted, reflecting the solution preparation demand density under a specific task, a specific time period, and a specific personnel combination. The statistically obtained density values are used as tensor elements to fill the corresponding coordinate positions, ultimately forming a cross-task time conflict tensor. The sparsity of this tensor intuitively reflects the distribution characteristics of solution preparation demand in the three dimensions of time, space, and personnel, with high-density areas corresponding to potential resource conflict hotspots.
[0023] To extract the coupling patterns between tasks from high-dimensional tensors, tensor rank decomposition (TFD) is employed. TFD approximates the original third-order tensor as a combination of three low-rank matrices, each corresponding to a feature subspace of one dimension. The decomposition process is implemented through an iterative optimization algorithm, aiming to minimize the reconstruction error while preserving the low-rank constraint. After decomposition, row vectors corresponding to each task are extracted from the task feature subspace matrix. These row vectors are the task's feature embedding vectors, with dimensions much smaller than the original tensor, but retaining the main behavioral patterns of the task in the time and personnel dimensions. The time feature subspace matrix captures common features across different time periods, reflecting the structured patterns in the time dimension.
[0024] For any two solution preparation tasks, their respective feature embedding vectors are extracted. These two vectors are then multiplied by the temporal feature subspace matrix to achieve a projection transformation of the vectors onto the temporal feature subspace. The two projected vectors contain the coupling information of the tasks in the temporal dimension. The inner product of these two projected vectors is calculated; the magnitude of the inner product quantifies the degree of overlap and similarity between the two tasks in their temporal distribution. A larger inner product value indicates that the predetermined solution preparation time points of the two tasks are closer in distribution along the time axis, and the higher the probability of conflict. This inner product value is defined as the coupling strength of the task pair.
[0025] Iterate through all possible task pair combinations, calculate the coupling strength between each pair, and organize these values into a symmetric matrix to form a coupling strength matrix. Rows and columns of the matrix correspond to different task identifiers, and the matrix element values represent the coupling strength of the corresponding task pair. Perform a threshold filtering operation on this matrix, setting a preset coupling threshold as the criterion. This threshold is determined based on historical data statistical analysis or empirical rules. Examine each element in the matrix one by one, recording the positions of elements whose values exceed the preset coupling threshold. Due to the symmetry of the matrix, only the upper or lower triangular parts need to be processed to avoid duplication. Extract the matrix position indices that meet the conditions. Each index corresponds to a row number and a column number, representing the two task identifiers with significant coupling. Based on these index pairs, determine the set of task pairs that require time adjustment. These task pairs have a strong risk of time conflict and need to be decoupled using a time offset strategy in subsequent optimization stages.
[0026] In this embodiment, the originally scattered multidimensional liquid preparation time data is transformed into a structured conflict coupling pattern, which can identify direct time overlap conflicts and also discover potential indirect coupling relationships, such as resource competition arising from two tasks that do not completely overlap in time but share executors. The low-rank characteristic of tensor decomposition effectively reduces computational complexity, making conflict identification feasible in large-scale task scenarios. The quantitative index of coupling strength provides a precise adjustment basis for subsequent time optimization, ensuring that optimization operations are carried out on task pairs with truly significant conflicts, avoiding unnecessary global adjustments that could lead to a decrease in solution stability.
[0027] In one optional embodiment, constructing a time gradient field for predetermined solution preparation time points in the task pair, and applying a time offset based on the time gradient field to obtain the optimized solution preparation time point includes: Extract the predetermined solution preparation time point sequence of each task in the task pair, construct the density distribution function of the predetermined solution preparation time point sequence on the time axis, and perform gradient calculation to obtain the time gradient field. Identify the time region with the largest gradient value in the time gradient field, determine the conflict core region, and calculate the time center coordinates of the conflict core region to obtain the disturbance reference point. Traverse each predetermined solution preparation time point in the task pair, calculate the time distance of each predetermined solution preparation time point relative to the disturbance reference point, perform a vector cross product operation between the time distance and the gradient value of the time gradient field at the corresponding position to generate a disturbance direction vector, and determine the offset direction of each predetermined solution preparation time point based on the disturbance direction vector. The task calculates the overlap of predetermined solution preparation time points within the core conflict area, multiplies the overlap with the gradient peak of the disturbance reference point to obtain the disturbance intensity factor, and applies a time offset to each predetermined solution preparation time point based on the disturbance intensity factor and the offset direction to generate optimized solution preparation time points.
[0028] In one specific implementation, to address the liquid preparation time conflict within a task pair, a temporal gradient field is constructed to quantify the spatial distribution characteristics of the conflict, and a differentiated time offset is applied to predetermined liquid preparation time points accordingly. The predetermined liquid preparation time point sequence for each task is extracted from the task pair. Assuming the task pair includes task A and task B, the predetermined liquid preparation time point sequence for task A is... The predetermined solution preparation time sequence for Task B is as follows: Project these time points onto a unified timeline, with the timeline range set to [specify range]. ,in This is the earliest scheduled solution preparation time for the task pair. This is the latest scheduled time for solution preparation.
[0029] A density distribution function for a predetermined solution preparation time series is constructed on the time axis, and modeled using the kernel density estimation method. For any time point on the time axis... Its density function value is calculated by summing the contributions of all predetermined solution preparation time points to that moment. Specifically, for each predetermined solution preparation time point... For time The contribution is characterized using a Gaussian kernel function. The bandwidth parameter of the kernel function is adaptively determined based on the time span of the predetermined solution preparation time sequence, typically set to 5% to 8% of the time span. The density distribution function at time... The value of reflects the degree of clustering of the scheduled solution preparation time points near that moment. The larger the value, the more scheduled solution preparation time points exist around that moment, and the higher the risk of conflict.
[0030] The gradient of the constructed density distribution function is calculated to obtain the temporal gradient field. The gradient calculation employs a numerical differentiation method, performing a difference operation on the density distribution function along the time axis with a fixed step size, typically set to 1 to 3 minutes. The gradient value at each moment in the temporal gradient field characterizes the rate of density change at that moment; a positive gradient value indicates increasing density, a negative gradient value indicates decreasing density, and a larger absolute gradient value indicates a more drastic density change. By traversing the temporal gradient field, the time region with the largest gradient value is identified. This region corresponds to the location where the density rises most rapidly at the predetermined solution preparation time point and is the core region where the conflict is most concentrated. Specifically, a gradient threshold is set to 80% to 90% of the maximum gradient value, and continuous time periods with gradient values exceeding this threshold are marked as conflict core regions.
[0031] After identifying the core conflict region, the time center coordinates of this region are calculated as the perturbation reference point. The time center coordinates are obtained by performing a density-weighted average of time points within the core conflict region; that is, the weight of each time point is equal to its corresponding density function value. Perturbation Reference Point As a reference position for subsequent application of time offset, its physical meaning is the centroid of the location where the conflict is most severe.
[0032] Iterate through each predetermined solution preparation time point in the task pair and calculate the time distance of each predetermined solution preparation time point relative to the disturbance reference point. For the predetermined solution preparation time points in Task A... The time distance is A positive time distance indicates that the time point is after the perturbation reference point, while a negative time distance indicates that it is before the perturbation reference point. The perturbation direction vector is generated by performing a cross product operation between the time distance and the gradient value of the temporal gradient field at the corresponding location. Since time is a one-dimensional variable, the cross product operation is understood here as a signed multiplication operation, i.e. ,in For the time gradient field in The gradient value at that point. The sign of the perturbation direction vector determines the offset direction; a positive value indicates an offset in the positive direction of the time axis, i.e., a backward delay, while a negative value indicates an offset in the negative direction of the time axis, i.e., an forward advance.
[0033] The offset direction of each predetermined solution preparation time point is determined based on the perturbation direction vector. For predetermined solution preparation time points with a positive perturbation direction vector, the offset direction is set to be delayed backward; for predetermined solution preparation time points with a negative perturbation direction vector, the offset direction is set to be advanced forward. This offset direction determination mechanism based on gradient field and time distance enables predetermined solution preparation time points located on different sides of the conflict core region to move in opposite directions, thereby effectively dispersing the concentrated solution preparation tasks.
[0034] Calculate the overlap of predetermined solution preparation time points for task pairs within the conflict core region. The overlap is obtained by statistically analyzing the number of predetermined solution preparation time points within the conflict core region for each task pair and then comparing this number to the total number of predetermined solution preparation time points for the task pair. Assume task A has n such time points within the conflict core region. A There are n predetermined solution preparation time points for Task B. B There are N tasks in total, including task A. A There are N predetermined solution preparation time points for Task B. B If there are 1, then the overlap is 1 The overlap value ranges from 0 to 1, with a larger value indicating a more severe conflict.
[0035] The perturbation intensity factor is obtained by multiplying the overlap by the peak gradient at the perturbation reference point. (Peak gradient) Let be the gradient of the time gradient field at the perturbation reference point, and be the perturbation intensity factor. This factor combines the range and intensity characteristics of the conflict and is used to regulate the magnitude of the time offset. The larger the disturbance intensity factor, the more severe the conflict, and the greater the required time offset.
[0036] A time offset is applied to each predetermined solution preparation time point based on the disturbance intensity factor and the offset direction.
[0037] like Figure 2 As shown, a flowchart illustrating the optimization of the solution preparation point based on the time gradient field is presented.
[0038] In one optional embodiment, the distribution entropy value of the optimized solution preparation time point is calculated. When the distribution entropy value is lower than a preset entropy threshold, the dense center points of the dense time distribution region are extracted, and a radial diffusion operation is performed to generate a solution preparation time control scheme, including: The time axis is divided into multiple time windows according to the solution preparation cycle. The number of optimized solution preparation time points in each time window is counted. The proportion of the number of optimized solution preparation time points in each time window to the total number is calculated to construct a time window probability distribution vector. The entropy value of the time window probability distribution vector is calculated to obtain the distribution entropy value. When the distribution entropy value is lower than the preset entropy threshold, a two-dimensional density heat map of the optimized solution preparation time point on the time axis is constructed. The expansion kernel size is determined according to the density peak value. Each position point in the two-dimensional density heat map is traversed. With the current position point as the center, the maximum density value of the neighboring pixels within the expansion kernel size range is searched and replaced with the density value of the current position point until all position points are completed. Connected regions are extracted, and the area value of each connected region is calculated. Connected regions with an area value exceeding the preset area threshold are selected as dense time distribution regions, and the corresponding geometric center is extracted as the dense center point. Based on the radial repulsion force value constructed by the dense center point, the optimized solution preparation time point is driven to diffuse radially until the time interval reaches a state of equilibrium, thereby generating a solution preparation time control scheme.
[0039] In one specific implementation, after initially optimizing the solution preparation time points, the rationality of the overall time distribution needs to be evaluated. The solution preparation operation cycle is used as the basis for time division, dividing the 24 hours into several time windows, such as morning shifts, afternoon shifts, and night shifts according to the shift schedule of the solution preparation workstations. For each time window, the number of optimized solution preparation time points falling within that window is counted, recorded as the solution preparation point count for that window. The solution preparation point count for each time window is divided by the total number of all optimized solution preparation time points to obtain the probability value for each window, thus constructing a time window probability distribution vector. This vector reflects the distribution of solution preparation tasks on the time axis. If the probability values of each time window are relatively uniform, it indicates that the task distribution is relatively reasonable; if the probability values of some windows are significantly higher, it indicates that there is a task clustering phenomenon.
[0040] Entropy is calculated on the probability distribution vector of the time windows. The negative logarithm of each window's probability value is taken, multiplied by the probability value, and the results for all windows are summed. The magnitude of the distribution entropy reflects the dispersion of the solution preparation time points. A higher entropy value indicates a more uniform distribution and a more reasonable time interval between tasks; a lower entropy value indicates significant time clustering, leading to excessive workload for personnel during certain periods while resources are idle during others. An entropy threshold is set as a judgment criterion, typically determined based on historical scheduling experience or through statistical analysis of entropy values from normal control schemes. When the calculated distribution entropy value is lower than the entropy threshold, it is determined that the current optimized solution preparation time points have an uneven distribution problem, requiring further equalization adjustments.
[0041] After detecting an excessively low distribution entropy value, a two-dimensional density heatmap of the optimized solution preparation time points on the time axis is constructed to visually represent the degree of clustering at each time point. The horizontal axis of this heatmap represents time, and the vertical axis can represent task type or other classification dimensions. The density value at each pixel location represents the degree of clustering of solution preparation time points within that spatiotemporal region. The density value can be calculated using a kernel density estimation method, applying a Gaussian kernel function to each optimized solution preparation time point and superimposing the kernel functions of multiple time points to form a continuous density distribution. By traversing the two-dimensional density heatmap, the global density peak is found, reflecting the density intensity of the most severe task clustering region. The expansion kernel size is determined based on the density peak. The expansion kernel size is typically set to a spatial range corresponding to a certain proportion of the peak density, or an adaptive method is used to determine a suitable expansion radius based on the density gradient change rate.
[0042] After determining the dilation kernel size, a morphological dilation operation is performed on the 2D density heatmap. This involves traversing each point in the heatmap, searching for the density values of all neighboring pixels within the neighborhood defined by the dilation kernel size, and selecting the maximum density value. This maximum value replaces the density value at the current point. Essentially, this is a local maximum expansion operation, causing high-density regions to expand outwards, thus connecting adjacent high-density pixels. After completing the dilation operation for all points, the previously scattered high-density pixels in the 2D density heatmap form continuous high-density regions. The dilated heatmap is then binarized, and a density threshold is set. Pixels above the threshold are marked as foreground, and the rest as background. All connected regions are then extracted. These connected regions represent task clusters on the timeline, with each region corresponding to a densely distributed temporal region.
[0043] For each extracted connected region, its area value is calculated, reflecting the spatiotemporal extent of the dense region. The area value can be calculated by counting the number of pixels within the connected region, or estimated by multiplying the span of the connected region on the time axis by the coverage of the task type. An area threshold is set to filter connected regions whose area values exceed the threshold; these regions are considered to be densely distributed time regions requiring equalization adjustments. The setting of the area threshold needs to comprehensively consider the actual capacity of the dispensing workstation and the work efficiency of pharmacists. Too small a threshold may lead to over-intervention, while too large a threshold may miss actual clustering issues. For each filtered densely distributed time region, its geometric center is calculated as the density center point. The geometric center is typically calculated by averaging the time coordinates of all optimized dispensing time points within the connected region, or by using a weighted average method, weighted according to the task priority or urgency of each time point.
[0044] Based on the extracted dense center points, a radial repulsion force value is constructed to drive the outward diffusion of optimized solution preparation time points within the dense region. For each optimized solution preparation time point within the dense region, the distance between it and the dense center point is calculated; the closer the distance, the greater the repulsion force. The repulsion force value can be calculated using an inverse proportional function, i.e., the repulsion force is inversely proportional to the square of the distance, or using an exponential decay function, causing the repulsion force to decrease rapidly with increasing distance. Based on the repulsion force value, a time offset is applied to the optimized solution preparation time points in a radial direction away from the dense center point, and the magnitude of the offset is proportional to the repulsion force value. During the application of the radial repulsion force, the time interval changes between each optimized solution preparation time point need to be monitored in real time, and statistical indicators such as the minimum interval, average interval, and interval variance between adjacent time points need to be calculated. When these statistical indicators reach the preset equilibrium criteria, such as the minimum interval not being less than the minimum safe interval and the interval variance being less than the preset variance threshold, the time interval is determined to have reached an equilibrium state, and the radial diffusion operation is stopped.
[0045] After radial diffusion is completed, the distribution of all optimized solution preparation time points on the time axis tends to be uniform, which avoids the execution pressure caused by excessive task aggregation and maintains a reasonable correspondence with the raw material delivery time. The adjusted optimized solution preparation time points are arranged in chronological order and combined with the corresponding solution preparation process task information to generate a solution preparation time control scheme.
[0046] This embodiment details the final solution preparation time schedule for each task, providing a time basis for subsequent task allocation. The control scheme also includes buffer time settings for each time point to cope with possible emergencies or task delays, ensuring the robustness and executability of the overall schedule.
[0047] In one optional embodiment, a radial repulsion force value is constructed based on dense center points, driving the optimized solution preparation time point to diffuse radially until the time interval reaches an equilibrium state, generating a solution preparation time control scheme including: Calculate the time distance between each optimized solution preparation time point and the dense center point within the dense time distribution area; determine the target time interval based on the time span of the dense time distribution area and the number of optimized solution preparation time points; and construct the radial repulsion force value of each optimized solution preparation time point based on the time deviation between the time distance and the target time interval. The diffusion direction and diffusion amplitude are determined based on the radial repulsion force value at each optimized solution preparation time point. Optimized solution preparation time points located before the dense center point are shifted forward, and optimized solution preparation time points located after the dense center point are shifted backward. The time positions of each optimized solution preparation time point are adjusted according to the diffusion direction and the diffusion amplitude. The deviation between the time interval of each optimized solution preparation time point and the adjacent optimized solution preparation time point after adjustment and the target time interval is calculated. When all deviations are less than the preset deviation threshold, it is determined that an equilibrium state has been reached, and a solution preparation time control scheme is generated.
[0048] In one specific implementation, after obtaining the densely distributed time regions and their central points, it is necessary to spatially expand the excessively concentrated optimal solution preparation time points using a physical field simulation method. For each optimal solution preparation time point within the densely distributed time region, the time distance between it and the central point is calculated. Assume the time corresponding to the central point is t. c The time point corresponding to a certain optimized solution preparation is t. i Then the time distance is d i = |t i - t c The time span of a densely distributed time region is obtained by the difference between the earliest and latest solution preparation times within that region, denoted as . The total number of optimized solution preparation time points contained within this dense region is counted and denoted as N. dense Divide the time span by the number of points minus one, that is... The target time interval is obtained, which represents the time distance that adjacent solution preparation time points should maintain under an ideal uniform distribution state.
[0049] A time deviation index is constructed based on the time distance and the target time interval. When an optimized solution preparation time point is too close to the dense center point, its time deviation is large. Specifically, the difference between the target time interval and the actual time distance is normalized to obtain the deviation. A positive deviation indicates that the distance from the center at that time point is too close and needs to be pushed away; a negative deviation or deviation close to zero indicates that the position at that time point is relatively reasonable. A radial repulsive force value is constructed based on the deviation. The repulsive force value needs to exhibit nonlinear characteristics, meaning the closer the distance, the stronger the repulsive force. An exponential function is used to construct the repulsive force model, specifically... Where k is the force coefficient, The steepness parameter is used. The force coefficient is usually calibrated based on the time span and can be set to 10% to 20% of the time span; the steepness parameter controls the sensitivity of the repulsive force to changes with distance, and the typical value range is 2 to 5. The radial repulsive force value at each optimized solution preparation time point in the densely distributed time region is calculated using this formula.
[0050] Determine the diffusion direction at each optimized solution preparation time point. Using the dense center point as a boundary, optimized solution preparation time points before the center point time should be shifted to an earlier time, and optimized solution preparation time points after the center point time should be shifted to a later time. The diffusion direction is determined using a sign function, i.e. A negative value indicates forward diffusion, while a positive value indicates backward diffusion. The diffusion amplitude is determined by the radial repulsive force; a larger repulsive force results in a longer diffusion distance. Multiplying the repulsive force value by the time step factor yields the specific diffusion amplitude. ,in The time step factor controls the magnitude of each adjustment, preventing over-adjustment and oscillations. The time step factor is typically set to 5% to 10% of the target time interval.
[0051] The time points for each optimized solution preparation were adjusted according to the diffusion direction and diffusion amplitude. The adjusted time points are as follows: When performing adjustments, boundary constraints must be considered to ensure that the adjusted time points do not exceed the allowed time window of the experiment. If a time point exceeds the limit after adjustment, it should be constrained to the boundary value. After completing one round of adjustments, the adjacent time intervals between each optimized solution preparation time point are recalculated. All adjacent pairs of optimized solution preparation time points within densely distributed time regions are traversed, and the time difference between them is calculated and denoted as . Each adjacent time interval is compared with the target time interval, and the deviation value is calculated. .
[0052] Check that all deviation values are less than the preset deviation threshold. The preset deviation threshold is determined based on the required accuracy of the dispensing time, and is typically set to 5% to 10% of the target time interval. Iterate through the deviation values of all adjacent time point pairs and count the number of deviation values exceeding the threshold. When all deviation values do not exceed the threshold, the time point distribution is considered to have reached a balanced state. If there are still deviation values exceeding the threshold, repeat the above process, recalculate the time distance, time deviation, and radial repulsion force value between each optimized dispensing time point and the dense center point, and perform diffusion adjustment again. Set a maximum number of iterations during the iteration process to prevent the algorithm from getting stuck in an infinite loop; the maximum number of iterations is typically set to 50 to 100.
[0053] Once equilibrium is reached, all optimized solution preparation time points are arranged chronologically to form a complete solution preparation time control plan. This plan not only resolves cross-task time conflicts but also ensures reasonable intervals between solution preparation time points within the same densely populated area, preventing personnel from facing excessively high task density in a short period. Each time point in the control plan corresponds to a specific drug preparation task identifier and solution preparation operation requirements, providing a time basis for subsequent task allocation. During the generation of the control plan, the number of adjustments and the magnitude of adjustments for each optimized solution preparation time point are recorded as supplementary information for scheduling quality assessment. If certain time points still cannot reach equilibrium after multiple significant adjustments, they are marked as high-risk time points, and experienced pharmacists are given priority to undertake related tasks in subsequent task allocation.
[0054] In this embodiment, the radial diffusion operation achieves automatic time allocation by simulating a physical repulsive force field, avoiding the tedious process of manual adjustment. This method fully considers the overall and local nature of time distribution, ensuring both the balance within dense regions and maintaining continuity with time points in non-dense regions.
[0055] In one optional embodiment, the time cost matrix of historical task switching for executors is extracted. The time interval between adjacent tasks in the liquid preparation time control scheme is convolved with the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor. The allocation scheme with the minimum total time cost is selected, and the task allocation result is generated, including: Extract historical task records of each executor, identify the task type combination formed by the preceding and following task types between two adjacent tasks, extract the task switching start time and task switching end time corresponding to each task type combination, calculate the switching time by the time difference between the task switching start time and task switching end time, and fill the switching time into the corresponding position of the time cost matrix according to the correspondence between the preceding and following task types. Extract the task type and task execution time corresponding to each optimized solution preparation time point from the solution preparation time control scheme. Arrange the task types according to the order of task execution times to construct a task type sequence. Extract the preceding and following task types of adjacent positions in the task type sequence. Find the corresponding switching time value in the time cost matrix. Extract the time interval corresponding to adjacent tasks in the task type sequence. Perform convolution operation on each switching time value and the corresponding time interval and accumulate them to obtain the total time cost. Iterate through the sequence of personnel and task types to select the task allocation result with the lowest total time cost.
[0056] In one specific implementation, after initially setting the solution preparation time control scheme, task allocation optimization needs to be performed based on the existing personnel configuration. There are significant differences in switching costs for personnel when performing different types of process tasks. For example, switching from routine solution preparation to aseptic solution preparation requires operating tools and adjusting the clean environment, while switching from continuous solution preparation tasks of the same type is more efficient. By mining the historical task execution data of personnel, the time cost of this task switching can be quantified, thereby providing data support for intelligent allocation decisions.
[0057] A historical task file is established for each executor. Task execution records from the past three months are retrieved from the solution preparation information system. Each record includes a unique task identifier, task type tag, task start timestamp, and task end timestamp. The task type tag uses a hierarchical coding system: primary classification identifies the solution type (solution preparation, powder mixing, emulsion preparation); secondary classification identifies the process type (routine solution preparation, aseptic solution preparation, high-precision solution preparation); and tertiary classification indicates special requirements (low-temperature environment, light-protected conditions, inert gas protection). Adjacent task pairs are identified by the chronological order of their timestamps, with the first task defined as the preceding task and the next task as the succeeding task.
[0058] For each identified task pair, the preceding and succeeding task types are extracted to form a task type combination. For example, if a pharmacist completes routine intravenous infusion preparation at 10:15 and then begins aseptic chemotherapy drug preparation at 10:32, the combination "intravenous infusion preparation - routine preparation → aseptic preparation - chemotherapy drug preparation" is formed. For this combination, the end timestamp of the preceding task (10:15) is defined as the task switch start time, and the start timestamp of the succeeding task (10:32) is defined as the task switch end time. The time difference between the two times is calculated to be 17 minutes, which comprehensively reflects the actual time cost of tool preparation, location transfer, environmental adjustment, and necessary cleaning and disinfection.
[0059] The above calculation process is repeated for all task type combinations. When the same task type combination occurs multiple times, the median of all switching times is taken as a representative value to reduce the impact of outliers. A time cost matrix C is constructed, where the row index corresponds to the preceding task type and the column index corresponds to the following task type. Matrix elements C pq This represents the typical time spent switching from task class p to task class q. If a combination of task types has never appeared in the historical records, it is estimated by interpolation based on the similarity of the task types. The similarity is calculated using the Hamming distance between the task type codes, with known combinations that are closer in distance having higher weights. For the executor r, its corresponding time cost matrix is denoted as C. r Different personnel exhibit different matrix characteristics due to differences in operational proficiency and work habits.
[0060] Task information is extracted from the generated solution preparation time control plan. This plan contains a series of optimized solution preparation time points, each associated with a specific solution preparation process task. For each optimized solution preparation time point, its corresponding task type label and planned execution time are extracted. For example, a plan might include time points 08:30 corresponding to a solution preparation - routine solution preparation task, 09:15 corresponding to a solution preparation - aseptic solution preparation task, and 10:00 corresponding to a powder mixing - routine solution preparation task. These task types are arranged sequentially according to their execution times to construct a task type sequence S = [s1, s2, ..., s...]. N ]$, where N represents the total number of tasks in the control plan, s n This indicates the type of the nth task to be executed.
[0061] Identify adjacent task type pairs in the task type sequence. Iterate through each position n in the sequence and extract the task type s at position n. n As a preceding task type, the task type s that extracts position n+1. n+1 As the type of subsequent task. Based on this pair of task types, in the time cost matrix C r Find the corresponding switching time value in the middle. Simultaneously, the time intervals corresponding to these two adjacent tasks in the control scheme are extracted. That is, the execution time of the (n+1)th task minus the execution time of the nth task. If Greater than the switching time This indicates that the person performing the task has sufficient time to complete the task switchover; if If the time taken is less than the switching time, it indicates that the time schedule is too tight and may cause delays.
[0062] The switching time value and the time interval are convolved to quantify the degree of time matching. A convolution kernel function is defined. When the time interval When the time interval is less than the switching time C, the convolution result is positive, indicating insufficient time; when the time interval is sufficient, the convolution result is zero. The convolution values are calculated and summed for all adjacent task pairs in the task type sequence to obtain the total time cost for the executor r to undertake this task sequence. This indicator comprehensively reflects the time pressure and potential delay risk for the executor to complete all tasks under a given control plan.
[0063] For M available executors, construct an allocation combination space for the set of executors and the sequence of task types. A greedy strategy combined with local search is used for traversal optimization. In the initial phase, several initial allocation schemes are randomly generated, and the total time cost for each executor under each scheme is calculated. In the local search phase, attempts are made to swap the task subsequences undertaken by different executors, and the change in total time cost is recalculated.
[0064] In one optional embodiment, the time intervals corresponding to adjacent tasks in the task type sequence are extracted, and the switching time values are convolved with the corresponding time intervals and summed to obtain the total time cost, which includes: A time interval vector is constructed based on the time interval. The historical completion rate data of the executors corresponding to each time interval in the time interval vector is statistically analyzed. The historical completion rate data records the ratio of the number of times the executor successfully completed task switching under the time interval condition to the total number of times. The reciprocal of the historical completion rate data is used as the time interval correction factor. Extract the switching time value corresponding to the adjacent task type in the task type sequence from the time cost matrix, construct the switching time vector, and perform element-wise multiplication operation on each switching time value in the switching time vector and the time interval at the corresponding position to obtain the initial convolution vector; The modified convolution vector is obtained by multiplying each element value in the initial convolution vector with the corresponding time interval correction factor. The total time cost of undertaking the task type sequence is obtained by summing all the element values in the modified convolution vector.
[0065] In one specific implementation, when an operator undertakes multiple consecutive tasks, the switching between tasks is not a simple time-based aggregation but is influenced by multiple factors. Once the task type sequence is determined, a refined assessment of the actual time cost for the operator within that sequence is required. The time intervals between adjacent tasks in the task type sequence are extracted; these intervals reflect the available preparation time between the completion of one solution preparation task and the start of the next. For example, a pharmacist needs to complete three tasks sequentially: chemotherapy drug preparation, intravenous nutrition solution preparation, and antibiotic solution preparation. The time interval between the first and second tasks is 15 minutes, and the time interval between the second and third tasks is 8 minutes. These time interval data form the basis of the analysis.
[0066] A time interval vector is constructed based on the extracted time intervals, arranging the interval durations between adjacent tasks in the order of the task sequence. Using the example above, the time interval vector can be represented as a vector structure containing two elements: 15 minutes and 8 minutes. For each time interval in this vector, the corresponding historical completion rate data is statistically analyzed from the historical execution database. The historical completion rate is calculated as follows: in the historical execution records, all records of task switching performed by the executor under the same time interval conditions are selected, the number of successful switches is counted, and the ratio of the successful switches to the total number of switches is calculated. For example, in the historical record of a pharmacist performing task switching under 15-minute interval conditions, there are 20 switching records, of which 18 were successfully completed on time. The historical completion rate for this time interval is 0.9. This completion rate reflects the executor's actual operational ability under specific time pressure. When the time interval is short, the executor may experience delays due to insufficient preparation time, resulting in a lower historical completion rate; when the time interval is ample, the completion rate is higher.
[0067] The reciprocal of historical completion rates is used as a time interval correction factor to quantify the amplifying effect of time pressure on actual execution costs. In the example above, if the historical completion rate at a 15-minute interval is 0.9, the corresponding time interval correction factor is 1.111; if the historical completion rate at an 8-minute interval is 0.7, the corresponding correction factor is 1.429. A correction factor greater than 1 indicates execution risk under that time interval condition, as historical data shows a certain proportion of failures or delays, requiring an upward correction of the theoretical time cost. The larger the correction factor, the higher the execution difficulty under that time interval condition, and the higher the actual effective time cost. This correction mechanism based on historical data can effectively capture individual differences among executors and the complexity of task switching.
[0068] The switching time values corresponding to adjacent task types in the task type sequence are extracted from the time cost matrix. The time cost matrix is a data structure recording the theoretical time required to switch between different task types. Its rows and columns represent the preceding and subsequent task types, respectively, and the matrix element values represent the standard time required to switch from the preceding task to the subsequent task. For example, the standard time to switch from chemotherapy drug preparation to intravenous nutrition solution preparation might be 5 minutes, including the time for cleaning the drug preparation equipment, changing drug materials, and adjusting solution parameters. The standard time to switch from intravenous nutrition solution preparation to antibiotic solution preparation might be 4 minutes. The corresponding switching time values are extracted according to the order of the task type sequence to construct a switching time vector. In the above example, the switching time vector contains two elements: 5 minutes and 4 minutes.
[0069] The initial convolution vector is obtained by element-wise multiplying each switching time value in the switching time vector with its corresponding time interval. This operation establishes a relationship between the theoretical switching time and the actual available time interval. Specifically, the first switching time value is multiplied by the first time interval, the second switching time value by the second time interval, and so on. The physical meaning of this multiplication operation is that when the switching time accounts for a high proportion of the available time interval, the product value is large, reflecting the degree of time pressure; conversely, when the time interval is ample, even if the switching time is long, the pressure is relatively low due to sufficient buffer. In the example above, the initial convolution vector contains two elements, 75 and 32, which provide the basic data for subsequent correction calculations.
[0070] The corrected convolutional vector is obtained by multiplying each element value in the initial convolutional vector with the corresponding time interval correction factor. This step incorporates risk factors introduced by historical performance into the time cost assessment. Specifically, the first element of the initial convolutional vector is multiplied by the first time interval correction factor, and the second element is multiplied by the second time interval correction factor. In the previous example, 75 multiplied by 1.111 yields approximately 83.325, and 32 multiplied by 1.429 yields approximately 45.728. The corrected convolutional vector contains these corrected element values. The correction process is essentially a dynamic adjustment of the theoretical time cost. When the historical completion rate is low in a certain time interval, the corresponding correction factor is larger, appropriately amplifying the cost of task switching in that segment, thus giving it more weight in task allocation decisions. This mechanism ensures that the time cost assessment not only reflects standard operating procedures but also the actual performance of executors under real pressure conditions.
[0071] The total time cost of undertaking this task type sequence is obtained by summing all the element values in the modified convolution vector. In the example above, the total time cost is 83.325 plus 45.728, which is approximately 129.053. This total time cost comprehensively reflects the overall time cost required for an executor to complete the entire task sequence, taking into account the standard time consumption between tasks, the sufficiency of the actual time interval, and the reliability of the executor's historical performance. By comparing the total time cost of different executors under the same task type sequence, the most suitable personnel for undertaking the sequence can be identified, thereby optimizing task allocation.
[0072] The multi-parameter collaborative optimization and control system for the solution preparation workstation in this embodiment of the invention includes: The time information unit is used to acquire the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; based on the raw material delivery time information and the liquid preparation time interval sequence, multiple predetermined liquid preparation time points are calculated and generated. The time conflict unit is used to construct cross-task time conflict tensors for multiple predetermined solution preparation time points. Through tensor decomposition, conflict coupling patterns between different tasks are extracted, the coupling strength of each conflict coupling pattern is calculated, task pairs with coupling strength exceeding a preset coupling threshold are identified, a time gradient field for predetermined solution preparation time points in the task pair is constructed, and a time offset is applied based on the time gradient field to obtain the optimized solution preparation time point. The control scheme unit is used to calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, the dense center point of the dense time distribution area is extracted and radial diffusion operation is performed to generate a solution preparation time control scheme. The task allocation unit is used to extract the time cost matrix of historical task switching of the executor, perform convolution operation on the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. The reminder instruction unit is used to send reminder instructions to the personnel performing the tasks based on the task assignment results.
[0073] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0074] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0075] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for multi-parameter collaborative optimization and control of a solution preparation workstation, characterized in that, include: Obtain the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; Based on the raw material delivery time information and the solution preparation time interval sequence, multiple predetermined solution preparation time points are calculated and generated accordingly. Construct cross-task time conflict tensors for multiple predetermined solution preparation time points, extract conflict coupling patterns between different tasks through tensor decomposition, calculate the coupling strength of each conflict coupling pattern, identify task pairs with coupling strength exceeding a preset coupling threshold, construct the time gradient field of predetermined solution preparation time points in the task pairs, apply time offset based on the time gradient field, and obtain the optimized solution preparation time point. Calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, extract the dense center point of the dense time distribution region and perform radial diffusion operation to generate a solution preparation time control scheme. Extract the time cost matrix of historical task switching for executors, perform convolution operation between the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. A reminder instruction is sent to the personnel responsible for the task assignment.
2. The method according to claim 1, characterized in that, Construct cross-task temporal conflict tensors for multiple predetermined solution preparation time points. Extract conflict coupling patterns between different tasks through tensor decomposition, calculate the coupling strength of each conflict coupling pattern, and identify task pairs whose coupling strength exceeds a preset coupling threshold, including: Obtain the task identifier, timestamp, and executor identifier corresponding to each predetermined solution preparation time point. Discretize the timestamp according to the preset time granularity to obtain the time index sequence. Construct a three-dimensional coordinate space with task dimension, time dimension, and personnel dimension. Map each predetermined solution preparation time point to the corresponding coordinate position in the three-dimensional coordinate space. Calculate the solution preparation point density at each coordinate position as the tensor element value to generate a cross-task time conflict tensor. Tensor rank decomposition is performed on the cross-task time conflict tensor to extract the task feature subspace, time feature subspace and personnel feature subspace. The feature embedding vector of each task is obtained from the task feature subspace. The vector inner product of any two feature embedding vectors after projection onto the time feature subspace is calculated. The vector inner product is used as the coupling strength of the corresponding task pair. Construct a coupling strength matrix, perform threshold filtering on the coupling strength matrix, extract the matrix position indices where the matrix element values exceed a preset coupling threshold, and determine the corresponding task pairs based on the matrix position indices.
3. The method according to claim 1, characterized in that, Construct a time gradient field for the predetermined solution preparation time points in the task pair, and apply a time offset based on the time gradient field to obtain the optimized solution preparation time points, including: Extract the predetermined solution preparation time point sequence of each task in the task pair, construct the density distribution function of the predetermined solution preparation time point sequence on the time axis, and perform gradient calculation to obtain the time gradient field. Identify the time region with the largest gradient value in the time gradient field, determine the conflict core region, and calculate the time center coordinates of the conflict core region to obtain the disturbance reference point. Traverse each predetermined solution preparation time point in the task pair, calculate the time distance of each predetermined solution preparation time point relative to the disturbance reference point, perform a vector cross product operation between the time distance and the gradient value of the time gradient field at the corresponding position to generate a disturbance direction vector, and determine the offset direction of each predetermined solution preparation time point based on the disturbance direction vector. The task calculates the overlap of predetermined solution preparation time points within the core conflict area, multiplies the overlap with the gradient peak of the disturbance reference point to obtain the disturbance intensity factor, and applies a time offset to each predetermined solution preparation time point based on the disturbance intensity factor and the offset direction to generate optimized solution preparation time points.
4. The method according to claim 1, characterized in that, Calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy threshold, extract the dense center points of the dense time distribution region and perform radial diffusion operation to generate a solution preparation time control scheme, including: The time axis is divided into multiple time windows according to the solution preparation cycle. The number of optimized solution preparation time points in each time window is counted. The proportion of the number of optimized solution preparation time points in each time window to the total number is calculated to construct a time window probability distribution vector. The entropy value of the time window probability distribution vector is calculated to obtain the distribution entropy value. When the distribution entropy value is lower than the preset entropy threshold, a two-dimensional density heat map of the optimized solution preparation time point on the time axis is constructed. The expansion kernel size is determined according to the density peak value. Each position point in the two-dimensional density heat map is traversed. With the current position point as the center, the maximum density value of the neighboring pixels within the expansion kernel size range is searched and replaced with the density value of the current position point until all position points are completed. Connected regions are extracted, and the area value of each connected region is calculated. Connected regions with an area value exceeding the preset area threshold are selected as dense time distribution regions, and the corresponding geometric center is extracted as the dense center point. Based on the radial repulsion force value constructed by the dense center point, the optimized solution preparation time point is driven to diffuse radially until the time interval reaches a state of equilibrium, thereby generating a solution preparation time control scheme.
5. The method according to claim 4, characterized in that, Based on the radial repulsive force value constructed from dense center points, the optimized solution preparation time point is driven to diffuse radially until the time interval reaches an equilibrium state, generating a solution preparation time control scheme including: Calculate the time distance between each optimized solution preparation time point and the dense center point within the dense time distribution area; determine the target time interval based on the time span of the dense time distribution area and the number of optimized solution preparation time points; and construct the radial repulsion force value of each optimized solution preparation time point based on the time deviation between the time distance and the target time interval. The diffusion direction and diffusion amplitude are determined based on the radial repulsion force value at each optimized solution preparation time point. Optimized solution preparation time points located before the dense center point are shifted forward, and optimized solution preparation time points located after the dense center point are shifted backward. The time positions of each optimized solution preparation time point are adjusted according to the diffusion direction and the diffusion amplitude. The deviation between the time interval of each optimized solution preparation time point and the adjacent optimized solution preparation time point after adjustment and the target time interval is calculated. When all deviations are less than the preset deviation threshold, it is determined that an equilibrium state has been reached, and a solution preparation time control scheme is generated.
6. The method according to claim 1, characterized in that, Extract the time cost matrix of historical task switching for executors. Convolve the time interval between adjacent tasks in the solution preparation time control scheme with the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor. Select the allocation scheme with the minimum total time cost to generate the task allocation results, including: Extract historical task records of each executor, identify the task type combination formed by the preceding and following task types between two adjacent tasks, extract the task switching start time and task switching end time corresponding to each task type combination, calculate the switching time by the time difference between the task switching start time and task switching end time, and fill the switching time into the corresponding position of the time cost matrix according to the correspondence between the preceding and following task types. Extract the task type and task execution time corresponding to each optimized solution preparation time point from the solution preparation time control scheme. Arrange the task types according to the order of task execution times to construct a task type sequence. Extract the preceding and following task types of adjacent positions in the task type sequence. Find the corresponding switching time value in the time cost matrix. Extract the time interval corresponding to adjacent tasks in the task type sequence. Perform convolution operation on each switching time value and the corresponding time interval and accumulate them to obtain the total time cost. Iterate through the sequence of personnel and task types to select the task allocation result with the lowest total time cost.
7. The method according to claim 6, characterized in that, Extract the time intervals corresponding to adjacent tasks in the task type sequence, perform convolution operations on each switching time value and its corresponding time interval, and sum them up to obtain the total time cost, which includes: A time interval vector is constructed based on the time interval. The historical completion rate data of the executors corresponding to each time interval in the time interval vector is statistically analyzed. The historical completion rate data records the ratio of the number of times the executor successfully completed task switching under the time interval condition to the total number of times. The reciprocal of the historical completion rate data is used as the time interval correction factor. Extract the switching time value corresponding to the adjacent task type in the task type sequence from the time cost matrix, construct the switching time vector, and perform element-wise multiplication operation on each switching time value in the switching time vector and the time interval at the corresponding position to obtain the initial convolution vector; The modified convolution vector is obtained by multiplying each element value in the initial convolution vector with the corresponding time interval correction factor. The total time cost of undertaking the task type sequence is obtained by summing all the element values in the modified convolution vector.
8. A multi-parameter collaborative optimization and control system for a solution preparation workstation, used to implement the method described in any one of claims 1-7, characterized in that, include: The time information unit is used to obtain the raw material delivery time information and the corresponding liquid preparation time interval sequence for multiple liquid preparation process tasks to be executed; Based on the raw material delivery time information and the solution preparation time interval sequence, multiple predetermined solution preparation time points are calculated and generated accordingly. The time conflict unit is used to construct cross-task time conflict tensors for multiple predetermined solution preparation time points. Through tensor decomposition, conflict coupling patterns between different tasks are extracted, the coupling strength of each conflict coupling pattern is calculated, task pairs with coupling strength exceeding a preset coupling threshold are identified, a time gradient field for predetermined solution preparation time points in the task pair is constructed, and a time offset is applied based on the time gradient field to obtain the optimized solution preparation time point. The control scheme unit is used to calculate the distribution entropy value of the optimal solution preparation time point. When the distribution entropy value is lower than the preset entropy value threshold, the dense center point of the dense time distribution area is extracted and radial diffusion operation is performed to generate a solution preparation time control scheme. The task allocation unit is used to extract the time cost matrix of historical task switching of the executor, perform convolution operation on the time interval of adjacent tasks in the liquid preparation time control scheme and the time cost matrix to obtain the total time cost of the task sequence undertaken by each executor, select the allocation scheme with the minimum total time cost, and generate the task allocation result. The reminder instruction unit is used to send reminder instructions to the personnel performing the tasks based on the task assignment results.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.