Batch processing methods, systems, devices, and media for determining quality of microbiological specimen test data
By employing batch processing methods in a relational database system, dividing time intervals and set numbers, and generating quality indicators for microbial specimen testing data, the inefficiency problem in existing technologies is solved, and efficient, real-time data quality assessment is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EIGHTH AFFILIATED HOSPITAL SUN YAT SEN UNIV (SHENZHEN FUTIAN)
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies for processing microbial specimen test data suffer from high time complexity and low computational efficiency, failing to meet the requirements of real-time performance and accuracy. Furthermore, they consume significant resources and are difficult to achieve efficient calculation and monitoring of quality indicators.
A batch processing method is adopted, which receives query instructions through a relational database system, divides time intervals and set numbers, and generates quality indicators based on an aggregation algorithm, avoiding traversal and loop operations and reducing the time complexity to O(1).
It improves the efficiency of microbial specimen testing data quality assessment, meets the real-time requirements of massive data, reduces resource consumption, and is suitable for scenarios with massive specimen testing data.
Smart Images

Figure CN122117192A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microbial testing, and in particular to batch processing methods, systems, equipment and media for determining the quality of microbial specimen testing data. Background Technology
[0002] In the clinical medical field, it is usually necessary to monitor the quality of microbial specimen testing data (such as blood culture specimen testing data) submitted to clinical microbiology laboratories. Currently, when statistically analyzing key quality indicators such as the "double bottle double set rate" of microorganisms in clinical microbiology laboratories, the microbial specimen testing data recorded in the Laboratory Information System (LIS, with embedded statistical analysis tools) is usually processed manually or semi-automatically to obtain the corresponding quality indicators.
[0003] However, traditional specimen testing data processing methods (such as the vernier loop method) require sorting the collected specimen testing data by patient and time, and then traversing and comparing the sorted dataset. This method requires at least one full data sort and multiple traversals / loops, resulting in high time complexity (typically O(N)). Furthermore, it is inefficient when processing large-scale data, with computation time increasing linearly with the data volume, leading to low computational efficiency. In addition, the code implementation is complex (including multiple loops and conditional statements), redundant, difficult to maintain and extend, and unable to achieve real-time, efficient indicator calculation and monitoring, thus failing to meet the timeliness and accuracy requirements of lean quality management in laboratories. Moreover, multiple data traversals and complex logic processing at the application layer consume significant CPU (Central Processing Unit) and memory resources. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a batch processing method, system, device, and medium for determining the quality of microbial specimen test data. This method improves the efficiency of microbial specimen test data quality assessment, and the processing time does not increase linearly with the amount of data. It is suitable for scenarios involving the determination of microbial specimen test data quality under massive amounts of test data, thus meeting the real-time requirements for quality assessment of microbial specimen test data. The specific solution is as follows:
[0005] In a first aspect, this application discloses a batch processing method for determining the quality of microbial specimen testing data, applied to a relational database system, comprising:
[0006] The system receives and responds to query commands to retrieve microbial specimen test records of different patients within a preset time period from the laboratory information system, thereby obtaining the current specimen test record set for each patient; the current specimen test record set carries the patient identifier and the specimen test record time.
[0007] The earliest specimen test record time in each of the current specimen test record sets is monitored, and the first partitioning logic code is executed to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the test record times of all microbial specimens in the current specimen test record set, and the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time;
[0008] The second partitioning logic code is executed to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, resulting in multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records within the same set, and the same set corresponds to all microbial specimen test records in the same time interval;
[0009] Based on a preset aggregation algorithm, the grouped specimen test records with the same set type in all patients are aggregated to obtain an aggregation result, and a quality index for determining the quality of microbial specimen test records for all patients is generated based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0010] Optionally, the batch processing method for determining the quality of microbial specimen test data further includes:
[0011] All microbial specimen test records falling within the same time interval are treated as the same set, and the same set number is generated for all microbial specimen test records within the same set.
[0012] The process of generating the set number is as follows:
[0013] The earliest specimen test record time is used as the time reference point corresponding to the current specimen test record set;
[0014] Calculate the difference between the specimen test record time and the time reference point for any microbial specimen test record in each time interval to obtain the specimen time difference, and calculate the ratio of the specimen time difference to the preset time window to obtain the set number of the corresponding time interval.
[0015] Optionally, calculating the ratio of the specimen time difference to a preset time window to obtain the set number for the corresponding time interval includes:
[0016] Calculate the ratio of the time difference of the specimen to the preset time window, and determine whether the ratio is an integer;
[0017] If the ratio is an integer, then the ratio is used as the set number for the corresponding time interval;
[0018] If the ratio is not an integer, the ratio is rounded down using a rounding function to obtain the set number for the corresponding time interval.
[0019] Optionally, the aggregation of the grouped specimen test records of the same set type from all patients to obtain the aggregation result includes:
[0020] The number of microbial specimen test records in each of the grouped specimen test records is counted to obtain the number of specimen test records, and it is determined whether the number of specimen test records is greater than 2;
[0021] If the number of specimen inspection records is greater than 2, the corresponding grouped specimen inspection records are determined to be of the double bottle double set type, and all grouped specimen inspection records determined to be of the double bottle double set type within the preset time period are aggregated to obtain the total number of double bottles double sets.
[0022] Optionally, the step of generating quality indicators based on the aggregation results to determine the quality of microbial specimen test records for all patients includes:
[0023] The total number of grouped specimen test records for all patients within the preset time period is counted to obtain the total number of sets.
[0024] The ratio of the total number of double bottles / double sets to the total number of sets is calculated to obtain the current double bottle / double set rate for assessing the quality of microbial specimen test records for all patients.
[0025] Optionally, after generating the quality indicators for determining the quality of microbial specimen test records for all patients based on the aggregation results, the method further includes:
[0026] Obtain multiple historical double-bottle double-set rates before the current time, and sort the multiple historical double-bottle double-set rates and the current double-bottle double-set rate in chronological order to obtain the sorted double-bottle double-set rate;
[0027] Determine whether there are a preset number of consecutive double-bottle double-set rates that are all greater than a preset threshold in the sorted double-bottle double-set rates;
[0028] If, after sorting, there are a preset number of consecutive double-bottle double-set rates that are all greater than a preset threshold, then an alarm message indicating abnormal sample test data quality will be generated.
[0029] Optionally, after generating the quality indicators for determining the quality of microbial specimen test records for all patients based on the aggregation results, the method further includes:
[0030] The current double-bottle double-set rate and the historical double-bottle double-set rate are input into a statistical analysis model based on machine learning algorithms to predict the double-bottle double-set rate for the next preset time period, thereby obtaining the predicted double-bottle double-set rate.
[0031] A specimen testing data quality report is generated based on the current double-bottle double-set rate, the historical double-bottle double-set rate, and the predicted double-bottle double-set rate, and the specimen testing data quality report is visualized.
[0032] Secondly, this application discloses a batch processing system for determining the quality of microbial specimen testing data, applied to a relational database system, comprising:
[0033] The query module is used to receive and respond to query commands to retrieve the microbial specimen test records of different patients within a preset time period from the laboratory information system, and obtain the current specimen test record set for each patient; the current specimen test record set carries the patient identifier and the specimen test record time;
[0034] The monitoring module is used to monitor the earliest specimen test record time in each of the current specimen test record sets;
[0035] The first execution module is used to execute the first partitioning logic code to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the time of all microbial specimen test records in the current specimen test record set; the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time.
[0036] The second execution module is used to execute the second partitioning logic code to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, so as to obtain multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records in the same set, and the same set corresponds to all microbial specimen test records in the same time interval;
[0037] An aggregation module is used to aggregate the grouped specimen test records with the same set type in all patients based on a preset aggregation algorithm, obtain an aggregation result, and generate a quality index for determining the quality of microbial specimen test records for all patients based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0038] Thirdly, this application discloses an electronic device including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the aforementioned batch processing method for determining the quality of microbial specimen test data.
[0039] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned batch processing method for determining the quality of microbial specimen test data.
[0040] As can be seen, this application is applied to a relational database system. It first receives and responds to a query command to retrieve microbial specimen test records of different patients within a preset time period from the laboratory information system, obtaining the current specimen test record set for each patient (carrying patient identification and specimen test record time). It then monitors the earliest specimen test record time in each of the current specimen test record sets and executes a first partitioning logic code to divide the target continuous time axis into multiple time intervals. The target continuous time axis is the continuous time axis corresponding to the test times of all microbial specimens in the current specimen test record set. The first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time. The application then executes... The second partitioning logic code groups the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, resulting in multiple grouped specimen test records. The set number is a number generated based on all microbial specimen test records within the same set, and the same set corresponds to all microbial specimen test records within the same time interval. Based on a preset aggregation algorithm, the grouped specimen test records with the same set type in all patients are aggregated to obtain an aggregation result, and a quality index for determining the quality of microbial specimen test records for all patients is generated based on the aggregation result. The set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0041] This application is applied to a relational database system. Upon receiving a query command, it first queries the laboratory information system (LIS) for microbial specimen test records of different patients within a preset time period to obtain a set of specimen test records. Then, it monitors the earliest specimen test record time in each set and, using the earliest specimen test record time as the starting point, divides the continuous time axis corresponding to the times of all microbial specimen test records in the set according to a preset time window to obtain multiple time intervals. Next, based on the patient identifier and the set number (the same set corresponds to all microbial specimen test records in the same time interval, and the set number of specimen test records within the same set is the same), it groups the microbial specimen test records in each set to obtain multiple grouped specimen test records. Finally, based on the preset aggregation algorithm, the grouped specimen test records of all patients with the same set type are aggregated, and the quality index of microbial specimen test records is generated based on the aggregation result. Through the above batch set merging method, there is no need to perform traversal and loop operations. It is only necessary to generate the same set number for all microbial specimen test records in the same time interval, and then group and aggregate the microbial specimen test records based on the set number and set type. The time complexity can be reduced from the traditional O(N) to O(1), thereby improving the efficiency of microbial specimen test data quality assessment. Moreover, the processing time does not increase linearly with the amount of data. It is suitable for the scenario of determining the quality of microbial specimen test data under massive specimen test data, thus meeting the real-time requirements for quality assessment of microbial specimen test data. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This application discloses a batch processing method for determining the quality of microbial specimen test data;
[0044] Figure 2 This application discloses a specific batch processing method for determining the quality of microbial specimen test data;
[0045] Figure 3 This is a schematic diagram of a batch processing system for determining the quality of microbial specimen test data disclosed in this application;
[0046] Figure 4 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] This application discloses a batch processing method for determining the quality of microbial specimen testing data, applied to a relational database system. See [link to relevant documentation]. Figure 1 As shown, the method includes:
[0049] Step S11: Receive and respond to the query command to query the microbial specimen test records of different patients within a preset time period from the laboratory information system, and obtain the current specimen test record set of each patient; the current specimen test record set carries the patient identifier and the specimen test record time.
[0050] It should be noted that the batch processing scheme proposed in this application for determining the quality of microbial specimen test data is specifically applied to relational database systems, such as Oracle, DB2, Microsoft SQL Server, Microsoft Access, MySQL, and other database systems.
[0051] In this embodiment, when the relational database system receives a query command, it first responds to the query command, and then queries the laboratory information system (LIS) through a preset interface (such as an API, application programming interface) for microbial specimen test records (such as blood culture specimen test records, drug-resistant bacteria specimen test records, etc.) of different patients p within a preset time period (such as 1 month, 3 months, 6 months, etc., which can be selected according to the actual application scenario). This yields the current specimen test record set for each patient p within the preset time period (denoted as...). A single microbial specimen test record is recorded as The current specimen test record set includes a patient identifier (used to uniquely identify each patient) and the specimen test record time (i.e., the time the specimen test record was generated / created / received, denoted as...). The patient identifier includes, but is not limited to, the patient's hospital number (denoted as...). Unique identifiers such as phone numbers and identity information are used to mark each patient. Specifically, the set of all patients within a preset time period can be labeled P. For any patient... .
[0052] It should be noted that the query command can be initiated by a terminal that needs to analyze microbial quality indicators, such as by laboratory personnel through a computer terminal in a clinical microbiology laboratory, and can be triggered according to a preset cycle.
[0053] Step S12: Monitor the earliest specimen test record time in each of the current specimen test record sets, and execute the first partitioning logic code to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the test record times of all microbial specimens in the current specimen test record set, and the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time.
[0054] In this embodiment, the relational database system queries the current specimen test record set of each patient p within a preset time period. Subsequently, the current specimen test record set for each patient p was analyzed. Record the time of all specimen examinations carried inside. The earliest specimen test record time in the set is monitored, that is, the earliest record time among all specimen test records in a single specimen test record set is obtained, denoted as: , It is a universal quantifier, meaning "for all", "any", or "any one".
[0055] Next, the pre-created first partitioning logic code is executed, which checks the record time using the earliest specimen. Starting from this point, the current specimen test records for each patient are processed according to a preset time window W (e.g., 120 minutes, 90 minutes, or 180 minutes). The continuous time axis corresponding to the examination records of all microbial specimens was divided to obtain multiple discrete time intervals.
[0056] It should be noted that the size of the preset time window W can be set according to actual application needs. For example, it can be set according to the duration of the "same set" during blood culture specimen testing, meaning that all blood culture specimen testing records within this window are from the same set. Specifically, it can be set according to the standard operating procedures for clinical blood culture. For instance, adults should have 2-3 sets of blood cultures collected each time, from different sites, such as both arms (left and right). Each set should include one aerobic bottle and one anaerobic bottle to maximize pathogen detection rate and reduce contamination interference. Furthermore, collection should be performed within the preset time.
[0057] Step S13: Execute the second partitioning logic code to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, to obtain multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records in the same set, and the same set corresponds to all microbial specimen test records in the same time interval.
[0058] In this embodiment, after dividing the target continuous time axis into multiple time intervals, the database system continues to execute the pre-created second partitioning logic code. This code treats all microbial specimen test records within the same time interval as the same set and generates the same set number (denoted as ) for all microbial specimen test records within the same set. This means that all microbial specimen test records within the same set have the same set number. Therefore, for all microbial specimen test records within the same time interval, only the set number needs to be calculated once, and there is no need to repeatedly calculate the set number of all records.
[0059] Next, based on the patient identifier and the package number (i.e. The microbial specimen test records in each current specimen test record set are grouped to obtain multiple grouped specimen test records for each patient.
[0060] Specifically, the process of generating the set number includes: classifying all microbial specimen test records falling within the same time interval as the same set, and generating the same set number for all microbial specimen test records within the same set; wherein the process of generating the set number can specifically be: taking the earliest specimen test record time as the time reference point corresponding to the current specimen test record set; calculating the difference between the specimen test record time corresponding to any microbial specimen test record in each time interval and the time reference point to obtain the specimen time difference, and calculating the ratio of the specimen time difference to a preset time window to obtain the set number for the corresponding time interval. In this embodiment, after dividing the target continuous time axis, all microbial specimen test records falling within the same time interval (the length of which is the size of the preset time window, i.e., 120 minutes) are classified as the same set, and then the same set number is generated for all microbial specimen test records within the same set. In other words, all specimen test records from the same patient within the same time interval share the same set number and are therefore automatically grouped into the same set. Specifically, the earliest specimen test record time can be... As the current specimen examination record set The corresponding time reference point is used, and then the specimen test record time corresponding to any microbial specimen test record in each time interval is calculated. With time reference point (i.e.) The difference between the specimen time difference and the preset time window W is used to obtain the sample time difference. Then, the ratio of the specimen time difference to the preset time window W is calculated to obtain the set number of the corresponding time interval (i.e., ).
[0061] Specifically, calculating the ratio of the specimen time difference to the preset time window to obtain the set number for the corresponding time interval may include: calculating the ratio of the specimen time difference to the preset time window and determining whether the ratio is an integer; if the ratio is an integer, then using the ratio as the set number for the corresponding time interval; if the ratio is not an integer, then using a rounding function to round the ratio to obtain the set number for the corresponding time interval. For example, calculating the ratio of the specimen time difference to the preset time window, and then determining whether the ratio is an integer; if the ratio is an integer, then directly using the ratio as the set number for the corresponding time interval (i.e., If the ratio is not an integer (e.g., the ratio is a decimal), then a rounding function is used to round the ratio to obtain the set number. Rounding functions include, but are not limited to, rounding up and rounding down functions, or rounding by using a rounding method. For example, by using a rounding down function, the set number (i.e., ...) is obtained. The specific calculation formula is as follows:
[0062] ;
[0063] In the formula, This represents the floor function.
[0064] In another specific implementation, a preset fixed time point can also be used as the time reference point corresponding to the current specimen test record set (e.g., midnight of each day or other fixed time points as the time reference point).
[0065] Step S14: Based on a preset aggregation algorithm, aggregate the grouped specimen test records with the same set type in all patients to obtain the aggregation result, and generate a quality index for determining the quality of microbial specimen test records for all patients based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0066] In this embodiment, after grouping the microbial specimen test records in each current specimen test record set, the set type of each grouped specimen test record is determined, and based on a preset aggregation algorithm (such as the COUNT function, SUM function, etc.), the grouped specimen test records with the same set type in all patients are aggregated to obtain the aggregation result. Then, based on the aggregation result, a quality index is generated to evaluate the quality of the microbial specimen test records of all patients within a preset time period.
[0067] In one specific implementation, aggregating the grouped specimen test records of the same set type from all patients to obtain the aggregation result may specifically include: counting the number of microbial specimen test records in each grouped specimen test record to obtain the number of specimen test records, and determining whether the number of specimen test records is greater than 2; if the number of specimen test records is greater than 2, then the corresponding grouped specimen test record is identified as a double-bottle double-set type, and all grouped specimen test records identified as double-bottle double-set type within the preset time period are aggregated to obtain the total number of double-bottle double-sets. In this embodiment, the number of microbial specimen test records in each grouped specimen test record can be counted to obtain the corresponding number of specimen test records, i.e., the actual number of culture bottles for each set. Specifically, it can be expressed as: .
[0068] Next, the number of specimen test records is determined according to clinical rules (i.e., If the number of test records is greater than 2, it indicates that the current batch (i.e., the test record after grouping) is of the double-bottle double-set type. Then, all batches (i.e., the test records after grouping) that are determined to be of the double-bottle double-set type within the preset time period are aggregated to obtain the total number of double-bottle double-sets for the current experimental sample. When the number of test records (i.e., the number of test records) is greater than 2, it indicates that the current batch (i.e., the test record after grouping) is of the double-bottle double-set type. When the number of sets is not greater than 2, the corresponding set (i.e., the specimen inspection record after grouping) can be determined as a single set type.
[0069] The criteria for determining the type of apartment can be expressed as follows: .
[0070] In this embodiment, generating quality indicators based on the aggregation results to determine the quality of microbial specimen test records for all patients may specifically include: counting the total number of grouped specimen test records for all patients within the preset time period to obtain the total number of sets; calculating the ratio of the total number of double-bottle double-set records to the total number of sets to obtain the current double-bottle double-set rate used to evaluate the quality of microbial specimen test records for all patients. In this embodiment, the total number of grouped specimen test records for all patients within the preset time period can be counted first to obtain the total number of sets, and then the total number of double-bottle double-set records can be calculated. Total number of sets The ratio of these ratios is used to obtain the current double-bottle double-set rate R, which is used to assess the quality of microbiological specimen examination records for all patients. The specific calculation formula is as follows: .
[0071] Furthermore, after generating quality indicators for determining the quality of microbial specimen test records for all patients based on the aggregation results, the process may further include: inputting the current double-bottle double-set rate and the historical double-bottle double-set rate into a statistical analysis model based on a machine learning algorithm to predict the double-bottle double-set rate for the next preset duration, thereby obtaining a predicted double-bottle double-set rate; generating a specimen test data quality report based on the current double-bottle double-set rate, the historical double-bottle double-set rate, and the predicted double-bottle double-set rate, and visually displaying the specimen test data quality report. In this embodiment, after obtaining the quality indicator (such as the current double-bottle double-set rate R), the current double-bottle double-set rate and the historical double-bottle double-set rates corresponding to multiple historical preset time periods before the current moment can be input into a statistical analysis model based on machine learning algorithms to predict the double-bottle double-set rate for the next preset time period, thus obtaining a new double-bottle double-set rate (i.e., the predicted double-bottle double-set rate). Then, a data quality report for the current specimen testing record can be generated based on the current double-bottle double-set rate, historical double-bottle double-set rate, and predicted double-bottle double-set rate. This data quality report can then be visualized, including but not limited to time trend charts, scatter plots, and geographic heatmaps. For example, a trend chart of drug-resistant bacteria detection rate, a heatmap of antimicrobial resistance spectrum, and a departmental distribution map of multidrug-resistant bacteria can be generated. Through the above methods (such as generating quality reports and visualization), it is beneficial to conduct more comprehensive management of the data quality of specimen testing records, and to promptly detect anomalies, thereby meeting the intelligent and visualized operational management needs of clinical microbiology laboratory quality management. Furthermore, statistical analysis models based on machine learning algorithms can predict the future trends of key quality indicators (such as the double-bottle double-set rate), provide early warnings of potential risks, automatically discover correlations between indicators, and intelligently identify abnormal fluctuations or deviations in the data (such as an abnormal increase in the microbial contamination rate on a certain day), thereby focusing on the root cause of the problem and providing data support for the formulation of accurate decisions.
[0072] Specifically, corresponding charts (such as line charts, bar charts, pie charts, and dashboards) can be dynamically generated using configurable chart components created in advance based on front-end chart libraries (such as ECharts, D3.js, AntV, etc.), thereby visually displaying the information in the specimen inspection data quality report (such as the current double-bottle double-set rate, historical double-bottle double-set rate, and predicted double-bottle double-set rate).
[0073] As can be seen, this embodiment of the application is applied to a relational database system. Upon receiving a query command, it first queries the laboratory information system (LIS) for microbial specimen test records of different patients within a preset time period to obtain a set of specimen test records. Then, it monitors the earliest specimen test record time in each set and, using the earliest specimen test record time as the starting point, divides the continuous time axis corresponding to the times of all microbial specimen test records in the set according to a preset time window to obtain multiple time intervals. Next, based on the patient identifier and the set number (the same set corresponds to all microbial specimen test records in the same time interval, and the set number of specimen test records within the same set is the same), it groups the microbial specimen test records in each set to obtain multiple grouped specimen test records. The data is recorded, and finally, based on a preset aggregation algorithm, the grouped specimen test records of all patients with the same set type are aggregated. Based on the aggregation results, the quality index of the microbial specimen test records is generated. Through the above batch set merging method, there is no need to perform traversal and loop operations. It is only necessary to generate the same set number for all microbial specimen test records in the same time interval, and then group and aggregate the microbial specimen test records based on the set number and set type. The time complexity can be reduced from the traditional O(N) to O(1), thereby improving the efficiency of microbial specimen test data quality assessment. Moreover, the processing time does not increase linearly with the amount of data. It is suitable for the scenario of determining the quality of microbial specimen test data under massive specimen test data, thus meeting the real-time requirements for quality assessment of microbial specimen test data.
[0074] This application discloses a specific batch processing method for determining the quality of microbial specimen testing data, applied to a relational database system. See [link to relevant documentation]. Figure 2 As shown, the method includes:
[0075] Step S21: Receive and respond to the query command to query the microbial specimen test records of different patients within a preset time period from the laboratory information system, and obtain the current specimen test record set of each patient; the current specimen test record set carries the patient identifier and the specimen test record time.
[0076] Step S22: Monitor the earliest specimen test record time in each of the current specimen test record sets, and execute the first partitioning logic code to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the test record times of all microbial specimens in the current specimen test record set, and the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time.
[0077] Step S23: Execute the second partitioning logic code to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, to obtain multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records within the same set, and the same set corresponds to all microbial specimen test records in the same time interval.
[0078] Step S24: Based on a preset aggregation algorithm, aggregate the grouped specimen test records with the same set type in all patients to obtain the aggregation result, and generate a quality index for determining the quality of microbial specimen test records for all patients based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0079] Step S25: Obtain multiple historical double-bottle double-set rates before the current time, and sort the multiple historical double-bottle double-set rates and the current double-bottle double-set rate in chronological order to obtain the sorted double-bottle double-set rate.
[0080] In this embodiment, after generating quality indicators (such as the current double-bottle double-set rate) for determining the quality of microbial specimen test records for all patients based on the aggregation results, the historical double-bottle double-set rate (i.e., the double-bottle double-set rate obtained after performing steps S21 to S24 on the historical microbial specimen test records within the historical time period) corresponding to multiple historical preset durations (i.e., historical time periods) before the current time period can be further obtained. Then, the multiple historical double-bottle double-set rates and the current double-bottle double-set rate (ranked last) are sorted according to the chronological order (i.e., starting from the earliest recording time) to obtain the sorted double-bottle double-set rate.
[0081] Step S26: Determine whether there are a preset number of consecutive double-bottle double-set rates that are all greater than a preset threshold in the sorted double-bottle double-set rates.
[0082] In this embodiment, the sorted double-bottle double-set rate is analyzed to determine whether there are multiple consecutive double-bottle double-set rates that are all greater than a preset threshold.
[0083] Step S27: If there are a preset number of consecutive double-bottle double-set rates in the sorted double-bottle double-set rates that are all greater than a preset threshold, then generate an alarm message indicating abnormal sample test data quality.
[0084] In this embodiment, if multiple consecutive double-bottle double-set rates appear in the sorted double-bottle double-set rate list, it indicates that the current double-bottle double-set rate is high. At this time, an alarm message indicating abnormal sample test data quality can be generated and sent to the corresponding terminal that initiated the query command. For example, when the sorted double-bottle double-set rate exceeds the preset threshold X% for three consecutive days, an alarm is triggered, and an alarm message (such as a red highlight or pop-up window) is generated on the system interface.
[0085] For more detailed processing procedures of steps S21 to S24, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0086] As can be seen, after generating quality indicators for determining the quality of microbial specimen test records for all patients based on the aggregation results, this embodiment of the application obtains multiple historical double-bottle double-set rates before the current time, and sorts the multiple historical double-bottle double-set rates and the current double-bottle double-set rates in chronological order to obtain the sorted double-bottle double-set rates. Then, it determines whether there are a preset number of consecutive double-bottle double-set rates greater than a preset threshold in the sorted double-bottle double-set rates. If so, an alarm message for abnormal specimen test data quality is generated. In this way, alarms can be issued in a timely manner for abnormal quality indicators. In addition, compared with the traditional cursor loop method, the above method replaces the lengthy sorting loop and condition judgment operation, reduces the error rate, and improves the readability, maintainability and portability of the system. Furthermore, without the need for traversal and loop operations, only a single aggregation operation is required from the database system. This reduces the computational complexity from the traditional O(N) to O(1), and the computation time from minutes to seconds or even milliseconds, thereby improving the statistical efficiency of microbial test kits. Moreover, the computation time does not increase linearly with the amount of data, and the performance curve is stable, which can meet the challenges brought by future data growth. It is suitable for test kit statistical scenarios under massive specimen test data, thus meeting the real-time requirements for quality assessment of microbial specimen test data and improving the efficiency of quality assessment of microbial specimen test data.
[0087] Accordingly, embodiments of this application also disclose a batch processing system for determining the quality of microbial specimen testing data, applied to a relational database system, see [link to relevant documentation]. Figure 3 As shown, the device includes:
[0088] Query module 11 is used to receive and respond to query commands to query the microbial specimen test records of different patients within a preset time period from the laboratory information system, and obtain the current specimen test record set of each patient; the current specimen test record set carries the patient identifier and the specimen test record time;
[0089] Monitoring module 12 is used to monitor the earliest specimen test record time in each of the current specimen test record sets;
[0090] The first execution module 13 is used to execute the first partitioning logic code to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the time of all microbial specimen test records in the current specimen test record set; the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time.
[0091] The second execution module 14 is used to execute the second partitioning logic code to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, so as to obtain multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records in the same set, and the same set corresponds to all microbial specimen test records in the same time interval;
[0092] The aggregation module 15 is used to aggregate the grouped specimen test records with the same set type in all patients based on a preset aggregation algorithm, obtain the aggregation result, and generate a quality index for determining the quality of microbial specimen test records in all patients based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
[0093] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0094] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0095] Figure 4This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the batch processing method for determining the quality of microbial specimen test data disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0096] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0097] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0098] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the batch processing method for determining the quality of microbial specimen test data executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0099] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned batch processing method for determining the quality of microbial specimen test data. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0100] Furthermore, embodiments of this application also disclose a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the batch processing method for determining the quality of microbial specimen test data as disclosed above.
[0101] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0102] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0103] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0104] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0105] The above provides a detailed description of the batch processing method, system, equipment, and media for determining the quality of microbial specimen testing data provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A batch processing method for determining the quality of microbial specimen test data, characterized in that, Applied to relational database systems, including: The system receives and responds to query commands to retrieve microbial specimen test records of different patients within a preset time period from the laboratory information system, thereby obtaining the current specimen test record set for each patient; the current specimen test record set carries the patient identifier and the specimen test record time. The earliest specimen test record time in each of the current specimen test record sets is monitored, and the first partitioning logic code is executed to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the test record times of all microbial specimens in the current specimen test record set, and the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time; The second partitioning logic code is executed to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, resulting in multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records within the same set, and the same set corresponds to all microbial specimen test records in the same time interval; Based on a preset aggregation algorithm, the grouped specimen test records with the same set type in all patients are aggregated to obtain an aggregation result, and a quality index for determining the quality of microbial specimen test records for all patients is generated based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
2. The batch processing method for determining the quality of microbial specimen test data according to claim 1, characterized in that, Also includes: All microbial specimen test records falling within the same time interval are treated as the same set, and the same set number is generated for all microbial specimen test records within the same set. The process of generating the set number is as follows: The earliest specimen test record time is used as the time reference point corresponding to the current specimen test record set; Calculate the difference between the specimen test record time and the time reference point for any microbial specimen test record in each time interval to obtain the specimen time difference, and calculate the ratio of the specimen time difference to the preset time window to obtain the set number of the corresponding time interval.
3. The batch processing method for determining the quality of microbial specimen test data according to claim 2, characterized in that, The step of calculating the ratio of the specimen time difference to the preset time window to obtain the set number of the corresponding time interval includes: Calculate the ratio of the time difference of the specimen to the preset time window, and determine whether the ratio is an integer; If the ratio is an integer, then the ratio is used as the set number for the corresponding time interval; If the ratio is not an integer, the ratio is rounded down using a rounding function to obtain the set number for the corresponding time interval.
4. The batch processing method for determining the quality of microbial specimen test data according to claim 1, characterized in that, The aggregation of the grouped specimen test records of the same set type from all patients yields the aggregation results, including: The number of microbial specimen test records in each of the grouped specimen test records is counted to obtain the number of specimen test records, and it is determined whether the number of specimen test records is greater than 2; If the number of specimen inspection records is greater than 2, the corresponding grouped specimen inspection records are determined to be of the double bottle double set type, and all grouped specimen inspection records determined to be of the double bottle double set type within the preset time period are aggregated to obtain the total number of double bottles double sets.
5. The batch processing method for determining the quality of microbial specimen test data according to claim 4, characterized in that, The quality indicators generated based on the aggregation results to determine the quality of microbial specimen test records for all patients include: The total number of grouped specimen test records for all patients within the preset time period is counted to obtain the total number of sets. The ratio of the total number of double bottles / double sets to the total number of sets is calculated to obtain the current double bottle / double set rate for assessing the quality of microbial specimen test records for all patients.
6. The batch processing method for determining the quality of microbial specimen test data according to claim 5, characterized in that, After generating quality indicators based on the aggregation results to determine the quality of microbial specimen test records for all patients, the process further includes: Obtain multiple historical double-bottle double-set rates before the current time, and sort the multiple historical double-bottle double-set rates and the current double-bottle double-set rate in chronological order to obtain the sorted double-bottle double-set rate; Determine whether there are a preset number of consecutive double-bottle double-set rates that are all greater than a preset threshold in the sorted double-bottle double-set rates; If, after sorting, there are a preset number of consecutive double-bottle double-set rates that are all greater than a preset threshold, then an alarm message indicating abnormal sample test data quality will be generated.
7. The batch processing method for determining the quality of microbial specimen test data according to claim 6, characterized in that, After generating quality indicators based on the aggregation results to determine the quality of microbial specimen test records for all patients, the process further includes: The current double-bottle double-set rate and the historical double-bottle double-set rate are input into a statistical analysis model based on machine learning algorithms to predict the double-bottle double-set rate for the next preset time period, thereby obtaining the predicted double-bottle double-set rate. A specimen testing data quality report is generated based on the current double-bottle double-set rate, the historical double-bottle double-set rate, and the predicted double-bottle double-set rate, and the specimen testing data quality report is visualized.
8. A batch processing system for determining the quality of microbial specimen test data, characterized in that, Applied to relational database systems, including: The query module is used to receive and respond to query commands to retrieve the microbial specimen test records of different patients within a preset time period from the laboratory information system, and obtain the current specimen test record set for each patient; the current specimen test record set carries the patient identifier and the specimen test record time; The monitoring module is used to monitor the earliest specimen test record time in each of the current specimen test record sets; The first execution module is used to execute the first partitioning logic code to divide the target continuous time axis into multiple time intervals; the target continuous time axis is the continuous time axis corresponding to the time of all microbial specimen test records in the current specimen test record set; the first partitioning logic code is used to divide the target continuous time axis according to a preset time window, starting from the earliest specimen test record time. The second execution module is used to execute the second partitioning logic code to group the microbial specimen test records in each of the current specimen test record sets based on the patient identifier and the set number, so as to obtain multiple grouped specimen test records; the set number is a number generated based on all microbial specimen test records in the same set, and the same set corresponds to all microbial specimen test records in the same time interval; An aggregation module is used to aggregate the grouped specimen test records with the same set type in all patients based on a preset aggregation algorithm, obtain an aggregation result, and generate a quality index for determining the quality of microbial specimen test records for all patients based on the aggregation result; wherein, the set type is determined based on the total number of microbial specimen test records in the grouped specimen test records.
9. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the batch processing method for determining the quality of microbial specimen test data as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when executed by a processor, the computer programs implement the batch processing method for determining the quality of microbial specimen test data as described in any one of claims 1 to 7.