Traditional Chinese medicinal material product quality control and tracing method and system
By obtaining the weight data of Chinese medicinal materials, binding tag numbers and calculating the time difference, the problem of lack of judgment standards in the quality control and traceability system of Chinese medicinal materials is solved, accurate screening of medicinal materials and real-time monitoring of data is realized, the system's automatic identification and information purification capabilities are improved, and the reliability of traceable data is ensured.
Patent Information
- Application Number
- CN202510900232.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-01
AI Technical Summary
The existing Chinese medicinal materials quality control and traceability system lacks key judgment standards and indicator systems, resulting in the inability to clearly judge the quality of medicinal materials, lack of real-time linkage of information registration, cannot be automatically identified in data abnormal status, and the system lacks information purification capabilities, and has traceability loopholes.
By obtaining the weight data of Chinese medicinal materials, conducting preliminary screening, binding tag numbers, calculating time difference values, generating time abnormal records, updating traceability permissions, screening quality qualified medicinal materials, and establishing a list of traceable data for Chinese medicinal materials.
It has realized the accurate screening of traditional Chinese medicinal materials, enhanced source control, guaranteed the specificity of traceability information, improved early warning capabilities, prevented risky medicinal materials from entering the traceability chain, and improved the reliability of traceability data.
Smart Images

