A cloud computing-based intelligent agricultural control system and method
Patent Information
- Application Number
- CN202611095479.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-09
AI Technical Summary
[0006]本申请实施例通过提供一种基于云计算的智慧农业控制系统及方法,解决了现有技术中云端决策模型在环境分布偏移发生时缺乏有效性自检能力、偏差推荐长期隐蔽累积且被自我优化机制反向强化放大的连锁性缺陷,实现了通过规则约束实时修正偏差输出、基于替代频率在线感知模型劣化状态并对劣化期历史记录执行训练权重折减的闭环控制
[0075]通过在当前决策周期中,将机器学习决策模型输出的原始推荐值与基于农艺规则约束库生成的可行数值区间进行比对,并在原始推荐值超出区间边界时以替代推荐值替换原始推荐值,使得即便当前生产环境与模型训练背景之间发生分布偏移而导致模型参数有效性下降,决策环节仍能在输出端通过规则约束对偏差建议进行即时修正,避免偏差累积至实际执行层面。
Smart Images

Figure CN122883512A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automation control technology, and in particular to a cloud computing-based smart agriculture control system and method. Background Technology
[0002] In cloud-based smart agriculture control applications, machine learning decision-making models deployed in remote computing centers receive environmental state input vectors transmitted from the field, output recommended values for irrigation or fertilization through forward inference, and then drive execution terminals to complete control via wireless links. The models undergo parameter calibration using historical planting data before being put into use.
[0003] The existing control process faces the following problems in actual operation. Variety changes and continuous cropping lead to alterations in soil properties or regional climate trends, causing a shift in the distribution of environmental data for the current production season compared to the historical training background. However, the cloud-based link lacks an online detection mechanism for this distribution shift, and the model itself cannot perceive that parameter effectiveness has declined. There is a monitoring blind spot between the occurrence of the shift and its detection. Management personnel are unaware that the model has entered a state of effectiveness degradation.
[0004] Decision-making models in a state of deteriorated effectiveness exhibit a systematic bias between their recommended irrigation or fertilization amounts and the optimal operating values actually required by the current production environment. For example, under a long-term warming and humidification context, the model consistently underestimates actual water consumption and outputs recommendations for insufficient irrigation. This bias is masked by the slow-appearing mild water stress in crops. During this period, managers tend to attribute minor crop growth deficiencies to external random factors such as weather or germplasm, rather than pointing to the systemic cause of the decision-making model parameter failure. This allows the problem of model effectiveness deterioration to persist in a hidden manner over a long period.
[0005] During the period when the aforementioned deviation suggestions were not identified and addressed, the field execution terminals performed a large number of suboptimal agricultural operations based on these suggestions. These operation records, along with subsequently collected crop growth response data, were saved by the system as normal historical execution records. Since the historical execution records themselves are suboptimal operation trajectories generated under the drive of deviation parameters, the update process is essentially a secondary reinforcement fitting of the parameters in the deviation direction, causing the updated model parameters to converge further from the true optimal direction compared to the previous version. Summary of the Invention
[0006] This application provides a cloud-based smart agriculture control system and method, which solves the problems in the prior art where cloud-based decision models lack effective self-checking capabilities when environmental distribution shifts occur, and where biased recommendations accumulate in the long term and are amplified by the self-optimization mechanism. It achieves closed-loop control by real-time correction of biased output through rule constraints, online perception of model degradation status based on substitution frequency, and reduction of training weights on historical records of degradation periods.
[0007] This application provides a cloud computing-based smart agriculture control system, including: an environmental state input module: used to input the environmental state input vector of the current decision cycle into a machine learning decision model and output the original recommended value;
[0008] Rule set composition module: used to filter the subset of rules that match the current environmental state in the agronomic rule constraint library to form the currently applicable rule set;
[0009] Alternative Recommendation Value Generation Module: Used to extract the constraint boundary clauses of each rule record in the currently applicable rule set, generate feasible numerical ranges, and generate alternative recommendation values within the feasible numerical ranges;
[0010] Threshold comparison module: used to obtain the rule substitution frequency according to the statistical window period, and compare the rule substitution frequency with the preset upper limit threshold of the rule substitution frequency baseline;
[0011] Signal generation module: used to generate signals indicating the degradation of model parameter validity and update the validity status markers of the machine learning decision model;
[0012] The model update module is used to retrieve all historical execution records, configure the training weight reduction coefficients based on the validity status markers, and perform parameter updates for the machine learning decision model.
[0013] Furthermore, the steps to construct the currently applicable set of rules include:
[0014] Extract the environmental parameter values contained in the environmental state input vector, and read the trigger condition clauses of each rule record;
[0015] Each environmental parameter value is compared with the corresponding parameter's range in the trigger condition clause;
[0016] When all conditions defined in the trigger condition clause of a rule record are true, the rule record is configured to be active.
[0017] If any of the included conditions are not met, the corresponding rule record remains inactive.
[0018] After completing the traversal and verification of the rule records within the subset, extract the rule records that are in the active state and summarize them;
[0019] The summarized activation rules are encapsulated and combined to generate a set of applicable rules for the current decision-making cycle.
[0020] Furthermore, the steps for generating feasible numerical intervals include:
[0021] Extract the first and second valid boundary values for each record in the currently applicable rule set;
[0022] The original recommended value is compared with the first and second legal boundary values respectively.
[0023] Record an out-of-bounds record when the value exceeds the first legal boundary value, and record an insufficient record when the value exceeds the first legal boundary value but does not reach the second legal boundary value.
[0024] Collect all outbound and incomplete records and generate a list of constraint violation events;
[0025] Given that a record exists in the list, extract the minimum value of the first boundary value as the first extreme value;
[0026] Extract the maximum value of all second boundary values as the second extreme value;
[0027] The first and second extreme values form a closed feasible numerical interval.
[0028] Furthermore, the steps for generating alternative recommended values within the feasible numerical range include:
[0029] By comparing the magnitudes of the extreme values within the feasible numerical range, it is determined whether the range contains a valid numerical range.
[0030] If the first extreme value is not less than the second extreme value, the determination interval includes a range of valid values.
[0031] When the original recommended value is greater than the first extreme value, the value of the first extreme value is extracted and configured as the alternative recommended value;
[0032] When the original recommended value is less than the second extreme value, the value of the second extreme value is extracted and configured as the alternative recommended value;
[0033] When the first extreme value is less than the second extreme value, the boundary contradiction leads to a lack of effective range;
[0034] Suspend the process execution, generate conflict records and write them to the log, and output conflict messages;
[0035] Maintain the suspended state until a confirmation command is received, and output the alternative recommended value after status annotation.
[0036] Furthermore, the steps for obtaining the rule replacement frequency according to the statistical window period include:
[0037] Load the statistical window time parameters, retrieve and extract the corrective decision records that fall within the current statistical window;
[0038] Perform cumulative processing on the revised decision records to obtain the constraint substitution count value for the current period;
[0039] Simultaneously extract all decision logs falling within the same time range;
[0040] Perform a counting operation on all decision logs to obtain the total decision count value;
[0041] Based on the constraint substitution count and the total decision count, the rule substitution frequency is obtained;
[0042] The rules replace the frequency and timestamps, which are then encapsulated and written into the historical record medium.
[0043] Furthermore, the step of comparing the rule substitution frequency with a preset upper bound threshold for the rule substitution frequency baseline includes:
[0044] Within the specified statistical window period of the initial operation, extract the set of rule substitution frequency values generated continuously in each window;
[0045] Calculations are performed on the set of frequency values for rule substitution to obtain the statistical average and statistical standard deviation values.
[0046] Extract the average value and multiply it by the standard deviation value with a preset coefficient, then perform the addition operation.
[0047] The result of the addition operation is formally confirmed as the upper bound threshold of the corresponding rule replacement frequency baseline;
[0048] Establish a mapping relationship between the upper bound threshold of the baseline and the data identifier, and persistently write it to the parameter storage medium;
[0049] Obtain the latest rule replacement frequency value and initiate a read request for the corresponding threshold from the storage medium;
[0050] The corresponding baseline upper threshold is retrieved to perform a numerical comparison operation, and then the corresponding comparison result is output.
[0051] Further steps for updating the validity state labels of the machine learning decision model include:
[0052] When the current rule replacement frequency is greater than the baseline upper bound threshold, candidate degradation signal markers are generated;
[0053] Write the candidate degradation signal markers into the cumulative counter and update the count value by incrementing it.
[0054] Read the current count value to determine whether the preset confirmation threshold has been reached;
[0055] When the count value reaches the set confirmation threshold, a formal validity degradation signal is generated.
[0056] Extract the current validity status marker of the corresponding decision model based on the degradation signal;
[0057] The validity status flag is changed from normal encoding overwrite to parameter validity degradation status encoding;
[0058] When the count value does not reach the threshold limit and the rule replacement frequency value drops, the counter is reset to zero.
[0059] Furthermore, the steps for configuring training weight reduction coefficients based on validity state labels include:
[0060] Extract the stored historical execution record data and read the running status markers attached to each record;
[0061] When an execution record has a degraded isolation marker, the running frequency parameter at the time the record was generated is parsed and extracted;
[0062] Extract the current rule substitution frequency value and perform ratio quantization calculation with the corresponding baseline upper bound threshold;
[0063] The value output by ratio quantization is subtracted from the reference value to generate a specific dynamic decay parameter;
[0064] The dynamic decay parameter is compared with the lower limit zero value by taking the larger value, and is officially confirmed as the weight reduction factor.
[0065] When the execution record does not have a degradation marker, standard training weights with no decay constant level are directly configured;
[0066] All execution records that have completed the configuration of the reduction factor values are summarized and sent to the underlying model update process.
[0067] This application provides a cloud computing-based smart agriculture control method, applied to a cloud computing-based smart agriculture control system, comprising the following steps:
[0068] Input the environmental state input vector of the current decision-making cycle into the machine learning decision-making model, and output the original recommendation value;
[0069] Select a subset of rules from the agronomic rule constraint library that matches the current environmental state to form the current applicable rule set;
[0070] Extract the constraint boundary clauses of each rule record in the currently applicable rule set, generate feasible numerical ranges, and generate alternative recommended values within the feasible numerical ranges;
[0071] The rule substitution frequency is obtained according to the statistical window period, and the rule substitution frequency is compared with the preset upper limit threshold of the rule substitution frequency baseline.
[0072] Generate a signal indicating the degradation of model parameter validity and update the validity status label of the machine learning decision model;
[0073] Retrieve all historical execution records, configure training weight reduction coefficients based on validity status markers, and update machine learning decision model parameters.
[0074] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0075] By comparing the original recommended value output by the machine learning decision model with the feasible value range generated based on the agronomic rule constraint library during the current decision cycle, and replacing the original recommended value with an alternative recommended value when the original recommended value exceeds the range boundary, the decision-making process can still correct the deviation suggestions in real time at the output end through rule constraints, even if the distribution shift between the current production environment and the model training background leads to a decrease in the effectiveness of the model parameters, thus avoiding the accumulation of deviations to the actual execution level.
[0076] Furthermore, in the process of correcting the deviation suggestions, the rule substitution events within each statistical window are counted and the rule substitution frequency is calculated. The rule substitution frequency is dynamically compared with the preset baseline upper threshold. When the rule substitution frequency continues to exceed the threshold, a signal of deterioration in the effectiveness of model parameters is generated. Thus, without relying on external labeled data or complex distribution comparison calculations, the endogenous and online perception of the health status of the decision model is realized, filling the monitoring blind spot between the occurrence of distribution shift and human detection.
[0077] Furthermore, after sensing the degradation of model effectiveness, the stored historical execution records are distinguished according to their attached running status labels. Training weight reduction coefficients are configured for historical records generated during the period of effectiveness degradation, so that the contribution of these records is reduced when the model parameters are updated later. This breaks the closed loop of biased execution records reinforcing biased parameters and prevents the model's self-optimization mechanism from continuously converging in the wrong direction due to the intake of low-quality samples. Attached Figure Description
[0078] Figure 1 A schematic diagram of the structure of a cloud computing-based smart agriculture control system provided in an embodiment of this application;
[0079] Figure 2 A flowchart illustrating a cloud computing-based smart agriculture control method provided in this application embodiment. Detailed Implementation
[0080] This application provides a cloud-based smart agriculture control system and method, which solves the chain reaction problems in the prior art, such as the lack of effective self-checking capability of cloud decision-making models when environmental distribution shifts, the long-term hidden accumulation of biased recommendations, and automatic iterative reverse reinforcement amplification. By generating feasible intervals to replace out-of-bounds recommendation values with agronomic rule constraints, statistically replacing frequencies and comparing with dynamic baselines to trigger effectiveness degradation signals, and configuring training weight reduction coefficients for historical execution records based on degradation markers, it achieves real-time correction of biased recommendations, online perception of model degradation status, and blocking of negative reinforcement loops.
[0081] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0082] like Figure 1 The diagram shown is a schematic representation of a cloud-based smart agriculture control system provided in this application embodiment, including: an environmental state input module: used to input the environmental state input vector of the current decision cycle into a machine learning decision model and output the original recommended value;
[0083] The original recommended values are preliminary control parameters (such as irrigation duration and fertilizer application rate) obtained from machine learning decision models. Their main function is to serve as "intermediate calculation results" that have not been verified by agronomic rules, and to be used for subsequent legality comparison with the constraint boundaries in the agronomic knowledge base.
[0084] If the original recommended value falls within the valid range of all activation rules, it will be directly adopted as the final execution instruction (i.e., the replacement recommended value is equal to the original recommended value).
[0085] If the original recommended value violates one or more agronomic rules (e.g., exceeds the maximum irrigation duration), a corrected alternative recommended value will be generated based on the rule boundaries. The original recommended value and the alternative recommended value will be recorded together for subsequent model degradation analysis.
[0086] Rule set composition module: used to filter the corresponding rule subset in the persistently stored agronomic rule constraint library, match the environmental state input vector with the trigger condition clauses of the rule subset, and summarize the matching rule records to form the currently applicable rule set;
[0087] Alternative Recommendation Value Generation Module: This module extracts the constraint boundary clauses of each rule record in the currently applicable rule set, compares the original recommendation value with the boundary defined by the constraint boundary clause, generates a feasible value range based on the comparison result, generates an alternative recommendation value within the feasible value range to correct the original recommendation value, and writes the execution record containing the alternative recommendation value into the storage medium.
[0088] Threshold comparison module: used to extract the execution frequency statistics of the execution record storage medium according to the statistical window period, obtain the rule replacement frequency, and compare the rule replacement frequency with the preset upper limit threshold of the rule replacement frequency baseline;
[0089] Signal generation module: used to generate a signal indicating the degradation of model parameter validity when the comparison condition continuously exceeds the upper bound threshold, and update the validity status label of the machine learning decision model;
[0090] The model update module is used to retrieve all historical execution records when the machine learning decision model parameter update is triggered, configure the training weight reduction coefficient according to the validity status mark, and use the historical execution records with the weight reduction coefficient configured to perform the machine learning decision model parameter update.
[0091] In this embodiment, at the architecture level, the method relies on an Internet of Things (IoT) architecture that includes a field sensing network, a cloud computing server, and field execution equipment.
[0092] When each decision cycle (e.g., triggered every 2 hours) begins, the data access layer of the cloud computing server receives environmental data (such as soil moisture content and meteorological elements) reported by the field sensing network via the MQTT or HTTP protocol. After cleaning and normalization, this data is combined with crop growth stage identifiers and field geographic identifiers read from the database to form the environmental state input vector for the current decision cycle.
[0093] Subsequently, the vector is input into a machine learning decision model (which can use a support vector regression (SVR), random forest, or lightweight multilayer perceptron (MLP) model) deployed on a cloud computing server for forward propagation inference, and outputs one or more original recommended values for the current environment (such as irrigation duration and fertilizer application amount).
[0094] To avoid the model outputting harmful decisions under unknown environmental distribution deviations, this scheme introduces mandatory agronomic rule constraint verification. Based on an agronomic rule constraint library persistently stored in a relational database (such as MySQL), the current environmental state input vector is matched with the rule triggering conditions to generate a set of applicable rules. Then, the boundaries of the rules are extracted to verify the legality of the original recommended values. A feasible numerical range is generated through extreme value convergence logic, and alternative recommended values are generated within this range. After the alternative recommended values are generated, not only are execution control instructions issued, but execution records containing the original recommended values, alternative recommended values, and triggering rule information are also persistently written to a time-series database.
[0095] Furthermore, an asynchronous statistical process is set up in the background to extract records from the time-series database according to a set statistical window period (e.g., 7 days or 14 days) to obtain the frequency of rule substitution operations. When this frequency continuously exceeds a preset dynamic baseline, it is determined that the parameter distribution inside the model has deviated from the current actual physical environment distribution, generating a model parameter effectiveness degradation signal, and marking the model as degraded in the state registry. When model retraining is triggered in this state, historical execution records are extracted, and based on the degree of deviation of the rule substitution frequency during the degradation period, the training weight reduction coefficient for each data record is dynamically calculated. The machine learning model parameters are then updated using a sample set with reduced weights.
[0096] Furthermore, the steps to construct the currently applicable set of rules include:
[0097] Extract the environmental parameter values contained in the environmental state input vector, and read the trigger condition clauses of each rule record;
[0098] Each environmental parameter value is compared with the corresponding parameter's range in the trigger condition clause;
[0099] When all conditions defined in the trigger condition clause of a rule record are true, the rule record is configured to be active.
[0100] If any of the included conditions are not met, the corresponding rule record remains inactive.
[0101] After completing the traversal and verification of the rule records within the subset, extract the rule records that are in the active state and summarize them;
[0102] The summarized activation rules are encapsulated and combined to generate a set of applicable rules for the current decision-making cycle.
[0103] In this embodiment, the core of rule subset matching lies in the precise filtering of multi-dimensional environmental parameters. Rule records are stored in the database in JSON format or wide table form, and their "trigger clauses" contain parameter constraints across multiple dimensions (such as temperature). ,humidity (e.g., reproductive period coding).
[0104] The logic for matching the environment state input vector with the trigger condition clauses of the rule subset is as follows: The server extracts the specific values of each item in the environment state input vector and traverses the located rule subset in memory. For each rule record, a logic and gating mechanism is used to compare and verify each item.
[0105] The rule's Boolean state is only set to "activated" when all environmental parameter values in the input vector fall within the numerical range or set defined by the rule's triggering condition clause. If any parameter in any dimension fails to meet the condition, the matching logic immediately circuit breaks and returns to an inactive state, thus saving computational overhead. After traversal, the record number (ID) and constraint boundary fields corresponding to all rules with a Boolean state of "activated" are deeply copied into memory and encapsulated into a structure array, thus generating the set of currently applicable rules for the current decision cycle.
[0106] Considering the possibility of occasional disconnections or packet loss by sensors, if a parameter is missing from the environmental state input vector, a smooth interpolation logic (such as taking the historical average of the same time period in the previous 24 hours) can be introduced to temporarily fill the missing parameter before performing conditional matching; alternatively, a tolerance threshold can be set in the rule base to allow skipping the verification of that dimension when non-core parameters (such as wind speed) are missing, thereby enhancing robustness in harsh agricultural environments.
[0107] Furthermore, the steps for generating feasible numerical intervals include:
[0108] Extract the first and second valid boundary values for each record in the currently applicable rule set;
[0109] The original recommended value is compared with the first and second legal boundary values respectively.
[0110] Record an out-of-bounds record when the value exceeds the first legal boundary value, and record an insufficient record when the value exceeds the first legal boundary value but does not reach the second legal boundary value.
[0111] Collect all outbound and incomplete records and generate a list of constraint violation events;
[0112] Given that a record exists in the list, extract the minimum value of the first boundary value as the first extreme value;
[0113] Extract the maximum value of all second boundary values as the second extreme value;
[0114] The first and second extreme values form a closed feasible numerical interval.
[0115] In this embodiment, for multiple activation rules in the applicable rule set, it is necessary to solve the boundary fusion problem under multiple constraints. The constraint boundary clauses of each record in the applicable rule set are parsed sequentially to extract the first legal boundary value (legal upper bound) and the second legal boundary value (legal lower bound). An out-of-bounds record list and an insufficient record list are initialized in memory. The original recommendation value output by the machine learning decision model is compared with the extracted upper and lower bounds using floating-point values.
[0116] If the original recommended value is greater than the first legal boundary value of a rule, the rule ID and the difference are written to the out-of-bounds record list; if it is less than the second legal boundary value, it is written to the insufficient record list. The sum of the two is the constraint violation event list.
[0117] When the list of violations is not empty, it indicates that alternative intervention is needed. To find the common valid intersection of all activation rules, extreme value calculations are performed in memory: all relevant first valid boundary values are extracted, and the minimum value is calculated using the min function, which is then configured as the first extreme value (feasible upper bound); all relevant second valid boundary values are extracted, and the maximum value is calculated using the max function, which is then configured as the second extreme value (feasible lower bound). These two extreme values logically close to form a feasible numerical interval.
[0118] Furthermore, the steps for generating alternative recommended values within the feasible numerical range include:
[0119] By comparing the magnitudes of the extreme values within the feasible numerical range, it is determined whether the range contains a valid numerical range.
[0120] If the first extreme value is not less than the second extreme value, the determination interval includes a range of valid values.
[0121] When the original recommended value is greater than the first extreme value, the value of the first extreme value is extracted and configured as the alternative recommended value;
[0122] When the original recommended value is less than the second extreme value, the value of the second extreme value is extracted and configured as the alternative recommended value;
[0123] When the first extreme value is less than the second extreme value, the boundary contradiction leads to a lack of effective range;
[0124] Suspend the process execution, generate conflict records and write them to the log, and output conflict messages;
[0125] Maintain the suspended state until a confirmation command is received, and output the alternative recommended value after status annotation.
[0126] In this embodiment, after obtaining the extreme value, its logical rationality is verified. The steps are as follows:
[0127] The logic module compares the first extreme value (upper bound) with the second extreme value (lower bound). If the first extreme value is not less than the second extreme value, it proves that there is a valid numerical intersection between multiple agronomic rules. At this time, the boundary adsorption logic is executed: if the original recommended value is greater than the first extreme value, to prevent resource waste or crop damage caused by excessive operation, the alternative recommended value is directly assigned to the first extreme value.
[0128] If the original recommended value is less than the second extreme value, the alternative recommended value will be assigned to the second extreme value to ensure the minimum crop growth requirements. If the first extreme value is less than the second extreme value, this logically indicates that multiple currently active agronomic rules have created an underlying contradiction (for example, rule A requires more watering to cope with high temperatures, while rule B requires strict water control due to disease warnings). In this case, the current control instruction generation process is suspended to prevent the output of harmful decisions. Simultaneously, a constraint conflict log containing the conflicting rule ID and conflict boundary values is generated, and an alarm message is sent to the administrator via a message queue (such as RabbitMQ) or external communication interface (such as an SMS gateway or WeChat API). This decision cycle remains suspended until authorized confirmation from the administrator via the interface and a manually specified value is obtained.
[0129] To prevent prolonged downtime due to administrators being offline, which could impact agricultural production, a timeout timer (e.g., set to 1 hour) can be attached to the downtime state. If no confirmation is received after the timeout, the system can automatically downgrade and extract the preset "basic maintenance safety value" for that crop's growth stage as a temporary alternative recommended value for output.
[0130] Furthermore, the steps for obtaining the rule replacement frequency according to the statistical window period include:
[0131] Load the statistical window time parameters, retrieve and extract the corrective decision records that fall within the current statistical window;
[0132] Whenever the model's original recommended value does not conform to agronomic rules (e.g., it recommends irrigation for 30 minutes, but the rules allow a maximum of 20 minutes), and the recommended value is automatically modified to a value allowed by the rules and executed, a special log is generated. This log is called the correction decision log.
[0133] Perform cumulative processing on the revised decision records to obtain the constraint substitution count value for the current period;
[0134] Simultaneously extract all decision logs falling within the same time range;
[0135] A complete control flow is executed every decision cycle (e.g., every 2 hours), regardless of whether the model output is ultimately corrected. The detailed log generated for each complete flow is called the "full decision log".
[0136] Perform a counting operation on all decision logs to obtain the total decision count value;
[0137] Based on the constraint substitution count and the total decision count, the constraint substitution count is divided by the total decision count, and the quotient data is confirmed as the rule substitution frequency.
[0138] The rules replace the frequency and timestamps, which are then encapsulated and written into the historical record medium.
[0139] In this embodiment, a scheduled task is configured in the database management to perform tasks according to a set statistical window period (e.g., ...). The statistics process is awakened on the first day. Once awakened, the process constructs an SQL time-range query and scans the time-series database. First, it performs an aggregation operation on records marked with "constraint substitution event" to obtain the current constraint substitution count. Next, the filtering criteria are removed, and the same aggregation operation is performed on all decision execution records falling within the same time window to obtain the total decision count. Subsequently, the floating-point unit (FPU) is invoked in memory to perform the division logic, as shown in the following formula:
[0140] ;
[0141] in, Replace frequency with rules. This represents the actual number of rule-based intervention decisions that occurred within the current window. This represents the total number of decisions generated within the current window. (Calculated...) Together with the current statistics window's cutoff timestamp, it is serialized and written to a dedicated historical data table.
[0142] If equipment downtime for maintenance occurs during a certain window period If the sample size is too small (e.g., less than the set minimum statistical sample size, such as 30 times), to avoid drastic fluctuations in the regular substitution frequency due to the small sample size, the calculation of the regular substitution frequency for this period can be skipped, or the data in this short window can be automatically merged with the previous window for calculation.
[0143] Furthermore, the step of comparing the rule substitution frequency with a preset upper bound threshold for the rule substitution frequency baseline includes:
[0144] Within the specified statistical window period of the initial operation, extract the set of rule substitution frequency values generated continuously in each window;
[0145] Calculations are performed on the set of frequency values for rule substitution to obtain the statistical average and statistical standard deviation values.
[0146] Extract the average value and multiply it by the standard deviation value with a preset coefficient, then perform the addition operation.
[0147] The result of the addition operation is formally confirmed as the upper bound threshold of the corresponding rule replacement frequency baseline;
[0148] Establish a mapping relationship between the upper bound threshold of the baseline and the data identifier, and persistently write it to the parameter storage medium;
[0149] Obtain the latest rule replacement frequency value and initiate a read request for the corresponding threshold from the storage medium;
[0150] The corresponding baseline upper threshold is retrieved to perform a numerical comparison operation, and then the corresponding comparison result is output.
[0151] In this embodiment, during the initial deployment phase (i.e., immediately after model deployment or manual recalibration), it is assumed that the model is in its optimal performance state. Continuous data from the initial run is collected. Statistical windows (such as) The rules replace the frequency values to form a set. First, calculate the statistical mean of the set. :
[0152] ;
[0153] Then, the statistical standard deviation of the set is calculated. This is used to measure the degree of natural fluctuation in the frequency of replacement within this phase:
[0154] ;
[0155] After obtaining the above parameters, perform a combined addition and multiplication operation to generate the upper bound threshold of the rule-based replacement frequency baseline. :
[0156] ;
[0157] In the above formula, The initial number of statistical windows used to establish the baseline is configured by the administrator based on experience or needs, typically 4-6 windows. For the first The frequency of rule substitutions calculated within a statistical window This is a preset sensitivity coefficient, typically with a value of 2 or 3. Statistically, this value corresponds to the upper limit of the confidence interval for a normal distribution.
[0158] Completed calculation Establish key-value pair mappings with the corresponding decision types (such as "irrigation decision" and "fertilization decision") and write them to the system's Redis cache or persistent configuration file. Then, update the rule replacement frequency each time. After calculation, the corresponding key is retrieved directly from the medium. Compare them.
[0159] In addition, sensitivity coefficient The value can be configured differently based on the economic value and tolerance of the crop. For example, for expensive cash crops that are extremely sensitive to water, the value can be... Set to a smaller value (e.g., 1.5) to increase sensitivity to model deviations; for field stress-resistant crops, set to a larger value (e.g., 3.0) to reduce false alarms.
[0160] Further steps for updating the validity state labels of the machine learning decision model include:
[0161] When the current rule replacement frequency is greater than the baseline upper bound threshold, candidate degradation signal markers are generated;
[0162] Write the candidate degradation signal markers into the cumulative counter and update the count value by incrementing it.
[0163] Read the current count value to determine whether the preset confirmation threshold has been reached;
[0164] When the count value reaches the set confirmation threshold, a formal validity degradation signal is generated.
[0165] Extract the current validity status marker of the corresponding decision model based on the degradation signal;
[0166] The validity status flag is changed from normal encoding overwrite to parameter validity degradation status encoding;
[0167] When the count value does not reach the threshold limit and the rule replacement frequency value drops, the counter is reset to zero.
[0168] In this embodiment, to prevent frequent interference with the model output due to drastic environmental changes caused by short-term extreme weather, thus generating false "degradation alarms," a debouncing logic based on a cumulative counter is provided. In the background daemon process, when the rule replacement frequency of the current window is detected... At that time, a Boolean candidate degradation signal is generated, and the independent cumulative counter variable in memory is incremented by 1.
[0169] Then, the current value of the counter is read and compared with the confirmation threshold limit set in the pre-configured file. (e.g., 3 consecutive statistical windows, i.e.) A comparison and judgment are made. Only when the independent cumulative counter variable in memory is not less than the confirmation threshold limit... Only when this deviation is determined to be a long-term, trending distribution shift, is a validity degradation signal formally triggered. At this point, the state machine management interface is called to overwrite the registration status field of the model in the database from the normal status code (e.g., 0x00) to the parameter validity degradation status code (e.g., 0xFF).
[0170] Conversely, if the counter has not yet reached... At that time, the frequency of regular substitution during a certain window period (If the model output reverts to the normal boundary), an interrupt is triggered, and the independent cumulative counter variable in memory is immediately forced to be cleared and reset, thereby eliminating the impact of short-term occasional interference.
[0171] Confirm threshold limits A dynamic sliding window approach can be used for judgment, for example, configured to "trigger a formal degradation signal if the rule substitution frequency exceeds the baseline four times in the last five statistical windows," rather than triggering continuously. This fault-tolerant mechanism can further improve the robustness of judgment in complex agricultural production environments.
[0172] Furthermore, the steps for configuring training weight reduction coefficients based on validity state labels include:
[0173] Extract the stored historical execution record data and read the running status markers attached to each record;
[0174] When an execution record has a degraded isolation marker, the runtime rule replacement frequency parameter at the time the record was generated is parsed and extracted;
[0175] Extract the current rule substitution frequency value and perform ratio quantization calculation with the corresponding baseline upper bound threshold;
[0176] The value output by ratio quantization is subtracted from the reference value to generate a specific dynamic decay parameter;
[0177] The dynamic decay parameter is compared with the lower limit zero value by taking the larger value, and is officially confirmed as the weight reduction factor.
[0178] When the execution record does not have a degradation marker, standard training weights with no decay constant level are directly configured;
[0179] All execution records that have completed the configuration of the reduction factor values are summarized and sent to the underlying model update process.
[0180] In this embodiment, the closed-loop execution data generated after the model is marked as degraded contains a high degree of bias. If it is directly fed into the model as positive samples for retraining, it will lead to the error being reinforced in reverse (negative reinforcement loop). Therefore, a fine-grained sample cleaning and weight reduction step is introduced before retraining.
[0181] When extracting historical execution records to construct the training set, the state markers carried by each data entry are parsed. For data samples carrying degradation isolation markers... Extract this data to generate the current period's rule substitution frequency. .
[0182] A specific penalty function is called to calculate the dynamic decay parameters, which are then converted into the corresponding weight reduction coefficients. The calculation formula is:
[0183] ;
[0184] in, The training weight reduction factor ultimately applied to this sample has its value truncated to the range [0,1]. This indicates the relative deviation of the current rule substitution frequency from the baseline threshold. Adjust the scalar parameter for the preset decay rate (e.g., take...) ).
[0185] When the deviation is small, the sample retains some weights for training; when the deviation is too large (causing the calculated result to be less than 0), the function forces the reduction coefficient to 0, that is, physically removing the highly contaminated dirty data from the training set. For normal records without degradation labels, standard training weights at constant levels are directly configured. .
[0186] like Figure 2 The diagram shown is a flowchart of a cloud computing-based smart agriculture control method provided in an embodiment of this application. The method includes the following steps: inputting the environmental state input vector of the current decision cycle into a machine learning decision model and outputting the original recommended value;
[0187] Select a subset of rules from the agronomic rule constraint library that matches the current environmental state to form the current applicable rule set;
[0188] Extract the constraint boundary clauses of each rule record in the currently applicable rule set, generate feasible numerical ranges, and generate alternative recommended values within the feasible numerical ranges;
[0189] The rule substitution frequency is obtained according to the statistical window period, and the rule substitution frequency is compared with the preset upper limit threshold of the rule substitution frequency baseline.
[0190] Generate a signal indicating the degradation of model parameter validity and update the validity status label of the machine learning decision model;
[0191] Retrieve all historical execution records, configure training weight reduction coefficients based on validity status markers, and update machine learning decision model parameters.
[0192] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0193] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0194] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0195] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0196] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0197] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A cloud computing-based smart agriculture control system, characterized in that, include: Environment State Input Module: Used to input the environment state input vector of the current decision cycle into the machine learning decision model and output the original recommendation value; Rule set composition module: used to filter the subset of rules that match the current environmental state in the agronomic rule constraint library to form the currently applicable rule set; Alternative Recommendation Value Generation Module: Used to extract the constraint boundary clauses of each rule record in the currently applicable rule set, generate feasible numerical ranges, and generate alternative recommendation values within the feasible numerical ranges; Threshold comparison module: used to obtain the rule substitution frequency according to the statistical window period, and compare the rule substitution frequency with the preset upper limit threshold of the rule substitution frequency baseline; Signal generation module: used to generate signals indicating the degradation of model parameter validity and update the validity status markers of the machine learning decision model; The model update module is used to retrieve all historical execution records, configure the training weight reduction coefficients based on the validity status markers, and perform parameter updates for the machine learning decision model.
2. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps to construct the currently applicable set of rules include: Extract the environmental parameter values contained in the environmental state input vector, and read the trigger condition clauses of each rule record; Each environmental parameter value is compared with the corresponding parameter's range in the trigger condition clause; When all conditions defined in the trigger condition clause of a rule record are true, the rule record is configured to be active. If any of the included conditions are not met, the corresponding rule record remains inactive. After completing the traversal and verification of the rule records within the subset, extract the rule records that are in the active state and summarize them; The summarized activation rules are encapsulated and combined to generate a set of applicable rules for the current decision-making cycle.
3. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps to generate a feasible numerical range include: Extract the first and second valid boundary values for each record in the currently applicable rule set; The original recommended value is compared with the first and second legal boundary values respectively. Record an out-of-bounds record when the value exceeds the first legal boundary value, and record an insufficient record when the value exceeds the first legal boundary value but does not reach the second legal boundary value. Collect all outbound and incomplete records and generate a list of constraint violation events; Given that a record exists in the list, extract the minimum value of the first boundary value as the first extreme value; Extract the maximum value of all second boundary values as the second extreme value; The first and second extreme values form a closed feasible numerical interval.
4. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps for generating alternative recommended values within the feasible numerical range include: By comparing the magnitudes of the extreme values within the feasible numerical range, it is determined whether the range contains a valid numerical range. If the first extreme value is not less than the second extreme value, the determination interval includes a range of valid values. When the original recommended value is greater than the first extreme value, the value of the first extreme value is extracted and configured as the alternative recommended value; When the original recommended value is less than the second extreme value, the value of the second extreme value is extracted and configured as the alternative recommended value; When the first extreme value is less than the second extreme value, the boundary contradiction leads to a lack of effective range; Suspend the process execution, generate conflict records and write them to the log, and output conflict messages; Maintain the suspended state until a confirmation command is received, and output the alternative recommended value after status annotation.
5. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps for obtaining rule replacement frequencies based on statistical window periods include: Load the statistical window time parameters, retrieve and extract the corrective decision records that fall within the current statistical window; Perform cumulative processing on the revised decision records to obtain the constraint substitution count value for the current period; Simultaneously extract all decision logs falling within the same time range; Perform a counting operation on all decision logs to obtain the total decision count value; Based on the constraint substitution count and the total decision count, the rule substitution frequency is obtained; The rules replace the frequency and timestamps, which are then encapsulated and written into the historical record medium.
6. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps for comparing the rule substitution frequency with a preset upper bound threshold for the rule substitution frequency baseline include: Within the specified statistical window period of the initial operation, extract the set of rule substitution frequency values generated continuously in each window; Calculations are performed on the set of frequency values for rule substitution to obtain the statistical average and statistical standard deviation values. Extract the average value and multiply it by the standard deviation value with a preset coefficient, then perform the addition operation. The result of the addition operation is formally confirmed as the upper bound threshold of the corresponding rule replacement frequency baseline; Establish a mapping relationship between the upper bound threshold of the baseline and the data identifier, and persistently write it to the parameter storage medium; Obtain the latest rule replacement frequency value and initiate a read request for the corresponding threshold from the storage medium; The corresponding baseline upper threshold is retrieved to perform a numerical comparison operation, and then the corresponding comparison result is output.
7. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps for updating the validity state labels of a machine learning decision model include: When the current rule replacement frequency is greater than the baseline upper bound threshold, candidate degradation signal markers are generated; Write the candidate degradation signal markers into the cumulative counter and update the count value by incrementing it. Read the current count value to determine whether the preset confirmation threshold has been reached; When the count value reaches the set confirmation threshold, a formal validity degradation signal is generated. Extract the current validity status marker of the corresponding decision model based on the degradation signal; The validity status flag is changed from normal encoding overwrite to parameter validity degradation status encoding; When the count value does not reach the threshold limit and the rule replacement frequency value drops, the counter is reset to zero.
8. The cloud computing-based smart agriculture control system as described in claim 1, characterized in that, The steps for configuring training weight reduction coefficients based on validity state labels include: Extract the stored historical execution record data and read the running status markers attached to each record; When an execution record has a degraded isolation marker, the running frequency parameter at the time the record was generated is parsed and extracted; Extract the current rule substitution frequency value and perform ratio quantization calculation with the corresponding baseline upper bound threshold; The value output by ratio quantization is subtracted from the reference value to generate a specific dynamic decay parameter; The dynamic decay parameter is compared with the lower limit zero value by taking the larger value, and is officially confirmed as the weight reduction factor. When the execution record does not have a degradation marker, standard training weights with no decay constant level are directly configured; All execution records that have completed the configuration of the reduction factor values are summarized and sent to the underlying model update process.
9. A cloud computing-based smart agriculture control method, applied to the cloud computing-based smart agriculture control system described in any one of claims 1-8, characterized in that, Includes the following steps: Input the environmental state input vector of the current decision-making cycle into the machine learning decision-making model, and output the original recommendation value; Select a subset of rules from the agronomic rule constraint library that matches the current environmental state to form the current applicable rule set; Extract the constraint boundary clauses of each rule record in the currently applicable rule set, generate feasible numerical ranges, and generate alternative recommended values within the feasible numerical ranges; The rule substitution frequency is obtained according to the statistical window period, and the rule substitution frequency is compared with the preset upper limit threshold of the rule substitution frequency baseline. Generate a signal indicating the degradation of model parameter validity and update the validity status label of the machine learning decision model; Retrieve all historical execution records, configure training weight reduction coefficients based on validity status markers, and update machine learning decision model parameters.