A method for retrieving seedling transportation information from a cloud database
By setting the seedling transportation quality rules for cloud databases and monitoring network delay and load, and calculating the influence factors of rule adaptability and data freshness, the problems of high cost and low accuracy of data retrieval in cloud databases are solved, and efficient and economical data retrieval and precise control are achieved.
Patent Information
- Application Number
- CN202510758713.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-06-09
AI Technical Summary
The existing technology fails to effectively monitor and evaluate network latency, load and data synchronization between cloud database replicas, resulting in high data retrieval costs and difficult to guarantee the accuracy of the search results.
Set the quality rules for seedling transportation in cloud databases, calculate the degree of matching between user search parameters and rules, generate rule adaptability scores, monitor network round trip time and load between database copies, calculate the impact of data delay on freshness, adjust the cost of data retrieval, and assign quality labels to data records for filtering.
It improves the real-time and economicality of data retrieval, ensures the reliability and accuracy of search results, and realizes the precise control and quality assurance of seedling transportation data.
Smart Images

Figure CN120256490B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information retrieval technology, and in particular to a method for retrieving seedling transportation information from a cloud database. Background Art
[0002] The seedling transportation information retrieval method is mainly used to quickly and efficiently obtain seedling transportation information that complies with specific transportation quality rules and constraints from the cloud database system, so as to achieve accurate monitoring and evaluation of transportation quality parameters such as temperature, speed, and time during seedling transportation.
[0003] During execution, existing technologies fail to effectively monitor and evaluate network latency, load, and data synchronization between database replicas. They also fail to quantify data freshness based on actual data conditions, resulting in a lack of dynamic adjustment of actual retrieval costs and high data retrieval costs. Furthermore, in terms of data record verification, there is a lack of quantification of abnormal deviations in seedling transport data and a targeted quality label assignment strategy, making it difficult to effectively determine whether there are obvious anomalies in seedling transport record data. This can lead to a large number of records that do not meet quality regulations appearing in data retrieval results, making it difficult to ensure the retrieval quality and accuracy of seedling transport data. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method for retrieving seedling transportation information from a cloud database.
[0005] In order to achieve the above objectives, the present invention adopts the following technical solution: a method for retrieving seedling transportation information from a cloud database, comprising the following steps:
[0006] Setting seedling transport quality rules in a cloud database and determining threshold ranges for temperature, speed, and time; receiving search parameters input by a user, calculating the degree of field matching between the user's search parameters and the seedling transport quality rules, and obtaining a rule fitness score; based on the rule fitness score, integrating the user's search parameters with the corresponding seedling transport quality rules to generate a seedling transport query instruction with quality rule constraints;
[0007] According to the seedling transport query instruction with quality rule constraints, the network round-trip time, load and data synchronization delay between database copies are monitored, the data delay lag is estimated, and the impact of data delay on data freshness requirements is calculated to form a data freshness impact factor; the data retrieval cost is adjusted according to the data freshness impact factor, and the database copy with the lowest cost is selected to execute the query instruction to obtain the seedling transport data record set to be verified;
[0008] Extracting quality rules from the seedling transport query instruction with quality rule constraints, traversing the seedling transport data record set to be verified, comparing the temperature, speed, and time fields in the data records one by one, quantifying the degree to which the abnormal fields deviate from the corresponding rules, and calculating a deviation metric value; assigning a quality label to each seedling transport record based on a comparison result of the record deviation metric value with a preset threshold value, thereby forming a seedling transport record set with attached quality labels;
[0009] Apply the filtering conditions in the seedling transportation query instruction with quality rule constraints to filter the seedling transportation record set with quality labels, count the proportion of qualified labels in the filtered records, combine the proportion of qualified labels with the filtering conditions set by the user, and output the seedling transportation information retrieval results.
[0010] Preferably, the step of obtaining the rule fitness score is: based on the seedling transport quality rules set in the cloud database, extracting the upper and lower limit thresholds of the temperature threshold range, the speed threshold range and the time threshold range to form a seedling transport quality rule threshold set;
[0011] According to the seedling transport quality rule threshold set, the temperature parameter, speed parameter, and time parameter in the search parameters input by the user are compared item by item to see whether they fall within the corresponding threshold range, and the matching situation of each field falling within the corresponding threshold range is counted to obtain a field matching count set;
[0012] A rule fitness score is calculated based on the field matching count set.
[0013] Preferably, the step of obtaining the seedling transportation query instruction with quality rule constraints is: based on the rule fitness score, setting a threshold standard for the rule fitness score, judging whether the rule fitness score reaches the threshold standard, if the rule fitness score is greater than or equal to the threshold standard, it is considered a valid score, if the rule fitness score is less than the threshold standard, it is considered an invalid score, and generating a rule fitness score validity judgment result;
[0014] Based on the validity judgment result of the rule fitness score, the temperature threshold range, speed threshold range, and time threshold range are extracted from the seedling transportation quality rule, the search parameters input by the user are associated and matched with the respective threshold ranges field by field, and a quality rule constraint condition combination with the temperature field, speed field, and time field as the screening conditions is constructed to generate a quality rule constraint condition combination;
[0015] According to the quality rule constraint combination, the quality rule constraint combination is converted into a query condition statement executable by the database and added into the seedling transportation data information retrieval request command body to form a seedling transportation query instruction with quality rule constraints.
[0016] Preferably, the step of obtaining the data freshness influencing factor is: according to the seedling transportation query instruction with quality rule constraints, sending a test data packet to each database copy respectively, and recording the total time from sending the data packet to receiving the verification feedback, and calculating the network round-trip time of all database copies to form a network round-trip time set;
[0017] Based on the network round-trip time set, the current load index and data synchronization delay time index of each database replica are obtained in real time through the status monitoring interface of the database replica, the load and data synchronization delay are calculated item by item, and a comprehensive database replica delay index is generated;
[0018] A data freshness impact factor is calculated based on the comprehensive database replica delay index.
[0019] Preferably, the step of obtaining the seedling transportation data record set to be verified is: according to the data freshness impact factor, obtaining the basic retrieval cost of each database copy in the current cloud database, and multiplying the basic retrieval cost of each database copy by the data freshness impact factor of the corresponding database copy to calculate the data retrieval cost of each database copy, and generating a database copy data retrieval cost set;
[0020] Based on the database replica data retrieval cost set, all data retrieval costs in the database replica data retrieval cost set are sorted in ascending order, and the database replica corresponding to the lowest data retrieval cost is selected from the sorted database replica data retrieval cost set to generate the lowest-cost database replica;
[0021] According to the lowest cost database copy, a seedling transportation query instruction with quality rule constraints is sent to the lowest cost database copy, and the corresponding seedling transportation data is obtained from the lowest cost database copy to form a seedling transportation data record set to be verified.
[0022] Preferably, the step of obtaining the deviation metric value is: according to the seedling transportation query instruction with quality rule constraints, parsing and extracting the temperature field rule value, the speed field rule value and the time field rule value from the instruction one by one, and forming a quality rule field reference set;
[0023] Based on the quality rule field reference set, the seedling transport data record set to be verified is traversed one by one, the temperature field measured value, the speed field measured value and the time field measured value in the seedling transport data record set are extracted one by one, and the values are compared one by one with the corresponding field rule values of the quality rule field reference set, and the abnormal deviation of the field is determined to form a field abnormal deviation set;
[0024] Calculate a deviation metric value based on the field abnormal deviation set.
[0025] Preferably, the step of obtaining the seedling transport record set with the quality label is as follows: according to the deviation measurement value, setting a preset threshold value for abnormal judgment of the deviation measurement value, comparing the record deviation measurement value of each seedling transport data record with the preset threshold value one by one, if the record deviation measurement value is greater than or equal to the preset threshold value, it is determined to be an abnormal record, if the record deviation measurement value is less than the preset threshold value, it is determined to be a normal record, and generating a record abnormality judgment result;
[0026] Based on the record abnormality determination result, all seedling transportation data records are traversed, and abnormal quality labels are assigned to data records determined to be abnormal records, and qualified quality labels are assigned to data records determined to be normal records, to form a data record quality label set;
[0027] According to the data record quality label set, the quality labels are added to the corresponding seedling transportation data records respectively, and the quality labels are merged with the corresponding data records one by one to obtain a seedling transportation record set with quality labels.
[0028] Preferably, the step of obtaining the seedling transportation information retrieval result is: according to the filtering conditions in the seedling transportation query instruction with quality rule constraints, the actual measured values of the temperature field, the actual measured values of the speed field and the actual measured values of the time field in the seedling transportation record set with the quality label are compared one by one, and the seedling transportation records whose temperature field, speed field and time field all fall within the threshold range of the filtering conditions are screened to form a seedling transportation record set that meets the filtering conditions;
[0029] Calculating a comprehensive value of the proportion of qualified labels based on the set of seedling transportation records that meet the filtering conditions;
[0030] A comparison is made between the comprehensive value of the proportion of qualified labels and the filter condition threshold set by the user. If the comprehensive value of the proportion of qualified labels is greater than or equal to the filter condition threshold set by the user, the seedling transportation record set that meets the filter condition is output as a qualified result of the seedling transportation information retrieval. If the comprehensive value of the proportion of qualified labels is less than the filter condition threshold set by the user, an empty record set is output to form a seedling transportation information retrieval result.
[0031] Compared with the prior art, the advantages and positive effects of the present invention are:
[0032] The present invention sets the threshold ranges of temperature, speed and time in the seedling transportation quality rules in the cloud database, receives user search parameters and calculates the degree of matching with the quality rules, and generates a specific rule fitness score, thereby effectively improving the accuracy of the subsequent query process; in the process of executing the query instruction, by comprehensively monitoring the network round-trip time, load and data synchronization delay of the database copy, and conducting a detailed quantitative assessment of the data delay, a specific data freshness influencing factor is formed, which effectively reduces the data retrieval cost when selecting the database copy, and improves the real-time and economic efficiency of data retrieval; at the same time, by calculating the deviation measurement value of the abnormal field in the data record relative to the rule, the data record is accurately assigned a quality label, and the data record is screened based on the quality label and the proportion of qualified labels is counted, thereby improving the reliability and accuracy of the retrieval results, realizing the precise control and quality assurance of seedling transportation data, and thereby improving the timeliness, accuracy and economic benefits of data retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Schematic diagram of the steps of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, 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 intended to limit the present invention.
[0035] See also Figure 1 The present invention provides a technical solution, a method for retrieving seedling transportation information from a cloud database, comprising the following steps:
[0036] Set seedling transport quality rules in the cloud database and determine the threshold ranges for temperature, speed, and time; receive search parameters entered by the user, calculate the degree of field matching between the user's search parameters and the seedling transport quality rules, and obtain a rule fitness score; based on the rule fitness score, integrate the user's search parameters with the corresponding seedling transport quality rules to generate a seedling transport query instruction with quality rule constraints;
[0037] Based on seedling transport query instructions with quality rule constraints, the network round-trip time, load, and data synchronization delay between database replicas are monitored, the data delay lag is estimated, and the impact of data delay on data freshness requirements is calculated to form a data freshness impact factor. The data retrieval cost is adjusted based on the data freshness impact factor, and the database replica with the lowest cost is selected to execute the query instruction to obtain the seedling transport data record set to be verified.
[0038] Extract quality rules from seedling transport query instructions with quality rule constraints, traverse the seedling transport data record set to be verified, compare the temperature, speed, and time fields in each data record, quantify the degree to which abnormal fields deviate from the corresponding rules, and calculate the deviation metric value; based on the comparison result of the record deviation metric value with the preset threshold, assign a quality label to each seedling transport record, forming a seedling transport record set with attached quality labels;
[0039] Apply the filtering conditions in the seedling transportation query instruction with quality rule constraints to filter the seedling transportation record set with quality labels, count the proportion of qualified labels in the filtered records, and combine the proportion of qualified labels with the user-set filtering conditions to output the seedling transportation information retrieval results.
[0040] The steps for obtaining the rule fitness score are as follows: based on the seedling transport quality rules set in the cloud database, extract the upper and lower thresholds of the temperature threshold range, speed threshold range, and time threshold range to form a seedling transport quality rule threshold set;
[0041] According to the seedling transportation quality rule threshold set, the temperature parameter, speed parameter, and time parameter in the search parameters input by the user are compared item by item to see whether they fall within the corresponding threshold range, and the matching situation of each field falling within the corresponding threshold range is counted to obtain a field matching count set;
[0042] According to the field matching count set, the rule fitness score is calculated using the following formula:
[0043] ;
[0044] in, Score the rule fit, The user input Search parameter values, The threshold value set for seedling transportation quality rule The central reference value of the field, For the The standard deviation of the field is obtained by dividing the difference between the upper and lower limits of the field by 6.
[0045] Specifically, based on the seedling transportation-related data that has been summarized in the cloud database in the early stage, it is necessary to read the measurement records such as temperature, speed and time registered during the transportation of multiple batches, and organize these records according to a fixed period, so as to count the minimum and maximum values of each field. In terms of temperature, the actual values collected by the sensors in different batches are traversed and compared, and the lowest temperature of 2 degrees Celsius and the highest temperature of 10 degrees Celsius are screened out and recorded as the final upper and lower limit ranges. In terms of speed, the driving distance of the transport vehicle in the equal time interval is converted into a driving speed value. After sorting out the data for many days, it is found that the minimum speed of the vehicle is 30 kilometers per hour and the maximum speed is 80 kilometers per hour. In terms of time, the start and end time records of each batch of transportation are used for subtraction operations. In the transportation case lasting one month, the shortest time is 1 hour and the longest time is 8 hours. Then the upper and lower limit thresholds of these three fields are uniformly numbered and combined into corresponding threshold sets to form a seedling transportation quality rule threshold set that can support subsequent processing.
[0046] After obtaining the seedling transportation quality rule threshold set, the temperature, speed, and time values entered by the user need to be strictly matched with the upper and lower limits of the corresponding fields in the aforementioned set. For the temperature field, the input value is judged according to the interval of 2 degrees Celsius to 10 degrees Celsius to determine whether it falls within the range. For the speed field, the interval of 30 kilometers per hour to 80 kilometers per hour is compared to determine whether the input speed meets the requirements. For the time field, it is detected whether the input time is between 1 hour and 8 hours. In order to further count the matching status of the three fields, an independent matching count variable is set for each field. When the value of a field meets its threshold range, the corresponding counting variable is increased by one. Finally, the counting results of the three fields are summarized to generate a matching count list, and the three matching values in the list are sorted together to obtain a field matching count set.
[0047] formula: The benefit of the formula is that this process can comprehensively quantify the differences in the three dimensions of temperature, speed, and time by performing an exponential attenuation operation on the degree of deviation between the user input and the rule center reference value. The deviation distance is mapped to an attenuation coefficient between 0 and 1 through a Gaussian distribution trade-off method, and the three results are averaged to ensure that the overall result will not be completely invalid due to the deviation of one field. This ensures that the process has more flexible adaptability when judging whether the seedling transportation quality requirements are met. This design idea can be fully applied in a variety of scenarios.
[0048] parameter The acquisition steps are as follows: This parameter represents the search value entered by the user, which includes three fields: temperature, speed and time, corresponding to 、 、 To obtain these three values, it is necessary to receive the data submitted by the user and parse it according to the pre-agreed field order. For example, the temperature can be directly extracted from the actual measurement results of a certain period of time from the temperature measurement records of the transportation environment. The speed can be obtained based on the average driving speed counted by the vehicle driving monitoring. The time can be determined by the transportation time registered in the waybill system. Different user input links will produce different value combinations. For example, in a certain data receiving process, degrees Celsius, kilometers per hour, Hour.
[0049] parameter The acquisition steps are as follows: This parameter is the central reference value of each field in the seedling transportation quality rule threshold set, corresponding to the midpoint of the optimal interval of temperature, speed and time. The average value of the temperature field in the range of 2 degrees Celsius to 10 degrees Celsius is 6 degrees Celsius. The speed field is calculated by taking the arithmetic midpoint in the range of 30 kilometers per hour to 80 kilometers per hour to get 55 kilometers per hour, or it is refined by the relatively concentrated running speed statistics in the historical data. Here it is set to 50 kilometers per hour. The time field is obtained by taking the midpoint of 4 hours within the range of 1 hour to 8 hours, or by calculating the centralized value closer to the transportation habits through the historical data of the scheduling system. Here, it is determined to be 4 hours. In order to ensure that the central reference value is sufficiently stable, it is necessary to collect transportation information for more than 30 days in a row, and then perform segmented statistics on the actual monitoring values of the corresponding fields, and take the midpoint of the highest frequency band or interval to set the central reference value of each field. For example, after calculation, the central value of temperature is determined to be 6 degrees Celsius, the central value of speed is 50 kilometers per hour, and the central value of time is 4 hours, all of which are obtained from the actual data.
[0050] parameter The steps to obtain are: This parameter is the standard deviation, which is used to characterize the fluctuation within the upper and lower limits of the field. According to the formula definition, the difference between the upper and lower limits of the field needs to be divided by 6. For example, the upper and lower limits of the temperature field are 2 degrees Celsius and 10 degrees Celsius, and the difference is 8 degrees Celsius. After dividing by 6 It is approximately 1.3333. The upper and lower limits of the speed field are 30 kilometers per hour and 80 kilometers per hour, and the difference is 50 kilometers per hour. After dividing by 6 It is about 8.3333. To ensure that it is more consistent with the historical operation statistics, the final determination is based on the vehicle speed fluctuation monitoring results within one month. The value is 10. The upper and lower limits of the time field are 1 hour and 8 hours, and the difference is 7 hours. After dividing by 6 It is about 1.1667, but after comprehensive comparison of a large number of scheduling records, it is uniformly corrected to 1 hour. When it is necessary to obtain this parameter, first query the actual lower and upper limits of each field in the cloud database, calculate the difference based on the actual measurement range and divide it by 6, and then compare the initial calculation result with the discrete degree of measurement data for multiple consecutive days. If there is any deviation, use the data distribution curve for further correction, and finally generate a suitable value for each field. Numerical values, such as 1.3333 for the temperature field, 10 for the speed field, and 1 for the time field, are all obtained from statistics of a large number of samples.
[0051] Calculation process:
[0052] The first step is to substitute the above parameters into the formula:
[0053] ;
[0054] Will 、 、 After substitution we get:
[0055] ;
[0056] Will 、 、 After substitution we get:
[0057] ;
[0058] Will 、 、 After substitution we get:
[0059] ;
[0060] The second step is to sum and average:
[0061] ;
[0062] This result shows that when When the value is about 0.3553, it means that the temperature, speed and time fields entered by the user deviate significantly from the central reference value. Different occasions can be set according to actual business needs. For example, when When the minimum requirement is defined as 0.5 or above, the user input will be considered as a low match. If it exceeds 0.8, it means that the input value is very close to the quality rules for seedling transportation and can meet more stringent requirements.
[0063] The steps for obtaining a seedling transportation query instruction with quality rule constraints are as follows: based on the rule fitness score, a threshold standard for the rule fitness score is set, and whether the rule fitness score meets the threshold standard is determined. If the rule fitness score is greater than or equal to the threshold standard, it is considered a valid score; if the rule fitness score is less than the threshold standard, it is considered an invalid score, and a rule fitness score validity judgment result is generated;
[0064] Based on the validity judgment results of the rule fitness score, the temperature threshold range, speed threshold range, and time threshold range are extracted from the seedling transportation quality rules. The search parameters entered by the user are associated and matched with the respective threshold ranges field by field. A quality rule constraint condition combination is constructed with the temperature field, speed field, and time field as the screening conditions to generate a quality rule constraint condition combination;
[0065] According to the quality rule constraint combination, the quality rule constraint combination is converted into a query condition statement executable by the database and added into the seedling transportation data information retrieval request command body to form a seedling transportation query instruction with quality rule constraints.
[0066] Specifically, based on the stored rule fitness score threshold information, a numerical comparison is performed on the score values obtained each time, and a specific threshold standard is determined by comparing the minimum score and maximum score range collected in historical monitoring. The score is compared with this threshold. When the score is greater than or equal to the threshold, the current score is marked as valid, otherwise it is marked as invalid. All score distributions in the past month are retrieved from the database for horizontal comparison. The reasonable range of the threshold is determined by analyzing the central trend and dispersion of the score distribution. It is recommended to set the threshold based on the deviation between the median and the mean of the sample distribution. It is necessary to sort the score list recorded in the early stage first, select the median score as the basic benchmark value, and then calculate the difference between all scores and this median. The sum of squares of differences between the two scores is used to obtain the score fluctuation measure, and the upper and lower boundaries of the interval corresponding to the score fluctuation measure are selected as the correction range of the threshold. In the specific implementation process, the threshold can be set as a value between the upper and lower boundaries. For example, when the median is 0.65, after calculating the fluctuation measure of all scores, it is found that the upper and lower boundaries are 0.6 and 0.7 respectively. Therefore, 0.65 is determined as the current threshold. The subsequent batch scores are compared. When the batch score is greater than or equal to 0.65, it is judged to be valid. When the batch score is lower than 0.65, it is judged to be invalid. These valid and invalid results are recorded and then combined with other fields for correlation analysis. Finally, the validity judgment distinction of the current rule fitness score under the threshold standard is obtained, and the validity judgment result of the rule fitness score is generated.
[0067] According to the validity judgment result of the rule adaptation score obtained in the previous step, combined with the temperature threshold range, speed threshold range and time threshold range recorded in the database, the temperature value entered by the user is numerically judged. When the temperature value falls within the specified interval, it is considered to meet the conditions. When the temperature value is not within the interval, it is considered to exceed the limit. The speed field and the time field are processed according to the same interval. It is necessary to read multiple field data submitted by the user in the retrieval stage. For example, the temperature value is 8 degrees Celsius, the speed value is 45 kilometers per hour, and the time is 6 hours. These three data are respectively compared with the extracted threshold range. When all fields are within the threshold range, the input is considered to fully meet the rule. When any field is found to be out of bounds during the comparison, it is marked as unsatisfied. When there is a need to distinguish between simultaneous satisfaction and partial satisfaction, a difference threshold should be added to measure and record the value deviation. For example, the temperature is set to 2 to 10 degrees Celsius, the speed is set to 30 to 80 kilometers per hour, and the time is set to 1 to 8 hours. When the input data range and the threshold interval match the requirements, these fields are combined to generate a complete set of quality rule constraints. For example, the limiting expression of the temperature field is , the limiting expression of the velocity field is , the limiting expression of the time field is , merged into ,These expressions form a constraint combination structure according to the ,previous association matching results, and generate a quality rule constraint ,combination.
[0068] According to the aforementioned quality rule constraint combination, convert them one by one into query expressions that conform to the database syntax structure. Use customized statement splicing to connect temperature field restriction, speed field restriction, time field restriction and other conditions into a joint judgment string. It is necessary to load the pre-registered field naming mapping in the query condition management first to keep the field name in the database consistent with the alias in the aforementioned expression. For example, The corresponding mapping is in the actual database field, The corresponding mapping is field, The corresponding mapping is Field, after the mapping is completed, string assemble the temperature condition, speed condition and time condition in turn, and connect them using common logical operators, such as using the greater than or equal to sign and the less than or equal sign , spliced together to get , organize the string into an executable SQL statement, and add the corresponding query identifier and field filtering instruction in the retrieval request command body. When the database receives the command body, it will perform range matching on the corresponding fields and filter out the record rows that meet the conditions. Finally, the relevant seedling transportation data information is returned to the calling end, forming a seedling transportation query instruction with quality rule constraints.
[0069] The steps for obtaining data freshness influencing factors are as follows: according to the seedling transportation query instruction with quality rule constraints, a test data packet is sent to each database replica, and the total time from sending the data packet to receiving the verification feedback is recorded. The network round-trip time of all database replicas is calculated to form a network round-trip time set;
[0070] Based on the network round-trip time collection, the current load index and data synchronization delay time index of each database replica are obtained in real time through the database replica status monitoring interface. The load and data synchronization delay are calculated item by item to generate a comprehensive database replica delay index.
[0071] According to the comprehensive index of database replica delay, the data freshness impact factor is calculated. The calculation formula is:
[0072] ;
[0073] in, is the data freshness influencing factor, For the The current load indicator of each database copy, For the The data synchronization delay time indicator of each database copy, For the Network round-trip time for each database copy, The total number of database copies.
[0074] Specifically, according to the seedling transportation query instruction with quality rule constraints obtained above, test data packets are distributed to different database copies and the time consumed from sending the data packet to receiving verification feedback is recorded. It is necessary to first clarify the identification and network connection method of each database copy, establish a separate sending command stream for each copy, write the data request instruction to be tested and the segmentation mark for random detection in the sending command stream, so that each copy interprets the instruction in the same order after receiving it, and then obtain the actual round-trip time by recording the difference between the local timestamp and the timestamp when sending when receiving the feedback information, and compare this time with an average value interval obtained through long-term monitoring. For example, when the round-trip time is between 50 milliseconds and 150 milliseconds, it can be considered normal. If it exceeds 150 milliseconds, it is considered that the current network throughput is congested. These distribution commands will generate multiple round-trip time records after all replicas are executed. All these round-trip times are collected and sorted, and indicators such as the maximum, minimum, and median are taken and their specific values are recorded. At the same time, multiple test results over several days are accumulated to obtain a set list containing the round-trip times of all database replicas. This list can be used for subsequent analysis to determine the response differences between different replicas, and finally provided to other steps for further processing based on the round-trip time set.
[0075] Based on the previously obtained network round-trip time collection, the current load and data synchronization delay metrics for each replica are extracted through the database replica status monitoring interface. This requires pre-deploying statistical tools on each replica to record load factors such as CPU utilization, read and write I / O times, and the number of concurrent transactions. These are then combined with delay records in the synchronization log to generate a delay value. For example, if a replica's CPU utilization reaches 85%, its read and write I / O times remain high for ten consecutive minutes, and its synchronization delay exceeds 300 milliseconds, the load and delay metrics for that replica are recorded and compared with load and delay thresholds compiled from real-world operations. If any of these metrics exceed the specified thresholds, the replica is marked as high load or high delay in the status record. Complete load and delay information is then aggregated for each replica, paired with previously collected network round-trip time data to form a comparable record table containing the replica ID, current load value, current synchronization delay value, and round-trip time. After the collection is complete, a comprehensive database replica delay metric is calculated for each entry, providing a basis for further processing.
[0076] formula: The benefit of the formula is that by using the load index Data synchronization delay indicator Perform vector-based merging and divide by the network round-trip time of the corresponding replica , which can comprehensively reflect the possible impact of the replica on data freshness under the simultaneous existence of high load and high latency. This structure couples the three elements in an overall expression, so that the calculation result can reflect the data validity risk of all replicas in the current scenario at one time, thereby facilitating the subsequent selection of replicas with relatively real-time data updates.
[0077] parameter The steps to obtain are: This parameter represents the The current load indicators of each database copy include CPU usage, disk IO volume, and transaction queue data. Real-time monitoring methods need to be deployed in advance to continuously collect and record these load-related data. CPU usage can be obtained through the process-level statistical interface provided by the system, disk IO volume comes from read and write operation counts, and transaction queue data is generated by the database engine in the query execution plan. In order to combine load data of different dimensions into a single value, a weighted summation method is used here to obtain , the specific weighted calculation formula can be listed, for example ,in 、 、 The weight is determined based on the impact of the various indicators obtained above on system performance. For example, by collecting the impact of CPU usage, IO operation frequency, and transaction queue number on database response within 30 days, the total proportion of the three is selected as 1, and the actual impact ratio is calculated. Set to 0.4, Set to 0.3, Set to 0.3, when performing calculations, when the CPU usage is 0.8, the IO operation frequency is 400 times per second, and the number of transactions queued is 10, we can get This value can be compared with similar values of other replicas in subsequent steps and give a clear load level assessment. When the load of other replicas is generally between 100 and 150, the current replica can be positioned in a more moderate range in terms of load.
[0078] parameter The steps to obtain are: This parameter represents the To determine the data synchronization delay time indicator for each database copy, it is necessary to establish an inter-node log replication tracking mechanism between database copies to accurately record the delay, including when the update transaction is written to the master database and when the slave database completes synchronization. While performing data synchronization, the difference between the write start time and the synchronization completion time is recorded, and the arithmetic average of these differences at multiple measurement points is taken to obtain the final synchronization delay data. If the synchronization delay is recorded as 280 milliseconds in one monitoring, 310 milliseconds in the next monitoring, and 350 milliseconds in another monitoring, the sum can be added and then divided by 3 to obtain an average delay of 313.3 milliseconds, which is used as the current value. .
[0079] parameter The steps to obtain it are: The network round-trip time of each database replica needs to be selected based on the round-trip time monitoring results obtained previously. For example, the round-trip time obtained from multiple round-trip monitoring of the same replica may fluctuate between 50 milliseconds and 100 milliseconds. To obtain the current stable value, the median of the round-trip time of the replica in the recent period can be used as the In the specific monitoring data, if the first five round-trip times are 54 milliseconds, 57 milliseconds, 65 milliseconds, 58 milliseconds, and 60 milliseconds, respectively, the third value (i.e., the middle value of the sort) can be selected as the network round-trip time after sorting.
[0080] parameter The steps to obtain the parameter are as follows: This parameter is the total number of database copies. In the actual environment, it needs to be obtained by counting the operation and maintenance configuration. When 5 replica servers are deployed, .
[0081] Calculation process:
[0082] The first step is to bring in each copy 、 、 and the total number of copies , for example when , the parameters of each copy are as follows, the first copy , , milliseconds, second copy , , milliseconds, 3rd copy , , milliseconds, 4th copy , , Milliseconds, the delay and load are unified using the numerical system, and the time is measured in milliseconds.
[0083] The second step is to calculate , taking the first copy as an example,
[0084] ;
[0085] Then divide 337.0 by T_{1}=58 milliseconds to get about 5.81. Using this method, we can calculate the other three replicas as follows:
[0086] ;
[0087] ;
[0088] ;
[0089] Step 3: Sum all the results and divide by the total number of copies ,
[0090] ;
[0091] This result shows that when When the value is about 5.08, it means that the comprehensive level of load, synchronization delay and network round-trip time of the current four replicas has reached a certain level. The larger the value, the higher the influence coefficient of the replica as a whole on the data freshness. A value less than 2 means that the load and latency are relatively controllable in a given environment. When the value reaches 5 or above, there is a higher risk of impact. Therefore, this value can be used to screen or allocate appropriate replicas in subsequent steps to grasp the timing of data reading or arrange replica synchronization strategies.
[0092] The steps for obtaining the seedling transportation data record set to be verified are as follows: based on the data freshness impact factor, the basic retrieval cost of each database copy in the current cloud database is obtained, and the basic retrieval cost of each database copy is multiplied by the data freshness impact factor of the corresponding database copy to calculate the data retrieval cost of each database copy, thereby generating a database copy data retrieval cost set;
[0093] Based on the database replica data retrieval cost set, all data retrieval costs in the database replica data retrieval cost set are sorted in ascending order, and the database replica corresponding to the lowest data retrieval cost is selected from the sorted database replica data retrieval cost set to generate the lowest-cost database replica;
[0094] According to the lowest cost database copy, a seedling transportation query instruction with quality rule constraints is sent to the lowest cost database copy, and the corresponding seedling transportation data is obtained from the lowest cost database copy to form a seedling transportation data record set to be verified.
[0095] Specifically, based on the data freshness influencing factors obtained above, it is necessary to first find the basic call cost of each database copy in the database configuration record. This cost can be quantified by multiple indicators, including the operating cost of the copy machine, the CPU and memory ratio costs in the operation and maintenance records, the unit time period cost generated by occupying the network bandwidth, etc. Each indicator should be registered at the time of deployment. For example, the CPU ratio cost is set to 0.3 yuan / core·hour, the memory ratio cost is set to 0.2 yuan / GB·hour, the network bandwidth cost is set to 0.5 yuan / MB·second, etc., and then the actual number of cores running on the corresponding copy, memory size, and network bandwidth data are multiplied and added. Processing, obtain the basic retrieval cost of the replica and summarize it one by one. After obtaining these basic retrieval costs, multiply them one by one according to the obtained data freshness impact factor. It is recommended to convert all values to a unified unit before calculation, keeping the cost unit in yuan and the time unit in seconds, and record the product as the data retrieval cost of each replica. If the basic retrieval cost of a replica is 12.5 yuan and the data freshness impact factor is 3.6, then the data retrieval cost of the replica is about 45 yuan. After completing the calculation of all replicas one by one, the data retrieval cost information of all replicas can be recorded in the table, and finally this information is combined together to form the database replica data retrieval cost set.
[0096] Based on the previously generated database replica data retrieval cost set, first iterate through all records in the set and separate the corresponding replica identifier and cost value. It's recommended to use consecutive numbers or unique identifier strings to distinguish replicas, mapping these identifiers to costs one-to-one. Then, sort these costs in ascending order from lowest to highest. If multiple records have the same cost during sorting, perform a secondary sort based on replica load or other fields from the previous step. Once the sorting is complete, perform a sequential search through the list, selecting the replica that ranks first or several times as the lowest cost. If the system's predefined criteria requires selecting only a single optimal replica, select the first replica after sorting, record its identifier, and indicate that it has the lowest data retrieval cost at the current moment. To determine if there are similar replicas, examine the cost difference between the second and third ranked replicas. If the difference falls below a threshold established by historical data statistics, a comparison can also be performed. Comparing each record against the predefined threshold is commonly used during project maintenance. Ultimately, the replica with the lowest data retrieval cost is identified based on the sorting results, generating the lowest-cost database replica.
[0097] Based on the previously obtained lowest-cost database replica, a seedling transport query instruction with quality rule constraints is sent to it. The actual content of the instruction must be clarified during execution, such as filter expressions for temperature, speed, and time fields, as well as relevant search keywords. Before sending the instruction, the query interface of the replica should be accessed using a unified connection method, and the complete query string generated in the previous step should be written. Wait for the replica to return records that match the filter conditions. All returned records are then compared one by one with the field list defined by the current query requirements to ensure that the required fields such as temperature, speed, and time exist and their contents are accurate. If the aforementioned constraints are confirmed to be met, the final data row set is obtained after parsing the output. This can be used as a batch of seedling transport data record sets to be verified. This record set often contains several specific records that meet the filtering requirements, such as hundreds of transport records with field values for temperature of 8 degrees Celsius, speed of 50 kilometers per hour, and time of 6 hours. After aggregation, it can be provided for subsequent verification or further processing steps, ultimately completing the acquisition of the corresponding seedling transport data from the lowest-cost database replica and forming the seedling transport data record set to be verified.
[0098] The steps for obtaining the deviation measurement value are as follows: according to the seedling transportation query instruction with quality rule constraints, the temperature field rule value, speed field rule value, and time field rule value are parsed from the instruction one by one and respectively extracted to form a quality rule field reference set;
[0099] Based on the quality rule field reference set, the seedling transport data record set to be verified is traversed one by one, and the measured values of the temperature field, speed field, and time field in the seedling transport data record set are extracted one by one. These values are then compared one by one with the corresponding field rule values in the quality rule field reference set to determine the abnormal deviation of the field and form a field abnormal deviation set.
[0100] Calculate the deviation metric value based on the field abnormal deviation set. The calculation formula is:
[0101] ;
[0102] in, is the deviation measure, The field deviates abnormally from the set The measured value of each field, For the quality rule field reference set The rule value of each field, It is the field number, 1 represents the temperature field, 2 represents the speed field, and 3 represents the time field.
[0103] Specifically, according to the seedling transportation query instruction with quality rule constraints obtained previously, the instruction is parsed one by one and the temperature field rule value, speed field rule value and time field rule value therein are read in turn. When parsing, it is necessary to analyze the text content one by one according to the field identifier specified in the instruction and locate the position of the rule value. For example, in the restricted expression of the instruction, the three keywords "temperature field restriction", "speed field restriction" and "time field restriction" can be found and the corresponding values can be identified. When the values are extracted, they are first sorted in the order of temperature, speed and time and a value integrity check is performed. The check includes detecting whether the value is within the feasible range of temperature, speed and time that has been registered previously, and recording those that do not meet the requirements as exceptions. The situation will be checked and supplemented later. If all the values pass the check, they will be compiled into a "quality rule field reference set". This set can store the collected rule benchmark values of temperature, speed, and time fields in a fixed structure, and then put them into a list with other related fields. The temperature field rule value, speed field rule value, and time field rule value can be listed in the list in turn, and the attribute definition and corresponding identification mark of the field can be attached to the back of each record. Then, after confirming that there are no errors in the list content, it will be written to the system memory and marked with a date and time stamp, so that it can be directly compared and called when traversing the seedling transportation data record set to be verified. When the parsing instruction is completed, the final quality rule field reference set can be obtained.
[0104] Based on the quality rule field reference set obtained earlier, the seedling transport data record set to be verified is read one by one and the measured value of the temperature field, the measured value of the speed field and the measured value of the time field of each data record is accessed. It is necessary to confirm in advance that the order and field names of these fields are consistent with the correspondence between the temperature, speed and time of the aforementioned reference set. Then, the temperature value of each data record is compared with the temperature field rule value in the set, and the values are compared one by one to see if they exceed the preset allowable range. For example, if the temperature is set in the range of 2 degrees Celsius to 10 degrees Celsius, if the measured value of the temperature field in a certain record is 12 degrees Celsius, It is determined that there is a large difference between it and the rule value. The speed and time fields are also compared to see if they fall within the intervals of 30 kilometers per hour to 80 kilometers per hour and 1 hour to 8 hours. After the comparison is completed, the fields with deviations will be marked as abnormal. After the statistics are completed, all abnormally marked fields can be classified and summarized, and the deviations in each record can be numbered. These numbers are combined with the measured values and rule values to form a field abnormal deviation set. In this way, these records can be directly referenced for calculation when the deviation measurement value is subsequently calculated. After this operation traverses all records, a field abnormal deviation set can be uniformly constructed.
[0105] formula: The benefit of the formula is that by performing a logarithmic weighted summation of the relative deviations of the three fields of temperature, speed, and time, it can suppress excessive amplification when the degree of deviation is small, and increase the proportion of the impact on the total value when the degree of deviation is large. This allows for the assessment of whether there are large numerical anomalies in the seedling transportation data records to take into account the impact of both slight and severe deviations, making the deviation assessment more targeted and adaptable to a variety of scenarios.
[0106] parameter The acquisition steps are: This parameter represents the abnormal deviation of the field from the first The measured values of each field, including the measured value of the temperature field, the measured value of the speed field, and the measured value of the time field, need to be read directly from the seedling transportation data record set to be verified and ensure that the field mapping order is consistent with the previous one. At the data source level, temperature or speed data can be obtained through temperature sensor collection or vehicle tracking system records, or time data can be calculated through the time difference between the start and end of transportation. After acquisition, the measured values corresponding to the three fields are packaged into the same record. Before performing the calculation, it must be ensured that the numerical types of these fields are unified and there are no missing values. For example, the measured temperature values are uniformly measured in degrees Celsius, the measured speed values are uniformly measured in kilometers per hour, and the measured time values are uniformly measured in hours. If there is unit confusion or data anomalies, they need to be corrected or eliminated in the previous stage, and finally they can be directly referenced when calculating the record. is the measured temperature value, is the measured value of speed, It is the actual measured value of time. For example, the temperature of a record is 12 degrees Celsius, the speed is 90 kilometers per hour, and the time is 9 hours.
[0107] parameter The acquisition steps are as follows: This parameter represents the rule value corresponding to the temperature, speed, and time fields in the quality rule field reference set. It needs to be obtained after parsing the query instruction with quality rule constraints and is linked to the quality rule field reference set established earlier. For example, the temperature field rule value is obtained by the system based on the target value selected from a certain range or the conventional transportation experience value. If the temperature is preferably 8 degrees Celsius, the speed is preferably 50 kilometers per hour, and the time is preferably 6 hours when setting the rules in the early stage, then at this time =8 degrees Celsius, =50 kilometers per hour, =6 hours.
[0108] Calculation process:
[0109] The first step is to set the corresponding field and Divide and square, add 1 in the brackets, and take the logarithm. Here we use the natural logarithm. ,
[0110] The second step is to sum the logarithmic results of the temperature, speed, and time fields respectively, and then divide the total by 3.
[0111] The third step is to get the final The numerical value is used to measure the degree of deviation of the record. An example is given below:
[0112] For example, in a record degrees Celsius, kilometers per hour, hours, and the corresponding rule value degrees Celsius, kilometers per hour, hours, first calculate the temperature term:
[0113] ;
[0114] Speed Item:
[0115] ;
[0116] Time item:
[0117] ;
[0118] After summing the three terms, we get ,
[0119] Dividing by 3 gives:
[0120] ;
[0121] The results show that the current data records have a certain degree of deviation in the three fields, but after the overall conversion, they are still in a relatively moderate deviation range. When it is less than 0.2, the deviation is very small, and when When it exceeds 1.0, it indicates a significant deviation. This value can be compared with other records. Compare or compare with established thresholds to determine the abnormality of each record and perform corresponding screening or marking steps.
[0122] The steps for obtaining a seedling transport record set with a quality label are as follows: according to the deviation measurement value, a preset threshold value for abnormality judgment of the deviation measurement value is set, and the record deviation measurement value of each seedling transport data record is compared with the preset threshold value one by one. If the record deviation measurement value is greater than or equal to the preset threshold value, it is judged as an abnormal record; if the record deviation measurement value is less than the preset threshold value, it is judged as a normal record, and a record abnormality judgment result is generated;
[0123] Based on the abnormal record determination results, all seedling transportation data records are traversed, and abnormal quality labels are assigned to data records determined to be abnormal records, and qualified quality labels are assigned to data records determined to be normal records, forming a data record quality label set;
[0124] According to the data record quality label set, the quality labels are added to the corresponding seedling transportation data records respectively, and the quality labels are merged with the corresponding data records one by one to obtain the seedling transportation record set with the quality labels.
[0125] Specifically, based on the deviation measurement values obtained above, it is necessary to create a statistical table in the system that can record and maintain the distribution of deviation measurement values. The statistical table can be generated by scanning all sample data one by one and extracting the deviation measurement values therein. When the statistical table is completed, a time period is selected as a benchmark, such as the deviation measurement value distribution in the past 30 days. All the deviation measurement values are sorted and the value at the median of the sort is extracted as the initial benchmark threshold. Then, based on previous historical conditions, additional analysis is performed on the distribution above and below the median. For example, a fluctuation reference interval centered on the median is set. When the number of deviation measurement values corresponding to the fluctuation reference interval exceeds a certain proportion, the upper edge value of the interval or a higher position can be used as the execution process after fixed-point monitoring. A preset threshold is set for abnormal judgment. If you want to further confirm the accuracy of the threshold, you can collect the deviation measurement values in the past 10 days again after completing the analysis and calculate the frequency of them falling above the threshold. If the frequency remains in a certain range, the threshold will be retained and not adjusted temporarily. If it is found that the number of records with deviation measurement values exceeding the range has increased sharply, you can re-evaluate the daily data or weekly data and calculate the median and quartile difference. A value that is closer to the actual situation can be selected as the threshold update. After configuring the preset threshold in the system, the deviation measurement values of all seedling transportation data records will be compared with this threshold one by one. When the deviation measurement value of a record is greater than or equal to the threshold, it will be directly marked as abnormal, otherwise it will be marked as normal, and the final record abnormality judgment result will be obtained.
[0126] Based on the previously obtained record anomaly determination results, when collating all seedling transport data records, it is necessary to first read the deviation information of each abnormal record and verify whether the deviation of the temperature, speed, and time fields of the record itself has reached the preset threshold standards. If the abnormal conditions are confirmed, the data record is moved to the abnormal allocation list and marked with an abnormal special flag. Then, all records not in the abnormal allocation list are retrieved and the previously calculated deviation metric is again checked to confirm that it is below the threshold. Finally, these records that do not exceed the threshold are marked as qualified, resulting in two major categories of record sets. The original order within each category can be maintained for subsequent review. After confirming the integrity of these flags, all records in the abnormal list are assigned an abnormal quality label, and all records in the qualified list are assigned a qualified quality label. This allows different quality levels to be distinguished in the data structure. When tracing the status of specific transport batches, relevant entries can be quickly located based on whether they are abnormal and the degree of deviation in temperature, speed, and time can be checked, ultimately forming a set of data record quality labels.
[0127] According to the quality label allocation results completed previously, abnormal quality labels and qualified quality labels need to be added to the corresponding seedling transportation data records respectively. During the implementation process, the field append method can be used to insert a character type field named "quality_label" at the end of each record. When the data traverses the abnormal record entry, the "abnormal" mark is written in the field. When the data traverses the qualified record entry, the "qualified" mark is written in the field. Before this operation, the database records are grouped by batch or date and the verification operation is completed for each group. The specific qualified list and abnormal list will be identified in the verification process first, so in the label writing stage, you only need to compare the corresponding record ID with the result of the previous step to complete the quick matching. Finally, after all records are marked with corresponding labels, the label information is uniformly merged with the original record structure. In subsequent queries or exports, you can see the quality assessment of the record at the same time, and finally obtain a seedling transportation record set with quality labels.
[0128] The steps for obtaining the seedling transportation information retrieval results are as follows: according to the filtering conditions in the seedling transportation query instruction with quality rule constraints, the actual measured values of the temperature field, the actual measured values of the speed field, and the actual measured values of the time field in the seedling transportation record set with the quality label are compared one by one, and the seedling transportation records whose temperature field, speed field, and time field all fall within the threshold range of the filtering conditions are selected to form a seedling transportation record set that meets the filtering conditions;
[0129] Based on the seedling transportation record set that meets the filtering conditions, the comprehensive value of the qualified label ratio is calculated using the following formula:
[0130] ;
[0131] in, is the comprehensive value of the proportion of qualified labels, The number of records with qualified quality labels in the seedling transportation record set that meet the filtering conditions. is the number of records with abnormal quality labels in the seedling transportation record set that meets the filtering conditions. The number of newly added records in the seedling transportation record set that meets the filtering conditions in the last month. The number of records in the seedling transportation record set that meet the filtering conditions and are in the pending verification state;
[0132] The comprehensive value of the proportion of qualified labels is compared with the filter condition threshold set by the user. If the comprehensive value of the proportion of qualified labels in the records is greater than or equal to the filter condition threshold set by the user, the seedling transportation record set that meets the filter conditions will be output as the qualified result of the seedling transportation information retrieval. If the comprehensive value of the proportion of qualified labels in the records is less than the filter condition threshold set by the user, the output is an empty record set, forming the seedling transportation information retrieval result.
[0133] Specifically, according to the query instruction filtering conditions with quality rule constraints obtained above, it is necessary to screen the actual measured values of the temperature field, the speed field and the time field of the seedling transportation record set with the current quality label. During the implementation process, the threshold values of the filtering conditions should be sorted into a record table first. For example, the temperature is set in the range of 2°C to 10°C, the speed is in the range of 30 kilometers per hour to 80 kilometers per hour, and the time is in the range of 1 hour to 8 hours. Then, the existing data records are reviewed one by one, and the temperature value, speed value and time value of each record are read and compared with the three intervals in the above record table respectively. When the actual measured value is lower than or exceeds the specified range, the record is deemed to be non-compliant and skipped directly. If If all three fields fall within the threshold range, the current record will be temporarily stored in a set. At the same time, when verifying each record, it is recommended to set a minimum and maximum allowable range for the three fields. For example, the temperature must not be lower than 0℃ or higher than 90℃, the speed must not be lower than 0 kilometers per hour or higher than 150 kilometers per hour, and the time must not be lower than 0 hours or higher than 24 hours, so as to avoid extreme anomalies in the input values that may cause problems in subsequent judgments. When all records are compared, a set containing only records that meet the filtering conditions can be obtained. The three field parameters of all items in the set will be recorded, and the quality labels of these items will also remain in their original state. After storage is completed, the basic data for further calculation or analysis will be available.
[0134] formula: The benefit of the formula is that by multiplying multiple fields within the cube root and squaring some of the differences, the relationship between the number of qualified records and the number of abnormal records can be balanced at one time. At the same time, dimensions such as new records added in the last month and records in the pending verification status can be integrated, making the simple qualified ratio more meaningful in all aspects.
[0135] parameter The steps to obtain are as follows: This parameter represents the number of records with qualified quality labels in the seedling transportation record set that meets the filtering conditions. It is necessary to make corresponding marks when merging quality labels. Each record will be written with a fixed string such as "qualified" or "abnormal" or "to be verified" in the quality_label field. After the filtering conditions are completed, all the remaining records constitute a set that meets the filtering conditions, and then only the count of records marked as "qualified" is counted. If you plan to continuously monitor the transportation information of each batch within a month, you can read the total number of records with quality_label equal to "qualified" in the data table. For example, in the latest statistics, it was found that there were 500 records that met the filtering conditions, of which 350 had qualified quality labels. At this time .
[0136] parameter The acquisition steps are as follows: This parameter represents the number of records with abnormal quality labels in the seedling transportation record set that meets the filtering conditions. The acquisition method is the same as Similar, but after traversing the set that meets the filter conditions, only the records with quality_label equal to "abnormal" are counted. This process can be completed automatically by the system. For example, among the 500 records that meet the filter conditions, 120 are labeled "abnormal", then .
[0137] parameter The acquisition steps are as follows: This parameter represents the number of new records in the seedling transportation record set that meet the filtering conditions in the last month. For example, if you check the database and find that 60 of the 500 records that meet the filtering conditions are new data that appeared in the past 30 days, then .
[0138] parameter The steps to obtain are as follows: This parameter indicates the number of records in the seedling transport record set that meet the filtering conditions and are in the pending verification state. In the system, the words "pending verification" are generally added as the quality_label value to records that have not been fully verified or still need further evaluation. Similarly, after the filtering condition operation is completed, only the entries with the quality_label of "pending verification" in the records that meet the conditions are counted. For example, if it is found that there are still 10 records in the batch of 500 that have not been verified, then .
[0139] Calculation process:
[0140] The first step is to calculate the records that meet the filtering conditions from the database query These four values, for example, the values obtained this time are as follows: , , , ;
[0141] The second step is to substitute the formula and perform multiplication and squaring operations on the cube root first:
[0142] ;
[0143] ;
[0144] It needs to be done in steps:
[0145] ;
[0146] ;
[0147] ;
[0148] The third step is to perform a cube root operation on the product:
[0149] ;
[0150] Step 4: Calculate the denominator ;
[0151] The fifth step finally concluded:
[0152] ;
[0153] This result shows that when When the value is about 4.20, it means that among the records that meet the filtering conditions, there are more qualified labels and the abnormal labels do not cause a low qualified ratio compared with the labels to be verified. If the value is lower than 1.0, it can be considered that the proportion of qualified labels is relatively low and the number of abnormal labels and labels to be verified is relatively prominent. If the value is higher than 3.0, it means that qualified labels occupy a more significant proportion in the total. Based on this, we can further decide whether to output these records as the final qualified results.
[0154] According to the comprehensive value of the proportion of qualified labels obtained previously, the value is compared with the filter condition threshold set by the user and it is determined whether to output the record set that meets the filter condition as the final qualified result. When implementing, it is necessary to first read the user-defined threshold from the configuration record, such as setting the threshold to 2.0 or 3.0. After completing the calculation of the comprehensive value of the proportion of qualified labels mentioned above, the value can be compared with the threshold. If the value obtained previously is higher than or equal to the threshold, the entire set is immediately selected as the search result and marked as qualified. If the value is less than this threshold, an empty set will be obtained and the search will end directly. During this comparison process, it is recommended to conduct periodic review of the threshold setting. The comprehensive value of the proportion of qualified labels for several consecutive days can be summarized and a distribution curve can be drawn. Each time it reaches or falls below a certain value, the rationality of the threshold can be rechecked. If it is found that the fluctuation is too large, it can be fine-tuned. For example, the threshold can be set to be close to the lower or upper edge of the distribution range of the comprehensive value of the proportion of qualified labels. After the final confirmation of the threshold is completed, the seedling transportation record set that meets the filtering conditions can be updated to the corresponding application result table in the current query process. It can be quickly called when analysis or statistics are required later, and the search results are finally output and retained in the database for traceability.
[0155] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A method for retrieving seedling transportation information from a cloud database, characterized in that: The following steps are involved: Setting seedling transport quality rules in a cloud database and determining threshold ranges for temperature, speed, and time; receiving search parameters input by a user, calculating the degree of field matching between the user's search parameters and the seedling transport quality rules, and obtaining a rule fitness score; based on the rule fitness score, integrating the user's search parameters with the corresponding seedling transport quality rules to generate a seedling transport query instruction with quality rule constraints; According to the seedling transport query instruction with quality rule constraints, the network round-trip time, load and data synchronization delay between database copies are monitored, the data delay lag is estimated, and the impact of data delay on data freshness requirements is calculated to form a data freshness impact factor; the data retrieval cost is adjusted according to the data freshness impact factor, and the database copy with the lowest cost is selected to execute the query instruction to obtain the seedling transport data record set to be verified; Extracting quality rules from the seedling transport query instruction with quality rule constraints, traversing the seedling transport data record set to be verified, comparing the temperature, speed, and time fields in the data records one by one, quantifying the degree to which the abnormal fields deviate from the corresponding rules, and calculating a deviation metric value; assigning a quality label to each seedling transport record based on a comparison result of the record deviation metric value with a preset threshold value, thereby forming a seedling transport record set with attached quality labels; Apply the filtering conditions in the seedling transportation query instruction with quality rule constraints to filter the seedling transportation record set with quality labels, count the proportion of qualified labels in the filtered records, combine the proportion of qualified labels with the filtering conditions set by the user, and output the seedling transportation information retrieval results.
2. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the rule fitness score is as follows: based on the seedling transport quality rules set in the cloud database, extracting the upper and lower thresholds of the temperature threshold range, the speed threshold range, and the time threshold range to form a seedling transport quality rule threshold set; According to the seedling transport quality rule threshold set, the temperature parameter, speed parameter, and time parameter in the search parameters input by the user are compared item by item to see whether they fall within the corresponding threshold range, and the matching situation of each field falling within the corresponding threshold range is counted to obtain a field matching count set; A rule fitness score is calculated based on the field matching count set.
3. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the seedling transportation query instruction with quality rule constraints is as follows: based on the rule fitness score, setting a threshold standard for the rule fitness score, judging whether the rule fitness score reaches the threshold standard, if the rule fitness score is greater than or equal to the threshold standard, it is considered to be a valid score, if the rule fitness score is less than the threshold standard, it is considered to be an invalid score, and generating a rule fitness score validity judgment result; Based on the validity judgment result of the rule fitness score, the temperature threshold range, speed threshold range, and time threshold range are extracted from the seedling transportation quality rule, the search parameters input by the user are associated and matched with the respective threshold ranges field by field, and a quality rule constraint condition combination with the temperature field, speed field, and time field as the screening conditions is constructed to generate a quality rule constraint condition combination; According to the quality rule constraint combination, the quality rule constraint combination is converted into a query condition statement executable by the database and added into the seedling transportation data information retrieval request command body to form a seedling transportation query instruction with quality rule constraints.
4. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the data freshness influencing factor is as follows: according to the seedling transportation query instruction with quality rule constraints, a test data packet is sent to each database copy respectively, and the total time consumed from sending the data packet to receiving the verification feedback is recorded, and the network round-trip time of all database copies is counted to form a network round-trip time set; Based on the network round-trip time set, the current load index and data synchronization delay time index of each database replica are obtained in real time through the status monitoring interface of the database replica, the load and data synchronization delay are calculated item by item, and a comprehensive database replica delay index is generated; A data freshness impact factor is calculated based on the comprehensive database replica delay index.
5. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the seedling transportation data record set to be verified is as follows: according to the data freshness impact factor, obtaining the basic retrieval cost of each database copy in the current cloud database, and multiplying the basic retrieval cost of each database copy by the data freshness impact factor of the corresponding database copy to calculate the data retrieval cost of each database copy, and generating a database copy data retrieval cost set; Based on the database replica data retrieval cost set, all data retrieval costs in the database replica data retrieval cost set are sorted in ascending order, and the database replica corresponding to the lowest data retrieval cost is selected from the sorted database replica data retrieval cost set to generate the lowest-cost database replica; According to the lowest cost database copy, a seedling transportation query instruction with quality rule constraints is sent to the lowest cost database copy, and the corresponding seedling transportation data is obtained from the lowest cost database copy to form a seedling transportation data record set to be verified.
6. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the deviation metric value is as follows: according to the seedling transportation query instruction with quality rule constraints, parsing and extracting the temperature field rule value, the speed field rule value and the time field rule value from the instruction one by one, and forming a quality rule field reference set; Based on the quality rule field reference set, the seedling transport data record set to be verified is traversed one by one, the temperature field measured value, the speed field measured value and the time field measured value in the seedling transport data record set are extracted one by one, and the values are compared one by one with the corresponding field rule values of the quality rule field reference set, and the abnormal deviation of the field is determined to form a field abnormal deviation set; Calculate a deviation metric value based on the field abnormal deviation set.
7. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the seedling transport record set with the quality label is as follows: according to the deviation measurement value, setting a preset threshold value for abnormality judgment of the deviation measurement value, comparing the record deviation measurement value of each seedling transport data record with the preset threshold value one by one, if the record deviation measurement value is greater than or equal to the preset threshold value, it is determined to be an abnormal record; if the record deviation measurement value is less than the preset threshold value, it is determined to be a normal record, and generating a record abnormality judgment result; Based on the record abnormality determination result, all seedling transportation data records are traversed, and abnormal quality labels are assigned to data records determined to be abnormal records, and qualified quality labels are assigned to data records determined to be normal records, to form a data record quality label set; According to the data record quality label set, the quality labels are added to the corresponding seedling transportation data records respectively, and the quality labels are merged with the corresponding data records one by one to obtain a seedling transportation record set with quality labels.
8. The method for retrieving seedling transportation information from a cloud database according to claim 1, characterized in that: The step of obtaining the seedling transportation information retrieval result is as follows: according to the filtering condition in the seedling transportation query instruction with quality rule constraints, the actual value of the temperature field, the actual value of the speed field, and the actual value of the time field in the seedling transportation record set with the quality tag are compared one by one, and the seedling transportation records whose temperature field, speed field, and time field all fall within the threshold range of the filtering condition are screened to form a seedling transportation record set that meets the filtering condition; Calculate a comprehensive value of the proportion of qualified labels based on the set of seedling transportation records that meet the filtering conditions; A comparison is made between the comprehensive value of the proportion of qualified labels and the filter condition threshold set by the user. If the comprehensive value of the proportion of qualified labels is greater than or equal to the filter condition threshold set by the user, the seedling transportation record set that meets the filter condition is output as a qualified result of the seedling transportation information retrieval. If the comprehensive value of the proportion of qualified labels is less than the filter condition threshold set by the user, an empty record set is output to form a seedling transportation information retrieval result.
Citation Information
Patent Citations
Network freight service compliance comprehensive modeling and monitoring method
CN116187877A
Meat product safety tracing and whole-process monitoring system and method
CN119250839A