Logistic regression correlation model-based equipment code design taboo inspection method
By combining a Logistic regression correlation model with a finite state machine and a multi-agent framework, the problem of high false alarm rate and low efficiency in the detection of large-scale complex equipment software code is solved. It realizes the automatic identification, filtering and repair of code design taboos, adapts to different programming languages and development environments, and improves the accuracy and efficiency of code quality detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies suffer from high false alarm rates, low efficiency, inability to achieve automatic repair and verification, and poor adaptability in the detection of software code for large-scale complex equipment, making it difficult to meet diverse development needs.
By employing a method based on a Logistic regression correlation model, combined with finite state machines, large model detection techniques, and a multi-agent framework, we can achieve automatic identification, filtering, and repair of code design taboos.
It significantly improves the accuracy and efficiency of code quality detection, reduces the false positive rate, enables automatic code repair and verification, and is adaptable to different programming languages and development environments.
Smart Images

Figure CN121764451A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of equipment software code quality inspection and automated improvement technology, and in particular relates to a method for checking equipment code design taboos based on a Logistic regression correlation model. Background Technology
[0002] In the development of equipment software, violations of code design taboos often lead to decreased software quality, increased maintenance costs, and even system failures. Equipment software typically has high complexity and stringent security requirements, and its code quality directly affects the reliability and stability of the entire equipment system. However, during software development, due to developers' lack of experience, negligence, or insufficient understanding of design specifications, it is easy to violate code design taboos, thereby introducing potential defects and security risks.
[0003] Traditional manual code review methods rely on the experience and expertise of reviewers, which is not only inefficient but also prone to overlooking issues. Manual review typically covers only a portion of the code, and the results are heavily influenced by the reviewer's subjectivity, making it difficult to guarantee comprehensiveness and accuracy. Furthermore, as software scales up and becomes more complex, the difficulty and cost of manual code review increase, making it unsuitable for the needs of large-scale, complex equipment software code inspection.
[0004] With the development of artificial intelligence technology, automated code detection and improvement has become a research hotspot. However, existing technologies still have many shortcomings in the detection of large-scale complex equipment software code. On the one hand, traditional automated code detection tools are usually based on rule or pattern matching, which makes it difficult to handle complex code structures and design taboos, resulting in a high false positive rate. On the other hand, existing technologies are inefficient in code improvement, usually only providing simple repair suggestions, and cannot achieve automatic code repair and verification. In addition, existing technologies have poor adaptability to different programming languages and development environments, making it difficult to meet the diverse development needs of equipment software. Summary of the Invention
[0005] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a method for checking code design taboos based on a Logistic regression correlation model. This method realizes the automatic identification, filtering and repair of code design taboos, thereby significantly improving the accuracy and efficiency of code quality detection, reducing the false alarm rate, and realizing automatic code repair and verification.
[0006] The objective of this invention is achieved through the following technical solution: a method for checking design taboos in equipment code based on a Logistic regression correlation model, comprising: collecting equipment software design taboo documents; organizing the equipment software design taboo documents to obtain a structured design taboo knowledge base; using a finite state machine to segment and process the equipment software design taboo documents in the structured design taboo knowledge base to obtain software code; performing large-scale model detection on the software code to identify problems; filtering the identified problems using a trained Logistic regression correlation model to obtain filtered code quality problems; and inputting the filtered code quality problems into a multi-agent framework for intelligent improvement and verification.
[0007] In the above-mentioned equipment code design taboo check method based on the Logistic regression correlation model, the equipment software design taboo document includes information on rules, standards, correct practices, and incorrect practices regarding equipment software design.
[0008] The above-mentioned equipment code design taboo checking method based on the Logistic regression correlation model includes the following steps in organizing equipment software design taboo documents: cleaning the equipment software design taboo documents to remove duplicate, redundant, and invalid information; and classifying and organizing the equipment software design taboo documents according to their theme, type, and severity to form a structured design taboo knowledge base.
[0009] In the aforementioned equipment code design taboo checking method based on the Logistic regression correlation model, the software code is obtained by segmenting and processing the equipment software design taboo documents in the structured design taboo knowledge base using a finite state machine. The finite state machine segments and processes the equipment software design taboo documents to deeply identify and parse the complex coding specifications within them. The finite state machine can decompose the equipment software design taboo documents into smaller and more operable units according to preset rules, keywords, phrases, and structures. The state machine then scans and processes the equipment software design taboo documents line by line. During the scanning process, the state machine continuously transitions states based on the current state and input symbols, extracting information from the equipment software design taboo documents and organizing and storing the extracted information according to a predefined format. The extracted information includes keywords, phrases, and structural units.
[0010] The aforementioned method for checking taboos in equipment code design based on the Logistic regression correlation model identifies problems including logical errors, syntax errors, and non-compliance with coding style standards.
[0011] Among the above-mentioned methods for checking taboos in equipment code design based on the Logistic regression correlation model, the major models include GPT-3.5 and CodeBERT.
[0012] In the above-mentioned equipment code design taboo check method based on the Logistic regression correlation model, the filtering includes: the trained Logistic regression correlation model predicts the probability of the existence of a real problem based on the feature vector of the identified problem, and judges whether it is a false alarm based on a preset threshold.
[0013] In the above-mentioned equipment code design taboo checking method based on the Logistic regression correlation model, the multi-agent framework includes a code repair agent, a verification agent, and a logging agent; configuring the multi-agent framework includes allocating resources to each agent, defining its tasks, and setting up communication mechanisms between agents.
[0014] In the aforementioned equipment code design taboo checking method based on the Logistic regression correlation model, intelligent improvement and verification include: the code repair agent generates repair suggestions based on a structured design taboo knowledge base and software code context information; wherein, the generation of repair suggestions adopts a combination of rule-based reasoning and machine learning, including retrieving repair rules or patterns from the structured design taboo knowledge base, and training a machine learning model using historical repair cases and code context information to generate candidate repair schemes; the verification agent verifies the repaired software code, wherein verification includes running test cases and checking whether the code meets the requirements in the design taboo document.
[0015] A system for checking design taboos in equipment code based on a Logistic regression correlation model includes: a first module for collecting equipment software design taboo documents and organizing them into a structured design taboo knowledge base; a second module for using a finite state machine to segment and process the equipment software design taboo documents in the structured design taboo knowledge base to obtain software code; a third module for using a large model to detect and identify problems in the software code; a fourth module for filtering the identified problems using a trained Logistic regression correlation model to obtain filtered code quality problems; and a fifth module for inputting the filtered code quality problems into a multi-agent framework for intelligent improvement and verification.
[0016] Compared with the prior art, the present invention has the following advantages:
[0017] This invention integrates finite state machines, large model detection technology, logistic regression correlation models, and multi-agent frameworks to achieve automatic identification, filtering, and repair of code design taboos, thereby significantly improving the accuracy and efficiency of code quality detection, reducing false alarm rates, and enabling automatic code repair and verification. Attached Figure Description
[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0019] Figure 1 This is a flowchart of the equipment code design taboo checking method based on the Logistic regression correlation model provided in this embodiment of the invention;
[0020] Figure 2 This is a schematic diagram of the logistic regression model fusion large model provided in the embodiment of the present invention. Detailed Implementation
[0021] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] Figure 1 This is a flowchart of the equipment code design taboo checking method based on the Logistic regression correlation model provided in this embodiment of the invention. Figure 1 As shown, the equipment code design taboo checking method based on the Logistic regression correlation model includes: collecting equipment software design taboo documents, organizing the equipment software design taboo documents to obtain a structured design taboo knowledge base; using a finite state machine to segment and process the equipment software design taboo documents in the structured design taboo knowledge base to obtain software code; performing large-scale model detection on the software code to identify problems; filtering the identified problems through a trained Logistic regression correlation model to obtain filtered code quality problems; and inputting the filtered code quality problems into a multi-agent framework for intelligent improvement and verification.
[0023] This embodiment integrates finite state machines, large-scale model detection technology, logistic regression correlation models, and a multi-agent framework to achieve automatic identification, filtering, and repair of code design taboos. First, it collects and organizes software design taboo documents to form a structured design taboo knowledge base. Then, it uses a finite state machine to segment and process these documents. Next, it uses a fine-tuned large-scale language model to detect software code issues. The trained logistic regression correlation model filters the detected problems. The filtered code quality issues are then input into the multi-agent framework. The multi-agent framework is configured, and communication protocols and resource allocation strategies between agents are defined. Finally, the agents in the multi-agent framework intelligently improve and verify the software problems. This invention can improve the accuracy and efficiency of code quality detection, reduce the false positive rate, and achieve automatic code repair and verification.
[0024] The equipment software design taboo document includes information on rules, standards, correct practices, and incorrect practices regarding equipment software design.
[0025] Organizing equipment software design taboo documents includes: cleaning the equipment software design taboo documents to remove duplicate, redundant, and invalid information; classifying and organizing the equipment software design taboo documents according to their theme, type, and severity to form a structured design taboo knowledge base.
[0026] In the process of using a finite state machine to segment and process equipment software design taboo documents from a structured design taboo knowledge base to obtain software code, the finite state machine is used to segment and process the equipment software design taboo documents to deeply identify and parse the complex coding specifications in the equipment software design taboo documents. The finite state machine can decompose the equipment software design taboo documents into smaller and more operable units according to preset rules, keywords, phrases, and structures. The state machine is used to scan and process the equipment software design taboo documents line by line. During the scanning process, the state machine continuously transitions states according to the current state and input symbols, and extracts information from the equipment software design taboo documents. The extracted information is organized and stored according to a predefined format. The extracted information includes keywords, phrases, and structural units.
[0027] The identified problems include logical errors, syntax errors, and non-standard coding styles.
[0028] Large models include GPT-3.5 and CodeBERT.
[0029] The filtering process includes: the trained Logistic regression correlation model predicts the probability of a real problem based on the feature vector of the identified problem, and determines whether it is a false alarm based on a preset threshold.
[0030] The multi-agent framework includes a code-fixing agent, a verification agent, and a logging agent; configuring the multi-agent framework includes allocating resources to each agent, defining their tasks, and setting up communication mechanisms between agents.
[0031] Intelligent improvement and verification include: a code-fixing agent generating fix suggestions based on a structured design taboo knowledge base and software code context information; wherein, the generation of fix suggestions adopts a combination of rule-based reasoning and machine learning, including retrieving fix rules or patterns from the structured design taboo knowledge base, and training a machine learning model using historical fix cases and code context information to generate candidate fix solutions; and a verification agent verifying the fixed software code, wherein verification includes running test cases and checking whether the code meets the requirements in the design taboo document.
[0032] This embodiment utilizes finite state machines, large model detection techniques, logistic regression models, and a multi-agent framework to automatically perform design taboo detection on equipment code. The specific implementation steps are as follows:
[0033] Step 1: Compile design taboos based on previously developed equipment software. In this step, a document outlining design taboos for equipment software design is compiled, including rules, standards, correct practices, and incorrect practices. The collected design taboo documents are then cleaned, removing duplicate, redundant, and invalid information. Simultaneously, the design taboos are categorized according to their theme, type, and severity, forming a structured design taboo knowledge base. This taboo standard is regularly maintained and updated for easy future reference and use.
[0034] The specific implementation of extracting design taboos is as follows: Obtain equipment software design taboo documents from multiple sources, including but not limited to industry standards and specifications, historical excellent and erroneous cases, expert experience, etc., and clean, deduplicate and classify the documents to form a structured design taboo knowledge base. This knowledge base supports CRUD operations and has version control functions.
[0035] Step 2: Use a finite state machine to segment and process the equipment software design taboo document. In this step, a finite state machine is used to segment and process the equipment software design taboo document to deeply identify and parse the complex coding specifications in the document. The finite state machine can decompose the document into smaller, operable units according to preset rules, keywords, phrases, and structures. The state machine is used to scan and process the design taboo document line by line. During the scanning process, the state machine continuously transitions states based on the current state and input symbols, and extracts keywords, phrases, and structural units from the document. The extracted information is organized and stored according to a predefined format (such as JSON). The generated JSON output contains detailed information about the design taboos, such as taboo ID, taboo description, severity, and sample code (correct practices, incorrect practices), which facilitates subsequent large model detection and Logistic regression model filtering.
[0036] The finite state machine (FSM) is used to segment and process the design taboo document for equipment software. The specific implementation is as follows: The design taboo checking method is characterized by the large model detection described in step 3, which is implemented as follows: The specific implementation method is to design a finite state machine (FSM), define a state set S, a transition function T, an initial state S0, and an accepting state set F. The document is decomposed into keywords, phrases, and structural units by the FSM, and a JSON format output is generated. This output contains detailed information about the design taboos, such as taboo ID, taboo description, severity, and sample code.
[0037] Step 3: Perform large-scale model inspection on the software code. In this step, a large-scale model is used to inspect the software code and identify potential code quality issues, including logical errors, syntax errors, and non-standard coding styles. Pre-trained large language models (such as GPT-3.5, CodeBERT, etc.) are selected as the base models. These models are pre-trained on large-scale code corpora and have powerful code understanding and generation capabilities.
[0038] The large model detection is implemented as follows: a pre-trained large language model is selected, the model is fine-tuned, and the equipment software code samples and the design taboo knowledge base are used as training data. The cross-entropy loss function is used to optimize the model parameters, and early stopping and model checkpointing techniques are used to prevent the model from overfitting. The optimal model parameters are saved. The fine-tuned model can identify potential code quality problems, such as logical errors, syntax errors, non-standard coding styles, and violations of design taboos.
[0039] Step 4: Filter the problems identified in Step 3 using the trained Logistic Regression model. In this step, the Logistic Regression model is used to filter the problems detected by the large model to reduce the false positive rate. The trained Logistic Regression model is used to filter the problems detected by the large model. The model predicts the probability of a real problem based on its feature vector and determines whether it is a false positive based on a preset threshold. By adjusting the threshold, the recall and precision of the model can be controlled, thus achieving a balance between the false positive and false negative rates.
[0040] The parameters of the Logistic Regression model are set as follows: collect historical detection data, construct a training dataset, select feature vectors, including lines of code, cyclomatic complexity, historical modification frequency, design tabu matching degree, etc., perform feature selection and feature engineering to improve model performance, train the Logistic Regression model, use the gradient descent algorithm to optimize model parameters, minimize the loss function, and control the recall and precision of the model by adjusting the threshold.
[0041] Step 5: Input the filtered code quality issues from Step 4 into the multi-agent framework. In this step, the filtered code quality issues are input into the multi-agent framework, ready for intelligent improvement and verification. The multi-agent framework consists of multiple agents, each responsible for different tasks such as code repair and verification. Configure the multi-agent framework to ensure that each agent can efficiently complete its task. This includes allocating resources to each agent, defining its tasks, and setting up communication mechanisms between agents.
[0042] The intelligent agent framework is implemented as follows: The multi-agent framework includes code repair agents, verification agents, logging agents, etc. It defines the communication protocol and resource allocation strategy between agents. The communication protocol specifies the format, content and method of message transmission. The resource allocation strategy dynamically allocates computing resources according to the task load and priority of the agents, so as to realize intelligent improvement and verification of code problems.
[0043] Step 6: Intelligent Improvement and Verification of Software Issues. In this step, agents in the multi-agent framework intelligently improve the software issues, including automatically fixing errors in the code and improving coding style. Each agent processes the code accordingly based on its task to improve code quality. The agents verify the improved code to ensure it doesn't introduce new problems, including running test cases and checking if the code meets the requirements in the design taboo document. If verification passes, the code improvement is successful; if verification fails, the process returns to the intelligent improvement agent for further code refinement.
[0044] The process of intelligent improvement and verification of software issues is as follows: The code-fixing agent generates repair suggestions based on a design taboo knowledge base and code context information. The algorithm for generating these suggestions combines rule-based reasoning and machine learning, including retrieving repair rules or patterns from the knowledge base and training a machine learning model using historical repair cases and code context information to generate candidate repair solutions. The verification agent verifies the improved code, including running test cases and checking whether the code meets the requirements in the design taboo document. If the verification fails, the intelligent improvement process should be repeated.
[0045] The software can be written in different languages, including but not limited to C, C++, Java, Python, etc. The average code sample is 500 lines when performing large-scale code quality testing, and it supports efficient testing of code libraries of different sizes.
[0046] This embodiment also features a visual interface and report generation function, which can intuitively display the detection results, filtered code quality issues, repair suggestions and verification results, and supports the generation of detailed detection reports, making it convenient for users to track, analyze and improve problems.
[0047] Specifically, this embodiment discloses a method for checking taboos in equipment code design based on a Logistic regression correlation model and a multi-agent framework. This method integrates finite state machines, large model detection technology, a Logistic regression correlation model, and a multi-agent framework to automatically identify, filter, and repair code design taboos. The overall process is described in [link to documentation]. Figure 1 First, a document outlining design taboos in equipment software is collected and organized to form a structured knowledge base. Then, a finite state machine is used to segment and process these documents. Next, a finely tuned large language model is used to detect software code issues. A trained Logistic regression correlation model is used to filter detected problems. The filtered code quality issues are then input into a multi-agent framework. The multi-agent framework is configured, and communication protocols and resource allocation strategies between agents are defined. Finally, the agents in the multi-agent framework intelligently improve and verify the software issues. This embodiment can improve the accuracy and efficiency of code quality detection, reduce false positives, and achieve automatic code repair and verification.
[0048] The specific implementation steps are as follows:
[0049] Step 1: Design Taboo Collection and Organization
[0050] Documents on taboos in equipment software design were extensively collected from multiple sources, including but not limited to aerospace standards, historical error cases, and expert experience. These documents cover all aspects of equipment software design, such as coding standards, performance requirements, and safety standards.
[0051] The collected design taboo documents are cleaned to remove duplicate, redundant, and invalid information. Simultaneously, they are categorized and organized according to the theme, type, and severity of the design taboos, forming a structured design taboo knowledge base. This knowledge base is stored using a database or file system for easy retrieval and use later.
[0052] The design taboo knowledge base should be maintained and updated regularly to ensure its timeliness and accuracy. When new design taboos emerge or existing taboos change, the knowledge base should be updated accordingly by adding, modifying, or deleting entries.
[0053] Step 2: Finite State Machine Processing Design Taboos Document
[0054] Design a finite state machine (FSM) for fine-grained segmentation and processing of design taboo documents. An FSM consists of a set of states S, a transition function T, an initial state S0, and a set of accepting states F.
[0055] The state set S includes states such as "start", "keyword recognition", "phrase parsing", "structural analysis" and "end", covering all stages of document processing.
[0056] The transition function T determines the next state based on the current state and the input symbols (such as characters, words, punctuation marks, etc.). For example, when the FSM is in the "Start" state and encounters the "<Design Taboo>" label, it transitions to the "Keyword Recognition" state; after recognizing the keyword in the "Keyword Recognition" state, it transitions to the "Phrase Parsing" state, and so on.
[0057] The initial state S0 is the "start" state, which indicates the starting point of FSM processing.
[0058] The acceptance state set F includes the "End" state, which indicates that the FSM has successfully processed a design taboo item.
[0059] The design-specific FSM is used to scan and process the design taboo document line by line. During the scanning process, the FSM continuously transitions states based on the current state and input symbols, and extracts keywords, phrases, and structural units from the document.
[0060] The extracted information is organized and stored in a predefined format (such as JSON). The generated JSON output contains detailed information about the design taboos, such as taboo ID, taboo description, severity, and sample code, which facilitates subsequent large-scale model testing and Logistic regression model filtering.
[0061] Step 3: Large Model Code Detection
[0062] We chose CodeBERT, a pre-trained large-scale language model, as the base model. The CodeBERT model was pre-trained on a large-scale code corpus and has powerful code understanding and generation capabilities.
[0063] The base model was fine-tuned to adapt to the specific task of equipment code design taboo detection. During fine-tuning, equipment software code samples and a design taboo knowledge base were used as training data. The code samples covered different programming languages, application scenarios, and design taboo types to ensure the model's generalization ability.
[0064] During fine-tuning, the cross-entropy loss function is used to optimize model parameters, enabling the model to more accurately identify design taboos in the code. Simultaneously, techniques such as early stopping and model checkpointing are used to prevent overfitting and to preserve optimal model parameters.
[0065] The finely tuned model is used to inspect new software code. The model can analyze code line by line or block by block, identifying potential code quality issues such as logical errors, syntax errors, non-standard coding styles, and violations of design taboos. The inspection results are output in a structured format, including information such as the problem type, problem location, and problem description.
[0066] Step 4: False Alarm Filtering for Logistic Regression Correlation Model
[0067] Collect historical detection data to construct a training dataset D = {(x1,y1),(x2,y2),...,(x_n,y_n)}. Here, x_i is a feature vector containing various features related to code quality issues, such as the number of lines of code, cyclomatic complexity, historical modification frequency, and design taboo matching degree; y_i is the label, indicating whether the code snippet contains a real problem (1 indicates presence, 0 indicates absence).
[0068] Feature selection and feature engineering are performed on the feature vector x_i to improve the model's performance and generalization ability. Feature selection methods include chi-square test and mutual information method, used to select features with high relevance to the label. Feature engineering methods include feature scaling and feature combination, used to enhance the representational power of the features.
[0069] A logistic regression model is trained, with the form p(y=1|x)=1 / (1+e^(-w·xb)). Here, w is the weight vector, and b is the bias term. The model establishes a probabilistic prediction model by learning the relationship between features and labels in the training dataset.
[0070] The gradient descent algorithm is used to optimize model parameters w and b, minimizing the loss function L = -Σ(y_i log(p_i) + (1-y_i)log(1-p_i)). The gradient descent algorithm iteratively updates the model parameters, gradually reducing the loss function until the convergence condition is met.
[0071] A trained Logistic Regression model is used to filter the problems detected by the large model. The model predicts the probability of a problem being a true problem based on its feature vector and determines whether it is a false positive based on a preset threshold. By adjusting the threshold, the model's recall and precision can be controlled, thus achieving a balance between false positive and false negative rates. For details, see [link to documentation]. Figure 2 .
[0072] Step 5: Multi-agent framework configuration and task allocation
[0073] Design a multi-agent framework for intelligent code improvement and verification. The framework consists of multiple agents, each responsible for different tasks, such as code fixing, verification, and logging.
[0074] The code-fixing agent is responsible for generating fix suggestions based on a knowledge base of design taboos and code context information. It can analyze the causes of code problems and retrieve relevant fix patterns from the knowledge base or generate new fixes.
[0075] The verification agent is responsible for verifying the fixed code to ensure that the problem has been correctly fixed and no new problems have been introduced. It can run test cases, check whether the code conforms to design taboos, etc.
[0076] The logging agent is responsible for recording key information throughout the detection, filtering, remediation, and verification process, such as detected issues, remedial measures taken, and verification results. This information is crucial for subsequent issue tracking, analysis, and improvement.
[0077] Define a communication protocol between agents to ensure they can work together efficiently. The communication protocol specifies the format, content, and method of message passing between agents. For example, use JSON format for message encoding and define message types (such as requests, responses, notifications, etc.) and message bodies (such as problem descriptions, repair suggestions, verification results, etc.).
[0078] Configure resource allocation strategies to dynamically allocate computing resources based on the agent's task load and priority. For example, allocate more CPU and memory resources to the code-fixing agent to accelerate the fixing process; allocate a separate test environment to the verification agent to ensure the accuracy of the verification results.
[0079] Step 6: Intelligent Improvement and Verification
[0080] The code-fixing agent generates fix suggestions based on a knowledge base of design taboos and code context information. The fix suggestion generation algorithm employs a combination of rule-based reasoning and machine learning.
[0081] Rule-based reasoning: Retrieves fix rules or patterns relevant to the current problem from a design taboo knowledge base. These rules or patterns are summarized by experts based on experience and can be directly applied to code fixes.
[0082] Machine learning: Machine learning models (such as sequence-to-sequence models) are trained using historical fixes and code context information to generate candidate fixes. The model learns the code's context and fix patterns, thus generating fix suggestions that better meet actual needs.
[0083] The verification agent verifies the repaired code. The verification process includes running test cases and checking if the code meets the requirements of the design taboo document. Pre-prepared test cases are executed to check if the repaired code runs correctly and outputs the expected results. Static analysis or dynamic checks are performed on the repaired code according to the requirements of the design taboo document to ensure that it no longer violates any design taboos.
[0084] If the verification passes, the code improvement is successful, and the fixed code can be submitted to the version control system; if the verification fails, the code improvement is unsuccessful, and you need to return to step 7 for the code repair agent to further improve the code.
[0085] Step 7: Iterative Optimization and Continuous Improvement
[0086] Collect feedback information throughout the entire detection, filtering, repair, and verification process, including indicators such as false alarm rate, false negative rate, repair success rate, and verification pass rate.
[0087] The system is iteratively optimized and continuously improved based on feedback. For example, the fine-tuning strategy of the large model is adjusted to improve detection accuracy; the feature selection and parameter settings of the Logistic regression model are optimized to reduce the false alarm rate; and the algorithm of the code repair agent is improved to increase the repair success rate.
[0088] Regularly conduct performance evaluations and stress tests on the system to ensure its stable and efficient operation and adaptability to constantly changing equipment software code and design taboos.
[0089] The basic model in this embodiment can be replaced with the Qwen series, DeepSeek series, Gamma series, etc., all with the aim of better detecting software quality problems and intelligently discovering software problems in advance.
[0090] This embodiment also provides an equipment code design taboo checking system based on a Logistic regression correlation model. The system includes: a first module for collecting equipment software design taboo documents and organizing them to obtain a structured design taboo knowledge base; a second module for using a finite state machine to segment and process the equipment software design taboo documents in the structured design taboo knowledge base to obtain software code; a third module for performing large-scale model detection on the software code to identify problems; a fourth module for filtering the identified problems using a trained Logistic regression correlation model to obtain filtered code quality issues; and a fifth module for inputting the filtered code quality issues into a multi-agent framework for intelligent improvement and verification.
[0091] This embodiment integrates finite state machines, large model detection technology, logistic regression correlation models, and multi-agent frameworks to achieve automatic identification, filtering, and repair of code design taboos. This significantly improves the accuracy and efficiency of code quality detection, reduces the false alarm rate, and enables automatic code repair and verification.
[0092] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make possible changes and modifications to the technical solutions of the present invention by utilizing the methods and techniques disclosed above without departing from the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solutions of the present invention shall fall within the protection scope of the technical solutions of the present invention.
Claims
1. A method for checking taboos in equipment code design based on a Logistic regression correlation model, characterized in that... include: Collect equipment software design taboo documents, and organize them to obtain a structured design taboo knowledge base; The software code is obtained by segmenting and processing the equipment software design taboo documents in the structured design taboo knowledge base using a finite state machine. Large-scale model detection was used to identify problems in the software code; The identified problems are filtered out by using a trained Logistic regression correlation model to obtain the filtered code quality issues. The filtered code quality issues are input into the multi-agent framework for intelligent improvement and verification.
2. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: The equipment software design taboo document includes information on rules, standards, correct practices, and incorrect practices regarding equipment software design.
3. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: Organizing equipment software design taboo documents includes: cleaning the equipment software design taboo documents to remove duplicate, redundant, and invalid information; classifying and organizing the equipment software design taboo documents according to their theme, type, and severity to form a structured design taboo knowledge base.
4. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: The software code is obtained by segmenting and processing the equipment software design taboo documents in the structured design taboo knowledge base using a finite state machine. By using a finite state machine, the equipment software design taboo document is segmented and processed to deeply identify and parse the complex coding specifications in the equipment software design taboo document; Finite state machines can break down equipment software design taboo documents into smaller and more operable units according to preset rules, keywords, phrases and structures; A state machine is used to scan and process the equipment software design taboo document line by line. During the scanning process, the state machine continuously transitions states based on the current state and input symbols, and extracts information from the equipment software design taboo document. The extracted information is then organized and stored according to a predefined format. The extracted information includes keywords, phrases, and structural units.
5. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: The identified problems include logical errors, syntax errors, and non-standard coding styles.
6. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: Large models include GPT-3.5 and CodeBERT.
7. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: Filtering includes: The trained Logistic regression correlation model predicts the probability of a real problem based on the feature vector of the identified problem, and determines whether it is a false alarm based on a preset threshold.
8. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: The multi-agent framework includes a code-fixing agent, a verification agent, and a logging agent; configuring the multi-agent framework includes allocating resources to each agent, defining their tasks, and setting up communication mechanisms between agents.
9. The equipment code design taboo check method based on the Logistic regression correlation model according to claim 1, characterized in that: Intelligent improvement and verification include: the code repair agent generates repair suggestions based on a structured design taboo knowledge base and software code context information; wherein, the generation of repair suggestions adopts a combination of rule-based reasoning and machine learning, including retrieving repair rules or patterns from the structured design taboo knowledge base, and training a machine learning model using historical repair cases and code context information to generate candidate repair solutions; The verification agent verifies the repaired software code, which includes running test cases and checking whether the code meets the requirements in the design taboo document.
10. A system for checking taboos in equipment code design based on a Logistic regression correlation model, characterized in that... include: The first module is used to collect documents on design taboos for equipment software, and to organize these documents into a structured knowledge base of design taboos. The second module is used to cut and process the equipment software design taboo documents in the structured design taboo knowledge base using a finite state machine to obtain software code. The third module is used to perform large-scale model detection on the software code to identify problems; The fourth module is used to filter the identified problems using a trained Logistic regression correlation model to obtain the filtered code quality issues. The fifth module is used to input the filtered code quality issues into the multi-agent framework for intelligent improvement and verification.