Smart city equipment closed-loop control method and system based on machine learning
By using machine learning technology to build multi-tenant demand mapping and dynamic spatiotemporal zoning control in shared building spaces in smart cities, the problems of multi-tenant demand conflicts and insufficient system adaptability are resolved, user satisfaction and energy efficiency are improved, and the system's self-repair and high reliability are achieved.
Patent Information
- Application Number
- CN202510810285.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-16
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN120652806A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart city device control, and more specifically, to a closed-loop control method and system for smart city devices based on machine learning. Background Art
[0002] With the rapid development of smart city construction, intelligent environmental control systems in shared building spaces (such as office buildings, commercial centers, cultural venues, etc.) face technical challenges such as conflicting multi-tenant demand, insufficient system adaptability, and low energy efficiency. Traditional building management systems usually adopt preset fixed control strategies or simple majority rule decisions, which make it difficult to effectively balance the needs of multiple parties, resulting in poor user experience for some users. When some components of the system fail or face unforeseen scenarios, traditional systems lack adaptive capabilities and require frequent manual intervention and reprogramming, resulting in high maintenance costs and slow response. In addition, implicit needs such as users' actual comfort preferences and usage habits are difficult to be automatically captured and understood by the system, resulting in control decisions that are inconsistent with user expectations, wasting energy and reducing user satisfaction.
[0003] Existing technologies attempt to improve some control aspects through single machine learning algorithms, such as adjusting temperature settings through simple user preference learning or optimizing energy use through predictive control. However, these approaches lack holistic systems thinking and fail to build a complete closed-loop control system. They also struggle to simultaneously address core technical issues such as understanding multi-tenant needs, making multi-objective balancing decisions, dynamic control adaptation, and system self-repair. Especially in the complex scenarios of multi-tenant shared spaces in smart cities, how to use machine learning to achieve understanding of people, precise control of the environment, and self-repair of the system itself, thereby building a truly collaborative human-machine-environment system, is a pressing technical challenge. Summary of the Invention
[0004] The present invention provides a closed-loop control method and system for smart city equipment based on machine learning, which solves the technical problems of multi-tenant demand conflicts, insufficient system adaptability and low energy utilization efficiency in related technologies.
[0005] The present invention provides a closed-loop control method for smart city equipment based on machine learning, comprising:
[0006] Use natural language processing and behavioral pattern analysis technologies to obtain users' advanced instructions and implicit preferences, and establish multi-tenant demand mapping;
[0007] Use Bayesian preference learning algorithms to analyze tenant demand data and generate multi-dimensional tenant portraits;
[0008] Based on the multi-dimensional tenant portrait, an improved non-dominated sorting genetic algorithm is used to find the optimal balance between tenant satisfaction and energy efficiency and generate a control decision plan.
[0009] Based on the decision-making plan, dynamic time and space partition control strategy is implemented according to tenant distribution and activity patterns;
[0010] Monitor the execution of spatiotemporal partitioning control and automatically synthesize alternative control programs to achieve system self-repair when system components fail or encounter unforeseen scenarios.
[0011] Furthermore, the step of establishing a multi-tenant demand mapping includes:
[0012] Collect user environment control instructions and behavior data to form the original interaction data set;
[0013] Input user text and voice commands into a BERT-based natural language processing model and output a user intent representation vector.
[0014] Apply time series pattern mining algorithms to analyze user historical behavior data and identify user usage habits and implicit preferences;
[0015] Based on the semi-supervised intent classification model, the user intention vector and behavior feature vector are taken as input and the standardized demand category is output;
[0016] Build standardized requirements mapping tables for each tenant or user group.
[0017] Furthermore, the use of the Bayesian preference learning algorithm to analyze tenant demand data and generate a multi-dimensional tenant profile includes:
[0018] The demand mapping table is associated and integrated with environmental monitoring data and user satisfaction feedback data to construct an environmental preference dataset;
[0019] Based on the integrated dataset, a multi-attribute preference learning model is trained to capture the environmental preference patterns of different user groups;
[0020] Applying hierarchical clustering algorithm to group users with similar preference patterns to form tenant groups;
[0021] Based on the principles of game theory, a utility game model among tenant groups is constructed to calculate the priority and mutual influence of each tenant's needs;
[0022] Based on the above analysis results, a multi-dimensional portrait is generated for each tenant group.
[0023] Furthermore, the step of generating a control decision plan includes:
[0024] The equipment control problem is formalized as a multi-objective optimization problem with two objective functions: maximizing tenant satisfaction and minimizing energy consumption.
[0025] According to the characteristics of smart city environmental control, an improved non-dominated sorting genetic algorithm with knowledge guidance mechanism is constructed to solve multi-objective optimization problems;
[0026] Accelerate algorithm convergence based on historical experience utilization, prediction model assistance and adaptive mutation strategy;
[0027] From the final Pareto optimal solution set, the most appropriate control decision scheme is selected based on the current system state and manager preferences.
[0028] Furthermore, the steps of dynamic time-space partition control include:
[0029] Construct a zoning control model that integrates time and space dimensions to describe the distribution of environmental parameters in the building space and their temporal evolution process;
[0030] An adaptive partitioning algorithm based on spectral clustering divides the building space into multiple control partitions;
[0031] The level set method is used to smooth the partition boundary and reduce the complexity of the boundary;
[0032] Design an independent model predictive controller for each partition and implement a collaborative control strategy between partitions;
[0033] Optimize global energy efficiency and design emergency response mechanisms.
[0034] Furthermore, the steps of implementing system self-repair include:
[0035] Build a real-time monitoring model based on multi-feature fusion to identify system abnormalities and component failures;
[0036] Apply symbolic execution and formal verification techniques to analyze the functional boundaries and execution path constraints of existing control programs;
[0037] Extract high-level intent specifications for the system from system design documents and historical data;
[0038] Based on the extracted specifications and the current system status, a backward inductive programming approach is used to automatically synthesize alternative control programs that meet the requirements;
[0039] The synthesized alternatives are fully validated and safely deployed into production environments.
[0040] Furthermore, the inter-partition collaborative control strategy includes:
[0041] Introducing the concept of soft boundaries, which treats partition boundaries as gradient areas rather than hard boundaries;
[0042] Limit the gradient of environmental parameters in the space to avoid discomfort caused by drastic changes;
[0043] A cooperative term is introduced at the partition boundary to optimize the joint objective function of the controllers of adjacent partitions.
[0044] Furthermore, the real-time monitoring model is based on a hybrid anomaly detection model of local anomaly factors and isolation forests, which fuses the results of multiple anomaly detection models through a weighted voting method, and adaptively determines the anomaly detection threshold based on system historical data and operating scenarios.
[0045] Furthermore, the synthesis of the alternative control program specifically includes:
[0046] Formalize the program synthesis problem as a satisfiability problem;
[0047] Break down high-level specifications into sub-specifications;
[0048] Build program skeleton based on domain knowledge and design patterns;
[0049] Determine the specific implementation of the program through conditional constraint solving and counterexample guided search;
[0050] Accelerate program synthesis using a library of predefined control components;
[0051] The initial procedure of the synthesis was optimized and simplified.
[0052] The present invention provides a closed-loop control system for smart city devices based on machine learning, which is used to implement the above-mentioned closed-loop control method for smart city devices based on machine learning, including:
[0053] Multi-tenant demand analysis module, which uses natural language processing and behavior pattern analysis technology to obtain user high-level instructions and implicit preferences and establish multi-tenant demand mapping;
[0054] The preference learning and tenant profiling module uses the Bayesian preference learning algorithm to analyze tenant environmental demand data and generate multi-dimensional tenant profiles.
[0055] A multi-objective balance decision module is used to find the optimal balance between tenant satisfaction and energy efficiency using an improved non-dominated sorting genetic algorithm and generate a control decision plan;
[0056] Dynamic time and space partition control module, used to implement dynamic time and space partition control strategy based on tenant distribution and activity patterns;
[0057] The self-repair program generation module is used to automatically synthesize alternative control programs to achieve system self-repair when system components fail or encounter unforeseen scenarios.
[0058] The beneficial effects of the present invention are: achieving an improvement in multi-tenant satisfaction and improving the average user satisfaction; enhancing the system's adaptability, increasing the proportion of abnormal scenario processing without manual intervention, and reducing the recovery time after system failure; optimizing energy utilization efficiency, reducing overall energy consumption while ensuring user comfort; providing more accurate personalized services, and being able to identify and respond to most hidden user needs; improving system reliability, improving the overall reliability of the system, and reducing the operational failure rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a flow chart of a closed-loop control method for smart city equipment based on machine learning of the present invention. DETAILED DESCRIPTION
[0060] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. Furthermore, features described in some examples may be combined in other examples.
[0061] At least one embodiment of the present invention discloses a closed-loop control method for smart city equipment based on machine learning, such as Figure 1 As shown, the following steps are included:
[0062] Step 1: Use natural language processing and behavior pattern analysis technologies to obtain user high-level instructions and implicit preferences and establish a multi-tenant demand mapping;
[0063] This step independently executes a multimodal data processing algorithm to analyze user interaction data, specifically including:
[0064] Step 1.1, user instruction and behavior data collection;
[0065] Collect user environment control instructions and behavior data to form a raw interaction dataset. The collected data includes: user ID, location information, timestamp, interaction type, environment parameter setting values, etc.
[0066] Step 1.2, natural language processing model application;
[0067] User text and voice commands are fed into a BERT-based natural language processing model, which outputs a user intent representation vector. This model is optimized for the environmental control domain and extracts standardized intent representations from user commands. The processing is represented as follows:
[0068] I u =NLPbert (T u );
[0069] Among them I u is the user intention vector, T u For user text or voice input, NLP bert It is a natural language processing model based on BERT.
[0070] Step 1.3, behavioral pattern analysis;
[0071] Apply time series pattern mining algorithms to analyze historical user behavior data and identify usage habits and implicit preferences. By searching for frequent patterns and periodic features in interaction sequences, a user behavior feature vector is constructed. The calculation process is as follows:
[0072]
[0073] Among them B u is the user behavior feature vector; ∑ represents the summation symbol, H u is the user's historical interaction data, f i is the i-th feature extraction function, is the weight of the corresponding feature, n 特征 is the total number of features.
[0074] Step 1.4, semi-supervised intent classification model construction;
[0075] Build a semi-supervised intent classification model that takes user intent vectors and behavior feature vectors as input and outputs standardized demand categories. Use pseudo-label iterative training to optimize model performance:
[0076] Model structure: A three-layer fully connected neural network with 128 nodes in the hidden layer (ReLU activation) and Softmax activation in the output layer. Training process: Initial training: Using a small amount of labeled data to train the basic model; Pseudo-label generation: Predicting unlabeled data, selecting samples with a confidence level greater than 0.85 as pseudo-labels; Iterative optimization: Retraining on a combination of labeled and pseudo-labeled data until performance converges or the maximum number of iterations is reached.
[0077] The classification process is expressed as:
[0078] C u =Classifier(I u ,B u );
[0079] Among them C u is the user demand category, and Classifier is a semi-supervised intent classification model.
[0080] Step 1.5, tenant demand mapping generation;
[0081] Based on the intent classification results, a standardized demand mapping table is constructed for each tenant, including key attributes such as demand type, priority, and spatiotemporal characteristics. The demand mapping table provides a unified format for subsequent processing and decision-making algorithm use.
[0082] Step 2: Use the Bayesian preference learning algorithm to analyze tenant demand data and generate a multi-dimensional tenant profile;
[0083] This step uses the Bayesian preference learning algorithm and other data analysis techniques to generate a multi-dimensional tenant profile based on environmental monitoring data and user feedback, and associates it with the demand mapping table in step 1. Specifically, it includes:
[0084] Step 2.1, environmental preference data integration;
[0085] The demand mapping table obtained in step 1 is associated and integrated with environmental monitoring data and user satisfaction feedback data to construct an environmental preference dataset. Data integration takes into account temporal alignment and spatial matching to ensure consistency between various data types.
[0086] Step 2.2, multi-attribute preference learning model training;
[0087] Based on the integrated dataset, a multi-attribute preference learning model is trained to capture the environmental preference patterns of different user groups. The user's utility function for environmental parameter combinations is inferred using the Bayesian preference learning algorithm. The preference learning process is expressed as:
[0088]
[0089] in For tenant groups zh The utility function for the environmental parameter combination e, φ j (e) is the jth characteristic function of the environmental parameter combination e, α j is the weight parameter of the feature, and m is the total number of feature functions.
[0090] The detailed implementation process of the Bayesian preference learning algorithm is as follows:
[0091] Utility function representation: The utility of environmental parameters is expressed as a linear weighted combination, where the weight vector is:
[0092]
[0093] Among them, α is the sensitivity of the user group to each environmental parameter, α1, α2, The first, second, and mth hc Sensitivity of environmental parameters, m hc is the total number of environmental parameters.
[0094] Prior distribution setting: Set the prior distribution for the weight parameter α, usually using the multivariate normal distribution:
[0095] P(α)=N(u0,∑0);
[0096] Where P(α) is the prior probability distribution of the weight parameter α, N is the normal distribution, μ0 is the prior mean vector, which is the initial estimate of the weight of each parameter; ∑0 is the prior covariance matrix.
[0097] Likelihood function construction: Bradley-Terry model is used to represent user preferences. Preference instance (e i >e j ) is:
[0098]
[0099] Among them, P(e i >e j |α) is the user preference e under the condition of weight parameter α. i Rather than e j The probability of φ(e) is the characteristic vector of the environmental parameter combination e, α T is the transpose of the weight vector α, φ(e i ),φ(e j ) are the environmental parameter combinations e i 、e j The eigenvector of .
[0100] Posterior distribution estimation: According to Bayes' theorem, calculate the posterior distribution of the weight vector α:
[0101] P(α|D 偏好 )∝P(D 偏好 |α)·P(α);
[0102] where P(α|D 偏好 ) is the observed data D 偏好 The posterior probability distribution of the weight parameter α, P(D 偏好 |α) is the observed data D under the condition of weight parameter α 偏好 The likelihood probability, D 偏好 is all the observed preference data, including all users’ preference selection records. Since the posterior distribution usually has no analytical solution, the Markov Chain Monte Carlo (MCMC) method is used for sampling estimation:
[0103] Initialize the starting state α of the MCMC chain (0) is the prior mean μ0;
[0104] Iterate T times, for the tth iteration:
[0105] According to the proposed distribution q(α1α (t-1) ) generates candidate states α′, where q(α1α (t-1) ) is from the current state α (t-1) The transition probability to the candidate state α′;
[0106] Calculate the probability of acceptance:
[0107]
[0108] Where A is the probability of accepting the candidate state α′, P(D 偏好 |α′) is the data D observed in the candidate state α′ 偏好 Likelihood probability, P(α′) is the prior probability of candidate state α′, q(α (t-1) |α′) is the transition from candidate state α′ to current state α (t-1) The transition probability, P(α (t-1) ) is the current state α (t-1) Prior probability; accept α′ as the new state α with probability A (t) Otherwise, α (t) =α (t-1) ;
[0109] The first burn-in samples are discarded, and the remaining samples are used to estimate the posterior distribution. Burn-in is the number of warm-up period iterations.
[0110] Uncertainty is expressed by evaluating the uncertainty of the parameter weights through the variance of the posterior distribution:
[0111] uncertainty(α j )=Var(α j |D 偏好 );
[0112] Among them, Uncertainty(α j ) is the parameter α j Uncertainty measure, Var(α j |D 偏好 ) is the parameter α j The variance in the posterior distribution reflects the uncertainty of the model's estimate of that parameter. When a feature weight has high uncertainty, the system will proactively generate related query instances to improve the accuracy of the feature estimate.
[0113] Multimodal preference processing uses a mixed Gaussian model to represent the posterior distribution:
[0114]
[0115] Where K1 is the number of Gaussian distributions in the mixture model, For the kth 模态 The weight of the importance of each mode in the mixture model, and kth 模态 The mean and covariance of a Gaussian distribution.
[0116] Incremental learning mechanism, an incremental learning mechanism is designed to enable the model to be continuously updated from new user feedback:
[0117] P(α|D 新 , D 旧 )∝P(D 新 |α)·P(α|D 旧 );
[0118] where P(α|D 新 , D 旧 ) is the posterior distribution after considering both new and old data, P(D 新 |α) is the likelihood function of new data, P(αID 旧 ) is the posterior distribution based on the old data, which serves as the prior distribution for the new round of learning.
[0119] Step 2.3, tenant group clustering;
[0120] Hierarchical clustering algorithm is applied to group users with similar preference patterns to form tenant groups. The clustering process is expressed as:
[0121]
[0122] Among them G 聚类 is the clustering result, g 租1 、g 租2 、 The first, second, and kth 群体 tenant groups, k 群体 is the total number of groups, that is, the optimal number of clusters determined by the clustering algorithm.
[0123] Step 2.4, game theory model construction;
[0124] Construct a utility game model between tenant groups to calculate demand priorities and mutual influence. The game model is expressed as:
[0125]
[0126] Where NE is the Nash equilibrium solution, that is, the optimal combination of environmental parameters, E 环境 For all possible combination spaces of environmental parameters, For tenant groups zh The weight coefficient of For tenant groups zhThe utility function value for the environmental parameter combination e; argmax is the maximization function; ∑ is the summation symbol.
[0127] Step 2.5: Generate multi-dimensional tenant profiles;
[0128] Based on the aforementioned analysis results, a multi-dimensional profile is generated for each tenant group, encompassing attributes such as environmental preferences, spatiotemporal activity patterns, and the coefficient of influence on other tenants. This tenant profile serves as a key input for subsequent decision optimization.
[0129] Step 3: Based on the multi-dimensional tenant portrait, an improved non-dominated sorting genetic algorithm is used to find the optimal balance between tenant satisfaction and energy efficiency and generate a control decision plan;
[0130] Step 3.1, multi-objective problem modeling;
[0131] The equipment control problem is formalized as a multi-objective optimization problem, where the objective function includes two dimensions: maximizing tenant satisfaction and minimizing energy consumption. The multi-objective optimization problem is expressed as:
[0132] maxF(x)=(S(x),-E(x));
[0133] Where F(x) is the objective function vector of the multi-objective optimization problem; x is the control decision vector, which includes control parameters such as temperature setpoint, humidity setpoint, light intensity, and fresh air volume; S(x) is the tenant satisfaction function under decision x, evaluated based on the user preference model learned in step 2; E(x) is the energy consumption function under decision x, calculated based on the equipment operating status and power parameters; maxF(x) is the maximization objective function.
[0134] The specific definitions of each objective function are as follows:
[0135] The tenant satisfaction function calculates the matching degree between the current control decision and the tenant preference based on the tenant profile generated in step 2:
[0136]
[0137] Among them G 总数 is the total number of tenant groups; is the group g in multi-objective decision making zh The weight of For group g zh The utility function value for the decision variable x; ∑ is the summation symbol.
[0138] Energy consumption function: Calculates total energy consumption based on equipment model and operating parameters:
[0139]
[0140] where n设备 To control the total number of devices; For device i 设备 In the parameters Power consumption under For device i 设备 The running time is used to calculate the total energy consumption; ∑ is the summation symbol.
[0141] The decision variables are subject to various constraints:
[0142]
[0143] in is the jth constraint function; m 约束 is the total number of constraints.
[0144] Step 3.2, improve the design and implementation of the NSGA-II algorithm;
[0145] In view of the characteristics of smart city environmental control, an improved NSGA-II is designed to solve multi-objective optimization problems. The steps include:
[0146] Initialization: Generate the initial population Each solution is a set of device control decisions:
[0147]
[0148] in is the initial population; x1, x2, are the first, second, and Nth population decision vectors respectively; N 种群 is the population size.
[0149] The Latin hypercube sampling strategy is used during initialization to ensure that the initial solutions are evenly distributed in the feasible region.
[0150] Fitness evaluation: For each solution x in the current population, calculate the corresponding objective function value:
[0151] F(x) = (S(x), -E(x));
[0152] Where F(x) is the objective function vector of the multi-objective optimization problem; E(x) is the energy consumption function under decision x; S(x) is the tenant satisfaction function under decision x; and the tenant satisfaction evaluation is updated according to the tenant portrait model.
[0153] Non-dominated sorting: The population is hierarchically sorted according to the Pareto dominance relationship and divided into several non-dominated frontiers:
[0154] F1, F2, ...;
[0155] Among them, F1 and F2 are the first and second non-dominated frontiers respectively;
[0156] For solutions p and q, if for all targets i 目标 , And there is at least one target j1 such that Then p is said to dominate q, and is expressed as p>q.
[0157] The first non-dominated front contains solutions in the population that are not dominated by any other solution; the second non-dominated front contains solutions that are not dominated by the remaining solutions, and so on.
[0158] Crowding calculation: Calculate the crowding distance for each solution to quantify the sparseness of the solution in the target space:
[0159]
[0160] in To solve 解 The congestion distance, quantified by i 解 The sparsity in the target space; M is the number of target functions; and They are respectively on the target m1 and the solution i 解 The target values of two adjacent solutions; and are the maximum and minimum values of the target m1 in the current population respectively; ∑ is the summation symbol.
[0161] To improve the diversity of the solution set, the algorithm introduces an adaptive grid mechanism: according to the distribution of the current solution set in the target space, the grid size is dynamically adjusted, the grid fineness is increased in sparse areas, and the sampling density is improved.
[0162] Environment selection: Select N from the merged population based on non-dominated sorting and crowding distance 种群 elite individuals form a new population P 种群t+1 :
[0163] R t =P t ∪Q t ;
[0164] Where U is the set union operation, R t is the combined population of the parent population and the offspring population; P f is the parent population of the current generation, P t is the offspring population of the current generation;
[0165] Solutions in the non-dominated front with higher rankings are selected first. When partial solutions need to be selected from the same front, solutions with larger crowding distance are preferred.
[0166] The specific selection process is:
[0167] Initialize the next generation population to an empty set; set the number of the currently processed frontier to start from the first one; when the new population size plus the number of current frontier solutions does not exceed the population size, add all the solutions of the entire frontier to the new population, and then process the next frontier; when the entire frontier cannot be completely added, sort the solutions in the frontier in descending order according to the crowding distance, and select the solutions with the largest crowding so that the new population size just reaches the preset population size.
[0168] This selection mechanism ensures that the next generation population maintains the advantage of non-dominated solutions while maintaining the diversity of the solution set. By giving priority to solutions with high congestion, the algorithm avoids converging to the local optimum too early.
[0169] Genetic operation: perform genetic operation on the current population to generate offspring population;
[0170] Selection,using tournament selection based on crowding comparison;
[0171] Crossover uses simulated binary crossover to generate offspring solutions. Offspring solutions are generated by taking a weighted average of the parent solutions. The first offspring solution is generated by enhancing the contribution of the first parent solution and weakening the contribution of the second parent solution, while the second offspring solution is generated by the opposite. The weighting coefficients are controlled by random numbers in the simulated binary crossover to ensure that the offspring solutions inherit the good properties of the parent solutions while introducing appropriate mutations.
[0172] Mutation uses polynomial mutation to introduce random perturbations. This operation is implemented by adding a random perturbation to the original decision variable value. The size of the perturbation is determined by the product of the random number in the polynomial mutation and the range of the decision variable value. This ensures that the mutated solution remains within the feasible domain while introducing sufficient diversity to facilitate algorithmic search.
[0173] Knowledge guidance mechanism, based on the characteristics of smart city environmental control, a knowledge guidance mechanism is proposed to accelerate convergence;
[0174] Utilize historical experience, maintain the historical optimal solution library, and extract decision-making patterns from historical solutions to guide population evolution;
[0175] Predictive model assistance, building a neural network proxy model to quickly evaluate the quality of the solution:
[0176]
[0177] in is the predicted value of the objective function; NN(x;θ) is the neural network model, θ is the network parameter; x is the decision variable vector.
[0178] Adaptive mutation strategy: Dynamically adjust the mutation probability and mutation distribution parameters according to the search stage:
[0179]
[0180] in is the mutation probability of the t1th generation; p m0 is the initial mutation probability; T max is the maximum number of iterations; α 调节 is the mutation probability adjustment parameter; t1 is the current iteration number.
[0181] Termination condition: When the maximum number of iterations is reached, or the optimal solution set does not change after k4 consecutive generations, the algorithm terminates and outputs the final Pareto optimal solution set, which is the non-dominated solution set of the multi-objective optimization problem.
[0182] Decision support: From the final Pareto optimal solution set, the most appropriate control decision solution is selected based on the current system status and manager preferences:
[0183] x * =argmax x∈P* ∪manager(x);
[0184] Where P* is the Pareto optimal solution set; U manager (x) is the utility function that reflects the manager’s decision preference; x * is the optimal decision solution for the final selection; argmax x∈P* To find the utility function U in the set P* manager (x) The decision plan x that obtains the maximum value.
[0185] Step 4: Based on the decision plan, implement dynamic time and space partition control strategy according to tenant distribution and activity patterns;
[0186] Using the control decision plan generated in step 3 as input, combined with the building space characteristics and tenant distribution, dynamic zoning control of the intelligent building space is achieved. Specifically, it includes:
[0187] Step 4.1, construction of spatiotemporal partitioning model;
[0188] Spatial scene modeling: The building space is represented as a three-dimensional grid model, with each grid unit being a basic control unit:
[0189]
[0190] in A collection of three-dimensional grid models of architectural spaces. The position coordinates are (i x ,j y , kz ), I, J, and K are the number of grid cells in the x-axis, y-axis, and z-axis directions, respectively.
[0191] Environmental parameter field modeling: Construct a field function model that describes the distribution of environmental parameters in space:
[0192] φ(x, y, z, t)
[0193] =[T(x,y,z,t),H(x,y,z,t),L(x,y,z,t),A 空气 (x, y, z, t)];
[0194] Among them, T, H, L, A 空气 They are temperature field, humidity field, light field and air quality field respectively, (x, y, z) is the spatial coordinate, t is the time variable, φ(x, y, z, t) is the environmental parameter vector of each point in the space at different times, which comprehensively describes the spatiotemporal distribution characteristics of the environmental state in the building space.
[0195] Heat and mass transfer model: Establish partial differential equations for the propagation of environmental parameters:
[0196]
[0197] in is the rate of change of environmental parameters over time; D 扩散 is the diffusion coefficient matrix; V is the air velocity matrix; S 源 is the source term, describing the impact of various devices on environmental parameters; φ is the environmental parameter field vector, including parameters such as temperature and humidity; is the gradient operator; t is the time variable.
[0198] Boundary condition definition: Based on the building structure characteristics and external environmental conditions, define the boundary conditions of the environmental parameter field:
[0199] The first type of boundary condition, Dirichlet condition:
[0200] φ|Γ1=φ D ;
[0201] The second type of boundary condition, Neumann condition:
[0202]
[0203] The third type of boundary condition, Robin condition:
[0204]
[0205] Where Γ1, Γ2, and Γ3 are fixed temperature boundaries, heat flow boundaries, and convection heat transfer boundaries, respectively; n is the boundary normal vector; α and β are the heat conduction coefficient and convection heat transfer coefficient, respectively; φ D 、φ N 、 are the fixed values of parameters under Dirichlet boundary conditions, the derivative values of parameters under Neumann boundary conditions, and the mixed boundary parameter values under Robin boundary conditions, respectively. is the derivative of the parameter along the boundary normal, which describes the rate of change of the parameter at the boundary.
[0206] Step 4.2, partition strategy optimization;
[0207] Based on tenant profiles and scenario characteristics, optimize the spatiotemporal partitioning strategy to maximize overall tenant satisfaction. Formalize the partitioning problem: Formalize the partitioning problem as a constrained optimization problem:
[0208]
[0209] stC(P 分区 )≤C max ;
[0210] Among them, P 分区 is the partition scheme, Z(P 分区 ) is the objective function value of the partition scheme, G 聚类 Assemble tenant groups. For group g zh The weight of For group g zh In the partition scheme P 分区 Satisfaction under 分区 ) is the partition scheme P 分区 The control complexity of C max is the maximum allowed complexity; st is the constraint condition; maxZ(P 分区 ) is the maximization partitioning scheme P 分区 The objective function value of .
[0211] Partitioning algorithm design, developing an adaptive partitioning algorithm based on spectral clustering to divide the building space into multiple control partitions;
[0212] Similarity matrix construction; construct the similarity matrix between grid cells:
[0213]
[0214] in is the grid cell i 节点 and i 节点 The similarity between d and σ tare the scale parameters of spatial distance and tenant preference differences, respectively; d spatial (i 节点 ,j 节点 ) is the grid unit i 节点 and j 节点 The spatial distance d tenant (i 节点 ,j 节点 ) is the grid unit i 节点 and j 节点 The degree of diversity in tenant preferences.
[0215] Laplace matrix calculation: Construct a normalized Laplace matrix based on the similarity matrix:
[0216]
[0217] L=D 节点 -W;
[0218]
[0219] Among them D 节点 is the degree matrix, the diagonal elements For node i 节点 The sum of similarities with all nodes; L is the Laplace matrix; L norm is the normalized Laplace matrix; W is the similarity matrix.
[0220] Characteristic decomposition: L norm Perform feature decomposition and obtain the top k 特征 Eigenvectors:
[0221]
[0222] Among them, v1, v2, The first, second, and kth 特征 feature vectors, k 特征 is the number of eigenvectors, forming the characteristic matrix:
[0223]
[0224] where n 分区 is the number of grid cells, k 特征 is the number of eigenvectors, V is the characteristic matrix, and R is the real number field.
[0225] K-means clustering, performing K-means clustering on the row vectors in the feature matrix V to obtain the final partitioning result;
[0226] Optimize the number of partitions and determine the optimal number of partitions:
[0227]
[0228] Where S(k2) is the evaluation index value when the number of partitions is k2, k 2min and k 2max are the lower and upper bounds of the number of partitions, is the optimal number of partitions; For k 2min and k 2max Find the k2 value that maximizes S(k2).
[0229] Partition boundary smoothing: Apply the level set method (LevelSetMethod) to smooth the partition boundaries:
[0230]
[0231] where φ LS is the level set function, the zero level set φ LS = 0 is the partition boundary, V is the normal velocity field; is the modulus of the gradient of the level set function; is the rate of change of the level set function over time.
[0232] Partition merging and splitting, dynamically adjusting the partition structure based on changes in tenant needs and environmental conditions;
[0233] Merge condition: When the difference in the environmental parameter requirements of adjacent partitions is less than the merge threshold, consider merging these partitions:
[0234]
[0235] in For partition and The difference in environmental parameter requirements between merge is the merging threshold, To partition and Merge operation.
[0236] Split condition: When the difference in environmental requirements of tenant groups within a partition is greater than the split threshold, further splitting is performed:
[0237]
[0238] in For partition Internal environmental demand difference, Δ split is the splitting threshold, To partition Split operation.
[0239] Step 4.3, partition collaborative control strategy;
[0240] Partitioned Controller Design: Design a separate model predictive controller for each partition:
[0241]
[0242]
[0243] in is the control sequence of partition i from time t to t+N, is the output (environmental parameters), is the reference trajectory, is the system status, and are the state error weight matrix and the control cost weight matrix, is the state transfer function, g 输出 is the output function, N is the length of the prediction time domain, and are the lower and upper limits of the control input, respectively. and are the lower and upper bounds of the state variable, respectively; For partition i at time t+k 时间 The control input vector of For control sequence The operation of finding the minimum value; ∑ is the summation symbol; T is the matrix transpose operation; st is the constraint condition.
[0244] The boundary coordination strategy introduces the concept of soft boundary and calculates the target environmental parameters of the area through weighted average:
[0245]
[0246] where r boundary (p) is the target environment parameter at position p in the boundary area, r i is the target environmental parameter of adjacent partition i, is the weight of the adjacent partition i at position p, m fq is the number of partitions adjacent to the boundary area. It decreases as the distance from position p to the center of partition i increases.
[0247] Temperature gradient constraints limit the gradient of environmental parameters in the space to avoid discomfort caused by drastic changes:
[0248]
[0249] where ΔT max and ΔH max are the maximum gradient values allowed for the temperature field and humidity field, and are the moduli of the temperature field and humidity field gradients, respectively, describing the spatial rate of change of environmental parameters.
[0250] Collaborative optimization introduces collaborative terms at the partition boundaries to optimize the joint objective function of adjacent partition controllers:
[0251]
[0252] in For partition i 分区 The local objective function, E is the set of adjacent partition pairs, For partition i 分区 and j 分区 The collaborative weight between is the difference measure of environmental parameters between partitions, n 分区 is the total number of partitions, J cooperative is the global objective function considering partition coordination; ∑ is the summation symbol.
[0253] Global energy efficiency optimization optimizes global energy efficiency while ensuring that the environment within the partition meets the requirements;
[0254] Device collaborative scheduling optimizes global device operation strategies based on device characteristics and partition requirements:
[0255]
[0256] Among them E total is the total energy consumption, D 设备 is the equipment set, E d (u d ) is the device d in the control input u d Energy consumption under For partition i 分区 The environmental parameter vector, and are the lower and upper limits of the environmental parameters respectively; ∑ is the summation symbol; st is the constraint condition.
[0257] Load forecasting and advance adjustment: predict future load changes and adjust control strategies in advance:
[0258] L t+k =f pred (L t-n:t , W t:t+k , S t:t+k );
[0259] Among them L t+k is the forecast load at time t+k, L t-n:t is the historical load of the past n moments, W t:t+k is the weather forecast for the next k moments, St:t+k Schedule activities for the next k moments, f pred is the load forecasting function.
[0260] Adaptive control parameter adjustment: Adaptive adjustment of control parameters based on system response and energy efficiency evaluation:
[0261]
[0262] where θ t is the control parameter vector at time t, α xx is the learning rate, which controls the step size of parameter updates, is the gradient of the objective function with respect to the parameter θ, t+1 is the updated control parameter vector.
[0263] Emergency response mechanism, designing emergency response strategies for special situations (such as equipment failure, extreme weather, etc.);
[0264] Fault detection and diagnosis, based on equipment operation data, detects equipment abnormal status in real time:
[0265]
[0266] in Based on observational data Infer the posterior probability of equipment failure, is the likelihood probability of the observed data under equipment failure conditions, is the marginal probability of the observed data, x1, x2, The first, second, and nth 观测 Observation data, n 观测 is the number of observation data; P(fault) is the prior probability of equipment failure.
[0267] Backup control strategy, when the main control strategy cannot be executed, it automatically switches to the backup control strategy:
[0268] u backup =f backup (x, r, fault t ype);
[0269] where u backup is the backup control input, x is the current system state, r is the target reference value, fault t ype is the fault type, f backup It is the backup control strategy function.
[0270] Gradual response: Based on the severity of the abnormality, a graded response strategy is implemented, giving priority to ensuring the environmental parameter requirements of key areas:
[0271] priority(P i )=f priority (tenant t ype i , activity t ype i , area i );
[0272] Among them, priority (P i ) is partition P i Priority is used to guide and control resource allocation under resource-constrained conditions. t ype i is the tenant type of partition i, activity t ype i is the activity type of partition i, area i is the area of partition i, f priority is the priority calculation function.
[0273] Step 5: Monitor the execution of spatiotemporal partitioning control. When system components fail or encounter unforeseen scenarios, automatically synthesize alternative control programs to achieve system self-repair.
[0274] This step initiates the self-repair process when an anomaly is detected, specifically including:
[0275] Step 5.1, system status monitoring and anomaly detection;
[0276] Build a real-time monitoring model based on multi-feature fusion to monitor the execution of the dynamic spatiotemporal partitioning control in step 4 and the operating status of each hardware device, and initiate the subsequent self-repair process when an anomaly is found.
[0277] Monitoring data collection and preprocessing, collecting system operation data from multiple sources:
[0278] D 监测 ={D 设备状态 , D 环境 , D 用户 , D 日志};
[0279] Among them D 监测 is the monitoring data set, D 设备状态 is the device status data, D 环境 is the environmental parameter data, D 用户 Feedback data for users, D 日志 This is system log data.
[0280] Multidimensional anomaly detection model, building a hybrid anomaly detection model that integrates local anomaly factors and isolation forests;
[0281] Local anomaly factor calculation: For each observation point p, the local anomaly factor is calculated based on the local density of its k3 nearest neighbors:
[0282]
[0283] in is the local reachability density of point p, is the local reachability density of point O, is the set of k3 nearest neighbors of p, is the reachable distance from p to o, is the local anomaly factor of point p, k3 is the number of neighbors, is the size of p’s k3 nearest neighbor set, and ∑ is the summation symbol.
[0284] Isolation Forest Anomaly Score: Calculates anomaly scores by building multiple isolation trees:
[0285]
[0286] Where s(x, n) is the anomaly score of point x on a sample set of size n, E(h(x)) is the average path length of x, c(n) is the normalization factor, h(x) is the path length of point x in the isolation tree, and x is the data point to be evaluated.
[0287] Multi-model fusion, which fuses the results of multiple anomaly detection models based on a weighted voting method:
[0288]
[0289] Where A(p) is the final anomaly score of point p, ∑ is the summation symbol, A i (p) is the abnormal score of point p by the i-th model, w i is the weight of the i-th model, m mx is the total number of models, and p is the data points to be evaluated.
[0290] Adaptive threshold determination: Adaptively determine the anomaly detection threshold based on system historical data and operating scenarios:
[0291] τ(t2)=μ A (t2)+α yz ·σ A (t2);
[0292] Where τ(t2) is the abnormal threshold at time t2, μ A (t2) and σ A (t2) are the historical mean and standard deviation of the anomaly score, α yz It is an adjustment parameter used to control the detection sensitivity, and t2 is the current moment.
[0293] Abnormal type classification: classify detected abnormalities into different types according to characteristic patterns to facilitate subsequent processing:
[0294] C(A)=argmax c∈C P(c|A);
[0295] Where C(A) is the anomaly type, C is the set of all possible anomaly types, P(c|A) is the probability that the anomaly belongs to type c given the anomaly feature A, argmax is the type that maximizes the probability, and A is the anomaly feature vector.
[0296] Step 5.2, control program functional boundary analysis;
[0297] Control program symbolic execution, replace program inputs with symbolic values, trace program execution and collect path constraints;
[0298] Initialization: Replace program input with symbolic variables:
[0299] s1, s2, …, s n ;
[0300] Among them, s1, s2, s n are the 1st, 2nd, and nth symbolic variables, respectively, where n is the number of symbolic variables;
[0301] Initialize the path constraint set:
[0302] PC = true;
[0303] Where PC is the path constraint set and true is true.
[0304] Path exploration, execution program, for each conditional branch C:
[0305] Update the path constraint when the condition is true or false:
[0306] PC true =PC∧c;
[0307]
[0308] Create an execution state branch and continue exploring two paths:
[0309] PC true and PC false ;
[0310] Where PC is the current path constraint set, PC true is the path constraint when the condition is true, PC false is the path constraint when the condition is false, C is the conditional branch, ∧ is the logical AND operation, It is a logical NOT operation.
[0311] Constraint solving, for each collected path constraint Use the constraint solver to check its satisfiability:
[0312]
[0313] in Is to satisfy the path constraint A specific assignment of If it cannot be satisfied, is the i3th path constraint, and Solve is the constraint solving function.
[0314] Path merging, at the merge point of the program, merges the execution states with the same program counter but different path constraints:
[0315] State merged =(PC1∨PC2∨…∨PC k ), Mem merged ;
[0316] Among them, Me merged is the memory state after the merger, through the conditional expression:
[0317] Mem merged =ite(PC1,Mem1,ite(PC2,Mem2,…));
[0318] Among them, PC1, PC2, PC k are the first, second, and kth path constraints, respectively. k is the number of path constraints. Mem1 and Mem2 are the memory states of the first and second paths, respectively. ite is an if-then-else conditional expression, which is used to select the corresponding memory state according to the path constraint.
[0319] Program invariant extraction, based on the program execution trace, extracts the key invariants of the control program;
[0320] Candidate invariant generation, through template matching and data mining methods, generates candidate invariants from the execution trace:
[0321] Inv cand =GenerateCandidates(Traces);
[0322] Among them, Inv cand is a set of candidate invariants, Traces is a set of program execution traces, and GenerateCandidates is a function for generating candidate invariants.
[0323] Invariant verification: For each candidate invariant inv, verify its validity on all feasible execution paths:
[0324]
[0325] Where States is the set of all reachable states of the program, Valid(inv) is the validity of the invariant inv, and inv(s) is the invariant in state s. v The value of (true or false).
[0326] Invariant refinement, based on counterexamples and program structure information, refines and enhances the extracted invariants:
[0327] Inv refined =Refine(Inv valid , Counterexamples);
[0328] Among them, Inv valid is the set of valid invariants that have been verified, Counterexamples is the set of counterexamples found during the verification process, Inv refined is the refined invariant set, and Refine is the invariant refinement function.
[0329] Functional boundary formalization: Expressing program functional boundaries as formal specifications, including preconditions, postconditions, and key properties:
[0330] Φ fuuc =Pre, Post, Inv;
[0331] Where Pre is the precondition of the program, Post is the postcondition of the program, Inv is the invariant maintained during the execution of the program, Φ func A formal specification of program functionality.
[0332] Step 5.3, high-level intent specification extraction;
[0333] Semantic analysis of design documents: Apply natural language processing technology to extract system functional requirements and performance requirements from design documents; pre-process text to perform word segmentation, part-of-speech tagging, and dependency syntax analysis on documents:
[0334] T processed =NLP preprocess (T raw );
[0335] Where T processed is the preprocessed text, T raw , is the original document text, NLP preprocess It is a text preprocessing function.
[0336] Requirements identification, based on rules and statistical models, identifies functional requirements and performance requirements in text:
[0337] R func =ExtractFuncRequirements(T processed );
[0338] R perf =ExtractPerfRequirements(T processed );
[0339] where R func is the set of functional requirements, R perf is a set of performance requirements, ExtractFuncRequirements and ExtractPerfRequirements are the extraction functions for functional requirements and performance requirements respectively, T processed The preprocessed text.
[0340] Semantic dependency graph construction, building a semantic graph that describes the dependencies between system components:
[0341] G sem =(V, E);
[0342] Where V is the system component or function set, E is the dependency set between components, G sem is a semantic dependency graph.
[0343] Operational data pattern extraction: Analyze the system's historical operation data to extract common behavioral patterns and implicit rules:
[0344] Sequential pattern mining, applying sequential pattern mining algorithms to discover sequential rules in system operations:
[0345] P seq =SeqPatternMining(D 历史 , min_sup);
[0346] Among them, P seq is the set of discovered sequence patterns, D 历史 is the historical operation data, min_sup is the minimum support threshold, and SeqPatternMining is the sequence pattern mining function.
[0347] Association rule discovery uses association rule mining algorithms to discover the association relationships between system parameters:
[0348] R assoc =AprioriAlg(D 参数 , min_conf);
[0349] Where R assoc is the set of discovered association rules, D 参数 is the system parameter data, min_conf is the minimum confidence threshold, and AprioriAlg is the Apriori association rule mining algorithm.
[0350] Determination of abnormal behavior boundary: Based on the historical data distribution, determine the normal change range of system parameters:
[0351] B norm (p) = (μ p - k·σ p , μ p + k·σ p );
[0352] Where B norm (p) is the normal boundary of parameter p, μ p and σ p are the historical mean and standard deviation of parameter p respectively, k is the boundary extension coefficient, and p is the system parameter.
[0353] Canonical formal representation: Transform the extracted high-level intent into a formal representation;
[0354] Linear temporal logic representation: Use LTL for the temporal properties of the system:
[0355] φ LTL = □(p → ◇q);
[0356] Where □ means "always", ◇ means "eventually", p and q are system state propositions, and φ LTL is the LTL formula.
[0357] Computation tree logic representation: Use CTL for the branching properties of the system:
[0358] φ CTL = AG(p → EFq);
[0359] Where AG means "always on all paths", EF means "eventually on some path", p and q are system state propositions, and φ CTL is the CTL formula.
[0360] Construction of state machine model: Construct a finite state machine that describes the expected behavior of the system:
[0361] FSM = (S, S0, ∑, δ, F);
[0362] Where S is the set of states, S0 is the set of initial states, ∑ is the input alphabet, δ is the transition function, F is the set of accepting states, and FSM is the finite state machine model.
[0363] Step 5.4, alternative control program synthesis;
[0364] Synthesis Problem Formulation: The program synthesis problem is formalized as a satisfiability problem:
[0365]
[0366] Where P is the program to be synthesized, X is the input space, and Φ(P, x) is the program P that satisfies the specification Φ on the input x; It is the quantifier of "existence"; is the quantifier for "to all"; ∈ is the "belongs to" relationship.
[0367] Backward inductive programming is used to derive the program implementation from the system specification:
[0368] Specification decomposition, breaking down a high-level specification into multiple sub-specifications:
[0369]
[0370] Where Φ is the complete gauge set, φ1, φ2, They are the 1st, 2nd and nth sub-specifications respectively, and n-specification is the number of sub-specifications.
[0371] Program skeleton construction, based on domain knowledge and design patterns, build the program skeleton:
[0372] P sketch =(V hole , Statements);
[0373] Where V hnole is the set of program "holes" to be filled, Statements is a fixed set of program statements, P sketch The program skeleton.
[0374] Conditional constraint solving, converting the program synthesis problem into a constraint solving problem:
[0375]
[0376] Where C(V hole ) is the constraint condition about the program "hole", ∧ is the logical AND operation, To fill the hole with value V, is the input space of the i4th sub-norm, To satisfy the relationship, is the i4th sub-norm.
[0377] Counterexample-guided search optimizes the search process through the inductive synthesis method guided by counterexamples:
[0378]
[0379] Where E is a set of counterexamples, e1, e2, The first, second, and mth lf Counterexamples, m lf is the number of counterexamples.
[0380]
[0381] Among them C refined (V hole ) is the constraint condition refined by counterexample, is the j3th counterexample, m fl is the number of counterexamples, and Φ is the complete specification.
[0382] Component library utilization, using predefined control component library to accelerate program synthesis;
[0383] Component interface definition, which defines a standardized interface for each library component:
[0384] Comp i =(In i ,Out i , Pre i , Post i );
[0385] Among them, Comp i is the i-th component, In i and Out i They are input and output interfaces, Pre i and Post i They are preconditions and postconditions respectively.
[0386] Component combination search, search for component combinations that meet the specifications:
[0387] P comp =FindComposition(Comps,Φ);
[0388] Among them, P comp is the synthesis program, Comps is the component library, Φ is the target specification, and FindComposition is the component combination search function.
[0389] Interface adapter generation, automatically generating interface adapters between components:
[0390] Adapter i,j =GenerateAdapter(Out i ,In j );
[0391] Adapter i,j is an adapter from the output of component i to the input of component j, Out i is the output interface of component i, In j It is the input interface of component j, and GenerateAdapter is the adapter generation function.
[0392] Program optimization and simplification: optimize and simplify the initial synthesis program;
[0393] Dead code elimination, removing code from a program that will never be executed:
[0394] P opt1 =RemoveDeadCode(P init );
[0395] Among them, P opt1 For the optimized program, P init It is the initial synthesized program, and RemoveDeadCode is the dead code elimination function.
[0396] Expression simplification, simplifying complex expressions in the program:
[0397] e simp =SimplifyExpr(e complex );
[0398] where e simp For the simplified expression, e complex is the original complex expression, and SimplifyExpr is the expression simplification function.
[0399] Loop optimization, optimize the loop structure in the program and reduce unnecessary calculations:
[0400] L opt =OptimizeLoop(L orig );
[0401] Among them L opt To optimize the post-loop, L orig is the original loop, and OptimizeLoop is the loop optimization function.
[0402] Step 5.5, runtime verification and program deployment;
[0403] Formal verification: Use model checking techniques to verify the key properties of a program;
[0404] Model construction: Build a formal model from program source code:
[0405] M prog =BuildModel(Pfinal );
[0406] Among them, M prog Formal model, P final is the program source code, and BuildModel is the model building function.
[0407] Property test: Verify whether the model meets the specified properties:
[0408] result check =ModelCheck(M prog ,φ verify );
[0409] where result check is the verification result (true or false), φ verify is the property to be verified, M prog is a formal model, and ModelCheck is a model checking function.
[0410] Counterexample analysis: Analyze the nature of the verification failure and correct the program:
[0411] P fixed =FixProgram(P final , counterexample found );
[0412] Among them, P fixed For the corrected program, counterexample found is the counterexample found during the verification process, P final is the original program, and FixProgram is the program correction function.
[0413] Simulation testing, which performs simulation tests in a virtual environment to evaluate the performance of the program in various scenarios;
[0414] Test scenario generation: Automatically generate test cases covering different scenarios:
[0415] T cases =GenerateTests(Scenarios test , P fixed );
[0416] Where T cases For test case collection, Scenarios test is the target scene set, P fixed is the program to be tested, and GenerateTests is the test generation function.
[0417] Execution and evaluation, execute the test in the simulation environment and collect evaluation metrics:
[0418] Results test =Execute(P fixed , T Cases , Metrics eval );
[0419] Results test For test results, Metrics eval is the set of evaluation indicators, P fixed is the program to be tested, T cases It is a collection of test cases, and Execute is a test execution function.
[0420] Fault injection testing, which evaluates the robustness of a program by injecting faults:
[0421] Kobustness score
[0422] =FaultInjectionTest(P fixed , FaultPatterns test );
[0423] Robustness score Scoring robustness, FaultPatterns test is the set of failure modes, P fixed is the program to be tested, and FaultInjectionTest is the fault injection test function.
[0424] Secure deployment strategy: design a secure program deployment strategy to ensure a smooth system transition;
[0425] Grayscale release: adopt a grayscale release strategy to gradually expand the application scope of alternative programs:
[0426]
[0427] Devices target (t3) is the target device set at time t3, Devices all is the set of all devices, t0 and t3 are the publishing start time and the current time respectively, I rollout is the time period for complete release; min is the minimum value.
[0428] Rollback mechanism, design a fast rollback mechanism to restore the original program in abnormal situations:
[0429] Rollback trigger =Monitor(Metrics runtime, Thresholds alert );
[0430] Rollback trigger For rollback triggers, when monitoring metrics runtime Thresholds alert When the rollback is triggered, Monitor is the monitoring function.
[0431] State migration ensures smooth state migration during program switching:
[0432] State new =MigrateState(State old , P orig , P fixed );
[0433] State new is the initial state of the new program, State old is the current state of the old program, P orig and P fixed They are the old program and the new program respectively, and MigrateState is the state migration function.
[0434] Continuous optimization: continuously monitor and optimize replacement programs after deployment; performance monitoring: real-time monitoring of program performance:
[0435] Perf metrics (t4) = CollectMetrics(P deployed , t4);
[0436] Among them, Perf metrics (t4) is the performance index set at time t4, P deployed is to run the program, t4 is the current time, and CollectMetrics is the indicator collection function.
[0437] Adaptive adjustment, based on operating data, adaptively adjust program parameters:
[0438]
[0439] in is the program parameter set at time t5, UpdateParams is the parameter update function, Perf metrics (t5) is the performance index at time t5, is the updated parameter set.
[0440] Experience accumulation, accumulate experience from program operation for future optimization:
[0441]
[0442] in The knowledge base at time t6, Experience new For the newly acquired operating experience, is the updated knowledge base, and UpdateKnowledgeBase is the knowledge base update function.
[0443] After this step is complete, an alternative control program is generated and deployed, enabling the system to maintain normal operation in the event of component failure or unforeseen scenarios. The self-repaired system status information is fed back to steps 1 through 4, providing information on the system's current operating status and available resources, and providing system status updates.
[0444] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make more forms of equivalent embodiments based on the inspiration of this embodiment, all of which are protected by this embodiment.
Claims
1. A closed-loop control method for smart city equipment based on machine learning, characterized in that: include: Use natural language processing and behavioral pattern analysis technologies to obtain users' advanced instructions and implicit preferences, and establish multi-tenant demand mapping; Use Bayesian preference learning algorithms to analyze tenant demand data and generate multi-dimensional tenant portraits; Based on the multi-dimensional tenant portrait, an improved non-dominated sorting genetic algorithm is used to find the optimal balance between tenant satisfaction and energy efficiency and generate a control decision plan. Based on the decision-making plan, dynamic time and space partition control strategy is implemented according to tenant distribution and activity patterns; Monitor the execution of spatiotemporal partitioning control and automatically synthesize alternative control programs to achieve system self-repair when system components fail or encounter unforeseen scenarios.
2. The closed-loop control method for smart city equipment based on machine learning according to claim 1, characterized in that: The step of establishing a multi-tenant demand mapping includes: Collect user environment control instructions and behavior data to form the original interaction data set; Input user text and voice commands into a BERT-based natural language processing model and output a user intent representation vector. Apply time series pattern mining algorithms to analyze user historical behavior data and identify user usage habits and implicit preferences; Based on the semi-supervised intent classification model, the user intention vector and behavior feature vector are taken as input and the standardized demand category is output; Build standardized requirements mapping tables for each tenant or user group.
3. The closed-loop control method for smart city equipment based on machine learning according to claim 1, characterized in that: The use of the Bayesian preference learning algorithm to analyze tenant demand data and generate a multi-dimensional tenant profile includes: The demand mapping table is associated and integrated with environmental monitoring data and user satisfaction feedback data to construct an environmental preference dataset; Based on the integrated dataset, a multi-attribute preference learning model is trained to capture the environmental preference patterns of different user groups; Applying hierarchical clustering algorithm to group users with similar preference patterns to form tenant groups; Based on the principles of game theory, a utility game model among tenant groups is constructed to calculate the priority and mutual influence of each tenant's needs; Based on the above analysis results, a multi-dimensional portrait is generated for each tenant group.
4. The closed-loop control method for smart city equipment based on machine learning according to claim 1, characterized in that: The step of generating a control decision plan includes: The equipment control problem is formalized as a multi-objective optimization problem with two objective functions: maximizing tenant satisfaction and minimizing energy consumption. According to the characteristics of smart city environmental control, an improved non-dominated sorting genetic algorithm with knowledge guidance mechanism is constructed to solve multi-objective optimization problems; Accelerate algorithm convergence based on historical experience utilization, prediction model assistance and adaptive mutation strategy; From the final Pareto optimal solution set, the most appropriate control decision scheme is selected based on the current system state and manager preferences.
5. The closed-loop control method for smart city equipment based on machine learning according to claim 1, characterized in that: The steps of dynamic time and space partition control include: Construct a zoning control model that integrates time and space dimensions to describe the distribution of environmental parameters in the building space and their temporal evolution process; An adaptive partitioning algorithm based on spectral clustering divides the building space into multiple control partitions; The level set method is used to smooth the partition boundary and reduce the complexity of the boundary; Design an independent model predictive controller for each partition and implement a collaborative control strategy between partitions; Optimize global energy efficiency and design emergency response mechanisms.
6. The closed-loop control method for smart city equipment based on machine learning according to claim 1, characterized in that: The steps of implementing system self-repair include: Build a real-time monitoring model based on multi-feature fusion to identify system abnormalities and component failures; Apply symbolic execution and formal verification techniques to analyze the functional boundaries and execution path constraints of existing control programs; Extract high-level intent specifications for the system from system design documents and historical data; Based on the extracted specifications and the current system status, a backward inductive programming approach is used to automatically synthesize alternative control programs that meet the requirements; The synthesized alternatives are fully validated and safely deployed into production environments.
7. The closed-loop control method for smart city equipment based on machine learning according to claim 5, characterized in that: The inter-partition collaborative control strategy includes: Introducing the concept of soft boundaries, which treats partition boundaries as gradient areas rather than hard boundaries; Limit the gradient of environmental parameters in the space to avoid discomfort caused by drastic changes; A cooperative term is introduced at the partition boundary to optimize the joint objective function of the controllers of adjacent partitions.
8. The closed-loop control method for smart city equipment based on machine learning according to claim 6, characterized in that: The real-time monitoring model is based on a hybrid anomaly detection model of local anomaly factors and isolation forests. It fuses the results of multiple anomaly detection models through a weighted voting method and adaptively determines the anomaly detection threshold based on system historical data and operating scenarios.
9. The closed-loop control method for smart city equipment based on machine learning according to claim 6, characterized in that: The synthesis of the alternative control program specifically includes: Formalize the program synthesis problem as a satisfiability problem; Break down high-level specifications into sub-specifications; Build program skeleton based on domain knowledge and design patterns; Determine the specific implementation of the program through conditional constraint solving and counterexample guided search; Accelerate program synthesis using a library of predefined control components; The initial procedure of the synthesis was optimized and simplified.
10. A closed-loop control method for smart city equipment based on machine learning, characterized in that: A closed-loop control system for smart city equipment based on machine learning, for executing any one of claims 1-9, comprising: Multi-tenant demand analysis module, which uses natural language processing and behavior pattern analysis technology to obtain user high-level instructions and implicit preferences and establish multi-tenant demand mapping; The preference learning and tenant profiling module uses the Bayesian preference learning algorithm to analyze tenant environmental demand data and generate multi-dimensional tenant profiles. A multi-objective balance decision module is used to find the optimal balance between tenant satisfaction and energy efficiency using an improved non-dominated sorting genetic algorithm and generate a control decision plan; Dynamic time and space partition control module, used to implement dynamic time and space partition control strategy based on tenant distribution and activity patterns; The self-repair program generation module is used to automatically synthesize alternative control programs to achieve system self-repair when system components fail or encounter unforeseen scenarios.