An AI-based intelligent generation method and system for urban governance application systems
By constructing a digital twin model and genetic coding technology for the urban governance application system, combined with multi-objective genetic algorithms and reinforcement learning agents, the problem of component combination optimization in the urban governance application system is solved, the intelligent component selection and multi-objective optimization are realized, and the efficiency and adaptability of component combination are improved.
Patent Information
- Application Number
- CN202511024439.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-24
AI Technical Summary
The existing urban governance application system development lacks intelligent component optimal combination capabilities, multi-objective optimization capabilities, component adaptive optimization and cross-level collaborative optimization capabilities, and is unable to automatically generate the best front-end and back-end functional combination solutions based on governance needs.
An AI-based approach is used to construct a digital twin model by acquiring multi-source data on urban governance. The front-end UI components and back-end API components in the component library are converted using genetic coding. Component combination optimization is performed by combining multi-objective genetic algorithms and reinforcement learning agents. Components are evaluated and updated using a federated learning framework to achieve intelligent management and optimization of the component library.
It realizes the intelligent selection of components of urban governance application systems, improves the efficiency of component selection search, optimizes the intelligence and adaptability of component combination, and meets multiple goals such as performance, security, maintainability and user experience.
Smart Images

Figure CN120523474B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of application system generation technology, and in particular to an AI-based intelligent generation method and system for an urban governance application system. Background Art
[0002] At present, the development of urban governance application systems mainly adopts traditional software engineering methods, including demand research, system design, coding implementation, testing and deployment. After selecting the software engineering method, it is necessary to select code generation technology to generate the corresponding application components. Existing code generation technologies are mainly divided into four categories: (1) Template-based code generators, such as MyBatisGenerator and Spring Boot CLI, which can generate basic CRUD code based on the database structure; (2) Low-code / no-code platforms, such as DingTalk YiDa and Tencent Cloud WeiDa, which can quickly build applications through visual drag and drop; (3) AI-assisted programming tools, such as GitHub Copilot and TabNine, which provide intelligent code completion and generation suggestions; (4) Component-based development platforms, which assemble and combine pre-built UI components and business components. In terms of the application of evolutionary algorithms, some existing technologies have explored the application of genetic algorithms in software architecture optimization and component selection, but they are mainly concentrated in the theoretical research stage.
[0003] The existing technologies have the following key problems in the development of urban governance applications:
[0004] (1) Lack of intelligent component optimal combination capabilities: Although the existing component library is rich, it lacks the ability to automatically find the optimal component combination and cannot automatically generate the best front-end and back-end functional combination solution based on governance requirements;
[0005] (2) Lack of architecture generation mechanism for multi-objective optimization: Urban governance applications need to simultaneously meet multiple objectives such as performance, security, maintainability, and user experience. Existing tools are unable to perform intelligent trade-offs for multi-objective optimization.
[0006] (3) Lack of component adaptability optimization based on evolutionary learning: It is impossible to iteratively optimize component combinations based on actual usage results, and lacks learning and evolution capabilities;
[0007] (4) Lack of cross-level collaborative optimization capabilities: The matching between front-end UI components and back-end API interfaces lacks an intelligent collaborative optimization mechanism;
[0008] (5) Lack of automatic component variation and innovation capabilities for governance scenarios: Unable to automatically innovate and generate new component combination patterns based on the needs of specific governance scenarios. Summary of the Invention
[0009] In view of this, the present invention provides an AI-based intelligent generation method and system for urban governance application systems to solve the technical problem of the lack of optimal component combination optimization capabilities in the existing application system generation process.
[0010] The technical solution adopted in the present invention is:
[0011] In a first aspect, the present invention provides an AI-based intelligent generation method for an urban governance application system, comprising:
[0012] S1: Obtain multi-source data on urban governance, extract spatiotemporal features from the data, and build a digital twin model based on the spatiotemporal features;
[0013] S2: Convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through genetic coding, and construct front-end and back-end collaborative genes to form a component gene library;
[0014] S3: Input the urban governance scenario into the digital twin model to generate component requirements. Based on the component requirements, a multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operators.
[0015] S4: Establish a reinforcement learning agent based on the optimization goal of the multi-objective fitness function. According to the preset component selection strategy, use genetic operators to globally search for the optimal component combination in the component gene library. At the same time, use the reinforcement learning agent to collaboratively perform local search optimization and strategy optimization to output the optimal component combination.
[0016] S5: Distribute the optimal component combination to multiple city governance departments through the federated learning framework for component evaluation model training. Aggregate the component evaluation model parameters of each city governance department through federated learning to establish component quality evaluation standards.
[0017] S6: Collect application operation data based on the optimal component combination from various urban governance departments online, evaluate the component usage effect of the application operation data through component quality assessment standards, and update the component gene library and digital twin model based on the component usage effect evaluation results.
[0018] Furthermore, the processing steps of S1 are as follows:
[0019] S11: Collect multi-source heterogeneous data related to urban governance through IoT sensors, social media, and government data systems;
[0020] S12: Use spatiotemporal graph convolutional networks to extract spatiotemporal features from multi-source heterogeneous data, and fuse the weights of different data sources through an attention mechanism to obtain fused spatiotemporal features;
[0021] S13: Use the CityGML standard for spatial modeling, and build a digital twin model that includes time dimension, space dimension and social dimension based on the integration of spatiotemporal features. At the same time, combine geographic data and business data of government departments, and use the digital twin model to establish a mapping relationship map of real-world scenarios-governance needs-component needs.
[0022] Furthermore, the processing steps of S2 are as follows:
[0023] S21: Perform static analysis on the front-end UI components and back-end API components in the component library, extract component features and construct component feature vectors;
[0024] S22: Map the component feature vectors to the gene space through principal component analysis and dimensionality reduction to obtain the gene fragments corresponding to the front-end UI component and the back-end API component. Then, use a multi-level gene encoding structure to perform front-end component gene encoding on the gene fragments of the front-end UI component to obtain the front-end component gene sequence. At the same time, use a hierarchical gene encoding structure to perform back-end interface gene encoding on the gene fragments of the back-end API component to obtain the back-end component gene sequence.
[0025] The multi-level gene coding structure includes layout genes, interaction genes and style genes; the hierarchical gene coding structure includes data access genes, business logic genes and security control genes;
[0026] S23: Construct cross-layer collaborative genes, and use them to encode the binding relationship between front-end components and back-end interfaces, data transmission format, and exception handling mechanism;
[0027] S24: Constructing a component gene library based on the front-end component gene sequence, the back-end component gene sequence and the cross-layer collaborative gene, and establishing a genotype-phenotype mapping function; the genotype-phenotype mapping function is used to convert the gene operation results into executable code components.
[0028] Furthermore, the processing steps of S3 are as follows:
[0029] S31: Input the urban governance scenario into the digital twin model and generate the component requirements corresponding to the urban governance scenario through the mapping relationship graph;
[0030] S32: Based on component requirements, the NSGA-III multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operator for urban governance applications;
[0031] The multi-objective fitness function includes a functional integrity objective function, a performance efficiency objective function, a user experience objective function, a security compliance objective function, and a maintainability objective function;
[0032] The genetic operation operator includes an intelligent crossover operator, an adaptive mutation operator and a repair operator.
[0033] Furthermore, the processing steps of S4 are as follows:
[0034] S41: Establishing reinforcement learning agents with optimization goals based on multi-objective fitness functions;
[0035] S42: Generate a population of 200 individuals based on the initialization in the component gene library, each individual corresponds to a combination of component gene sequences in the component gene library, and create an external archive set;
[0036] S43: Based on the initialized population, genetic operators are used to perform 1000 generations of iterative evolution. Apache Spark is used to evaluate the fitness of individuals in each generation, and 10% of the best elite individuals are retained according to Pareto rank and crowding degree.
[0037] S44: 180 parents are selected through a tournament, and offspring are generated by simulating binary crossover with an 80% probability and polynomial mutation with a 5% probability. Non-dominated solutions are incorporated into an external archive set and the diversity of the solution set is maintained. Simultaneously, the reinforcement learning agent learns a local optimization strategy for component combinations based on historical iterative data, guiding the genetic operator to adjust the crossover and mutation preference parameters, and performing local optimization on candidate solutions in the external archive set.
[0038] S45: After 1000 generations of evolution, the Pareto optimal solution set accumulated in the external archive will be used as a candidate solution. Combined with the strategy learned by the reinforcement learning agent, the preset component selection strategy will be optimized to select the optimal component combination from the candidate solutions.
[0039] Furthermore, the processing steps of S5 are as follows:
[0040] S51: Distribute the optimal component combination and initial component evaluation system to multiple city governance departments through the federated learning framework. After receiving the optimal component combination, each city governance department selects the corresponding component from the local component library based on the optimal component combination for deployment and application, and collects component output data and real feedback data during the application process.
[0041] S52: Based on the initial component evaluation system, each city governance department uses component output data and real feedback data to train the component evaluation model locally. After training, the local component evaluation model parameters are differentially privately processed and the privacy-sensitive evaluation model parameters are output.
[0042] S53: Aggregate the privacy assessment model parameters of various urban governance departments to build a global unified component quality assessment standard.
[0043] Furthermore, the processing steps of S6 are as follows:
[0044] S61: Online collection of application operation data based on the optimal component combination of each city governance department; wherein the application operation data includes component operation data of the optimal component combination of the system application, user behavior data, and governance effect data;
[0045] S62: Evaluate the effectiveness of component usage on application operation data using component quality assessment standards. Update component fitness assessment parameters based on the results. At the same time, use concept drift detection to capture changes in the urban governance environment and dynamically adjust genetic algorithm parameters.
[0046] S63: Establish a real-time feedback mechanism between component usage effects and the digital twin model, and update the mapping relationship map in the digital twin model based on the component usage effect evaluation results.
[0047] In a second aspect, the present invention provides an AI-based intelligent generation system for urban governance application systems, which is implemented using the AI-based intelligent generation method for urban governance application systems of the first aspect. The system includes:
[0048] The gene coding module is used to convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through gene coding, and to construct front-end and back-end collaborative genes to form a component gene library;
[0049] Genetic operation module, which uses genetic operation operators to perform a global search for the optimal component combination in the component gene library and output the candidate solutions required for urban governance scenarios;
[0050] The fitness evaluation module is used to use reinforcement learning agents to perform local search optimization and strategy optimization on candidate solutions required for urban governance scenarios, and output the optimal component combination;
[0051] The evolution control module is used to manage the population in the genetic algorithm, monitor the algorithm convergence, and adjust the genetic algorithm parameters;
[0052] The code generation module is used to decode the gene sequence according to the optimal component combination, generate executable code, and perform quality inspection on the generated code.
[0053] In summary, the beneficial effects of the present invention are as follows:
[0054] The present invention provides an AI-based intelligent generation method for an urban governance application system. The method abstracts the components of the urban governance application into gene sequences through gene coding technology, constructs a component gene library, and uses a multi-objective genetic algorithm to perform adaptive genetic operations. The method also uses reinforcement learning collaborative technology to construct a reinforcement learning agent to optimize the genetic operations. The method automatically searches and outputs the optimal component combination solution from the component gene library, thereby realizing the intelligent component selection of the urban governance application system and improving the component selection search efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work, and these are all within the scope of protection of the present invention.
[0056] Figure 1 This is a flow chart of an AI-based urban governance application system intelligent generation method of the present invention;
[0057] Figure 2 A diagram of the distributed network architecture for applying the intelligent generation method of the urban governance application system of the present invention;
[0058] Figure 3 This is a diagram of the overall architecture of component evolution optimization for the intelligent generation method of the urban governance application system of the present invention;
[0059] Figure 4 This is a diagram of the gene coding structure of the present invention;
[0060] Figure 5 A flowchart of the component gene coding and genetic manipulation of the present invention;
[0061] Figure 6 Schematic diagram of Pareto frontier search of the multi-objective genetic algorithm of the present invention;
[0062] Figure 7 This is a flowchart of the collaborative optimization of reinforcement learning and genetic algorithm of the present invention;
[0063] Figure 8 This is a functional module diagram of the intelligent generation system of the AI-based urban governance application system of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. If there is no conflict, the various features of the present invention and the embodiments can be combined with each other and are all within the scope of protection of the present invention.
[0065] This paper proposes a method for intelligently generating urban governance applications based on a four-pronged architecture: digital twins, knowledge graphs, genetic algorithms, and reinforcement learning. This method incorporates a component evolutionary optimization mechanism based on a genetic algorithm to achieve intelligent combination and continuous evolutionary optimization of front-end and back-end functional components. The detailed implementation of this invention is described in the following examples.
[0066] Example 1: Reference Figure 1 As shown, Figure 1 This is a flow chart of the intelligent generation method of the AI-based urban governance application system of the present invention. Figure 1 As shown, the present invention provides an AI-based intelligent generation method for an urban governance application system, comprising:
[0067] S1: Obtain multi-source data on urban governance, extract spatiotemporal features from the data, and build a digital twin model based on the spatiotemporal features;
[0068] S2: Convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through genetic coding, and construct front-end and back-end collaborative genes to form a component gene library;
[0069] S3: Input the urban governance scenario into the digital twin model to generate component requirements. Based on the component requirements, a multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operators.
[0070] S4: Establish a reinforcement learning agent based on the optimization goal of the multi-objective fitness function. According to the preset component selection strategy, use genetic operators to globally search for the optimal component combination in the component gene library. At the same time, use the reinforcement learning agent to collaboratively perform local search optimization and strategy optimization to output the optimal component combination.
[0071] S5: Distribute the optimal component combination to multiple city governance departments through the federated learning framework for component evaluation model training. Aggregate the component evaluation model parameters of each city governance department through federated learning to establish component quality evaluation standards.
[0072] S6: Collect application operation data based on the optimal component combination from various urban governance departments online, evaluate the component usage effect of the application operation data through component quality assessment standards, and update the component gene library and digital twin model based on the component usage effect evaluation results.
[0073] In this embodiment, the processing steps of S1 are as follows:
[0074] S11: Collect multi-source heterogeneous data related to urban governance through IoT sensors, social media, and government data systems.
[0075] S12: A spatiotemporal graph convolutional network (ST-GCN) is used to extract spatiotemporal features from multi-source heterogeneous data, and the weights of different data sources are fused through the attention mechanism to obtain fused spatiotemporal features.
[0076] S13: Use the CityGML standard for spatial modeling, and build a digital twin model that includes time dimension, space dimension and social dimension based on the integration of spatiotemporal features. At the same time, combine geographic data and business data of government departments, and use the digital twin model to establish a mapping relationship map of real-world scenarios-governance needs-component needs.
[0077] In this embodiment, S2 is mainly used to establish a genetic algorithm gene representation system for the urban governance application component. The specific processing steps of step S2 are as follows:
[0078] S21: Perform static analysis on the front-end UI components and back-end API components in the component library, extract component features, and construct component feature vectors. Component features include functional characteristics, performance parameters, dependencies, and other information.
[0079] S22: Map the component feature vector to the gene space through principal component analysis and dimensionality reduction to obtain the gene fragments corresponding to the front-end UI component and the back-end API component, and use a multi-level gene coding structure to perform front-end component gene encoding on the gene fragments of the front-end UI component to obtain the front-end component gene sequence. At the same time, use a hierarchical gene coding structure to perform back-end interface gene encoding on the gene fragments of the back-end API component to obtain the back-end component gene sequence.
[0080] The multi-level gene encoding structure includes layout genes, interaction genes, and style genes. Layout genes use binary encoding to represent the spatial positional relationships of components, interaction genes use integer encoding to represent event processing logic, and style genes use real numbers to represent visual attribute parameters. Each front-end page is represented as a chromosome, containing multiple component gene segments.
[0081] The hierarchical gene coding structure includes Data Access Gene, Business Logic Gene, and Security Control Gene. The Data Access Gene encodes database operation types and parameters, the Business Logic Gene encodes processing procedures and algorithm selection, and the Security Control Gene encodes permission verification and data encryption methods.
[0082] S23: Construct a cross-layer collaborative gene (Cross-Layer Gene), use the cross-layer collaborative gene as the front-end and back-end collaborative gene, and encode the binding relationship, data transmission format and exception handling mechanism of the front-end component and the back-end interface through the cross-layer collaborative gene.
[0083] S24: Constructing a component gene library based on the front-end component gene sequence, the back-end component gene sequence and the cross-layer collaborative gene, and establishing a genotype-phenotype mapping function; the genotype-phenotype mapping function is used to convert the gene operation results into executable code components.
[0084] In this embodiment, step S3 primarily implements intelligent component combination optimization based on a multi-objective genetic algorithm. By using an improved NSGA-III (Non-dominated Sorting Genetic Algorithm III) multi-objective genetic algorithm, a specialized fitness function and genetic operators are designed to perform multi-objective fitness evaluation and genetic evolution for the specific needs of urban governance applications. The processing steps of step S3 are as follows:
[0085] S31: Input the urban governance scenario into the digital twin model, and generate the component requirements corresponding to the urban governance scenario through the mapping relationship map.
[0086] S32: Based on component requirements, the NSGA-III multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operator for urban governance applications.
[0087] The multi-objective fitness function includes functional integrity, performance efficiency, user experience, security compliance, and maintainability. Genetic operators include intelligent crossover, adaptive mutation, and repair.
[0088] Specifically, the design process of the multi-objective fitness function is as follows:
[0089] Set the objective function F1, specifically the functional integrity objective function, and its calculation formula is expressed as:
[0090] F1 = Σ(requirement coverage × weight) + functional redundancy penalty.
[0091] The calculation process of demand coverage is: demand coverage = realized function points / total required function points. The function point identification method adopts the International Function Point Analysis (IFPGA) standard to decompose urban governance needs into:
[0092] External input (EI), including data entry, form submission, file upload, etc., weight coefficient = 3;
[0093] External output (EO), including report generation, data export, notification push, etc., weight coefficient = 4;
[0094] External query (EQ), including information retrieval, status query, statistical analysis, etc., weight coefficient = 3;
[0095] Internal logical files (ILF), including business data storage, configuration management, etc., weight coefficient = 7;
[0096] External Interface File (EIF), including third-party system integration, data synchronization, etc., weight coefficient = 5.
[0097] Coverage calculation formula: Coverage = Σ(implemented function point type i × corresponding weight coefficient) / Σ(all required function point types i × corresponding weight coefficient).
[0098] The weight design follows the principle of being based on the priorities and scope of influence of urban governance business, specifically:
[0099] Core business function weight: 0.4 (such as emergency response and security monitoring);
[0100] Weight of routine management functions: 0.3 (such as daily approval and information query);
[0101] Weight of auxiliary support functions: 0.2 (such as statistical analysis and report generation);
[0102] Weight of extended value-added functions: 0.1 (such as intelligent recommendations and personalized settings).
[0103] Dynamic weight adjustment mechanism: Weight (t) = basic weight × (1 + usage frequency adjustment factor + business importance adjustment factor), where usage frequency adjustment factor = (actual number of uses - average number of uses) / average number of uses × 0.2, and business importance adjustment factor = leadership attention score / 10 × 0.1.
[0104] The purpose of the functional redundancy penalty term is to avoid functional duplication in component combinations and reduce system complexity. Its calculation formula is:
[0105] Redundancy penalty = -λ×Σ(redundant functional similarity²×number of redundant components).
[0106] Parameter description: λ: penalty intensity coefficient, value range [0.1, 0.5], default value 0.3;
[0107] Similarity calculation: Cosine similarity is used to calculate the similarity of function vectors. Similarity = cos(θ) = (A・B) / (|A| × |B|), where A and B are the function feature vectors of the two components.
[0108] Redundancy threshold: Similarity > 0.8 is considered functional redundancy;
[0109] Penalty mechanism: For each additional redundant component, the penalty value increases quadratically.
[0110] Set the objective function F2, specifically the performance efficiency objective function, and its calculation formula is expressed as:
[0111] F2 = α × response time + β × resource consumption + γ × concurrent processing capability.
[0112] The response time is measured using the weighted average response time, which is calculated as follows: response time = Σ(average response time of operation type i × operation frequency weight).
[0113] Operation classification and target response time: Query operation: target <100ms, weight 0.4;
[0114] Data entry: target < 200ms, weight 0.3;
[0115] Report generation: target < 2s, weight 0.2;
[0116] File upload: target < 5s, weight 0.1.
[0117] Performance scoring function: Response time score = 100 × e^(-(actual response time / target response time-1)).
[0118] Determination of the α coefficient: the basic value is 0.4; for systems with high real-time requirements (such as emergency command), α=0.6; for systems that mainly process batches (such as data analysis), α=0.2.
[0119] The resource consumption evaluation indicator is: Resource consumption = w1 × CPU usage + w2 × memory usage + w3 × disk I / O + w4 × network bandwidth.
[0120] Weight distribution: (1) CPU usage weight w1 = 0.3; (2) Memory usage weight w2 = 0.3; (3) Disk I / O weight w3 = 0.2; (4) Network bandwidth weight w4 = 0.2.
[0121] The resource scoring criteria are as follows:
[0122] Excellent (90-100 points): CPU <50%, memory <60%, disk I / O <70%, network <40%;
[0123] Good (70-89 points): CPU <70%, memory <75%, disk I / O <85%, network <60%;
[0124] Average (50-69 points): CPU <85%, memory <85%, disk I / O <95%, network <80%;
[0125] Poor (<50 points): Any resource exceeds the above threshold.
[0126] β coefficient settings: resource-constrained environment β=0.5; standard deployment environment β=0.3; high-configuration environment β=0.1.
[0127] The measurement formula for concurrent processing capability is: Concurrency capability score = min(100, (actual concurrent number / target concurrent number) × 100).
[0128] Target concurrent users: District / county system: 1,000 concurrent users; city system: 5,000 concurrent users; provincial system: 20,000 concurrent users.
[0129] Concurrency testing method: Use JMeter for stress testing; the test scenario is 80% query, 15% data entry, and 5% report generation; the test lasts 30 minutes; the success criteria are response time < 2 times the baseline value and error rate < 1%.
[0130] γ coefficient adjustment: γ=0.4 for high concurrency demand system; γ=0.3 for medium concurrency demand system; γ=0.1 for low concurrency demand system.
[0131] Set the objective function F3, specifically the user experience objective function, and its calculation formula is expressed as:
[0132] F3 = interface consistency score + interaction fluency score + accessibility score.
[0133] Among them, the interface consistency score is evaluated from three dimensions: visual consistency (weight 40%), layout consistency (weight 30%), and interaction consistency (weight 30%).
[0134] Visual consistency includes color standard compliance (consistency in the use of primary, secondary, and accent colors), font standard compliance (consistency in font family, font size, and line height), and icon style consistency (consistency in design style and size specifications).
[0135] Layout consistency includes standardization of grid system usage (adherence to the 12-grid / 24-grid system), uniformity of page structure (consistent layout of navigation, content area, and sidebar), and standardization of component spacing (standardization of margins and padding).
[0136] Interaction consistency includes uniformity of operation feedback (button status, loading effect, prompt method), consistency of navigation mode (breadcrumbs, menu structure, page jump), and uniformity of form validation (error prompts, required field indicators, input format).
[0137] Calculation formula: Interface consistency score = Σ(number of components that meet the specifications / total number of components × corresponding dimension weight) × 100.
[0138] The evaluation indicators and weights of the interaction fluency score are:
[0139] Page loading speed (weight 25%), first screen rendering time < 1.5s is full score, 1.5s-3s is proportionally deducted, and 3s is 0 points;
[0140] Animation smoothness (weight 20%): Full marks for frame rate ≥ 60fps, points will be awarded proportionally for 30-60fps, and points will be severely deducted for < 30fps.
[0141] Operation response timeliness (weight 25%): click feedback <100ms is full score, 100-300ms is slightly deducted, and 300ms is significantly deducted;
[0142] Page switching smoothness (weight 15%): no lag or white screen is a full score, occasional lag is deducted, and frequent lag is deducted significantly;
[0143] Error handling friendliness (weight 15%): clear and instructive error prompts will be given full marks, unclear prompts will be deducted, and no error prompts or misleading users will be given 0 points.
[0144] Comprehensive scoring formula: Interaction fluency score = Σ(score of each indicator × corresponding weight).
[0145] Accessibility scores are based on the Web Content Accessibility Guidelines (WCAG 2.1) Level AA. The evaluation items and weights are:
[0146] Perceptibility (weighted 30%), including image Alt text coverage ≥ 95%, color contrast ≥ 4.5:1 (normal text) and ≥ 3:1 (large text), and video subtitle support ≥ 90%;
[0147] Operability (weighting 25%), including full keyboard operability (all functions can be accessed via the keyboard), focus management (the tab key order is reasonable and the focus is visible), and no epileptic content (flicker frequency <3Hz);
[0148] Understandability (weighted 25%), including page language identification (correctly setting the lang attribute), form label association (correctly associating labels with inputs), and error identification (clearly identifying form errors);
[0149] Compatibility (weighting 20%), including a screen reader compatibility test pass rate of ≥ 90%, multi-browser compatibility (Chrome, Firefox, Safari, Edge), and responsive design (support for mobile device access).
[0150] Scoring criteria: Full compliance with WCAG 2.1AA is 100 points; compliance with 80%-99% is 80-99 points; compliance with 60%-79% is 60-79 points; compliance rate <60% is scored proportionally, with a minimum of 10 points.
[0151] Set the objective function F4, specifically the safety compliance objective function, and its calculation formula is expressed as:
[0152] F4 = security vulnerability detection score + compliance check score + data protection level.
[0153] Among them, the security vulnerability detection score combines static code analysis and dynamic security testing, and the vulnerability classification and weight are:
[0154] High-risk vulnerabilities (weighted 50%), including SQL injection, XSS cross-site scripting, etc., will result in a 20-point deduction for each vulnerability found, with a maximum deduction of 100 points;
[0155] Medium-risk vulnerabilities (weighted 30%), including information leakage and weak encryption algorithms, will result in a 10-point deduction for each vulnerability found, with a maximum deduction of 100 points.
[0156] Low-risk vulnerabilities (weight 20%), including version information leakage, cache control loss, etc., will result in a 5-point deduction for each vulnerability found, with a maximum deduction of 100 points.
[0157] Detection tool chain: Static analysis includes SonarQube, Checkmarx, and Veracode; dynamic scanning includes OWASPZAP, Nessus, and AppScan; dependency checking includes Snyk and OWASPDependencyCheck.
[0158] Scoring formula: Vulnerability detection score = 100 - (number of high-risk vulnerabilities × 20 + number of medium-risk vulnerabilities × 10 + number of low-risk vulnerabilities × 5). The minimum score is 0.
[0159] The applicable standards and weights for the compliance check score are:
[0160] Level Protection 2.0 (weight 40%): The three-level system has 75 basic requirements and 73 extended requirements, of which technical requirements account for 65% and management requirements account for 35%;
[0161] Data security law (weighting 30%), involving data classification and grading (core data, important data, general data) and data lifecycle management;
[0162] Personal Information Protection Law (weighting 20%), including the principles of personal information processing and the protection of personal information rights and interests;
[0163] The Cybersecurity Law (weight 10%) involves the cybersecurity level protection system and the protection of critical information infrastructure.
[0164] Scoring criteria: Compliance score = Σ(inspection items that meet the requirements / total inspection items × corresponding standard weight) × 100.
[0165] Data protection levels are divided into general data protection (60-69 points), important data protection (70-84 points), and core data protection (85-100 points).
[0166] General data protection requires basic encryption (AES-128), access control (role-based RBAC), and logging (critical operation logs);
[0167] Important data protection requires strong encryption (AES-256), fine-grained permissions (attribute-based ABAC), full auditing, and data desensitization;
[0168] Core data protection requires national encryption algorithms (SM2, SM3, SM4), zero-trust architecture, integrity protection, etc.
[0169] Score calculation: Data protection score = basic score 60 + security measures implementation degree × 40, where security measures implementation degree = number of implemented security measures / number of measures required for this level.
[0170] Set the objective function F5, specifically the maintainability objective function, and its calculation formula is expressed as:
[0171] F5=inverse of code complexity + inverse of module coupling + test coverage.
[0172] Among them, the inverse of code complexity is measured by cyclomatic complexity (Cyclomatic Complexity), and the calculation formula is cyclomatic complexity V(G)=E-N+2P (E=number of edges, N=number of nodes, P=number of connected components). The simplified calculation is cyclomatic complexity=number of decision nodes+1 (decision nodes include if, while, etc.).
[0173] Complexity levels: simple (1-10), medium (11-20), complex (21-50), extremely complex (>50).
[0174] Reciprocal calculation: code complexity score = 100 / (1+average cyclomatic complexity / 10).
[0175] In the inverse of module coupling, the coupling type and weight are:
[0176] Data coupling (the loosest, weight 1.2), data is passed between modules only through parameters;
[0177] Tag coupling (weight 1.5), passing data structures but using only some fields;
[0178] Control coupling (weight 1.8), where one module controls the execution flow of another module;
[0179] Public coupling (weight 2.5), multiple modules access the same global data;
[0180] Content coupling (tightest, weight 3.0), directly accessing the internal data of another module.
[0181] Coupling degree calculation: module coupling degree = Σ(number of coupling relationships × corresponding weight) / total number of modules.
[0182] Reciprocal score: module coupling score = 100 / (1+average coupling).
[0183] Test coverage includes statement coverage (weight 25%, target ≥80%), branch coverage (weight 35%, target ≥70%), function coverage (weight 20%, target ≥90%), and condition coverage (weight 20%, target ≥60%).
[0184] Comprehensive coverage: Test coverage score = Σ(coverage of each type × corresponding weight).
[0185] Quality grade: excellent (90-100 points), good (80-89 points), average (70-79 points), poor (<70 points).
[0186] This embodiment also sets a multi-objective function weight distribution strategy, whose default weight configuration is: F1 functional integrity: 30%; F2 performance efficiency: 25%; F3 user experience: 20%; F4 security compliance: 15%; F5 maintainability: 10%.
[0187] The multi-objective function weight allocation strategy can be adjusted according to the governance scenario. The specific scenario-based weight adjustment is as follows: Emergency Management System: F1 (35%), F2 (30%), F4 (20%), F3 (10%), F5 (5%);
[0188] Public service system: F3 (35%), F1 (25%), F2 (20%), F4 (15%), F5 (5%);
[0189] Data analysis system: F2 (35%), F5 (25%), F1 (20%), F4 (15%), F3 (5%);
[0190] Government service system: F4 (30%), F1 (25%), F3 (25%), F2 (15%), F5 (5%).
[0191] In this embodiment, the designed genetic operation operators are as follows:
[0192] (1) Intelligent crossover operator: Design a crossover operation based on semantic similarity to ensure that the component combination after crossover is semantically reasonable. Use the graph edit distance algorithm to calculate the similarity between components and prioritize gene exchange between similar components.
[0193] (2) Adaptive mutation operator: Dynamically adjusts the mutation probability based on the current population diversity. When the population diversity is below the threshold, the mutation intensity is increased to explore new solution spaces; when the population converges, the mutation intensity is reduced for fine-tuning optimization.
[0194] (3) Repair operator guided by domain knowledge: When the genetic operation produces an infeasible solution, the urban governance domain knowledge is used for intelligent repair to ensure that the generated component combination complies with the government application specifications.
[0195] In this embodiment, based on the genetic algorithm, a reinforcement learning mechanism is introduced to further optimize the component selection strategy. A reinforcement learning agent based on the actor-critic architecture is designed. The agent specifically includes:
[0196] State space: currently selected component set, remaining requirements list, system resource status
[0197] Action space: select the next component from the candidate component library, adjust component parameters, and terminate the combination process
[0198] Reward function: Based on the weighted combination of multi-objective fitness functions, dynamically adjust the weight of each objective
[0199] Policy Network: Using Graph Neural Network (GNN) to handle complex dependencies between components
[0200] The reinforcement learning agent works in conjunction with the genetic algorithm: the genetic algorithm is responsible for global search for the optimal component combination, while the reinforcement learning agent is responsible for local optimization and strategy adjustment. The processing steps of step S4 in this embodiment are as follows:
[0201] S41: Establishing reinforcement learning agents with optimization goals based on multi-objective fitness functions;
[0202] S42: Generate a population of 200 individuals based on the initialization in the component gene library, each individual corresponds to a combination of component gene sequences in the component gene library, and create an external archive set;
[0203] S43: Based on the initialized population, genetic operators are used to perform 1000 generations of iterative evolution. Apache Spark is used to evaluate the fitness of individuals in each generation, and 10% of the best elite individuals are retained according to Pareto rank and crowding degree.
[0204] S44: 180 parents are selected through a tournament, and offspring are generated by simulating binary crossover with an 80% probability and polynomial mutation with a 5% probability. Non-dominated solutions are incorporated into an external archive set and the diversity of the solution set is maintained. Simultaneously, the reinforcement learning agent learns a local optimization strategy for component combinations based on historical iterative data, guiding the genetic operator to adjust the crossover and mutation preference parameters, and performing local optimization on candidate solutions in the external archive set.
[0205] S45: After 1000 generations of evolution, the Pareto optimal solution set accumulated in the external archive will be used as a candidate solution. Combined with the strategy learned by the reinforcement learning agent, the preset component selection strategy will be optimized to select the optimal component combination from the candidate solutions.
[0206] Specifically, in the urban governance application component optimization scenario, the technical implementation process of the multi-objective genetic algorithm and reinforcement learning collaboration in this embodiment is as follows:
[0207] First, a population of 200 individuals (each representing a component combination) and an empty external archive were initialized, followed by 1000 generations of iterative evolution. Within each generation, the Apache Spark distributed computing framework was used to partition the population across multiple nodes, where individuals were evaluated in parallel for multiple objectives, including efficiency, fairness, and cost. The top 10% (20) of the best individuals were then ranked by Pareto dominance and crowding, with the top 10% (elite) selected to advance directly to the next generation, ensuring that high-quality solutions were not lost. Next, 180 parents were selected from the elite population through tournament selection. Simulated binary crossover was performed with an 80% probability (adhering to component functional dependencies and spatial constraints) to generate offspring individuals. Polynomial mutation was then performed on these offspring with a 5% probability, with mutations preferentially occurring in high-priority regions or gene segments associated with performance bottlenecks. After the genetic operation, the non-dominated solutions in the current population were added to the external archive, and the diversity of the solution set was maintained using crowding. During this process, a reinforcement learning agent simultaneously intervenes: First, it learns local optimization strategies for component combinations based on historical iterative data (e.g., identifying high-frequency, effective gene fragments), guiding genetic operators to adjust crossover and mutation preference parameters. Second, it conducts a localized refinement search on the candidate solution sets found by the genetic algorithm (e.g., fine-tuning the parameter configuration of specific components). After 1,000 generations of evolution, the Pareto-optimal solution set accumulated in an external archive is used as a candidate. Combined with the strategies learned by the reinforcement learning agent, the optimal component combination that meets the multi-objective requirements of urban governance is ultimately output.
[0208] In this embodiment, step S5 mainly implements cross-departmental component knowledge sharing based on federated learning. The processing steps of S5 are as follows:
[0209] S51: Distribute the optimal component combination and initial component evaluation system to multiple city governance departments through the federated learning framework. After receiving the optimal component combination, each city governance department selects the corresponding components from the local component library for deployment and application based on the optimal component combination. The department also collects component output data and real-world feedback data during the application process. Establish an initial component evaluation system that includes dimensions such as functional compatibility, performance, and user satisfaction.
[0210] S52: Based on the initial component evaluation system, each city governance department uses component output data and real feedback data to train the component evaluation model locally. After the training is completed, the local component evaluation model parameters are differentially privacy processed and the privacy-sensitive evaluation model parameters are output.
[0211] S53: Aggregate the privacy assessment model parameters of various urban governance departments to build a global unified component quality assessment standard.
[0212] This implementation, addressing government data security requirements, utilizes a federated learning framework to enable cross-departmental sharing of component usage experience. Each department trains a component evaluation model locally, learning how components perform in specific governance scenarios. Federated learning then aggregates the city's component knowledge base. During the model parameter aggregation process, differential privacy technology is used to protect sensitive information across departments. The privacy-focused evaluation model parameters from each department are aggregated to form a unified citywide component quality assessment standard.
[0213] In this embodiment, step S6 is based on component evolution optimization based on digital twin feedback. The processing steps of S6 are as follows:
[0214] S61: Online collection of application operation data based on the optimal component combination of each city governance department; wherein the application operation data includes component operation data of the optimal component combination of the system application, user behavior data, and governance effect data;
[0215] S62: Evaluate the effectiveness of component usage on application operation data using component quality assessment standards. Update component fitness assessment parameters based on the results. At the same time, use concept drift detection to capture changes in the urban governance environment and dynamically adjust genetic algorithm parameters.
[0216] S63: Establish a real-time feedback mechanism between component usage effects and the digital twin model, and update the mapping relationship map in the digital twin model based on the component usage effect evaluation results.
[0217] In this embodiment, when various departments apply components in the actual governance scenarios mapped by the digital twin model, they collect component operation data (such as response speed and accuracy), user operation behavior (such as correction frequency and function call preference) and governance result data (such as problem resolution rate and changes in citizen complaints) in real time. Based on the four-dimensional standards of "functional matching (adaptation to the core requirements of the scenario), performance (stability under high concurrency and scenario mutations), governance effectiveness (problem resolution rate and cost optimization), and dynamic adaptability (speed of adaptation to environmental changes)" (based on the global component quality evaluation standards, with the addition of governance effectiveness and dynamic adaptability dimensions), the use effect is evaluated and the component fitness parameters are updated synchronously. The online evolutionary algorithm incorporates the gene characteristics of components with excellent performance into the gene library based on the fitness parameters, and captures changes in the governance environment through concept drift detection, dynamically adjusts the genetic algorithm parameters, and allows the component library to continue to evolve under the real-time verification of the digital twin and always adapt to the dynamic needs of urban governance.
[0218] Specifically, in response to the five core issues of the prior art, the embodiments of the present invention achieve the following technical breakthroughs by introducing a genetic algorithm:
[0219] 1. Intelligent Optimal Component Combination: Using a multi-objective genetic algorithm, the system automatically searches for the optimal combination within a massive component library. Compared to traditional expert experience-based selection, the quality of the combination is improved by 48%, and search time is reduced from days to hours. The genetic algorithm can handle a 10^12-level combination space, with an 87.3% probability of finding the global optimal solution.
[0220] 2. Establishing a multi-objective optimization architecture generation mechanism: An innovative five-dimensional optimization system finds Pareto optimal solutions among conflicting objectives, including functionality, performance, user experience, security, and maintenance. Multi-objective optimization results are 65% better than single-objective optimization, and the resulting application achieves an overall quality score of 92.5 out of 100.
[0221] 3. Build component adaptability optimization based on evolutionary learning: Through genetic algorithm selection, crossover, and mutation operations, component combination solutions can continuously evolve and improve. After six months of system operation, the component combination quality improved by an average of 35%, the ability to adapt to new scenarios increased by 60%, and the ability to handle exceptions increased by 70%.
[0222] 4. Achieve cross-layer collaborative optimization: Innovative cross-layer collaborative genetic design enables intelligent matching of front-end UI components and back-end API interfaces. The front-end and back-end matching accuracy rate reaches 96.8%, interface call efficiency is improved by 42%, and data transmission error rate is reduced by 85%.
[0223] Component innovation capabilities tailored to governance scenarios: Through genetic algorithm mutation and recombination operations, the system automatically generates new component combination patterns. An average of 15 new effective combination patterns are discovered each month, 60% of which are recognized as best practices and promoted for adoption.
[0224] The method of this embodiment has the following technical advantages:
[0225] 1. It realizes the intelligent optimal combination of components and solves the NP-hard problem of component selection. Compared with traditional methods, the quality of combination solutions is improved by 48% and the search time is greatly shortened.
[0226] 2. Through a multi-level gene coding system and cross-layer collaborative genes, unified optimization of front-end and back-end components is achieved, with the front-end and back-end matching accuracy reaching 96.8% and the interface call efficiency increased by 42%.
[0227] 3. Through a multi-objective optimization mechanism, we find the optimal balance between multiple goals such as functional completeness and performance efficiency, and the overall quality score of the generated application reaches 92.5 points.
[0228] 4. Federated learning and feedback evolution mechanisms enable cross-departmental knowledge sharing and continuous system evolution, increasing the ability to adapt to new scenarios by 50% and continuously improving component quality.
[0229] Example 2:
[0230] Reference Figure 2 As shown, the distributed network architecture formed by applying the method of Example 1 above to the urban governance application scenario includes the following structure:
[0231] Cloud layer: Deployment of a genetic algorithm computing cluster, component gene library, federated learning center nodes, and a knowledge graph inference engine. The genetic algorithm computing cluster is managed using Kubernetes and includes population management nodes, fitness calculation nodes, and genetic operation nodes. Efficient communication between nodes is achieved through the Apache Kafka message queue.
[0232] Edge layer: Edge evolution nodes are deployed across government departments, including local component libraries, local optimization algorithms, and real-time feedback collection modules. Edge nodes synchronize with cloud clusters via 5G networks, enabling rapid local response and collaborative cloud-based global optimization.
[0233] Terminal layer: This layer includes application operation monitoring agents, user behavior collectors, and performance data collectors. It collects component usage data in real time to provide evolutionary feedback for the genetic algorithm.
[0234] Evolutionary Computation Network Layer: This layer uses a P2P network architecture to connect multiple evolutionary computing nodes, supporting large-scale parallel evolutionary computation. Blockchain technology is used to record the evolutionary history of components, ensuring the traceability and fairness of the evolutionary process.
[0235] Specifically, the overall architecture of component evolution optimization based on the above distributed network architecture is as follows: Figure 3 As shown, Figure 3 The four-layer architecture is demonstrated: the digital twin layer, the genetic algorithm computing layer, the component gene library, and the application generation layer. The digital twin layer provides governance scenario modeling, the genetic algorithm computing layer is responsible for component combination optimization, the component gene library stores excellent genes during the evolution process, and the application generation layer outputs the final governance application.
[0236] In this embodiment, refer to Figure 4 As shown in the gene coding structure, the front-end component gene coding includes a layout gene segment (8 bits), an interaction gene segment (6 bits), a style gene segment (12 bits), a data binding segment (8 bits), and a control gene segment (4 bits).
[0237] The back-end interface gene code includes API gene segment (10 bits), business logic segment (16 bits), data access segment (12 bits), security control segment (8 bits) and performance optimization segment (6 bits).
[0238] Reference Figure 5 The component gene encoding and genetic operation flow chart shown in the figure illustrates the gene encoding method of front-end components, back-end interfaces, and cross-layer collaboration, as well as the specific implementation process of genetic operations such as crossover, mutation, and selection. The specific component gene encoding and genetic operation process is as follows:
[0239] 1. Intelligent crossover operation: Determine the intersection point through semantic similarity analysis, and perform a crossover operation on the parent individuals to generate the child individuals. For example: Parent individual A: [11010011][011110][11001011]
[1011] ; Parent individual B: [10110111][100101][10110101]
[1001] . Determine the intersection point of individuals A and B through semantic similarity analysis, and generate the child individual A' as: [11011110][1011110][11001011]
[1011] .
[0240] 2. Adaptive mutation operation: Detect population diversity. If it is below the threshold, adjust the mutation intensity (increase the mutation rate) and perform the mutation operation.
[0241] Population diversity test: D = 0.3 (below the threshold of 0.5);
[0242] Mutation strength adjustment: Enhanced mutation (mutation rate 0.1 → 0.2)
[0243] The original gene is
[1101]
[0011] [101110...], and the mutated gene is:
[1101]
[0111] [101110...]
[0245] 3. Multi-objective fitness evaluation: This evaluates multiple objectives, including functional integrity, performance efficiency, user experience, security compliance, and maintainability, to produce a comprehensive fitness vector. Among them, F1 functional integrity = 0.85; F2 performance efficiency = 0.72; F3 user experience = 0.90; F4 security compliance = 0.78; F5 maintainability = 0.65; the comprehensive fitness vector is: [0.85, 0.72, 0.90, 0.78, 0.65].
[0246] 4. Elite retention selection strategy: Use the Pareto frontier solution to retain a certain proportion (20%), and the tournament selects the remaining proportion (80%) to generate a new generation of population and decide whether to continue evolution or terminate.
[0247] In this embodiment, refer to Figure 6 The Pareto frontier search process of the multi-objective genetic algorithm shown in Figure 1 and the Pareto frontier evolution process are as follows:
[0248] Generation 1: The initial population is relatively dispersed, and the algorithm begins to search for the optimal solution space;
[0249] Generation 10: The population begins to converge to the Pareto frontier, and the quality of the solution gradually improves;
[0250] Generation 25: Most solutions are close to the Pareto frontier, and the algorithm converges significantly;
[0251] Generation 50: The algorithm has basically converged, forming a clear Pareto frontier.
[0252] The convergence index specifically includes the excess volume index and the distribution index. The specific convergence process of the two indicators is as follows:
[0253] Hypervolume index: 0.34 → 0.67 → 0.82 → 0.91 → 0.95;
[0254] Distribution index: 0.78 → 0.85 → 0.91 → 0.95 → 0.98.
[0255] Based on the fitness vectors corresponding to the multi-objective fitness functions F1, F2, F3, F4, and F5, a decision support matrix can be established. Through the decision support matrix, the balance point between the optimization objectives corresponding to multiple fitness functions can be searched, and the quality of the component combination scheme can be evaluated. The specific evaluation process is shown in Table 1 below:
[0256] Table 1 Example of component combination scheme evaluation
[0257]
[0258] It can be seen that the multi-objective genetic algorithm of this embodiment seeks a balance between multiple objectives such as functional integrity, performance efficiency, user experience, security compliance, and maintainability.
[0259] In this embodiment, refer to Figure 7 The collaborative optimization process of reinforcement learning and genetic algorithm shown in the figure illustrates the collaborative workflow of reinforcement learning and genetic algorithm, achieving an effective combination of global search and local optimization. The specific collaborative process is as follows:
[0260] Phase 1: Initialize the collaborative environment
[0261] Initializing the collaborative environment involves both GA initialization and RL initialization. GA initialization involves randomly generating an initial population, setting evolutionary parameters, and setting the fitness function. RL initialization involves initializing the neural network, learning parameters, and constructing the state-action space.
[0262] Phase 2: Parallel execution and information exchange
[0263] (1) The GA execution cycle includes fitness evaluation, selection operations, crossover mutation, and population update. (2) The RL execution cycle includes state observation, action selection, environment interaction, and network update. (3) The collaborative mechanism includes: GA provides global optimal region guidance, RL provides local search strategy optimization, dynamic adjustment of collaborative weights, and real-time performance feedback mechanism.
[0264] Phase 3: Fusion decision and output, specifically including multi-objective weight fusion and optimal solution integrated output process.
[0265] Example 3: Reference Figure 8 As shown, this embodiment provides an AI-based intelligent generation system for urban governance application systems based on the method of Example 1, and the system includes:
[0266] The gene coding module is used to convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through gene coding, and to construct front-end and back-end collaborative genes to form a component gene library;
[0267] Genetic operation module, which uses genetic operation operators to perform a global search for the optimal component combination in the component gene library and output the candidate solutions required for urban governance scenarios;
[0268] The fitness evaluation module is used to use reinforcement learning agents to perform local search optimization and strategy optimization on candidate solutions required for urban governance scenarios, and output the optimal component combination;
[0269] The evolution control module is used to manage the population in the genetic algorithm, monitor the algorithm convergence, and adjust the genetic algorithm parameters;
[0270] The code generation module is used to decode the gene sequence according to the optimal component combination, generate executable code, and perform quality inspection on the generated code.
[0271] Specifically, the gene encoding module includes a component feature extractor, a gene mapper, and an encoding verifier. The component feature extractor is primarily used to perform static analysis on the front-end UI components and back-end API components in the component library, extracting various component features such as layout, interaction, and style features of front-end components, and data access, business logic, and security control features of back-end components, and constructing component feature vectors.
[0272] The gene mapper maps component feature vectors to gene space through principal component analysis and dimensionality reduction, obtaining gene fragments corresponding to front-end UI components and back-end API components. It then uses multi-level gene coding structure and hierarchical gene coding structure to encode the gene fragments of front-end and back-end components respectively to obtain corresponding gene sequences, and simultaneously constructs cross-layer collaborative genes to form a component gene library.
[0273] The coding verifier verifies the accuracy and validity of the genetic coding, checks whether the encoded genetic sequence can correctly reflect the characteristics of the component and the collaborative relationship between the front-end and back-end components, ensures the reliability of the genetic coding, and provides qualified genetic sequences for subsequent genetic operations.
[0274] The genetic operation module specifically includes crossover, mutation, selection, and repair operators. The crossover operator is used to perform a crossover operation on gene sequences in the component gene library, swapping and combining parts of two or more parent gene sequences to generate new offspring gene sequences, increasing gene diversity and expanding the search range to find more optimal component combinations.
[0275] The mutation operator is used to randomly change certain gene fragments in the gene sequence, introduce new gene information, prevent the genetic algorithm from falling into the local optimal solution, and increase the probability of finding the global optimal component combination.
[0276] The selection operator is used to select individuals with better adaptability from the population as parents based on the fitness value of the component combination, to participate in the genetic operations of the next generation, so that high-quality gene sequences can be retained and passed on, and promote the evolution of the population in a better direction.
[0277] The repair operator is used to repair and adjust the gene sequence generated by the genetic operation when it has defects or does not meet the constraints of the component combination, ensuring the validity and feasibility of the gene sequence and ensuring that the generated component combination can operate normally.
[0278] The fitness evaluation module includes a multi-objective calculator, a performance tester, and a security checker. The multi-objective calculator represents the construction of a multi-objective fitness function, which includes optimization objectives such as functional integrity, performance efficiency, user experience, security compliance, and maintainability. It calculates the fitness value of the component combination on these objectives and comprehensively evaluates the pros and cons of the component combination. The performance tester represents the testing of the performance of the component combination, including response speed, processing power, stability, etc., to obtain relevant performance data and provide an evaluation basis for the performance efficiency objectives in the multi-objective fitness function. The security checker represents the inspection of the security performance of the component combination, such as data encryption, access control, vulnerability protection, etc., to evaluate whether it meets security compliance requirements and provide support for the security compliance objectives in the multi-objective fitness function.
[0279] The evolution control module consists of a population manager, a convergence detector, and a parameter adjuster. The population manager is responsible for managing the genetic algorithm population, including initializing the population, determining the population size (e.g., 200 individuals), maintaining and updating the population, ensuring its diversity and vitality, and providing a sound population foundation for the genetic algorithm's operation. The convergence detector monitors the convergence of the genetic algorithm, determining whether it has converged to the optimal solution or is close to it. When the algorithm converges to a certain level, it promptly stops iterations to avoid unnecessary waste of computing resources. The parameter adjuster dynamically adjusts relevant genetic algorithm parameters (such as crossover probability and mutation probability) based on the algorithm's operation and convergence status. It also adjusts the genetic algorithm parameters based on changes in the urban governance environment captured by concept drift detection, enabling the algorithm to adapt to different situations and improving search efficiency and optimization results.
[0280] The code generation module includes a gene decoder, a code renderer, and a quality checker. Among them, the gene decoder is used to decode the gene sequence corresponding to the optimal component combination, convert the gene fragments in the gene space into actual front-end UI components and back-end API components, as well as the collaborative relationship between them, to provide specific component information for code generation. The code renderer is used to generate executable code based on the component information obtained by the gene decoder, and combine the front-end UI components and back-end API components according to a certain logic and structure to form a complete urban governance application system code. The quality checker is used to perform quality checks on the generated code, including the syntactic correctness, logical rationality, performance indicators, safety performance, etc. of the code, to ensure that the generated application system code can run normally, efficiently, and safely, and meet the requirements of urban governance applications.
[0281] In this embodiment, the automatic generation scenario of the intelligent traffic congestion management application is taken as an example to illustrate the working principle of the system of this embodiment. The specific working principle is as follows:
[0282] User input: Generating a comprehensive traffic congestion management system requires integrating functions such as traffic flow monitoring, signal light control, bus scheduling, and parking guidance, and supporting real-time monitoring, intelligent decision-making, and effect evaluation.
[0283] The genetic algorithm optimization process is:
[0284] (1) Gene coding stage:
[0285] Front-end component genes: map display component (latitude and longitude code: 110010), real-time monitoring panel (layout code: 101101), data chart component (chart type code: 001110)
[0286] Backend interface genes: Traffic data API (query algorithm code: 11001), signal control API (optimization algorithm code: 10110), scheduling algorithm API (path planning code: 01101)
[0287] Collaborative Gene: Data Binding Relationship (Front-end and Back-end Mapping Code: 1001101)
[0288] (2) The process of genetic evolution is:
[0289] Initial population: randomly generate 200 component combination schemes
[0290] Generations 1-100: Exploration phase, high mutation rate (0.3) to quickly search the solution space
[0291] Generations 101-500: Development phase, medium mutation rate (0.1) and fine optimization
[0292] Generations 501-1000: Convergence phase, low mutation rate (0.05) to find the optimal solution
[0293] (3) Multi-objective optimization results: Functional completeness: 95.2% (covering all core requirements); Performance efficiency: response time <150ms, supporting 100,000 concurrent connections; User experience: interface consistency 98%, interaction fluency 96%; Security compliance: passed the Information Security Level 3 certification, 0 security vulnerabilities; Maintainability: code complexity 7.2, test coverage 94%.
[0294] (4) The optimal component combination is:
[0295] Front-end: React + AntD map component + ECharts chart + WebSocket real-time communication;
[0296] Backend: Spring Boot + Redis cache + TensorFlow decision engine;
[0297] Database: MySQL main database + MongoDB log database + InfluxDB time series database.
[0298] (5) Application effects: Development time: shortened from 3 months to 1.5 days; Code quality: 40% higher than manual development; Governance effect: Traffic congestion time reduced by 30%, travel efficiency increased by 25%;
[0299] This embodiment forms a complete "perception-modeling-evolution-generation-feedback" technology closed loop, involving the following technologies:
[0300] Perception modeling technology: multimodal data collection, digital twin construction, and governance scenario understanding technology provide evolutionary goals and constraints for genetic algorithms.
[0301] Gene encoding technology: component feature abstraction, multi-level gene representation, and genotype-phenotype mapping technology to achieve bidirectional conversion from components to genes.
[0302] Evolutionary optimization technology: multi-objective genetic algorithm, adaptive genetic operation, and reinforcement learning collaborative technology to achieve intelligent optimization of component combinations.
[0303] Collaborative generation technology: front-end and back-end collaborative genes, cross-layer optimization, and federated learning sharing technology to achieve intelligent generation of full-stack applications.
[0304] Feedback evolution technology: real-time effect monitoring, online parameter adjustment, and component library update technology to achieve continuous evolution of the system.
[0305] This example, for the first time, introduces a genetic algorithm to optimize component combinations in urban governance applications, resolving the NP-hard problem of component selection. An innovative multi-layered genetic encoding system with front-end and back-end collaboration is designed, enabling unified optimization across the entire technology stack. A component evolution mechanism based on governance effectiveness feedback is proposed, achieving continuous improvement in application quality. Furthermore, this example establishes an application generation paradigm for multi-objective optimization, finding the optimal balance between multiple conflicting objectives.
[0306] This embodiment has the following technical effects:
[0307] (1) Multi-level genetic coding optimization: We designed a three-layer front-end genetic coding (layout-interaction-style) and a three-layer back-end genetic coding (data-logic-security), achieving refined representation of component features. The coding accuracy reached 95.7%, and the component availability after genetic manipulation reached 92.1%, a 30% improvement compared to single-layer coding.
[0308] (2) Adaptive genetic optimization: Dynamically adjust the crossover probability (0.6-0.9) and mutation probability (0.01-0.3) based on population diversity and convergence status. This adaptive mechanism increases the algorithm's convergence speed by 40%, improves the solution quality by 25%, and achieves a 94% success rate in avoiding premature convergence.
[0309] (3) Intelligent Repair Operator Optimization: Integrating urban governance domain knowledge, it automatically repairs infeasible solutions when genetic operations produce them. The repair success rate reaches 89.5%, and the functional integrity of repaired components is retained at 96%, significantly reducing the number of invalid evolution generations.
[0310] (4) Parallel Evolutionary Computation Optimization: Using an island model parallel genetic algorithm, the population is divided into 32 computing nodes for parallel processing. The parallel efficiency reaches 85.6%, computing time is reduced by 78%, and it can handle large-scale optimization problems containing 5,000 components.
[0311] (5) Reinforcement learning collaborative optimization: The strategy learned by the RL agent improves the accuracy of component selection by 23%. After working in conjunction with the genetic algorithm, the overall optimization effect is improved by 37% and the convergence stability is improved by 45%.
[0312] (6) Optimization of federated learning knowledge sharing: Cross-departmental component knowledge sharing has increased adaptability to new scenarios by 50% and component evaluation accuracy by 28%. The knowledge sharing success rate under differential privacy protection has reached 91.2%, meeting government data security requirements.
[0313] (7) Real-time feedback evolution optimization: The online evolution mechanism enables the component library to be updated 2-3 times a week, and the quality score of new components has increased by an average of 15%. The accuracy of concept drift detection has reached 88.7%, and the response time to environmental changes has been shortened to within 2 hours.
[0314] (8) Code generation quality assurance optimization: The code generated by genetic decoding has passed static analysis and inspection, with a code specification compliance rate of 99.1%, an automatic optimization success rate for performance bottlenecks of 87.3%, and a security vulnerability detection rate of 99.6%.
[0315] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An AI-based intelligent generation method for urban governance application systems, characterized by: include: S1: Obtain multi-source data on urban governance, extract spatiotemporal features from the data, and build a digital twin model based on the spatiotemporal features; S2: Convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through genetic coding, and construct front-end and back-end collaborative genes to form a component gene library; S3: Input the urban governance scenario into the digital twin model to generate component requirements. Based on the component requirements, a multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operators. S4: Establish a reinforcement learning agent based on the optimization goal of the multi-objective fitness function. According to the preset component selection strategy, use genetic operators to globally search for the optimal component combination in the component gene library. At the same time, use the reinforcement learning agent to collaboratively perform local search optimization and strategy optimization to output the optimal component combination. S5: Distribute the optimal component combination to multiple city governance departments through the federated learning framework for component evaluation model training. Aggregate the component evaluation model parameters of each city governance department through federated learning to establish component quality evaluation standards. S6: Collect application operation data based on the optimal component combination from various urban governance departments online, evaluate the component usage effect of the application operation data through component quality assessment standards, and update the component gene library and digital twin model based on the component usage effect evaluation results.
2. The AI-based intelligent generation method for urban governance application systems according to claim 1 is characterized in that: The processing steps of S1 are as follows: S11: Collect multi-source heterogeneous data related to urban governance through IoT sensors, social media, and government data systems; S12: Use spatiotemporal graph convolutional networks to extract spatiotemporal features from multi-source heterogeneous data, and fuse the weights of different data sources through an attention mechanism to obtain fused spatiotemporal features; S13: Use the CityGML standard for spatial modeling, and build a digital twin model that includes time dimension, space dimension and social dimension based on the integration of spatiotemporal features. At the same time, combine geographic data and business data of government departments, and use the digital twin model to establish a mapping relationship map of real-world scenarios-governance needs-component needs.
3. The AI-based intelligent generation method for urban governance application systems according to claim 1 is characterized in that: The processing steps of S2 are as follows: S21: Perform static analysis on the front-end UI components and back-end API components in the component library, extract component features and construct component feature vectors; S22: Map the component feature vectors to the gene space through principal component analysis and dimensionality reduction to obtain the gene fragments corresponding to the front-end UI component and the back-end API component. Then, use a multi-level gene coding structure to perform front-end component gene coding on the gene fragments of the front-end UI component to obtain the front-end component gene sequence. At the same time, use a hierarchical gene coding structure to perform back-end interface gene coding on the gene fragments of the back-end API component to obtain the back-end component gene sequence. The multi-level gene coding structure includes layout genes, interaction genes and style genes; the hierarchical gene coding structure includes data access genes, business logic genes and security control genes; S23: Construct cross-layer collaborative genes, and use them to encode the binding relationship between front-end components and back-end interfaces, data transmission format, and exception handling mechanism; S24: Constructing a component gene library based on the front-end component gene sequence, the back-end component gene sequence and the cross-layer collaborative gene, and establishing a genotype-phenotype mapping function; the genotype-phenotype mapping function is used to convert the gene operation results into executable code components.
4. The AI-based intelligent generation method for urban governance application systems according to claim 1 is characterized in that: The processing steps of S3 are as follows: S31: Input the urban governance scenario into the digital twin model and generate the component requirements corresponding to the urban governance scenario through the mapping relationship graph; S32: Based on component requirements, the NSGA-III multi-objective genetic algorithm is used to construct a multi-objective fitness function and genetic operation operator for urban governance applications; The multi-objective fitness function includes a functional integrity objective function, a performance efficiency objective function, a user experience objective function, a security compliance objective function, and a maintainability objective function; The genetic operation operator includes an intelligent crossover operator, an adaptive mutation operator and a repair operator.
5. The AI-based intelligent generation method for urban governance application system according to claim 1 is characterized in that: The processing steps of S4 are as follows: S41: Establishing reinforcement learning agents with optimization goals based on multi-objective fitness functions; S42: Generate a population of 200 individuals based on the initialization in the component gene library, each individual corresponds to a combination of component gene sequences in the component gene library, and create an external archive set; S43: Based on the initialized population, genetic operators are used to perform 1000 generations of iterative evolution. Apache Spark is used to evaluate the fitness of individuals in each generation, and 10% of the best elite individuals are retained according to Pareto rank and crowding degree. S44: 180 parents are selected through a tournament, and offspring are generated by simulating binary crossover with an 80% probability and polynomial mutation with a 5% probability. Non-dominated solutions are incorporated into an external archive set and the diversity of the solution set is maintained. Simultaneously, the reinforcement learning agent learns a local optimization strategy for component combinations based on historical iterative data, guiding the genetic operator to adjust the crossover and mutation preference parameters, and performing local optimization on candidate solutions in the external archive set. S45: After 1000 generations of evolution, the Pareto optimal solution set accumulated in the external archive will be used as a candidate solution. Combined with the strategy learned by the reinforcement learning agent, the preset component selection strategy will be optimized to select the optimal component combination from the candidate solutions.
6. The AI-based intelligent generation method for urban governance application systems according to claim 1 is characterized in that: The processing steps of S5 are as follows: S51: Distribute the optimal component combination and initial component evaluation system to multiple city governance departments through the federated learning framework. After receiving the optimal component combination, each city governance department selects the corresponding component from the local component library based on the optimal component combination for deployment and application, and collects component output data and real feedback data during the application process. S52: Based on the initial component evaluation system, each city governance department uses component output data and real feedback data to train the component evaluation model locally. After training, the local component evaluation model parameters are differentially privately processed and the privacy-sensitive evaluation model parameters are output. S53: Aggregate the privacy assessment model parameters of various urban governance departments to build a global unified component quality assessment standard.
7. The AI-based intelligent generation method for urban governance application system according to claim 1 is characterized in that: The processing steps of S6 are as follows: S61: Online collection of application operation data based on the optimal component combination of each city governance department; wherein the application operation data includes component operation data of the optimal component combination of the system application, user behavior data, and governance effect data; S62: Evaluate the effectiveness of component usage on application operation data using component quality assessment standards. Update component fitness assessment parameters based on the results. At the same time, use concept drift detection to capture changes in the urban governance environment and dynamically adjust genetic algorithm parameters. S63: Establish a real-time feedback mechanism between component usage effects and the digital twin model, and update the mapping relationship map in the digital twin model based on the component usage effect evaluation results.
8. An AI-based intelligent generation system for urban governance application systems, implemented using the AI-based intelligent generation method for urban governance application systems according to any one of claims 1 to 7, characterized in that: include: The gene coding module is used to convert the front-end UI components and back-end API components in the urban governance application component library into gene sequences through gene coding, and to construct front-end and back-end collaborative genes to form a component gene library; Genetic operation module, which uses genetic operation operators to perform a global search for the optimal component combination in the component gene library and output the candidate solutions required for urban governance scenarios; The fitness evaluation module is used to use reinforcement learning agents to perform local search optimization and strategy optimization on candidate solutions required for urban governance scenarios, and output the optimal component combination; The evolution control module is used to manage the population in the genetic algorithm, monitor the algorithm convergence, and adjust the genetic algorithm parameters; The code generation module is used to decode the gene sequence according to the optimal component combination, generate executable code, and perform quality inspection on the generated code.
Citation Information
Patent Citations
Automatic ship obstacle avoidance path planning method and device and storage medium
CN120295310A
Game engines with smart contract systems and digital wallets
US20230419304A1