Figure CN120410336A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quality traceability, and particularly to a method and system for quality control and traceability of Chinese herbal medicine products. Background Art
[0002] The technical field of quality traceability includes the whole-process technology of information collection, recording and management of products in various links such as production, processing and circulation. The aim is to track and confirm the source and flow of product quality through digital means. The core content is to achieve traceability of the whole process of product life cycle based on information management means, including registration of raw material sources, recording of production and processing processes, monitoring of warehousing and transportation, and display of traceability information at the sales terminal. The technologies covered in this field usually include means such as bar code identification, electronic tag identification, data collection, information storage and processing, visual query interface, and information encrypted transmission, and are widely used in product chains with safety supervision requirements such as food, medicine, and agricultural products.
[0003] Among them, the method for quality control and traceability of Chinese herbal medicine products refers to the whole-process information traceability method established for quality assurance and traceability management of Chinese herbal medicine in links such as planting, harvesting, primary processing, storage and sales, covering information collection and registration of key elements such as variety information, planting environment parameters, harvesting time, drying treatment method, judgment basis of medicinal material grade, packaging batch and circulation record of Chinese herbal medicine, and storing the information into a dedicated platform through the association method of two-dimensional code identification and database, and completing information traceability display through the query interface of the user terminal, generally completed by means such as image shooting, weighing record, manual input, etc. The information is registered and entered into the database system in a unified format, and one object one code management is realized through a unified coding rule.
[0004] In the existing quality control and traceability process of Chinese herbal medicine, there is a lack of support from key judgment criteria and index systems, resulting in no clear judgment basis for the quality of medicinal materials in the preliminary screening stage, and it is easy for unqualified medicinal materials to enter the label binding process. Information registration is often mainly static records, lacking real-time linkage with the actual label generation time, resulting in delayed labeling that cannot be recognized in time. As a basic discriminant condition for information authenticity, the time dimension is not effectively utilized in the existing system, and abnormal identifications mostly rely on manual discovery, resulting in the system lacking automatic recognition ability. After the generation of data abnormal states, they are often disconnected from the system permission control, and it is impossible to automatically isolate data objects with doubts, resulting in the continuation of information pollution to the user query terminal and affecting the data trust structure. The screening logic mainly relies on single quality judgment or status label judgment, resulting in the inability to eliminate some medicinal materials with abnormal identification information but seemingly qualified on the surface, leaving potential traceability loopholes. In the whole-chain operation process of the traceability system, if an accurate time response mechanism is not established or a dual-factor screening rule is not constructed, great limitations will be shown in source identification, anti-proliferation control, and data purification. Summary of the Invention
[0005] The object of the present invention is to solve the disadvantages existing in the prior art, and a method for quality control and traceability of Chinese herbal medicine products is proposed.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions: A method for quality control and traceability of Chinese herbal medicine products, comprising the following steps: S1: Obtain the weight data of Chinese herbal medicines, compare the measured weight with the lowest standard quality, determine the corresponding medicines to be excluded, attach medicine numbers, and generate a preliminary screening result set of medicines; S2: Based on the preliminary screening result set of medicines, read the medicine numbers and status identifiers, and cooperate with the label numbers to bind the relationship between medicines and labels one by one, and generate a label binding index table; S3: According to the label binding index table, calculate the absolute time difference between the label generation time and the data storage time, compare it with the preset time tolerance threshold, judge the medicines with abnormal time synchronization in the current state, and generate a time anomaly record set; S4: Read the medicine numbers with abnormal time synchronization in the time anomaly record set, match the numbers with the list of medicine information to be included in the traceability chain, mark the successfully matched numbers as the traceability locked state, and generate a traceability permission update log; S5: Based on the traceability permission update log, count the medicine numbers that can be included in the traceability chain, read the corresponding quality status identifiers and label time statuses and conduct cross-comparison, screen the medicine records with qualified quality and synchronized label information, and summarize and generate a list of traceable data for the quality of Chinese herbal medicines.
[0007] As a further solution of the present invention, the preliminary screening result set of medicines includes status identifiers, medicine numbers, and quality evaluation results. The label binding index table includes identification status, label numbers, generation time, and medicine number mapping relationships. The time anomaly record set includes medicine numbers, anomaly types, time differences, and anomaly identifiers. The traceability permission update log includes traceability locked state, matching numbers, and status change times. The list of traceable data for the quality of Chinese herbal medicines includes quality status, label time status, traceable numbers, and screening pass identifiers.
[0008] As a further solution of the present invention, the specific steps for obtaining the preliminary screening result set of medicines are as follows: S111: Based on the weighing values measured by the electronic scale for Chinese herbal medicines, compare them with the lowest standard quality of the corresponding Chinese herbal medicine categories in the standard database, count the coding information of the medicines corresponding to the weighing values and the lowest quality values respectively, and obtain quality deviation records; S112: According to the recorded quality deviation, in combination with the lowest quality threshold information in the standard database, judge item by item whether the deviation value is negative. If it is negative, mark the current medicinal material status as to be rejected, record the medicinal material number, and obtain the set of unqualified medicinal material identifications; S113: According to the set of unqualified medicinal material identifications, integrate the weighing value, standard minimum quality value, quality deviation value, and status identification of each medicinal material, and calculate the status score of the Chinese medicinal materials , perform status score - number mapping, and establish a preliminary screening result set of medicinal materials.
[0009] As a further solution of the present invention, the steps for obtaining the label binding index table are specifically as follows: S211: Based on the preliminary screening result set of medicinal materials, extract the medicinal material number and the corresponding status identification, read each item of the medicinal material number field and uniformly convert it into a standard character format, establish a pairing structure of the number and the status identification, and obtain the number - status mapping set; S212: According to the number - status mapping set, obtain the label number, make the medicinal material number correspond to the label number one by one, form a pair of the medicinal material number and the label number through item - by - item binding operation, establish a binding status record, and obtain the label association pairing result; S213: According to the label association pairing result, integrate the medicinal material number, status identification, label number, and generation time content of each binding record, sort them in ascending order according to the number field, and sequentially enter the sorted records into a table structure to establish a label binding index table.
[0010] As a further solution of the present invention, the steps for obtaining the time anomaly record set are specifically as follows: S311: According to the binding time field in the label binding index table, read the label number and generation time corresponding to each record, extract the corresponding warehousing time field, and confirm whether there is an abnormal time format through field comparison to generate a label warehousing time comparison set; S312: According to the label warehousing time comparison set, read the generation time and warehousing time in each pair of records, calculate the difference between the two timestamps and take the absolute value, compare it with the preset time tolerance threshold, determine the status of the medicinal materials with time synchronization anomalies, and obtain a time error identification list; S313: Based on the time error identification list, extract the records with the status field being time synchronization anomaly, sort them in ascending order according to the medicinal material number field, construct a table - type structure for storage, and generate a time anomaly record set after sorting.
[0011] As a further solution of the present invention, the steps for obtaining the traceability permission update log are specifically as follows: S411: Based on the time anomaly record set, extract the medicinal material number field in each anomaly record and uniformly convert it into a standard format number. Combine it with the medicinal material information list to be included in the traceability chain, and perform item-by-item matching according to the number field to generate a traceability number matching list; S412: According to the medicinal material numbers in the traceability number matching list, write the traceability status fields item by item, synchronously register the change time as the current system timestamp, calculate the traceability write deviation value, and synchronously establish a traceability status registration form; S413: Based on the traceability status registration form, construct a log structure according to the record order, integrate it into structured text information to form record entries, and append the system user information and operation IP fields at the end of each entry. Export a queryable log document to establish a traceability permission update log.
[0012] As a further solution of the present invention, the steps for obtaining the Chinese medicinal material quality traceability data list are specifically as follows: S511: Based on the traceability permission update log, read the label status and quality status information corresponding to the medicinal material numbers, perform format verification and anomaly record filtering on the two fields respectively, record the source log time field, and establish a traceability status medicinal material information set; S512: According to the traceability status medicinal material information set, perform a cross-comparison operation on the quality status identification field and the label status identification field of each record, record the qualified entries with successful status matching, and perform consistency verification on the format of each time field to construct a set of medicinal materials with consistent quality labels; S513: According to all the valid medicinal material numbers in the set of medicinal materials with consistent quality labels, sort them in ascending order by number, output the field content in a unified format, and write them item by item in the traceability chain output directory according to the record order to establish a Chinese medicinal material quality traceability data list.
[0013] A Chinese medicinal material product quality control and traceability system includes: The quality screening module obtains the measured weight data of the electronic scale, combines it with the minimum standard quality, compares and identifies the status and medicinal material numbers, and generates a preliminary medicinal material screening result set; The label matching module binds the label numbers based on the medicinal material numbers in the preliminary medicinal material screening result set, records the status, label numbers and time, and generates a label binding index table; The time verification module reads the corresponding medicinal material data storage time according to the label generation time in the label binding index table, calculates the absolute difference, compares it with the preset time tolerance threshold, screens out the items with time differences exceeding the limit and assigns an abnormal status, and generates a time anomaly record set; The traceability identification module matches the numbers to be included in the traceability chain in the database based on the medicinal material numbers in the time anomaly record set, marks the traceability locked status, and generates a traceability permission update log; The quality archiving module updates the traceable number based on the traceability permission update log, compares the quality status with the time status value, filters out compliant records, and generates a list of traceable data for the quality of Chinese medicinal materials.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In the present invention, precise screening is achieved through the weight of the processed Chinese medicinal materials, substandard medicinal materials are excluded, the control force at the source is enhanced, the process synchronization status identifier is bound to the label number to ensure the exclusivity of the traceability information, the time difference comparison mechanism identifies data anomalies, realizes the active verification of information lag, improves the early warning ability, the abnormal status triggers the traceability limit mark, forms an information closed-loop, prevents risky medicinal materials from entering the traceable chain, cross-checks the quality status and the time status, constructs a dual-factor filtering model, improves the reliability of the traceability data, and establishes a whole-process dynamic quality control and traceability path. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is the main process flow chart of the present invention; Figure 2 is the flow chart for obtaining the initial screening result set of the medicinal materials of the present invention; Figure 3 is the flow chart for obtaining the label binding index table of the present invention; Figure 4 is the flow chart for obtaining the set of time anomaly records of the present invention; Figure 5 is the flow chart for obtaining the traceability permission update log of the present invention; Figure 6 is the flow chart for obtaining the list of traceable data for the quality of Chinese medicinal materials of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0017] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, in the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0018] Please refer toFigure 1 , a method for controlling and tracing the quality of traditional Chinese medicine products, comprising the following steps: S1: Obtain the weight data of the traditional Chinese medicine measured by an electronic scale. According to the minimum quality requirements specified in the Pharmacopoeia of the People's Republic of China (the legal basis for the current quality standards of traditional Chinese medicine in China) corresponding to the category of traditional Chinese medicine, compare the measured weight with the minimum standard quality. If it is less than the minimum standard quality, assign the corresponding medicine the status label of "to be rejected", and attach a medicine number to generate a preliminary screening result set of medicines; S2: Based on the preliminary screening result set of medicines, read the medicine numbers and status labels contained therein, and synchronize with the label numbers generated by the GS1 coding system (an internationally common commodity coding and traceability identification system) to bind the medicines and labels one by one, record the identification status, label number, and generation time, and generate a label binding index table; S3: According to the label generation time in the label binding index table, obtain the storage time point when the corresponding medicine record enters the database, calculate the absolute time difference between the label generation time and the data storage time, and compare it with the preset time tolerance threshold (the maximum allowable time interval for data collection and system entry set according to the enterprise production regulations, determined through equipment response testing). If the absolute time difference is greater than the threshold, record the current medicine status as "time synchronization abnormal" and generate a time anomaly record set; S4: Based on the medicine numbers marked as "time synchronization abnormal" in the time anomaly record set, match the numbers with the list of medicine information to be included in the traceability chain in the database, mark the successfully matched numbers as the traceability locked status, and enter the status information into the traceability status registration form to generate a traceability permission update log; S5: Based on the traceability permission update log, obtain the medicine numbers with the status of "can be included in the traceability chain", read the corresponding quality status label and label time status and conduct cross-comparison, screen the medicine records with qualified quality and synchronized label information, and summarize and generate a list of traceable data for the quality of traditional Chinese medicine.
[0019] The preliminary screening result set of medicines includes status labels, medicine numbers, and quality assessment results. The label binding index table includes identification status, label numbers, generation time, and medicine number mapping relationships. The time anomaly record set includes medicine numbers, anomaly types, time differences, and anomaly labels. The traceability permission update log includes traceability locked status, matching numbers, and status change times. The list of traceable data for the quality of traditional Chinese medicine includes quality status, label time status, traceable numbers, and screening pass labels.
[0020] Please refer to Figure 2 , and the steps of S1 are: S111: Compare the weighed value of traditional Chinese medicine measured by an electronic scale with the lowest standard quality of the corresponding traditional Chinese medicine category in the standard database, count the coding information of the herbs corresponding to the weighed value and the lowest quality value respectively, and obtain the quality deviation record; Based on the weighed value of traditional Chinese medicine measured by an electronic scale, compare it with the lowest standard quality value of the corresponding traditional Chinese medicine category in the "Chinese Pharmacopoeia" standard database. In the specific implementation process, first record the actual weight of each herb through the electronic scale. For example, the weight of Angelica sinensis numbered A001 is 14.6 grams, and that of A002 is 16.4 grams. Then call the lowest standard quality value corresponding to Angelica sinensis in the database and set it as 16.0 grams. Next, extract the number information of all herbs one by one and compare it with the standard value according to the corresponding herb category. For example, if the weighed value of Angelica sinensis numbered A003 is 14.2 grams, it will also be compared with 16.0 grams. The quality deviation value is obtained by subtracting the standard value from the actual weight of each herb. This deviation value is used to measure whether the herb is below the standard requirements. The example in the table is as follows: Table 1 Comparison table of herb weighing and standard quality Medicinal Material No. Medicinal Material Name Actual Weight (g) Minimum Standard Quality Value (g) Quality Deviation Value (g) A001 Angelica sinensis 14.6 16.0 -1.4 A002 Angelica sinensis 16.4 16.0 +0.4 A003 Angelica sinensis 14.2 16.0 -1.8 As shown in Table 1, the quality deviation value is calculated by the difference between the actual weight and the standard value. A negative deviation value indicates that it is below the pharmacopoeia standard value. Through the above method, the quality deviation record can be systematically obtained.
[0021] S112: According to the quality deviation record, combined with the lowest quality threshold information in the standard database, judge item by item whether the deviation value is negative. If it is negative, mark the current herb status as to be excluded, record the herb number, and obtain the set of unqualified herb identifiers; According to the obtained quality deviation record, call the lowest quality threshold information in the "Chinese Pharmacopoeia" standard database to judge item by item whether the deviation value is negative. Set the quality threshold judgment standard as that a deviation value less than 0 is unqualified. Based on this judgment principle, mark the herbs corresponding to negative values as "to be excluded". For example, A001 and A003 are judged as unqualified herbs because their deviations are -1.4 and -1.8 respectively, both of which are less than 0. Record the numbers of these herbs and summarize their status information to form a status identifier set. For example, the status identifier of A001 is 1, A002 is 0, and A003 is 1. Build the mapping set of herbs and status item by item as follows: Table 2 Judgment table of herb quality deviation status Medicinal Material No. Quality Deviation Value (g) Status Flag (0 / 1) Judgment Result A001 -1.4 1 To be Rejected A002 +0.4 0 Qualified A003 -1.8 1 To be Rejected As shown in Table 2, the herbs with a status identifier value of 1 are the samples that do not meet the lowest quality standard requirements, and then summarize to obtain the set of unqualified herb identifiers.
[0022] S113: According to the set of unqualified medicinal material identifiers, integrate the weighing values, standard minimum quality values, quality deviation values, and status identifiers of each medicinal material, and use the formula: ; Calculate the status score of traditional Chinese medicinal materials , perform mapping between the status score and the number, and establish a preliminary screening result set of medicinal materials. Among them, represents the weighing value of the th medicinal material, represents the minimum standard quality, represents the packaging surplus of the corresponding medicinal material, represents the average weight of the same category of medicinal materials in the current batch of the corresponding medicinal material, represents the th medicinal material's rejection identifier status quantity (1 if to be rejected, otherwise 0), represents the total number of traditional Chinese medicinal materials in this batch; According to the set of unqualified medicinal material identifiers, integrate the weighing values, standard minimum quality values, quality deviation values, and status identifiers of each medicinal material, and set the packaging surplus to 0.3 grams, and the average weight of Angelica sinensis medicinal materials in the current batch is 15.1 grams. Use the formula to calculate the status score, and substitute Angelica sinensis with the number A001 for calculation: , , , ; The weighing values of the medicinal materials participating in the rejection are [14.2, 14.6, 15.0, 15.3, 14.7] grams, corresponding to ; ; The first part: ; The second part: ; The combined result is: ; This status score value is used for classification judgment. Set the threshold to 5.0. Then, if the score value is greater than 5.0, it is "to be rejected", and if it is less than or equal to 5.0, it is "qualified". Therefore, A001 is classified as "to be rejected". The complete classification result is shown in the following table: Table 3 Medicinal Material Score Value and Screening Judgment Table Medicinal Material No. Weighing Value (g) Standard Value (g) Packaging Remainder (g) Batch Mean Value (g) Status Flag Status Scoring Value Screening Conclusion A001 14.6 16.0 0.3 15.1 1 6.2438 To be Rejected A002 16.4 16.0 0.3 15.1 0 0.2297 Qualified A003 14.2 16.0 0.3 15.1 1 6.4711 To be Rejected As shown in Table 3, the score value can be used to comprehensively identify the status of medicinal materials. This result shows that the medicinal material status score value not only reflects the deviation of the individual from the standard, but also combines the batch rejection medicinal material weight correction factor to obtain the preliminary screening result set of medicinal materials.
[0023] The state score of traditional Chinese medicinal materials is a numerical index used to quantitatively evaluate whether the quality of a single traditional Chinese medicinal material meets the minimum standard requirements of the Chinese Pharmacopoeia. Its specific significance lies in constructing a comprehensive score that reflects the degree of deviation and rejection trend of the medicinal material quality by integrating the actual weighing value, the pharmacopoeia standard value, the packaging margin, and the overall quality level of the medicinal materials in the same batch. This score not only reflects the direct difference between the individual and the standard, but also integrates the overall proportion and quality weight of unqualified medicinal materials in the entire batch, so as to distinguish the medicinal material units that may have quality hazards in batch processing. By setting reasonable score thresholds, the classification, screening, and rejection operations of traditional Chinese medicinal materials can be effectively realized, thus assisting in forming a clearly structured and logically rigorous medicinal material screening result set, providing quantitative basis and standardized support for subsequent medicinal material processing or circulation links.
[0024] The operation logic of this formula is based on the comprehensive evaluation of two dimensions: individual deviation and group background correction. First, the numerator in the fraction represents the difference between the actual weighing value of the medicinal material and the standard quality value, reflecting the quality deviation of the medicinal material at the individual level. This difference is processed in absolute value form to ensure that whether it is too high or too low, it can reflect the degree of deviation; the denominator part introduces a square root structure to construct a normalization factor based on the sum of the squares of two errors, where reflects the weight influence of the total amount of actual weighing and packaging margin, and represents the overall deviation trend between the average value of the same type of medicinal materials in the current batch and the standard quality value. After summing the two and taking the square root, a comprehensive measurement factor is constructed to alleviate the result distortion caused by too small a denominator and reflect the balanced suppression of individual fluctuations; the second summation term is a weighted average processing method, which only weights the medicinal materials to be rejected (because has a value only when), which represents the quality weighted influence of unqualified samples in the overall sample. It is standardized by dividing by the total number of samples . The introduction of this value is used to correct the sensitivity of the score to the rejection trend, improve the recognition ability of the overall score to batch fluctuations and local anomalies, and finally add the individual normalized deviation value and the rejection group correction term to complete the construction of the score value . This logic realizes the integration of local anomaly recognition and global trend evaluation, and has hierarchical structure and sensitivity regulation functions.
[0025] Please refer to Figure 3 , and the steps of S2 are as follows: S211: Based on the preliminary screening result set of medicinal materials, extract the medicinal material numbers and corresponding status identifiers, read each item of the medicinal material number field and uniformly convert it into the standard character format, establish a paired structure of the number and the status identifier, and obtain the number status mapping set; Based on the preliminary screening result set of medicinal materials, for each piece of medicinal material information recorded therein, the medicinal material number and the corresponding status flag are read in sequence. During the execution process, the reading operation is first accurate to the field level, the fields "number" and "status" are extracted, and the medicinal material entries in the entire dataset are traversed in order. The number field is standardized in a unified format. That is, if the original numbers are A001, A002, A003, etc., they are converted into a 12-bit standard coding format such as "000000000001", "000000000002", "000000000003". During the standardization process, it is necessary to judge the length of the number and pad zeros on its left to meet the unified output requirements. After the status flag field is read, it needs to be numerically processed. The "qualified" flag is uniformly set to the value 0, and the "to be excluded" flag is uniformly set to the value 1. At the same time, a mapping pair structure with the medicinal material number as the key and the status flag as the value is constructed, and each mapping pair is separately stored in the intermediate dataset. For example, for three records with numbers A001 (qualified), A002 (to be excluded), and A003 (qualified), after processing, three mapping pairs are formed: "000000000001": 0, "000000000002": 1, "000000000003": 0. If the read number field has a non-preset character length or the status flag field is a null value during the above operation process, the exception recognition mechanism should be triggered, and this piece of data is not written into the mapping set for the time being, and the data source line number is recorded for subsequent verification processing. The numerical determination rule of this process does not depend on the classification logic, but is achieved by accurately comparing the character of the status field value with the two keywords "qualified" or "to be excluded", so as to generate the number status mapping set.
[0026] S212: According to the number status mapping set, obtain the label number, make the medicinal material number correspond to the label number one by one, form a pair of the medicinal material number and the label number through item-by-item binding operation, establish a binding status record, and obtain the label association pairing result; According to the numbered status mapping set, read the GS1 label number set generated synchronously. In actual operation, each GS1 label number consists of 12 fixed pure digits, such as "690123456789". In the mapping operation, read the medicinal material numbers item by item in the order of the mapping set, and perform a one-to-one binding operation between each medicinal material number and an unbound GS1 label number. During the binding process, it is necessary to ensure that the label number is not reused and its generated timestamp record can be extracted. If a duplicate number appears, record the abnormality and skip this binding. After the label number and the medicinal material number are paired, a pairing unit is formed, which contains four-dimensional information: medicinal material number, label number, status identifier, and binding time. Among them, the binding time should be collected from the current system time, accurate to the second, such as "2024-05-09 15:43:27". In addition, it is necessary to verify whether the binding status is consistent with the value in the numbered status mapping, that is, if the medicinal material status is 1 (to be excluded), the bound data should be marked as "abnormal binding" in the binding record, otherwise it is "normal binding". After the above structure is established, a complete pairing record list is formed. The list record should use the medicinal material number as the primary key field and the label number as the secondary field to ensure information relevance and uniqueness. For example, if the medicinal material number "000000000002" has a status of 1 and its bound label is "690123456789", then the status identifier in the record is "abnormal binding". After all the records in the list are sorted by the system time, they are updated and stored in the database to obtain the label association pairing result.
[0027] S213: According to the label association pairing result, integrate the medicinal material number, status identifier, label number, and generation time content of each binding record, sort them in ascending order by the number field, and sequentially enter the sorted records into the table structure to establish a label binding index table; After obtaining the label association pairing results, the bound medicinal material numbers, status flags, label numbers, and binding times in the pairing records are extracted in sequence, sorted in ascending order by number. During the sorting process, the numerical part in the number field is used as the comparison basis to exclude the interference of prefix characters and ensure accurate sorting. At the same time, a field integrity check is performed on each record. If any field is empty or the format does not conform, the record is automatically marked as an "invalid record", and the subsequent table writing operation is skipped. The remaining valid records are then written into the label binding index table in sequence. The table structure is uniformly set to a four-column structure, and the column names are "medicinal material number", "status flag", "label number", and "binding time" respectively. Each row of records is filled into the table row according to the corresponding relationship to ensure that all data fields in the table are output in a standard format. All time fields are uniformly in the standard timestamp format of year-month-day hour-minute-second. The label number field must maintain a 12-bit length, the status flag field is of numerical type, and the medicinal material number field is in a unified format number. Before each record is written, a data verification function should be called to perform a secondary verification on the field length and format. After writing, re-index and sort according to the number field. The final output data structure is the label binding index table, as shown in Table 4: Table 4 Label Binding Index Table Medicinal Material No. Status Flag Label No. Binding Time 000000000001 0 690123456781 2024-05-09 15:40:01 000000000002 1 690123456782 2024-05-09 15:40:04 000000000003 0 690123456783 2024-05-09 15:40:06 As shown in Table 4, the label binding index table displays the binding information between medicinal materials and labels through standard structured data. Among them, the status flag field reflects whether the medicinal material is to be excluded, the label number is the GS1 standard identifier, and the binding time records the timestamp when the operation is completed.
[0028] Please refer to Figure 4 , step S3 is as follows: S311: According to the binding time field in the label binding index table, read the label number and generation time corresponding to each record, extract the corresponding warehousing time field, confirm whether there is an abnormal time format through field comparison, and generate a label warehousing time comparison set; According to the binding time field in the label binding index table, first read the medicinal material number and label generation time in each binding record in sequence. The extraction method is to retrieve each row in the "medicinal material number" field of the table, and after matching the number, extract the timestamp in the "generation time" field. The timestamp format is uniformly converted to the second-level time unit within the system. For example, convert "2024-05-09 15:43:27" to the numerical form 1704939807 seconds. Subsequently, use the medicinal material number as the index condition to query the incoming warehouse record table corresponding to the medicinal material in the database. The field matching method is to compare with the index field "medicinal material number". If the match is successful, extract the content of the "incoming warehouse time" field and perform the same second-level conversion process. If the content of this field is empty or does not meet the standard time format, mark this record as "time field exception" and skip the subsequent processing of this data record. Next, construct a number-time comparison structure, bind the converted generation time and incoming warehouse time under the medicinal material number to form a complete data unit. For example, the label generation time of the number "000000000001" is 1704939807 seconds, and the incoming warehouse time is 1704939831 seconds. After binding, it is constructed as "000000000001": {generation: 1704939807, incoming warehouse: 1704939831}. If there is batch data processing, perform the same process for each record to ensure that all records have two sets of time fields and the same format. After the above processing, the label-incoming warehouse time comparison set can be generated.
[0029] S312: According to the label-incoming warehouse time comparison set, read the generation time and incoming warehouse time in each pair of records, calculate the difference between the two timestamps and take the absolute value, and compare it with the preset time tolerance threshold. If the time deviation comparison value is greater than the threshold, mark the current medicinal material status as "time synchronization exception", record the medicinal material number and time difference, and obtain the time error identification list; According to the label warehousing time comparison set, perform the calculation operation of the absolute difference between the generation time and the warehousing time for each medicinal material record. First, calculate the time stamp difference and output the difference result in absolute value form. For example, if the warehousing time is 1704939831 seconds and the label generation time is 1704939807 seconds, the calculated difference is |1704939831 - 1704939807| = 24 seconds. After obtaining the preliminary time difference, continue to call the time tolerance threshold set by the enterprise. The set threshold value is 180 seconds, which is set by the production management system based on the equipment response test parameters. For example, for the automatic barcode scanning warehousing system, the maximum allowed data delay input interval time is 180 seconds. Next, compare the time difference with the tolerance threshold. If the calculation result is greater than 180 seconds, it is determined that there is a delay behavior in the current medicinal material warehousing and the abnormality is recorded. If the time difference is less than or equal to 180 seconds, it is regarded as normal. Synchronously construct an identification field to label the status as 0 or 1, where 1 represents abnormality and 0 represents normal. For example, if the medicinal material number "000000000002" has a calculation result of 196 seconds, mark its status as 1. During the whole process, it is necessary to verify the consistency of the time value data source to prevent abnormal calculation results caused by incorrect input values. The example is as follows: Table 5 Time Comparison and Difference Calculation Table Medicinal Material No. Generation Time (seconds) Warehousing Time (seconds) Time Difference (seconds) Status Flag 000000000001 1704939807 1704939831 24 0 000000000002 1704939800 1704939996 196 1 000000000003 1704939805 1704939850 45 0 As shown in Table 5, each medicinal material data in the record is attached with the calculated difference and status identification. The status values of all medicinal materials can be used as the input for subsequent classification and exception handling logic, thus obtaining a time error identification list.
[0030] S313: Based on the time error identification list, extract the records with the status field being time synchronization abnormality, sort them in ascending order according to the medicinal material number field, construct a tabular structure for storage, and generate a time abnormality record set after sorting; Based on the time error identification list, perform the extraction and sorting operations on the medicinal material records with the status identification field being 1. First, screen all the medicinal material numbers with abnormal status according to the status field, extract their corresponding numbers, label numbers, calculated time differences, and status fields. At the same time, the system records the current operating system time as the abnormal generation record time field, which is uniformly represented in the time stamp format. For example, "2024-05-09 16:02:10" corresponds to the value of 1704940930 seconds. The field combination order is medicinal material number, label number, time difference, status field, record generation time. Subsequently, combine these five fields into a row structure and write it into the abnormal record set table, and sort it in ascending order according to the medicinal material number. Set the field length standard as 12 - character for the medicinal material number, 12 - digit digital code for the label number, the time difference unit is seconds, the status field is the numerical value 0 or 1, and the record time is in the standard time stamp format. After sorting, a time abnormality record set is obtained.
[0031] Please refer to Figure 5 , step S4 is as follows: S411: Based on the time anomaly record set, extract the medicinal material number fields in each anomaly record and uniformly convert them into standard format numbers. Combine with the list of medicinal material information to be included in the traceability chain, and perform one-by-one matching according to the number fields to generate a traceability number matching list; Based on the medicinal material numbers marked as "time synchronization anomaly" in the time anomaly record set, first obtain all record entries with a status of 1, extract the field "medicinal material number", uniformly standardize the number format, and pad the left side of the number with zeros to make up the number of digits if it is less than 12 digits. For example, the number "A07" is processed as "000000000007" to ensure that the number is consistent with the structure in the database. Subsequently, use the formatted number as the matching condition, call the "list of medicinal material information to be included in the traceability chain" table in the main medicinal material database, and perform the number matching operation one by one. The matching uses the full-field exact equal value comparison method, and the matching logic is based on the condition "medicinal material number = medicinal material number", and it is required that the "traceability status" field in the target entry is 0, which means that the current has not been traced and bound. If both conditions are met, include this record in the set to be processed, record the matching position, index order, and basic information fields for the subsequent locking operation process. During the whole process, avoid marking duplicate numbers multiple times, which can be limited by setting an auxiliary boolean variable "already matched". After processing, count the total number of matches. The example is as follows: Table 6 Record table for matching medicinal materials with time anomalies Medicinal Material No. Is Abnormal Is Matching Successful Original Status Index Position 000000000007 Yes Yes 0 121 000000000015 Yes No 1 — 000000000023 Yes Yes 0 173 As shown in Table 6, only when the medicinal material number exists in the database and the traceability status is not set, the record can be determined to be successfully matched. Through this structure, the valid numbers can be confirmed item by item and the traceability number matching list can be obtained.
[0032] S412: According to the medicinal material numbers in the traceability number matching list, write the traceability status fields item by item, synchronously register the change time as the current system timestamp, extract the warehousing time, anomaly record generation time, and marked write time of each record, and use the formula: ; Calculate the traceability write deviation value , and synchronously establish a traceability status registration form, where is the timestamp of the traceability mark write time for this record, is the warehousing timestamp, is the th anomaly record generation timestamp, is the average value of the generation times of all anomaly records, is the integer value corresponding to the last three digits of the medicinal material number, is the batch number value, is the total number of anomaly records; Match all the medicinal material numbers in the traceability number matching list and write them into the traceability status field in sequence. For the fields whose original value was set to 0, update them to 1, indicating the locked status. During the processing, read the current value of the "traceability status" field. If the value is not 0, skip the processing and record it as a "skipped record". After the status update is successful, call the current system time to generate a timestamp as the filling value of the "marking time" field. For example, the system time "2024-05-10 09:12:53" is converted to a second value of 1705002773. After writing it into the field, call the "warehousing time" and "abnormal record generation time" fields, and the three form the basic time structure. Then calculate the time deviation, extract the field values for arithmetic operations, and calculate the deviation value using a formula.
[0033] Among them, set the medicinal material with the number 000000000127 as an example, and the values of its various fields are as follows: warehousing time , abnormal record generation time , marking write time , the last three digits of the number are 127, set the batch reference value , the current total number of abnormal entries , and their corresponding generation times are respectively , , , then the calculation steps are as follows: The first item calculation is: ; In the second item calculation, calculate ; Then calculate the difference between each item and the mean value and sum them up respectively: ; ; ; The sum is , and the mean value is ; The third item number difference is: ; The final result is: ; The calculation result shows that the traceability write deviation value corresponding to the number 000000000127 is 444.87. This value will be written as a deviation feature into the status registration form, constituting an important parameter item for screening management records and used to establish the traceability status registration form.
[0034] The traceability write deviation value is a comprehensive numerical index used to measure the degree of various temporal and structural offsets during the change of the traceability status of a single medicinal material record. The larger the value, the longer the response delay from the time of warehousing to being traced and locked for the medicinal material, the more deviated the time of generating abnormal records from the overall distribution of other abnormal records, and the more deviated the number structure of its serial number in the entire batch from the unified serial number sequence. This index is formed by integrating the three dimensions of operation delay, abnormal time distribution discreteness, and number structure consistency, so as to provide a quantitative basis for the system to judge the abnormal level of traceability operations and the priority of management intervention without relying on subjective threshold judgment. It is a key intermediate control parameter in the traceability processing of abnormal medicinal material records.
[0035] The operation logic of this formula lies in comprehensively evaluating the degree of change in three aspects: the timeliness deviation, the group synchronization offset, and the serial number sequence stability when each medicinal material record is marked. The first item represents the actual time interval from the warehousing of the medicinal material to the marking of the traceability status, which is used to measure the delay degree of the traceability control response. The larger the value, the more lagged the operation response. The second item is the discreteness of the generation time of abnormal records, which measures the time deviation degree of this record in the overall abnormal record group. By calculating the difference between the generation time of each abnormal record and the group mean and then averaging, it reflects the time aggregation characteristics of the abnormal batch. The higher the value, the more discrete the record is in time. The third item is used to evaluate the number structure fluctuation between the serial number of this medicinal material and the batch reference serial number. The square root operation is used to introduce a non-linear growth trend to avoid the extreme influence of a single serial number difference on the result. The three items are linearly superimposed by addition because all three represent the sources of offsets in different dimensions and can be directly added after dimension processing, thus constituting a unified deviation evaluation value and realizing the comprehensive expression across the time domain, structure domain, and group domain.
[0036] S413: Based on the marking write information in the traceability status registration form, construct a log structure according to the record order. The log content fields include the medicinal material serial number, the original traceability status, the current traceability status, the write time, the traceability write deviation value, which are integrated into structured text information to form record entries, and append the system user information and operation IP fields at the end of each entry, and export it as a queryable log document to establish a traceability permission update log; Read the marked write information field in the traceability status registration form, extract the fields "medicinal material number", "original status", "current status", "write time", "traceability write deviation value" in ascending order of record time, generate a log structure text for each record, perform structured splicing in a fixed field order, and append the fields "operating user ID" and "operating IP address" at the end of the log for traceability records. The operating user ID is fixed as the system automatic task identifier "SYS-AUTO-001", and the IP address field is uniformly set to "127.0.0.1" for system kernel records. After all records are generated, write them into the log structure data table uniformly, sort them by the time field, and output the log document. The sample is as follows: Table 7 Traceability Permission Log Record Table Medicinal Material No. Original Status Current Status Writing Time Deviation Value User ID IP Address 000000000007 0 1 2024-05-1009:12:53 45 SYS-AUTO-001 127.0.0.1 000000000023 0 1 2024-05-1009:13:08 39 SYS-AUTO-001 127.0.0.1 As shown in Table 7, the log records have made detailed records of each status change action, including the comparison of the front and back statuses, time stamps, source user information, etc., and finally establish a traceability permission update log.
[0037] Please refer to Figure 6 , and the S5 step is as follows: S511: Based on the traceability permission update log, read the label status and quality status information corresponding to the medicinal material number, perform format verification and exception record filtering on the two fields respectively, record the source log time field, and establish a traceability status medicinal material information set; For the "medicinal materials that can enter the traceability chain" medicinal material numbers obtained based on the traceability permission update log, first, it is necessary to judge and screen the traceability status fields in the log data. The records with the status field limited to 1 are the qualified target data. Extract and deduplicate their corresponding medicinal material numbers to prevent repeated participation in subsequent matching. After the number standardization process, use the unified 12-bit character format as the main index field to call the Chinese medicinal material label information table and the quality status record table, and extract the label status and quality status fields that match each medicinal material number respectively. Set the exception recognition conditions during the reading process. If the label status field is empty, not a 0 / 1 value, or the format is missing, this record is determined to be data abnormal and excluded. The quality status field is similarly verified for data integrity, and the set value must be 0 or 1. If it does not meet the requirements, it is excluded. The exclusion rule is set that as long as any field is abnormal, it does not participate in the subsequent cross comparison. The qualified records use the medicinal material number as the key, append the label status value and the quality status value to form a three-field structure and record its reading source time field as an auxiliary data item, forming an information set for the next step of comparison processing. The sample of typical field extraction is as follows: Table 8 Traceability Medicinal Material Status Information Table Medicinal Material No. Label Status Quality Status Source Time 000000000201 0 0 2024-05-10 09:10:22 000000000202 1 0 2024-05-10 09:12:08 000000000203 0 1 2024-05-10 09:14:43 As shown in Table 8, the generated data needs to completely retain the source time field for audit tracking, and thus obtain the traceability status medicinal material information set.
[0038] S512: Perform a cross-comparison operation on the quality status identification field and the label status identification field of each record according to the traced status medicinal material information set, record the qualified entries with successful status matching, and perform a consistency check on the format of each time field to construct a set of medicinal materials with consistent quality labels; Based on the traced status medicinal material information set, perform a combined comparison operation on the label status field and the quality status field of each record. Set the screening rule that the records with both fields being 0 are the qualified targets, that is, the label information is synchronized and the quality inspection is qualified. Write the record numbers that meet this condition into the target set, and do not process the remaining records. During the process, the comparison field information needs to be retained synchronously to ensure that the original field data in the target set is still traceable and readable. If the value of the label status field is 1 but the quality status is 0, or the label status is 0 but the quality status is 1, both are regarded as inconsistent and are not included in the screening results. At the same time, record the comparison logarithm of this type of conflict as the screening conflict count. The typical examples are as follows: Table 9 Sample Table of Compliance Screening Results Medicinal Material No. Label Status Quality Status Screening Mark 000000000201 0 0 Compliant 000000000202 1 0 Conflict 000000000203 0 1 Conflict As shown in Table 9, the record must be marked as "compliant" to continue flowing into the list output logic. After the process ends, a set of medicinal materials with consistent quality labels is formed.
[0039] S513: According to all valid medicinal material numbers in the set of medicinal materials with consistent quality labels, sort them in ascending order by number, output the field content in a unified format, and write them into the traced chain output directory item by item according to the record order to establish a list of traceable data on the quality of Chinese medicinal materials; According to all compliant medicinal material numbers in the set of medicinal materials with consistent quality labels, assemble the fields of "quality status", "label status", "traced status", "writing time" and the medicinal material number field into a list structure. Set the output field order as medicinal material number, quality status, label status, traced status, record time. Each record time field needs to be processed by converting the time stamp format into a standard readable time format such as "YYYY-MM-DD HH:MM:SS". The status field is set as an enumerated value of 0 or 1. Before writing, the field type and bit width specifications need to be uniformly verified, the output structure is unified and sorted in ascending order by the medicinal material number, and the record entries are uniformly imported into the traced chain storage table. At the same time, set the list record log number, export time and list version number as file metadata for subsequent management operation verification. Finally, establish a list of traceable data on the quality of Chinese medicinal materials.
[0040] A quality control and traceability system for Chinese medicinal material products, including: The quality screening module obtains the measured weight data of the electronic scale, combines the minimum standard quality, compares and identifies the status and the medicinal material number, and generates a preliminary screening result set of medicinal materials; The label matching module binds the label number based on the Chinese medicinal material number in the preliminary screening result set of Chinese medicinal materials, records the status, label number and time, and generates a label binding index table; The time verification module generates the time according to the label in the label binding index table, reads the time when the corresponding Chinese medicinal material data is stored in the database, calculates the absolute difference, compares it with the preset time tolerance threshold, screens out the items with the time difference exceeding the limit and assigns an abnormal status, and generates a time anomaly record set; The traceability identification module matches the traceability chain number to be entered in the database based on the Chinese medicinal material number in the time anomaly record set, marks the traceability lock status, and generates a traceability permission update log; The quality archiving module compares the quality status and the time status value based on the traceable number in the traceability permission update log, screens out the compliant records, and generates a list of traceable Chinese medicinal material quality data.
[0041] The above is only the preferred embodiment of the present invention, and does not limit the present invention in other forms. Any person skilled in the art may use the technical content disclosed above to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical solution content of the present invention, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for controlling the quality and tracing of traditional Chinese medicine products, characterized in that It includes the following steps: S1: Obtain the weight data of traditional Chinese medicinal materials, compare the measured weight with the lowest standard quality, determine the corresponding medicinal materials to be eliminated, append the medicinal material numbers, and generate a preliminary screening result set of medicinal materials; S2: Based on the preliminary screening result set of medicinal materials, read the medicinal material numbers and status identifiers, and cooperate with the label numbers to bind the medicinal materials and labels one by one, and generate a label binding index table; S3: According to the label binding index table, calculate the absolute time difference between the label generation time and the data storage time, compare it with the preset time tolerance threshold, judge the medicinal materials with abnormal time synchronization in the current state, and generate a time anomaly record set; S4: Read the medicinal material numbers with abnormal time synchronization in the time anomaly record set, match the numbers with the list of medicinal material information to be included in the traceability chain, mark the successfully matched numbers as the traceability locked state, and generate a traceability permission update log; S5: Based on the traceability permission update log, count the medicinal material numbers that can be included in the traceability chain, read the corresponding quality status identifiers and label time statuses and conduct cross-comparisons, screen the medicinal material records with qualified quality and synchronized label information, and summarize and generate a list of traceable data for the quality of traditional Chinese medicinal materials.
2. The quality control and traceability method for traditional Chinese medicine products according to claim 1, characterized in that The preliminary screening result set of medicinal materials includes status identifiers, medicinal material numbers, and quality assessment results. The label binding index table includes identification status, label numbers, generation time, and medicinal material number mapping relationships. The time anomaly record set includes medicinal material numbers, anomaly types, time differences, and anomaly identifiers. The traceability permission update log includes traceability locked state, matching numbers, and status change times. The list of traceable data for the quality of traditional Chinese medicinal materials includes quality status, label time status, traceable numbers, and screening pass identifiers.
3. The method for quality control and traceability of traditional Chinese medicine products according to claim 1, characterized in that, The specific steps for obtaining the preliminary screening result set of medicinal materials are as follows: S111: Based on the weighing values measured by the electronic scale for traditional Chinese medicinal materials, compare them with the lowest standard quality of the corresponding traditional Chinese medicinal material categories in the standard database, count the coding information of the medicinal materials corresponding to the weighing values and the lowest quality values respectively, and obtain quality deviation records; S112: According to the quality deviation records, combined with the lowest quality threshold information in the standard database, judge item by item whether the deviation value is negative. If it is negative, mark the current medicinal material status as to be eliminated, record the medicinal material numbers, and obtain a set of unqualified medicinal material identifiers; S113: Integrate the weighing values, standard minimum quality values, quality deviation values, and status identifiers of each medicinal material according to the unqualified medicinal material identifier set, and calculate the status score of traditional Chinese medicinal materials , perform mapping between the status score and the number, and establish a preliminary screening result set of medicinal materials.
4. The method for controlling the quality and tracing the origin of traditional Chinese medicine products according to claim 1, wherein The specific steps for obtaining the label binding index table are as follows: S211: Based on the preliminary screening result set of medicinal materials, extract the medicinal material numbers and corresponding status identifiers, read the medicinal material number fields item by item and uniformly convert them into the standard character format, establish a pairing structure of numbers and status identifiers, and obtain a number status mapping set; S212: According to the number status mapping set, obtain the label numbers, correspond the medicinal material numbers and label numbers one by one, form a pair of the medicinal material numbers and label numbers through item-by-item binding operations, establish a binding status record, and obtain the label association pairing result; S213: According to the label association pairing result, integrate the medicinal material numbers, status identifiers, label numbers, and generation time contents of each binding record, sort them in ascending order according to the number fields, and sequentially enter the sorted records into the table structure to establish a label binding index table.
5. The method for quality control and traceability of traditional Chinese medicine products according to claim 1, wherein The specific steps for obtaining the time anomaly record set are as follows: S311: According to the binding time field in the label binding index table, read the label number and generation time corresponding to each record, extract the corresponding warehousing time field, confirm whether there is a time format anomaly through field comparison, and generate a label warehousing time comparison set; S312: According to the label warehousing time comparison set, read the generation time and warehousing time in each pair of records, calculate the absolute value of the difference between the two timestamps, compare with the preset time tolerance threshold, determine the state of the medicinal materials with time synchronization anomalies, and obtain a time error identification list; S313: Based on the time error identification list, extract the records with the status field being time synchronization anomalies, sort them in ascending order according to the medicinal material number field, construct a tabular structure for storage, and generate a time anomaly record set after sorting; 6. The method for quality control and traceability of traditional Chinese medicine products according to claim 1, wherein, The specific steps for obtaining the traceability permission update log are as follows: S411: Based on the time anomaly record set, extract the medicinal material number fields in each anomaly record and uniformly convert them into standard format numbers, combine with the medicinal material information list table to be included in the traceability chain, and perform item-by-item matching according to the number field to generate a traceability number matching list; S412: According to the medicinal material numbers in the traceability number matching list, write the traceability status fields item by item, synchronously register the change time as the current system timestamp, calculate the traceability writing deviation value, and synchronously establish a traceability status registration form; S413: Based on the traceability status registration form, construct a log structure according to the record order, integrate it into structured text information to form record entries, and append the system user information and operation IP fields at the end of each entry, export a queryable log document, and establish a traceability permission update log; 7. The method for quality control and traceability of traditional Chinese medicine products according to claim 1, wherein, The specific steps for obtaining the traditional Chinese medicine quality traceability data list are as follows: S511: Based on the traceability permission update log, read the label status and quality status information corresponding to the medicinal material numbers, perform format verification and anomaly record filtering on the two fields respectively, record the source log time field, and establish a traceability status medicinal material information set; S512: According to the traceability status medicinal material information set, perform a cross-comparison operation on the quality status identification field and the label status identification field of each record, record the qualified entries with successful status matching, and perform consistency verification on the format of each time field to construct a set of medicinal materials with consistent quality labels; S513: According to all the valid medicinal material numbers in the set of medicinal materials with consistent quality labels, sort them in ascending order by number, output the field content in a unified format, and write them item by item into the traceability chain output directory according to the record order to establish a traditional Chinese medicine quality traceability data list; 8. A quality control and traceability system for traditional Chinese medicine products, characterized in that, The system is used to implement the traditional Chinese medicine product quality control and traceability method described in any one of claims 1-7, including: The quality screening module obtains the measured weight data of the electronic scale, combines with the minimum standard quality, compares and identifies the status and medicinal material numbers, and generates a preliminary medicinal material screening result set; The label matching module binds the label numbers based on the medicinal material numbers in the preliminary medicinal material screening result set, records the status, label numbers and time, and generates a label binding index table; The time verification module generates a time based on the tags in the tag binding index table, reads the time when the corresponding medicinal material data is stored in the database, calculates the absolute difference, compares it with the preset time tolerance threshold, filters out the items with time differences exceeding the threshold and assigns an abnormal status, and generates a time anomaly record set; The traceability identification module matches the medicinal material numbers in the time anomaly record set with the numbers to be traced in the database, marks the traceability lock status, and generates a traceability permission update log; The quality archiving module compares the quality status with the time status value based on the traceable numbers in the traceability permission update log, filters out the compliant records, and generates a list of traceable data for the quality of Chinese medicinal materials.
Citation Information
Patent Citations
Chinese herbal medicine traceability system and method
CN105096075A
Traditional Chinese medicinal material quality safety tracing supervision method based on block chain technology
CN111932279A
Storage-based traditional Chinese medicine database management method, server and storage medium
CN116402435A
Tracing method and system based on drug consumable traceability code
CN119648247A
Traditional chinese medicine identification method based on artificial intelligence
WO2021093354A1
Cited By
Notarization method for property checking
CN120598732A
Tracing system and method based on block chain technology
CN120765274A
Automobile extended insurance multi-source heterogeneous data cleaning evaluation system
CN120929453A
An automobile extended warranty multi-source heterogeneous data cleaning and evaluation system
CN120929453B
Propolis quality detection management system based on multi-source data
CN121279855A
