Food package printing material batch traceable management method and system
By constructing time coding and batch data packets of food packaging printing materials, the problem of difficulty in traceability of quality problems of food packaging printing materials in the prior art is solved, efficient batch query and tracking is achieved, and quality control capabilities are improved.
Patent Information
- Application Number
- CN202510402876.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, when there are quality problems with food packaging printing materials, the lack of clear batch markings makes it difficult to quickly determine the source of the problem by searching data, delaying the response process, and increasing food safety risks.
By collecting accurate to seconds time data for each production batch, building a unique time code, combining it with batch production data to form a time-marked data packet, classifying and indexing storage, establishing a fast-responsive data retrieval mechanism, and generating a batch tracking interface.
It realizes more efficient information integration and storage management, improves the efficiency and reliability of batch query and tracking, and directly generates a complete and clear batch tracking interface, avoids chaos and delays in the information query process, and improves quality control and risk prevention capabilities.
Smart Images

Figure CN120338816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of product data management, and in particular to a management method and system for traceability of food packaging printing material batches. Background Art
[0002] The technical field of Product Data Management (PDM for short) refers to a systematic method of using information technology to uniformly collect, store, organize, manage, and trace product-related information and data. The management method for traceability of food packaging printing material batches is a method that uses product data management technology to accurately record, manage, and track the batch information of food packaging printing materials.
[0003] In the prior art, when it is necessary to trace the source due to quality problems of food packaging printing materials, due to the lack of clear batch marks, data retrieval usually stays at the rough positioning stage, it is difficult to quickly determine the source of the problem, delaying the response and handling process, and easily causing the expansion of food safety risks. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of the present invention is to solve the drawbacks existing in the prior art, and to propose a management method and system for traceability of food packaging printing material batches.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions. A management method for traceability of food packaging printing material batches includes the following steps:
[0006] Collect the production time of each production batch, construct time data, the time data includes year, month, day, hour, minute, and second, and create a time code based on the time data; combine the time code with the data of the production batch to form a time-marked data packet, and generate a batch time-marked file;
[0007] Store the batch time-marked file in a database to obtain a storage result; classify and organize the batch time-marked file, create a corresponding index table, and generate an indexed batch database;
[0008] Use the indexed batch database to perform data comparison, locate each query request, retrieve the corresponding production batch, and obtain a retrieval result; based on the retrieval result, extract the production and quality control information of the batch to generate a batch detailed result;
[0009] Based on the batch detailed result, construct a batch tracking interface to display the production information and time mark of each batch, and obtain a display result.
[0010] Preferably, the step of obtaining the time code is:
[0011] Collect the production time of each production batch, extract the fields of year, month, day, hour, minute, and second, arrange them in chronological order, standardize the data format, and eliminate the records with missing or abnormal time information to obtain time data;
[0012] Based on the time data, extract the time fields, analyze the logical order between time units, perform time format conversion, combine the year, month, day, hour, minute, and second fields into continuous numerical values, and generate a time code.
[0013] Preferably, the steps for obtaining the batch time marking file are as follows:
[0014] Based on the time code, simultaneously extract the production batch information of each production batch to obtain verified production batch data;
[0015] Based on the verified production batch data, calculate the batch marking value. The calculation formula is:
[0016]
[0017] where TID is the batch marking value, BID represents the production batch number, TC represents the time code, and PT represents the Unix timestamp of the production time;
[0018] Based on the batch marking value, bind the production batch information with the time code to obtain a batch time marking file.
[0019] Preferably, the steps for obtaining the storage result are as follows:
[0020] Based on the batch time marking file, calculate the file content complexity. The calculation formula is:
[0021]
[0022] where C represents the file content complexity, L i represents the character length of the i-th paragraph in the file, P i represents the character diversity metric value of the i-th paragraph in the file, ZT represents the total number of lines in the file, U represents the number of unique character types in the file, represents the average value of all paragraph lengths, CP k represents the character repeatability of the entire file, and m represents the total number of paragraphs in the file;
[0023] Based on the file content complexity, select a matching database storage mode, divide the storage area according to the file content complexity, store the batch time marking file in the corresponding storage area, and record the storage path to obtain a storage result.
[0024] Preferably, the step of obtaining the indexed batch database is as follows:
[0025] Based on the batch time marking file, calculate the batch data clustering tightness, and the calculation formula is:
[0026]
[0027] Among them, GT represents the batch data clustering tightness, X represents the number of batches with the same time code in the batch data, Y represents the number of batches with consecutive batch numbers in the same classification, Z represents the average value of the intervals between batch numbers between different classifications, VW represents the total number of batch files under the same storage path in the batch data, and VM represents the total number of classifications in the database;
[0028] Based on the batch data clustering tightness, create index fields and an index table to obtain the indexed batch database.
[0029] Preferably, the step of obtaining the retrieval result further includes:
[0030] Based on the indexed batch database, calculate the query efficiency optimization index, and the calculation formula is:
[0031]
[0032] Among them, E represents the optimization index of query efficiency, f i represents the frequency of the i-th query request, t i represents the average response time of the corresponding query, n represents the total number of query requests, v is the number of currently active query sessions, s is the total number of available session quantities, and k represents the concurrent query number of the current database;
[0033] Based on the query efficiency optimization index, adjust the index table and the database query strategy, optimize the data retrieval path, and obtain the retrieval result.
[0034] Preferably, the step of obtaining the batch detailed result is as follows:
[0035] Extract the production batch information in the retrieval result, parse the batch number, production time, and production line number to obtain the original data of batch production and quality control;
[0036] Based on the original data of batch production and quality control, parse the production process log, extract the operating status of production equipment, raw material batches, and production process parameters, conduct a comparative analysis of quality inspection data, match historical production records, and generate batch production and quality control data;
[0037] Based on the batch production and quality control data, classify and organize the production links, process parameters, equipment status, and quality inspection results to form the batch detailed result.
[0038] Preferably, the step of obtaining the display result is as follows:
[0039] Based on the batch detailed result, calculate the data transmission stability, and the calculation formula is:
[0040]
[0041] where S represents the data transmission stability, V(t) represents the data stream rate at time t, T represents the total data loading time, M i represents the production data block size of the i-th batch, N represents the number of production batches, D represents the length of the current task queue in the database, H represents the network bandwidth occupancy rate, W represents the file size of the current batch of data, G represents the number of database index items associated with the batch, J represents the number of concurrent requests during data transmission, and QL represents the currently available memory space of the server;
[0042] Based on the data transmission stability, adjust the data loading strategy, and at the same time bind the production data and time stamps to the interface elements to obtain the display result.
[0043] The present invention provides a management system, including:
[0044] A time coding module that collects the production time of production batches, including year, month, day, hour, minute, and second, creates corresponding time codes according to the production time, and generates time coding results;
[0045] A batch marking data packet module that combines the time coding results with the corresponding production batch data to form a data packet including time stamps, generates a batch time stamp file from the data packet, and stores it in the database to obtain the batch time stamp file;
[0046] An indexed database module that classifies and organizes based on the batch time stamp file, creates a corresponding index table, structures the stored data through the index table, and generates an indexed batch database to obtain the indexing result;
[0047] A data retrieval module that uses the indexing result to locate and compare data for each query request, retrieves the corresponding production batch, obtains the retrieval result therefrom, and generates retrieval result data;
[0048] A batch tracking display module that extracts batch information including production and quality control information based on the retrieval result data, constructs a batch tracking interface, and displays the production information and time stamps of each batch.
[0049] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0050] The present invention collects time data accurate to the second for each production batch, constructs a unique time code, closely combines the time code with the batch production data to form a traceable time-marked data packet, ensures the precise correspondence between production information and time, and realizes more efficient information integration and storage management. During the storage process, classification and indexing are carried out in combination with the batch time-marked data packet, a data retrieval mechanism that can respond quickly is established, the speed and accuracy of information location are improved, and the efficiency and reliability of batch query and tracking are improved. In the specific query process, the indexed data structure is used to accurately retrieve the required batch, and by extracting the detailed production and quality control information, a complete and clear batch tracking interface is directly generated, making the presentation of data tracking results more intuitive, avoiding chaos and delays in the process of batch information query, and improving the quality control and risk prevention capabilities of food packaging and printing materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, 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.
[0053] Please refer to Figure 1 , the present invention provides a technical solution, a management method for traceability of batches of food packaging and printing materials, including the following steps:
[0054] Collect the production time of each production batch, construct time data, the time data includes year, month, day, hour, minute and second, and create a time code based on the time data; combine the time code with the data of the production batch to form a time-marked data packet and generate a batch time-marked file;
[0055] Store the batch time-marked file in a database to obtain a storage result; classify and sort the batch time-marked file, create a corresponding index table, and generate an indexed batch database;
[0056] Use the indexed batch database to perform data comparison, locate each query request, retrieve the corresponding production batch to obtain a retrieval result; based on the retrieval result, extract the production and quality control information of the batch to generate a detailed batch result;
[0057] Based on the detailed batch result, construct a batch tracking interface to display the production information and time mark of each batch to obtain a display result.
[0058] The steps for obtaining the time code are as follows:
[0059] Collect the production time of each production batch, extract the year, month, day, hour, minute, and second fields, arrange them in chronological order, standardize the data format, eliminate records with missing or abnormal time information, and obtain time data;
[0060] Based on the time data, extract the time fields, analyze the logical order between time units, perform time format conversion, and combine the year, month, day, hour, minute, and second fields into a continuous numerical value to generate a time code.
[0061] Specifically, based on the original production time content obtained previously, first disassemble and extract according to the six elements of year, month, day, hour, minute, and second indicated in each record, and then compare each element sequentially with the set legal time range. For example, set the year to be between 1970 and 2100, the month to be between 1 and 12, the day to be between 1 and 31, the hour to be between 0 and 23, the minute to be between 0 and 59, and the second to be between 0 and 59. These range values are obtained by empirical statistics and production demand estimation. Among them, 1970 is used as the reference year for timestamp conversion, and 2100 takes into account the possible production plan range for a relatively long time period. The other numerical ranges are respectively determined by common calendar specifications or combined with the actual situation of production scheduling. When it is found that the year is less than 1970 or exceeds 2100, it is regarded as an abnormal record and removed. When it is found that the day or month is not within the specified interval, it is also removed or marked as abnormal. To ensure the operability of the processing process, the removal operation is set to directly remove the record without compensation. When there are still obvious missing fields in the data after the removal, then verify again whether there is an overlapping range that can be used and try to fill it. If it cannot be filled, continue to remove the record. To provide complete data for subsequent processing, calibration can also be performed for the differences caused by a small number of time zone conversions. For example, when encountering a cross-time zone situation, unified correction is performed by comparing the standard time zone offset. The range of the corrected time zone offset can be set to -12 to +12 hours, and the specific value is determined by daily cross-border production line scheduling experience or the actual time zone distribution of production operations. Finally, summarize and organize the remaining data after multiple comparisons and corrections to obtain time data.
[0062] Based on the obtained time data, read the year, month, day, hour, minute, and second fields and combine them into a continuous numerical value according to the established format. In this process, first analyze the logical order between the year, month, and day, and then arrange the hour, minute, and second in sequence behind. When splicing each field into an integer numerical value or string representation, it can be adopted as Year×10 10 +Month×10 8 +Day×10 6 +Hour×10 4 +Minute×10 2Calculate in the way of +Second, where Year, Month, Day, Hour, Minute, and Second respectively represent the values extracted from the previously verified time data. Before combination, it is determined that each field meets the valid range. If a field is not within the range, the combination is not executed but enters the exception information processing flow, and targeted updates are made again based on the existing production schedule or cross-time zone correction results. After confirming that all fields are within the given range, the above splicing method is used to complete the conversion. Record and verify the format consistency of the converted data one by one, including decimal digit checking and duplicate code conflict checking. If there are duplicate time fields within the same production batch, it is necessary to check whether there is overlap at the second level or conflicts due to cross-time zone adjustment. If a conflict occurs, compare according to the time zone offset range and retain the record that best matches the production operation time. Finally, output all the consecutive numerical values that meet the requirements as the final result to generate the time code.
[0063] The steps to obtain the batch time marking file are as follows:
[0064] Based on the time code, simultaneously extract the production batch information of each production batch to obtain the verified production batch data;
[0065] Based on the verified production batch data, calculate the batch marking value. The calculation formula is:
[0066]
[0067] Among them, TID is the batch marking value, BID represents the production batch number, TC represents the time code, and PT represents the Unix timestamp of the production time;
[0068] Based on the batch marking value, bind the production batch information with the time code to obtain the batch time marking file.
[0069] Specifically, based on the time-coded content obtained previously, the corresponding production batch information is extracted simultaneously to compare and screen each batch to check if it has sufficient and complete batch fields. First, the production number and production time period in each batch record are read. When comparing with the time code, the records are retrieved line by line, and the production number is matched with its corresponding time code one by one. The distribution of production time in the six dimensions of year, month, day, hour, minute, and second is identified numerically. Referring to the existing production plan data, it is determined in which time period each batch is assigned to the production line. For example, the content named "Basis for Production Time Period Division" can be read from the database. This content is obtained by collecting the production scheduling information in the workshop in the early stage and includes the production line number, the preset start time, and the end time. Each batch of information is associated with this division basis, and the start and end times corresponding to the production number are recorded. Then, the availability of the production line included in the batch information is queried, and each record is compared with the preset valid range. For example, the temperature is compared with the range of 0°C to 90°C, the pressure is compared with the range of 0 MPa to 2 MPa, the current is compared with the range of 0 A to 5 A, and the voltage is compared with the range of 0 V to 24 V. In this way, it is determined whether each production batch meets the established requirements under different conditions. If the value is found to be lower than 0°C or higher than 90°C, it is determined that it does not meet the requirements of the current process or there is an abnormality. When recording, this batch is marked as an abnormal batch and transferred to the subsequent investigation process. The same applies to pressure, current, or voltage outside the preset range. If all record parameters are within the valid range, it is marked as passed. After all comparisons are completed, the batch numbers that meet the requirements are cross-checked with the corresponding time codes, and the operation duration of the workshop equipment and the safety inspection interval duration are compared to ensure that there is no conflict, and it is confirmed that the batch numbers do not occupy the same time period repeatedly. Otherwise, all production numbers are sorted in chronological order, the batches in the front are selected, and the subsequent conflicting batches are marked as waiting for rearrangement to ensure that there is no overlapping time period for all batch information. Finally, after these verification processes are completed, the production batch information that matches the time code and has no conflict is output to obtain the verified production batch data.
[0070] The advantage of the formula is that it introduces a three-dimensional comprehensive operation of the square term of the production batch number and the cube term of the time code, and combines the logarithmic operation structure of the Unix timestamp, thus integrating the batch identifier, the chronological order, and the actual production time information within the same expression. This integration method is more convenient for quick retrieval and unique differentiation in the subsequent binding and traceability query stage.
[0071] The steps to obtain the parameter BID are as follows: Read the batch number field in the scheduling system of each production area, use the production number mapping table obtained previously to determine whether the number is within the valid range, and record the moment when each number appears in the actual production process. If there are duplicate numbers in the same time period, only retain the numbers that conform to the time sequence according to the set screening logic. Then, collect all the confirmed numbers into the batch number set BID_list, and extract a single BID that needs to perform the marker value operation from it. For example, in a case, the production batch number is between 0 and 99999. If it is confirmed that the numbers from 120 to 130 are all assigned to a certain type of product, the corresponding BID is taken from one of them. For example, BID = 125.
[0072] The steps to obtain the parameter TC are as follows: In the previous stage, the production time has been field-concatenated to obtain the time code, and the time code is distributed in the numerical range of 10 10 to 10 14 and is composed of the time stamp accurate to seconds plus the year, month, day, hour, minute, and second. First, query the previously generated time code list, compare each item in the time registration record of the production batch one by one, and filter out the entries corresponding to the BID. If the time registration conforms to the batch production process in the six dimensions of year, month, day, hour, minute, and second, record its value as TC. For example, in a typical production task, the time code can be 20230302103059, and this value comes from the time information of 10:30:59 on March 2, 2023. It has been calculated through the concatenation formula Year × 10 10 + Month × 10 8 +
[0073] Day × 10 6 + Hour × 10 4 + Minute × 10 2 + Second in the previous steps.
[0074] The steps to obtain the parameter PT are as follows: Extract the time stamp information of the same production batch from the system. This Unix time stamp is in seconds. For 10:30:59 on March 2, 2023, this Unix time stamp is 1677753059. For example, in this case, after directly entering the specified date and time in the query module, PT = 1677753059 can be obtained.
[0075] Calculation process:
[0076] The first step is to calculate BID 2 :
[0077] BID 2 = 125 2 = 15625;
[0078] In the second step, divide TC by 10 3 , and then cube the result:
[0079]
[0080] (20230302103.059) 3 ≈8.28×10 30 ;
[0081] In the third step, add the two results and take the cube root:
[0082] 15625 + 8.28×10 30 ≈8.28×10 30 ;
[0083]
[0084] In the fourth step, calculate log 10 (PT):
[0085] log 10 (1677753059)≈9.2247;
[0086] In the fifth step, add the above results and multiply by 10 6 :
[0087] (2.03×10 10 +9.2247)×10 6 ≈2.03×10 16 ;
[0088] Thus, TID≈2.03×10 16 . This result indicates that in this batch of operations, the value scale of TID is relatively large, representing that this batch is at a relatively high number and a relatively late time point. When TID is larger, it can indicate that the production batch number or time code is in a more backward position. If it is found that TID exceeds a specific range in some comparisons of logarithmic results, it means that there are extreme values in the batch records in the operation parameters. It can be classified or specially marked according to this value in the subsequent steps for precise positioning when binding with the time code in the next step.
[0089] Based on the obtained batch mark value TID, pair it one-to-one with the previously confirmed production batch information and the corresponding time code to generate a corresponding binding relationship for each verified batch. First, read the association table of batch numbers and time codes in the record. When the batch number is read, compare it with the previously obtained TID, and combine the two according to the matching entries. Each combination depends on the mark value obtained in the previous calculation and the accurate time code. Then, sequentially check whether there are duplicate batch numbers or duplicate time codes. To avoid conflicts caused by duplicates at large-scale concurrent moments, a batch number duplication threshold can be set and calculated during the comparison process. The source of this threshold is the empirical data of the production line capacity, which is usually obtained by monitoring the maximum processing volume during the peak hours of each day in two consecutive months on the production line. During these two months, the processing volume is disassembled and recorded in ten-minute time slices every day, and the threshold quantitative standard is formed by comparing with the predefined maximum processing value per single line. If it is detected that the number of times the same batch number is mapped to the same time code is greater than this threshold, the binding process needs to be interrupted and a deep investigation is performed. Otherwise, continue to combine the batch number, time code, and TID, and arrange them in the order of batch priority. If there are batches with higher priorities, they will be arranged to the corresponding positions first. After all pairings and arrangements are completed, a secondary inspection will be performed on these integrated data. The inspection method is similar to the previous comparison process. It is necessary to verify item by item whether there is an overlap within the operable range of the equipment between the time period and the batch, and judge whether the process requirements are still met by comparing values such as temperature, pressure, current, and voltage. If some data fails to meet the previously given valid range, it is marked as an abnormal batch and excluded. Subsequently, the binding results of the qualified batches are organized into a unified structure, including three key fields: BID, TC, and TID, to form a batch time mark file.
[0090] The steps to obtain the stored result are as follows:
[0091] Based on the batch time mark file, calculate the file content complexity. The calculation formula is:
[0092]
[0093] Among them, C represents the file content complexity, L i represents the character length of the i-th paragraph in the file, P i represents the character diversity metric value of the i-th paragraph in the file, ZT represents the total number of lines in the file, U represents the number of unique character types in the file, represents the average value of all paragraph lengths, CP k represents the character repeatability of the entire file, m represents the total number of paragraphs in the file;
[0094] Based on the complexity of the file content, select a matching database storage mode, divide the storage area according to the complexity of the file content, store the batch time-marked file into the corresponding storage area, and record the storage path to obtain the storage result.
[0095] Specifically, the advantage of the formula lies in the comprehensive balance among the character length, the character diversity metric value, the total number of lines, the number of unique character types, the average paragraph length, and the character repetition degree, so that files of different scales can be quantified into complexity values under the same standard. This formula structure not only considers the content differences within paragraphs during operation, but also takes into account the global character distribution and paragraph length fluctuations, and can present the comprehensive characteristics of the file text information within the same complexity index, which has the significance of unified processing in subsequent database retrieval and area division.
[0096] Parameter L i The acquisition steps are as follows: L i represents the character length of the i-th paragraph in the file. When collecting this parameter, first scan the batch time-marked file paragraph by paragraph, count the number of characters in each paragraph character by character, and any invisible characters (spaces, tab characters, line break characters, etc.) are also included in the total number of characters. For example, in a statistical process, the length of the first paragraph L1 = 320, and the length of the second paragraph L2 = 605. The following is an example to illustrate the acquisition process: When processing a certain paragraph, the program reads from the first line, records the number of consecutive characters and simultaneously identifies the line break character. When encountering an empty line or the end-of-chapter character, the statistics of this paragraph are completed, and the cumulative value is used as L i and store it in the data list, and thus the paragraph character length can be obtained.
[0097] Parameter P i The acquisition steps are as follows: P i represents the character diversity metric value of the i-th paragraph in the file. To obtain this parameter, first collect the character occurrence frequencies paragraph by paragraph, and construct a character distribution vector by counting the occurrence times of each character in the paragraph to measure the diversity degree of the paragraph. The specific processing method can first traverse all characters in the paragraph and establish a mapping relationship between the character types and the occurrence times, and then use the quantization formula to calculate the diversity degree: where p j represents the ratio of the occurrence times of the j-th character in the paragraph to the total number of characters in the paragraph, and k is the number of actual character types that appear in the paragraph. Taking a paragraph as an example, after counting the occurrence times of each character, k = 28 character types can be obtained, and calculate the corresponding p j one by one and substitute them into the entropy formula to obtain the diversity metric value. For example, after calculation, D i ≈4.52.
[0098] The steps to obtain the parameter ZT are as follows: ZT represents the total number of lines in the file, that is, the total number of lines obtained by separating all line breaks in the batch time marker file. To obtain ZT, the lines can be counted one by one when reading the file, using the line breaks in the continuous text as the natural segmentation markers. After finishing reading, the total number of lines can be obtained. Taking an actual statistics as an example, this file is distributed in 300 paragraphs in the production log, and the total number of lines is recorded as ZT = 2200.
[0099] The steps to obtain the parameter U are as follows: U is the number of unique character types in the file, which characterizes how many different characters appear in the file. To accurately obtain U, a character set needs to be constructed in real time when reading the entire file, and any new character that appears will be added to the set. After reading the entire file, the size of this set is U. Taking a statistics as an example, a total of 210 Chinese characters, 52 English letters (including upper and lower cases), 10 digits, and about 30 punctuation marks and other symbols are identified in a certain document. After merging and removing duplicates, the final size of the set U = 302.
[0100] Parameter The steps to obtain it are as follows: represents the average value of the lengths of all paragraphs. Before calculation, the L of each paragraph needs to be obtained first i , and then they are accumulated and divided by the total number of paragraphs m. The specific method is as follows: Taking an example to illustrate, a certain file contains m = 5 paragraphs, and their character lengths are 320, 605, 890, 410, and 1002 respectively. Adding them up gives 320 + 605 + 890 + 410 + 1002 = 3227, and then dividing by 5 gives
[0101] Parameter CP k The steps to obtain it are as follows: CP k represents the character repeatability of the whole file, and its main purpose is to measure the degree of repeated use of the same character in the text. To obtain CP k , it is necessary to first count the frequency of each character appearance in the whole text range and calculate its concentration. The following formula is used: where f j represents the proportion of the appearance frequency of the j-th character, and N is the total number of character types that appear in the file. Taking an actual calculation as an example, when the statistics obtain f1 = 0.25, f2 = 0.20, f3 = 0.15, f4 = 0.10, f5 = 0.30, etc., their squares are accumulated, that is, 0.25 2 + 0.20 2 + 0.15 2 + 0.10 2 + 0.30 2 = 0.0325 + 0.04 + 0.0225 + 0.01 + 0.09 = 0.195.
[0102] The steps to obtain the parameter m are as follows: m represents the total number of paragraphs in the file, which is consistent with the paragraph division when counting L i and it is necessary to identify the paragraphs in the text and count each paragraph under the same rules.
[0103] Calculation process:
[0104] Here is an example calculation case. Let m = 5, L1 = 320, L2 = 605, L3 = 890, L4 = 410, L5 = 1002, and let P1 = 3.90, P2 = 4.12, P3 = 4.08, P4 = 3.76, P5 = 4.33. At the same time, let ZT = 2200, U = 302, CP k = 0.58.
[0105] First step, calculate the numerator
[0106]
[0107] Add up the above results to get:
[0108]
[0109] Second step, calculate the denominator
[0110]
[0111] Third step, calculate the first part
[0112]
[0113] Fourth step, calculate
[0114]
[0115] Fifth step, calculate
[0116]
[0117] e -0.00192 ≈0.99808;
[0118] 1 + 0.99808 = 1.99808;
[0119]
[0120] Step 6: Add the two parts of the results: C = 151.37 + (240.48 × 0.50048) = 151.37 + 120.50 = 271.87; This result indicates that when C ≈ 271.87, the file content complexity is at a relatively high value range in this example, indicating a large span of text length and high character diversity. If this value continues to rise to 300 or even higher, it indicates that the file character distribution is more abundant and the paragraph length difference is more significant. On the contrary, it means that the file structure is more single. In terms of the association with the result of this step, when the database receives this complexity, it will allocate different storage areas to the file according to the specific value range, thus completing the final storage mode selection.
[0121] Based on the obtained file content complexity C, read the original statistical data and character distribution information involved in each calculation link, and compare these data in the database environment. First, confirm that there are no duplicates or omissions in statistical values such as the number of paragraphs m and the total number of lines ZT. Then, for each record, compare the matching number of lines with the pre-set safety range. For example, control the number of paragraphs within the range of 1 to 1000, and the number of lines within the range of 1 to 50000. These ranges are obtained by detecting the actual scale of the batch time-stamped file in the early stage. If the detected number of paragraphs is less than 1, it means the file is empty. If it exceeds 1000, it may represent improper file splitting or merging errors. Similarly, if the number of lines is less than 1, it is regarded as an invalid file. If it exceeds 50000, it is necessary to re-check whether it belongs to a large merged file. Then, after confirming that the basic statistical items do not exceed the empirical range, further retrieve the specific source of the character repetition degree CP k value and view the proportion of each type of character in turn. Refer to the character category benchmark table summarized from the production log, which details the category ranges of numbers, English upper and lower cases, Chinese, and punctuation marks. Compare the character proportions in the actual file with this benchmark table one by one. If the character proportion is within the range of 0 to 5%, it is marked as a rare character type. When it exceeds 30%, it is marked as a high-frequency character type. Similarly, according to the fluctuation level defined in the benchmark table, when it exceeds a certain value, it will be registered as an item for investigation. After completing the character distribution analysis, it is also necessary to review the extreme value situation of the paragraph length L i For each paragraph length, perform outlier detection. For example, when the calculated difference exceeds three times the average value, it is regarded as an abnormal paragraph. Finally, summarize the statistical situations of each paragraph to form a complete verification result and cross-reference it with the aforementioned file content complexity C. In this way, distinguish which files need to be allocated to a higher-level storage area and generate corresponding storage path records accordingly.
[0122] The steps for obtaining the indexed batch database are as follows:
[0123] Based on the batch time-stamped file, calculate the batch data clustering tightness. The calculation formula is:
[0124]
[0125] Among them, GT represents the batch data clustering tightness, X represents the number of batches with the same time encoding in the batch data, Y represents the number of batches with consecutive batch numbers in the same classification, Z represents the average value of the intervals between batch numbers in different classifications, VW represents the total number of batch files under the same storage path in the batch data, and VM represents the total number of classifications in the database;
[0126] Based on the batch data clustering tightness, an index field and an index table are created to obtain an indexed batch database.
[0127] Specifically, the advantage of the formula lies in the multi-dimensional integration of the number of batches with the same batch time encoding, the number of consecutive batch numbers, and the intervals between different classifications, as well as the storage path information, in the same expression. By combining the cube root and the arctangent function, the relationship between proximity and distance among batches is synthesized into a clustering tightness value, which can more intuitively present the similarity or grouping degree of different batches. It is convenient to quickly screen out more compact or more dispersed batch groups during the subsequent index construction process. At the same time, by combining parameters such as the scale of batch files under the storage path and the total number of database classifications, the clustering analysis has the balance of both local and overall aspects.
[0128] The steps for obtaining the parameter X are as follows: X represents the number of batches with the same time encoding in the batch data, which refers to finding all batches corresponding to the unique time encoding formed by the same year, month, day, hour, minute, and second in the batch time marking file and counting their quantity values. When obtaining, first perform a line-by-line parsing of the batch time marking file, read the time encoding of each batch, and then compare whether these time encodings are exactly the same in a special comparison table. Whenever two or more batches are found to share the same time encoding, the count is incremented by 1. For example, in a daily production log, it is found that the second-level timestamp "20230302123015" corresponds to 15 production batches in total, then it is determined that X = 15.
[0129] The steps to obtain parameter Y are as follows: Y represents the number of consecutive batches within the same classification. Its meaning is that for the same database classification (such as categorizing the same type of packaging materials or the same type of printing process), all batch numbers under this classification are retrieved and it is determined whether these batch numbers show an adjacent order. If there are several batches within a certain consecutive number segment, they are regarded as part of the number of consecutive batches. The acquisition method is to establish a mapping between the internal classification table and the batch number allocation table, extract the batch number arrays under the same classification name one by one, and then check whether these batch numbers increase by 1 one by one from smallest to largest. The number of batches that meet the consecutive conditions in this part is added up to obtain Y. For example, if it is recorded that there are batch numbers 101, 102, 103, 104, etc. in sequence under the A-class packaging classification, and the corresponding quantity reaches 4, then Y = 4.
[0130] The steps to obtain parameter Z are as follows: Z represents the average interval of batch numbers between different classifications and is used to measure the density of number allocation among different classifications. When obtaining this parameter, multiple classifications need to be scanned within the overall database range, and the maximum and minimum values of batch numbers at the adjacent classification boundaries are recorded. These differences are statistically analyzed and the average value is calculated. The larger the interval between different classifications, the more dispersed the batch number distribution. To make this process numerical, all classifications can be sorted in ascending order according to the number allocation sequence first, the batch number intersections of adjacent classifications are extracted, the intervals of each pair of adjacent classifications are calculated respectively, and then the sum is accumulated and divided by the total number of classification pairs to obtain the average value Z. If the difference between the largest and smallest batch numbers between Class B and Class C in the database is 500, the difference between Class C and Class D is 700, and the difference between Class D and Class E is 300, after adding them up and dividing by the corresponding number of interval pairs, the final Z can be obtained. For example, in an actual registration, the boundary differences of multiple classifications are detected, and after summing up and averaging, Z = 500.
[0131] The steps to obtain parameter VW are as follows: VW represents the total number of batch files under the same storage path in batch data, which is an indicator to measure how many batch files are stored in the current storage location. To obtain VW, the path mapping relationship table in the storage system can be accessed to view how many batch data files correspond to a certain path. Each time a batch file is identified, the quantity is accumulated, and finally the total number of files under this path is obtained. For example, in the actual storage path of " / data / packaging / ", it is statistically found that 35 batch files are stored, then VW = 35.
[0132] The steps to obtain the parameter VM are as follows: VW represents the total number of classifications in the database, that is, for the entire production database, how many defined classification categories there are, such as packaging material classification, printing method classification, or other different product line classifications, etc. To obtain this value, it is necessary to access the classification table in the database, query all the classification names from it and count them. For example, when it is found that there are 12 types of packaging materials, 8 types of printing processes, 10 types of auxiliary materials and several derivative classifications set in the database, summing them up can know what VW is specifically. Taking a common scenario as an example, if there are 5 classifications registered in the database, namely A, B, C, D, and E, then VM = 5.
[0133] Calculation process:
[0134] Here is a set of example values:
[0135] X = 15, Y = 20, Z = 500, VW = 35, VM = 5
[0136] The first step is to calculate
[0137] X 2 = 15 2 = 225, Y 2 = 20 2 = 400;
[0138] X 2 + Y 2 = 225 + 400 = 625;
[0139]
[0140] The second step is to calculate
[0141]
[0142] The third step is to calculate
[0143]
[0144] The value of arctan(507) can be calculated using the arctangent function in radians,
[0145] arctan(507) ≈ 1.568;
[0146] In the fourth step, divide the above results to obtain GT:
[0147] The results show that under the batch quantity distribution selected above, the calculated clustering tightness of batch data is approximately 5.45. This value is related to factors such as the overlapping degree of the batch time encoding selected, the number of consecutive batches in classification and the classification interval, and the file scale under the storage path. The larger the value, the more inclined the current batches are to be close in the time or number sequence, and the smaller the value, the more discrete the batch distribution. In practical applications, when GT is close to certain set upper threshold values, it often means that batches are highly concentrated within certain numbers or time periods. As a result, when constructing an index, additional levels or partitions will tend to be added to these batches, enabling faster retrieval or grouping.
[0148] Based on the batch data clustering tightness GT, read the time encoding and classification information corresponding to each batch, and then compare the order of batch numbers and the storage path allocation under the same category. First, retrieve the batch time marker file, and match the classification category and storage path identifier of the batch item by item in this file. Confirm whether the batch has occupied a certain number range under the classification it belongs to by querying the batch number allocation table, and check one by one whether the correlation between the batch and the time encoding is within the pre-established matching range. For example, compare the batch number within the range of 100 to 1000, and compare the time encoding within the range of 20230101000000 to 20231231235959. These ranges are the numerical ranges set during the annual production scheduling plan. If it is detected that a batch falls outside the set range, it is recorded as an abnormal entry and transferred to subsequent monitoring. If it meets the range, it is retained and the storage path identifier is further checked to see if it matches the current batch content. After completing these queries, group all batch records. The grouping rule is to gather batches according to the interval where the clustering tightness GT is located. When the GT value is less than 2, it represents a very dispersed state; between 2 and 5 represents a medium dispersion degree; between 5 and 8 represents relative aggregation; and exceeding 8 is regarded as high tightness. The setting of each interval is obtained from the statistical average clustering results of batches in the previous year. Based on these groupings, start constructing index fields. First, assign an index prefix to each group to distinguish the batch sets corresponding to different tightness intervals. Then, generate an index table in the database in the order of classification, batch number, and time encoding. Each index record includes the batch number, clustering tightness, storage path, and the corresponding time encoding, and the belonging tightness interval is registered separately at the top of the index table. After registration, check again whether the number of batches is consistent with the number of index entries. If some entries are repeated, find the reason for the repetition in the tightness grouping and perform merging processing on the repeated data. For example, multiple records with the same number and the same time encoding will be located in the same group and then merged into one index record. Finally, after summarizing and exporting all index data, the indexed batch database can be obtained.
[0149] The steps for obtaining the retrieval results also include:
[0150] Based on the indexed batch database, calculate the query efficiency optimization index, and the calculation formula is:
[0151]
[0152] where E represents the query efficiency optimization index, and f i represents the frequency of the i-th query request, t i represents the average response time of the corresponding query, n represents the total number of query requests, v is the number of currently active query sessions, s is the total number of available sessions, and k represents the concurrent query number of the current database;
[0153] Based on the query efficiency optimization index, adjust the index table and the database query strategy, optimize the data retrieval path, and obtain the retrieval result.
[0154] Specifically, the advantage of the formula is that it simultaneously incorporates multi-dimensional factors such as the frequency of query requests, average response time, number of active sessions, total number of available sessions, and concurrent query number into the same expression. By using the combination of geometric mean and logarithmic operations, it uniformly measures the various influencing factors of query efficiency, thereby comprehensively reflecting different access loads and response performances in a single value. Through the coupling operation of frequency multiplied by the number of sessions and response time and concurrent query number, it helps to quickly identify the request set with bottlenecks or optimization space when adjusting the index or database strategy later.
[0155] The acquisition steps of parameter f i are as follows: f i represents the frequency of the i-th query request, and the value is derived from the real-time statistics of each query operation in the database management system. The specific method is: for each identifiable SQL command or other query instruction, set up a frequency counter, and add 1 when this instruction is called once. Finally, divide the total number of occurrences accumulated within a unit time (such as 1 hour) by this unit time to obtain the call frequency value of the query. If the system monitors the calls of some common interfaces in the production environment, the corresponding call count can be directly read from its monitoring log file and then divided by the monitoring duration to obtain f i . For example, there is a query statement "SELECT*FROM packaging_info" that is called 120 times in 1 hour, then f i = 120 / 1 = 120.
[0156] The acquisition steps of parameter t i are as follows: t iRepresents the average response time for the corresponding query, which refers to the value obtained by averaging the response times of multiple identical query requests within a unit of time. Specifically, during calculation, the start time and end time of each query request can be collected in the performance monitoring of the database or server, and after adding up the elapsed times, divide by the number of executions of the query. Take an example: within 2 hours, the total execution elapsed time of a certain query request is 16000 milliseconds and it has run 80 times, then t i = 16000 / 80 = 200 milliseconds.
[0157] The steps to obtain the parameter n are as follows: n represents the total number of query requests, that is, how many different types of queries are counted within the current evaluation window. The specific approach is to access the database request log or monitoring system, classify and count all identified query statements, ensuring that the same statement structure is regarded as the same query request, and if the structure is slightly different, it is classified into different requests. For example, assuming that the system has identified 10 query requests (such as querying the packaging table, querying the printing table, querying the production schedule table, etc.) during the monitoring time, then n = 10 can be obtained.
[0158] The steps to obtain the parameter v are as follows: v represents the number of currently active query sessions, which refers to the total number of sessions that have established connections and are in the execution or waiting-to-execute state at the current moment. This data is often maintained by the database connection manager. Whenever a request initiates a connection and maintains it to the database, the session counter is incremented by 1, and when the execution is completed and the connection is closed, the session counter is decremented by 1. Therefore, v can be obtained in real-time in the system status monitoring. If the database concurrency is relatively high, v is usually relatively large. Example: At a certain monitoring moment, when viewing the database connection pool or session list, if it shows that 45 connections are in a non-idle state, then v = 45.
[0159] The steps to obtain the parameter s are as follows: s represents the total number of currently available sessions, that is, the maximum number of connections allowed by the database or server minus the number of occupied connections. If a database system defines the maximum number of allowed connections as 200, and at this time there are already 50 connections (including idle and active), then the available number of sessions s = 200 - 50 = 150.
[0160] The steps to obtain the parameter k are as follows: k represents the number of concurrent queries in the current database, that is, how many queries are in the state of being issued simultaneously within a time slice. Similar to v, but more concerned about the number of instantaneous parallel requests, and it can be obtained by identifying the number of query sets executed in parallel within 2 seconds through the database scheduling or monitoring system. If it is detected that the number of query statements being executed in the system is 12 at a certain moment, then k = 12.
[0161] Calculation process:
[0162] Here is an example scenario: Suppose there are n = 3 query requests identified in the current database monitoring window, and their call frequencies f1 = 120, f2 = 60, and f3 = 30 within 1 hour are respectively counted, and the corresponding average response times t1 = 200 milliseconds, t2 = 350 milliseconds, and t3 = 500 milliseconds are recorded; at this time, the number of active database sessions v = 20, the number of available sessions s = 80, and the current concurrent query number k = 12.
[0163] In the first step, calculate That is, the geometric mean of all query frequencies:
[0164]
[0165]
[0166] In the second step, calculate That is, the sum of the average response times of all queries:
[0167] t1 + t2 + t3 = 200 + 350 + 500 = 1050;
[0168] In the third step, calculate
[0169]
[0170] 0.0573 × 0.25 = 0.014325;
[0171] In the fourth step, calculate ln(k):
[0172] k = 12, ln(12) ≈ 2.4849;
[0173] In the fifth step, multiply the above results to get E: E = 0.014325 × 2.4849 ≈ 0.0356;
[0174] This result indicates that within the current monitoring window, after comprehensively considering the frequencies, response times, number of active sessions, number of available sessions, and number of concurrent queries of these three query requests, the optimization index of the query efficiency is approximately 0.0356. The relatively low value indicates that there is a certain pressure on the query response effect in the existing environment, or the query volume and response time are relatively balanced but have not reached a very high efficiency range; in some scenarios, if f i is relatively higher or t i is smaller, or the number of concurrent queries k increases, then E may increase significantly. When E approaches a pre-set high-level threshold (such as 0.1 or 0.2), it indicates that the overall query efficiency is better; when E is low for a long time, system administrators can use this index to optimize the index table or query strategy specifically in the next step.
[0175] Based on the calculated query efficiency optimization index E, read the execution frequency, response time and indexed information of each query request in the database, record each query request and its numerical performance in different time periods against the pre-established query performance registration table, and check the proportion of each query in the number of active sessions and the number of available sessions. Compare these proportions with the pre-established reference ranges, for example, compare the proportion of active sessions between 0 and 50, and the proportion of available sessions between 1 and 100. If the number of active sessions is higher than 50 at one time, it is marked as a tense state. If the number of available sessions is lower than 10, it is marked as insufficient resources. Then retrieve the fluctuation of the number of concurrent queries and combine it with the query log The start and end time of each query are checked one by one. During the checking process, the frequency monitoring results and response time collection results established in the previous stage are queried at the same time to determine whether there are large quantities of repeated SQL statements or instantaneous peaks that cause the request queue to accumulate continuously. The specific peak time period is identified by comparing the query status mapping and session occupancy at each moment, and the identified peak information is associated with the query efficiency optimization index E. When it is found that the index has dropped significantly within a specific period of time, the period is recorded as a key monitoring section. Finally, after summarizing all query adjustment requirements, the index field is appropriately modified and the database query strategy is updated to complete the further optimization of the data retrieval path.
[0176] The steps to obtain detailed batch results are:
[0177] Extract the production batch information in the search results, parse the batch number, production time, and production line number, and obtain the original data of batch production and quality control;
[0178] Based on the original batch production and quality control data, the production process log is parsed to extract the operating status of production equipment, raw material batches and production process parameters, and the quality inspection data is compared and analyzed to match the historical production records to generate batch production and quality control data;
[0179] Based on batch production and quality control data, the production links, process parameters, equipment status and quality inspection results are classified and organized to form detailed batch results.
[0180] Specifically, extract the production batch information from the retrieval results, parse the batch number, production time, and production line number. First, read the unique identifier corresponding to each batch from the retrieval results and match the production time field. Compare the batch number with the pre-registered batch number range in the system. For example, compare the batch number with the range from 1 to 999999. If the number is less than 1 or exceeds 999999, it is recorded as an abnormal record and temporarily shelved. Subsequently, check whether the production time is within an acceptable range. For example, compare the date with the range from 20230101 to 20241231, and compare the time with the range from 00:00:00 to 23:59:59. These ranges are obtained from the annual production scheduling data. If the production time is not within this range, it is marked as invalid data and transferred to the fault query. Then, read the production line number information and confirm whether the corresponding workshop allocation meets the equipment availability limit. For example, compare the production line number with the pre-established valid range, compare the number with the range from 1 to 100. If the number falls between 1 and 100, determine whether there is an overload situation on this production line. Estimate the available amount by counting the operation duration and output of this production line in the past two weeks. If the operation duration reaches 300 hours and the output has reached the established load threshold, it is marked as resource-intensive and requires subsequent review. This threshold is set by the workshop equipment management group based on the accumulated operation and maintenance data in the past and adjusted by the average operation load in the past three months. Then, splice and record the confirmed valid batch number, production time, and production line number and maintain consistency in the same entry. If a certain entry is found to be missing the batch number or production time during the reading process, it is classified as an incomplete data entry and not included in the subsequent processing. After all inspections are completed, sort the normal entries again to ensure that the batch numbers are arranged from small to large and consistent with the chronological order of the production time. Finally, summarize all the production batch numbers, production times, and production line numbers without abnormalities to obtain the original data for batch production and quality control.
[0181] Based on the original data of batch production and quality control, parse the production process log. First, retrieve records that match the batch number one by one from the production process log, and conduct cross-verification based on the confirmed production time and production line number to ensure that the time period when the same batch appears in the process log corresponds to the original data. During the process of comparing with the log, read the parameters such as temperature, pressure, current, and working duration of each record line by line, and compare them item by item with the pre-established valid ranges. For example, the temperature is compared in the range of 0°C to 90°C, the pressure is compared in the range of 0 MPa to 2 MPa, and the current is compared in the range of 0 A to 5 A. If it exceeds these ranges, mark the corresponding record as an abnormal equipment state. Lock the operation continuity of the equipment according to the timestamp indicated in each record. If there is a shutdown state or the temperature suddenly exceeds 90°C during a certain time period, register it as an abnormal event. At the same time, retrieve the raw material batch number at the same log position and match it with the raw material distribution list in the system, and include the successfully matched raw material number and batch number in the subsequent tracking scope. Then, continuously compare the production process parameters to check whether the specific values of temperature gradient, stirring speed, or machine speed at each stage are within the segmented standards. These segmented standards are formulated based on historical process specifications and requirements for product characteristics. For example, when the stirring speed requirement is 500 to 1500 revolutions per minute, if it is higher than 1500, it is classified as an overspeed record and data verification is triggered again. Finally, compare the quality inspection data with the historical production records item by item, and confirm whether there are duplicate or deviation fields by retrieving the inspection information before similar batches. If the difference between the inspection data and the historical average value exceeds 5%, mark it as a batch entry that needs to be observed closely. When all these stages are completed, batch production and quality control data are generated.
[0182] Based on batch production and quality control data, classify and organize the production process, process parameters, equipment status, and quality inspection results. First, read the start and end time periods of each batch in the production process and perform section division. Determine which key processes and auxiliary processes this batch has passed through by referring to the pre-established process flow numbering table. Then, split the process parameters into several dimensions such as temperature, humidity, pressure, rotation speed, feeding time, etc. according to the classification standard, and integrate the parameter entries of the same batch in different dimensions. If there are records of relevant equipment status, append them to the corresponding process for knowing the specific operating conditions of each process during summarization. Next, arrange the quality inspection results in the order of the inspection time. Confirm the stability of the measurement correlation by comparing the product inspection time period, inspection indicators, and equipment operation points within the batch, and list each batch and its corresponding quality index results in a continuous table in sequence. At the same time, record the value range of each indicator and judge whether it exceeds the threshold. This threshold is obtained by the quality department through summarizing and analyzing the factory pass rate within one year. For example, when the threshold of an indicator is set to a deviation not exceeding ±3%, if it exceeds ±3%, mark this indicator as abnormal and append it to the subsequent inspection queue. Finally, centrally organize the production process, process parameters, equipment status, and quality inspection results of each batch and list them in the order of batch numbers to form the detailed batch results.
[0183] The steps to obtain the display results are as follows:
[0184] Based on the detailed batch results, calculate the data transmission stability. The calculation formula is:
[0185]
[0186] Among them, S represents the data transmission stability, V(t) represents the data flow rate at time t, T represents the total data loading time, M i represents the production data block size of the i-th batch, N represents the number of production batches, D represents the current task queue length of the database, H represents the network bandwidth occupancy rate, W represents the file size of the current batch of data, G represents the number of database index items associated with the batch, J represents the number of concurrent requests during data transmission, and QL represents the currently available memory space of the server;
[0187] Based on the data transmission stability, adjust the data loading strategy, and at the same time bind the production data and time stamps to the interface elements to obtain the display results.
[0188] Specifically, the benefit of the formula lies in integrating the data stream rate integral with multiple dimensions such as the batch data block size, database queue length, network bandwidth occupancy rate, file size, number of index entries, number of concurrent requests, and available memory space into one expression. It measures the overall stability during the data transmission process in the form of segmented summation, reflects the deviation degree between the total data volume and the actual loaded volume in the numerator part, embodies the dynamic impact of database and network resources in the denominator part, and depicts the load pressure of concurrent requests by combining logarithmic and maximum value operations. This structure can measure whether the transmission is stable in a complex production environment and provide a quantitative reference.
[0189] The steps to obtain the parameter V(t) are as follows: V(t) represents the data stream rate at time t. To obtain this parameter, it is necessary to capture each time slice after the data transmission starts. For example, in actual situations, the data stream rate is collected with a sampling period of 1 second, and we get V(0) = 8 MB / s, V(1) = 9 MB / s, V(2) = 10 MB / s, etc.
[0190] The steps to obtain the parameter T are as follows: T represents the total time of data loading, which refers to the duration from the start to the end of this transmission. For example, in a batch file distribution, the start time is recorded as 14:00:00, and the end time is 14:00:50, then T = 50.
[0191] Parameter The steps to obtain it are as follows: represents the sum of the production data block sizes of the i-th batch. N is the number of production batches, and the total amount is obtained by summing up the data sizes of each batch. To obtain each M i , it is necessary to check the actual stored file size or data block capacity in the batch information and obtain it through the file attributes of the operating system or the capacity fields recorded in the database. If the N batches respectively occupy 10 MB, 12 MB, 8 MB... and are added up in sequence, the total amount can be obtained. For example, in a certain case, there are 5 batches with sizes of 10 MB, 12 MB, 8 MB, 5 MB, and 15 MB respectively, then
[0192] The steps to obtain the parameter D are as follows: D represents the current task queue length of the database, indicating how many uncompleted queries or operations are in a queued waiting state at the database level. The real-time length of this queue can be read in the database management interface or the scheduling system. Whenever a new request arrives but has not been executed, it enters the queue and is removed after completion. To accurately obtain D, it is necessary to read the database queue within the same time window of the transmission. If the system monitoring shows that there are 25 waiting tasks in the current queue, record D = 25.
[0193] The steps to obtain parameter H are as follows: H represents the network bandwidth occupancy rate, which refers to the percentage or relative ratio of the network bandwidth occupied by the system during transmission in the available bandwidth. First, measure the actual transmission rate used by this link, and then divide it by the maximum bandwidth of the network channel where the server is located to obtain the occupancy rate value. For example, if the maximum bandwidth of a dedicated network channel is 100 MB / s and it is observed that the system is using 40 MB / s, then H = 0.4.
[0194] The steps to obtain parameter W are as follows: W represents the file size of the current batch of data and is used to indicate how large the file size of a single batch is. When obtaining it, the value is obtained by consulting the file storage information or the record fields in the database. For example, when a certain batch of files occupies 60 MB, then W = 60.
[0195] The steps to obtain parameter G are as follows: G represents the number of database index entries associated with the batch, that is, how many index records in the database correspond to this batch. Whenever there are several index entries (such as the main index, time index, process index, etc.) for a production batch information in the database, the count is accumulated. To obtain this value, all index keys can be retrieved and the total count can be calculated according to the batch number in the indexed batch database. For example, if it is found that a certain batch has 30 index entries after retrieval, then G = 30.
[0196] The steps to obtain parameter J are as follows: J represents the number of concurrent requests during data transmission, which here refers to how many requests are in progress at the same time within the same time period. To obtain J, the transmission threads or connection counts can be viewed in network or server - side monitoring. For example, when the monitoring system shows 15 connections in the process of transmission (each for sending different files or at different time periods), then J = 15.
[0197] The steps to obtain parameter QL are as follows: QL represents the currently available memory space on the server (which can be regarded as "idle memory" or "remaining memory capacity") and will change continuously during transmission. The real - time available memory value can be read through the memory monitoring interface in the operating system or container, and then the actual available capacity can be obtained after excluding the reserved memory of other processes on the server. For example, if the physical memory of the server is 64 GB, 42 GB has been occupied by other programs, and another 2 GB is reserved as system buffer, then the available memory QL = 20 GB.
[0198] Calculation process:
[0199] The following gives an example calculation:
[0200] Set That is, the total amount of data sent integrated during the entire transmission period is 220 MB;
[0201] That is, the total size of N batches of data involved in this task is 200 MB;
[0202] D = 25, indicating that there are currently 25 tasks waiting to be processed in the database;
[0203] H = 0.4, indicating an occupancy rate of 40%;
[0204] W = 60 MB, which is the size of the current batch of data files;
[0205] G = 30, which is the number of index entries of this batch in the database;
[0206] J = 15, which is the number of concurrent requests;
[0207] QL = 10 GB;
[0208] Step 1: Calculate the numerator
[0209] |220 - 200| = 20 (MB);
[0210] Step 2: Calculate the denominator
[0211] tan(0.4) ≈ 0.4245, D + tan(H) = 25 + 0.4245 = 25.4245;
[0212]
[0213] Step 3: Obtain the value of the first part:
[0214]
[0215] Step 4: Calculate the second part
[0216] max(60, 30) = 60, ln(15) ≈ 2.7081;
[0217] 60 × 2.7081 = 162.486;
[0218]
[0219]
[0220] Step 5: Add the two parts to get S: S = 3.967 + 39.06 = 43.027 ≈ 43.03;
[0221] The result shows that under the above example parameters, the data transmission stability value S is in a relatively high numerical range. If a threshold is set in the range of 10 to 30, it can be regarded as slightly unstable transmission. If it is lower than 10, it means the transmission process is more stable. If it exceeds 50, it means there are higher degrees of fluctuations and pressures overall. When S continues to increase, it indicates that the gap between the usage and available amount of network or system resources during transmission is relatively large, so that the actual transmission state is evaluated as more likely to experience jitter or waiting blockage situations. Different data loading strategies or shunting means can be selected according to the value range of S in the follow-up.
[0222] Based on the obtained data transmission stability S, read the previously generated batch detailed results and check each network transmission record and database connection utilization situation item by item. First, retrieve the file size and the number of index items of each batch to see how much network resources and database resources they occupy during transmission. Compare these values with the pre-established reference ranges. For example, limit the file size between 0MB and 200MB. If a certain batch exceeds 200MB, it is marked as a type with large resource consumption. Then, check in the same way whether the number of index items falls between 1 and 1000. If the batch index item number is higher than 1000, index splitting or partitioning may be required. Subsequently, compare with the data loading time during the production period and check whether the database queue length has exceeded the daily experience threshold (such as 30 queue tasks) at this time. This threshold is obtained from multiple peak statistics. If the queue length reaches 45 or more at this time point, it is regarded as too long queuing and the abnormality is recorded. At the same time, summarize the sending rate of each time slice in the transmission log item by item and compare it with the bandwidth occupancy rate in a chart to find high occupancy sections or sudden peak sections. Then, compare the number of concurrent requests and the available memory space with the previously statistically 0 to 50 concurrent range and 2GB to 32GB available memory range respectively. If it is detected that the number of concurrent requests reaches 60 or the available memory is less than 1GB, it is still marked as an area that needs to be optimized. Finally, mark the batches that do not meet the reference range on the interface elements and combine each batch and time mark to output a summary information for the operation and maintenance personnel to consult, and obtain the display result.
[0223] The above is only the preferred embodiment of the present invention, and it does not limit the present invention in other forms. Any person skilled in the art may use the disclosed technical content 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 content of the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention still belong to the protection scope of the technical solution of the present invention.
Claims
1. A management method for traceability of food packaging printing material batches, characterized in that, It includes the following steps: Collect the production time of each production batch, construct time data, which includes year, month, day, hour, minute, and second, and create a time code based on the time data; combine the time code with the data of the production batch to form a time-marked data packet, and generate a batch time-marked file; Store the batch time-marked file in a database to obtain a storage result; classify and organize the batch time-marked file, create a corresponding index table, and generate an indexed batch database; Use the indexed batch database to perform data comparison, locate each query request, retrieve the corresponding production batch, and obtain a retrieval result; Based on the retrieval result, extract the production and quality control information of the batch to generate a detailed batch result; Based on the detailed batch result, construct a batch tracking interface to display the production information and time mark of each batch, and obtain a display result.
2. The management method for traceability of food packaging printing material batches according to claim 1, wherein The steps for obtaining the time code are as follows: Collect the production time of each production batch, extract the year, month, day, hour, minute, and second fields, arrange them in chronological order, and standardize the data format. Eliminate records with missing or abnormal time information to obtain time data; Based on the time data, extract the time fields, analyze the logical order between time units, perform time format conversion, and combine the year, month, day, hour, minute, and second fields into a continuous numerical value to generate a time code.
3. The management method for traceability of food packaging printing material batches according to claim 1, characterized in that The steps for obtaining the batch time-marked file are as follows: Based on the time code, simultaneously extract the production batch information of each production batch to obtain verified production batch data; Based on the verified production batch data, calculate the batch mark value, and the calculation formula is: where TID is the batch mark value, BID represents the production batch number, TC represents the time code, and PT represents the Unix timestamp of the production time; Based on the batch mark value, bind the production batch information to the time code to obtain a batch time-marked file.
4. The management method for traceability of food packaging printing material batches according to claim 1, characterized in that, The steps for obtaining the storage result are as follows: Based on the batch time-marked file, calculate the file content complexity, and the calculation formula is: Among them, C represents the file content complexity, L i represents the character length of the i-th paragraph in the file, P i represents the character diversity metric value of the i-th paragraph in the file, ZT represents the total number of lines in the file, U represents the number of unique character types in the file, represents the average value of all paragraph lengths, CP k represents the character repeatability of the whole file, m represents the total number of paragraphs in the file; Based on the file content complexity, select a matching database storage mode, divide the storage area according to the file content complexity, store the batch time-marked file in the corresponding storage area, and record the storage path to obtain a storage result.
5. The management method for traceability of food packaging printing material batches according to claim 1, characterized in that, The steps for obtaining the indexed batch database are as follows: Based on the batch time-marked file, calculate the batch data clustering tightness, and the calculation formula is: where GT represents the batch data clustering tightness, X represents the number of batches with the same time code in the batch data, Y represents the number of consecutive batch numbers in the same classification, Z represents the average interval of batch numbers between different classifications, VW represents the total number of batch files under the same storage path in the batch data, and VM represents the total number of classifications in the database; Based on the batch data clustering tightness, create an index field and an index table to obtain an indexed batch database.
6. The management method for traceability of food packaging printing material batches according to claim 1, wherein, The steps for obtaining the retrieval result further include: Based on the indexed batch database, calculate the query efficiency optimization index, and the calculation formula is: Among them, E represents the optimization index of query efficiency, f i represents the frequency of the i-th query request, t i represents the average response time of the corresponding query, n represents the total number of query requests, v is the number of currently active query sessions, s is the total number of currently available session quantities, and k represents the concurrent query number of the current database; Based on the query efficiency optimization index, adjust the index table and database query strategy, optimize the data retrieval path, and obtain the retrieval result.
7. The management method for traceability of food packaging printing material batches according to claim 1, characterized in that The steps for obtaining the detailed batch results are as follows: Extract the production batch information from the retrieval result, parse the batch number, production time, and production line number to obtain the original data of batch production and quality control; Based on the original data of batch production and quality control, parse the production process log, extract the operating status of production equipment, raw material batches, and production process parameters, conduct a comparative analysis of the quality inspection data, match the historical production records, and generate the data of batch production and quality control; Based on the data of batch production and quality control, classify and sort out the production links, process parameters, equipment status, and quality inspection results to form the detailed batch results.
8. The management method for traceability of food packaging printing material batches according to claim 1, characterized in that, The steps for obtaining the display result are as follows: Based on the detailed batch results, calculate the data transmission stability, and the calculation formula is: Among them, S represents the data transmission stability, V(t) represents the data flow rate at time t, T represents the total data loading time, M i represents the production data block size of the i-th batch, N represents the number of production batches, D represents the current task queue length of the database, H represents the network bandwidth occupancy rate, W represents the file size of the current batch of data, G represents the number of database index items associated with the batch, J represents the number of concurrent requests during data transmission, and QL represents the currently available memory space of the server; Based on the data transmission stability, adjust the data loading strategy, and at the same time bind the production data and time mark to the interface elements to obtain the display result.
9. The management system for the traceable management method of food packaging printing material batches according to any one of claims 1-8, characterized in that, Including: A time coding module that collects the production time of the production batch, including year, month, day, hour, minute, and second, creates a corresponding time code according to the production time, and generates a time coding result; A batch marking data packet module that combines the time coding result with the corresponding production batch data to form a data packet including a time mark, generates a batch time mark file from the data packet, and stores it in the database to obtain the batch time mark file; An indexed database module that classifies and organizes based on the batch time mark file, creates a corresponding index table, structures the stored data through the index table, generates an indexed batch database, and obtains the indexing result; A data retrieval module that uses the indexing result to locate and compare data for each query request, retrieves the corresponding production batch, obtains the retrieval result from it, and generates retrieval result data; A batch tracking display module that extracts batch information including production and quality control information based on the retrieval result data, constructs a batch tracking interface, and displays the production information and time mark of each batch.
Citation Information
Cited By
Stamping hardware quality management method and system
CN121279863A
Pre-twisted suspension clamp convenient to install and replace
CN121367158A
Pre-assembled suspension clamp
CN121367158B