Method for automatically and safely developing back-end project through AI

Through the AI ​​automation security development back-end project method, the problems of low development efficiency, poor code quality and difficult to detect security risks in the existing technology are solved, and development automation, code optimization and security improvement are achieved.

CN119577737APending Publication Date: 2025-03-07赵琦民
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411638256.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-16
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

During the existing software development process, developers have low efficiency in writing code manually, resulting in project cycles extended, code quality uneven, difficult to maintain and expand, and traditional code reviews are difficult to fully cover security risks.

Method used

Using the AI ​​automated security development method of back-end projects, we analyze requirements documents through AI, extract core business logic, generate project architecture and functional modules, automatically generate code, and perform performance optimization and security review, generate test cases and integrate new functions.

Benefits of technology

It realizes comprehensive automation of the development process, reduces the work burden of developers, and the generated code structure is clear, with good performance and security, which facilitates later function expansion and code maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577737A_ABST
    Figure CN119577737A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence and software engineering, in particular to a method for automatically and safely developing a back-end project through AI, which comprises the following steps of: S11, inputting a demand document and framework information, or inputting an existing project compressed file and a function demand; s12, the AI analyzes the demand document, extracts core business logic, generates an overall architecture and a function module of a project, or analyzes a code structure, module division and interface calling of an existing project, and extracts core logic and a module dependency relationship of a current system; s13, generating and optimizing a code; s14, performing test generation and function integration; and S15, packaging and outputting the project. According to the method, a highly automatic and intelligent back-end project development method is adopted, from demand analysis to code generation to function optimization, comprehensive automation of the development process is realized, a performance detection and security examination mechanism is built in, potential performance problems and security vulnerabilities can be automatically repaired, and the workload of developers is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence and software engineering technology, and in particular to a method for AI automated security development of backend projects. Background Art

[0002] The current software development process relies on developers to manually write code and maintain it. Although there is a certain degree of tool support, there are still many pain points.

[0003] In back-end development, rapid iteration of requirements is the norm. Developers need to frequently respond to new functional requirements and repair tasks. However, due to the low efficiency of manual coding, each requirement can only be handled one by one. Especially when there are limited developers, the project cycle is often delayed, resulting in the project being unable to go online on time. In addition, differences in coding habits and technical levels among developers will lead to uneven code quality. Different developers may have different implementations of the same requirement. This difference will lead to more bugs in the project and increased debugging difficulty. At the same time, after multiple rounds of development iterations, the code gradually becomes redundant and complex. Every time a new feature is added to the project, developers need to spend a lot of time to understand the existing code logic, and these codes may be of different styles and difficult to maintain and expand. In addition, manual code review cannot fully cover security risks. Developers may ignore potential vulnerabilities. Traditional code review usually finds it difficult to detect all security issues, resulting in security risks after the project goes online.

[0004] Traditional development requires a lot of time and manpower, especially when faced with complex projects and frequently changing requirements, the development process is particularly slow. Existing code optimization tools often only provide basic code checking functions and cannot perform in-depth optimization for the functions and performance of the entire project.

[0005] To address the above issues, this paper proposes a method for AI automated security development of backend projects. Summary of the invention

[0006] The purpose of the present invention is to overcome the above problems and provide a method for AI automated security development of backend projects.

[0007] To achieve the above object, the present invention adopts the following technical solution:

[0008] A method for AI automated security development backend project, comprising the following steps:

[0009] Step S11: Input the requirement document and framework information, or input the existing project compressed file and functional requirements;

[0010] Step S12: AI analyzes the requirements document, extracts the core business logic, and generates the overall architecture and functional modules of the project.

[0011] Or analyze the code structure, module division, and interface calls of existing projects to extract the core logic and module dependencies of the current system;

[0012] Step S13: Code generation and optimization

[0013] Automatically generate the core code of a new project or the implementation code of a new function of an existing project based on the analysis results;

[0014] Step S14: Test generation and functional integration

[0015] Automatically generate corresponding test cases to cover the key logic of each functional module, or integrate the newly generated functional modules with the existing project code, and automatically refactor the code when necessary;

[0016] Step S15: Project packaging and output

[0017] The generated source code, test cases, and configuration files are packaged into a compressed file, and developers can directly download the compressed file for debugging and deployment.

[0018] Furthermore, in step S11, the requirement document includes business logic, functional requirements, any specific security requirements, and technology stack information of the project;

[0019] The compressed file of the existing project must include the existing module structure and interface documents.

[0020] Furthermore, in step S12, when the AI ​​analyzes the requirement document, it generates a modular code structure according to the requirement, and designs a data flow diagram and interface definition;

[0021] When analyzing existing projects, generate a module dependency graph for the existing projects, analyze the existing interface design and database structure, and determine the modules that the new functions need to be associated with.

[0022] Furthermore, in step S13, when the core code of the new project is automatically generated, security and performance optimization measures are added to the code;

[0023] When the implementation code of the new function of the existing project is generated, corresponding interface integration and data processing are performed.

[0024] Furthermore, in step S14, the test cases include unit tests and integration tests. The unit tests will verify the functional correctness of each module, and the integration tests will ensure the collaborative work of each module to avoid erroneous calls between interfaces.

[0025] The function integration automatically adapts the calling method of the new function according to the framework of the project to avoid interface conflicts.

[0026] Furthermore, in step S15, the generated code includes a complete project structure, and the developer only needs to decompress the file and run the deployment script provided by the system to start the project;

[0027] The project packaging generates test cases containing new functions and packages the entire project.

[0028] The advantages of the present invention are:

[0029] 1. The present invention adopts a highly automated and intelligent method for developing backend projects, from demand analysis to code generation to function optimization, realizing comprehensive automation of the development process and greatly reducing the workload of developers.

[0030] 2. AI automation has built-in performance detection and security review mechanisms. The generated code complies with industry standards and can automatically fix potential performance issues and security vulnerabilities.

[0031] 3. The code structure generated by AI automation is clear and follows the principle of modular design. It can quickly adjust the code generation logic when requirements change, ensuring that the project can respond quickly to market changes and facilitate subsequent functional expansion and code maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The illustrative embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application.

[0033] In the attached picture:

[0034] Figure 1 The present invention is a flowchart of a method for AI automated security development of backend projects.

[0035] Figure 2 This is a flowchart of the new project code generation in Example 1.

[0036] Figure 3 A flowchart added to the existing project function of Example 2. DETAILED DESCRIPTION

[0037] 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. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0038] In the description of the embodiments of the present invention, "plurality" means at least 2.

[0039] The present invention is described in detail and specifically by specific examples below to provide a better understanding of the present invention, but the following examples do not limit the protection scope of the present invention.

[0040] A method for AI automated security development backend project, comprising the following steps:

[0041] Data preparation: (If there is ready-made, no additional preparation is required) (Back-end programmers can enrich and improve relevant documents based on the generation results and enterprise requirements to ensure that they meet the project delivery requirements).

[0042] 1. Enter the project requirement template and generate a project requirement document [Project Requirements Document.doc] for the project;

[0043] 2. Generate functional modules, goals, etc. according to the demand template;

[0044] 3. API interface document [api.txt] (if it does not exist, generate the corresponding API interface document with the help of GPT and enterprise requirements);

[0045] 4. Code logic design [code logic design.txt] is the focus of development. Based on 2 and 3, generate the code logic involved, first generate simple ones, then complex ones, let GPT expand step by step to consider reasonable and unreasonable ones, consider multiple situations, consider security, consider order, and finally generate complex, step-by-step code logic, and then update the API interface to make it applicable.

[0046] The following steps are based on the above-provided information, using GPT to enrich and improve the relevant information. After generation, the back-end programmer can enrich and modify the relevant documents according to the generation results and enterprise requirements to ensure that they meet the project delivery requirements.

[0047] 5. [Function.txt] Generate related functions based on project requirements documents, API interfaces, and code logic, taking into account many aspects, such as functions covering all major modules and extended functions in system design, including user management, product processing, shopping carts, orders, payments, caches, permissions, logs, asynchronous tasks, encryption, and anti-duplicate submission. If there are more specific business logics or other functions that need to be extended, more details and logic can be added.

[0048] 6. [Basic Information.txt] Provide basic information according to the project delivery requirements. Generally, it is decided by the company. (In extremely special cases, if there is no basic information plan related to project requirement documents, API interfaces, code logic, and function generation. Basic information: technology selection, back-end framework and database selection, third-party component selection, and front-end and back-end interaction methods.

[0049] 7. [System architecture design.txt] Generate relevant system architecture design based on project requirement documents, API interfaces, code logic, functions, and basic data plans: architectural model (such as layered architecture), project source code structure, module division, hierarchical structure, etc.

[0050] 8. Deep code logic design [Deep code logic design.txt]: Specific module design, function design, interface design, component design, data architecture design. (Based on the above information, conduct deep code logic design (focus on combining code logic, API and function), and output a txt file, which must include the following points: (In-depth analysis of design details).

[0051] 9. Third-party library design: Provide third-party dependency components according to project delivery requirements. Generally, it is decided by the company. (In extremely special cases, if there is none, the most appropriate third-party dependency will be selected based on the above functions, related architecture, and code logic).

[0052] 10. Provide technical specifications, safety standards and code compliance specifications provided by the company

[0053] After the data preparation is completed and the above inputs are obtained, the above inputs are sorted out and the GPT project analysis is entered to automatically develop the process:

[0054] 1. Project Requirements Document

[0055] 2. Technical solution planning (the most important part), including the required functions, the API interface documents used, basic information (technical architecture selection), system architecture design, deep code logic design, code logic flow, each document has a role, must be read and deeply understood (read in order) to ensure that the generated project source code is based on the following points:

[0056] a. Read basic information

[0057] b. System architecture design

[0058] c.Three-party library.txt

[0059] d. Deep design of code logic.txt,

[0060] e. Code logic flow.docx,

[0061] f.api.txt

[0062] g.function.txt,

[0063] 3. Technical specifications and safety standards

[0064] a.Code compliance specifications.docx

[0065] b.Technical specifications and safety standards.docx.

[0066] 4. After the input, GPT will automatically analyze and generate the project structure and related code files. GPT will make modifications according to the requirements until a satisfactory project structure is reached.

[0067] 5. GPT generates code based on the relevant project structure.

[0068] 6. Package the generated code into project source code, and write configuration files, documents, test scripts and deployment plans.

[0069] 7. Package all the above files into a zip file for developers to download.

[0070] Example 1

[0071] like Figure 2 As shown, the new project code generation includes the following steps:

[0072] Step S21: Input requirements document and framework information

[0073] Developers provide a project requirements document that describes the project's main functions, modules, and framework selection. The document should include business logic, functional requirements (such as user registration, product management, etc.), and any specific security requirements (such as user authentication, data encryption). At the same time, the project's technology stack information must also be provided so that the system can generate code that meets the technical requirements.

[0074] Step S22: System analysis requirements document

[0075] AI analyzes the requirements document, extracts the core business logic, generates the overall architecture and functional modules of the project, generates modular code structure according to the requirements, and designs data flow diagrams and interface definitions.

[0076] Step S23: Code generation and optimization

[0077] Based on the analysis results, the core code of the project is automatically generated, and security and performance optimization measures are included in the code.

[0078] Step S24: Test generation and verification

[0079] Corresponding test cases are automatically generated to cover the key logic of each functional module. Unit testing will verify the functional correctness of each module, and integration testing will ensure the collaborative work of each module to avoid erroneous calls between interfaces.

[0080] Step S25: Code packaging and output

[0081] The generated source code, test cases, and configuration files are packaged into a ZIP file, which developers can download directly for debugging. The generated code will include the complete project structure (front-end and back-end separated projects will automatically generate front-end and back-end codes). Developers only need to unzip the file and run the deployment script provided by the system to start the project.

[0082] Example 2

[0083] like Figure 3 As shown, adding existing project functions includes the following steps:

[0084] Step S31: Input the existing project compressed file and functional requirements

[0085] Developers upload the compressed file of the existing project and describe the new functions that need to be added, including relevant interfaces, database operations and other detailed information. The functional requirement description should include the interface description, business logic, data processing method and existing interfaces that may be involved in the new function.

[0086] Step S32: The system analyzes the existing project

[0087] By analyzing the code structure, module division, interface calls, etc. of existing projects, the core logic and module dependencies of the current system are extracted, the module dependency graph of the existing projects is generated, the existing interface design, database structure, etc. are analyzed, and the modules that need to be associated with the new functions are determined.

[0088] Step S33: Generate new function code

[0089] Based on the input of new functional requirements, the function code is automatically generated, and the corresponding interface integration and data processing are performed to generate the recommendation algorithm code, and automatically process the interface docking with the existing user module and social module.

[0090] Step S34: Functional integration and code refactoring

[0091] The newly generated functional modules are integrated with the existing project code, and the code is automatically refactored when necessary to ensure the compatibility of the new functions with the project.

[0092] Step S35: New function testing and project packaging

[0093] Generate test cases containing new functions and package the entire project (including existing code and new functions). Automatically generate unit tests and integration tests for new functions to ensure that the logic of the new functions is correct and does not affect existing functions. The generated ZIP compressed package contains the complete project code, newly added functional modules, test cases and deployment scripts, which developers can directly download for debugging and deployment.

[0094] The specific embodiments of the present invention are described in detail above, but they are only examples, and the present invention is not equivalent to the specific embodiments described above. For those skilled in the art, any equivalent modifications and substitutions made to the present invention are also within the scope of the present invention. Therefore, the equalization changes and modifications made without departing from the spirit and scope of the present invention should be included in the scope of the present invention.

Claims

1. A method for AI automated security development of backend projects, characterized in that: The following steps are involved: Step S11: Input the requirement document and framework information, or input the existing project compressed file and functional requirements; Step S12: AI analyzes the requirements document, extracts the core business logic, and generates the overall architecture and functional modules of the project. Or analyze the code structure, module division, and interface calls of existing projects to extract the core logic and module dependencies of the current system; Step S13: Code generation and optimization Automatically generate the core code of a new project or the implementation code of a new function of an existing project based on the analysis results; Step S14: Test generation and functional integration Automatically generate corresponding test cases to cover the key logic of each functional module, or integrate the newly generated functional modules with the existing project code, and automatically refactor the code when necessary; Step S15: Project packaging and output The generated source code, test cases, and configuration files are packaged into a compressed file, and developers can directly download the compressed file for debugging and deployment.

2. According to claim 1, a method for AI automated security development of backend projects is characterized by: In step S11, the requirements document includes business logic, functional requirements, any specific security requirements, and the project's technology stack information; The compressed file of the existing project must include the existing module structure and interface documents.

3. The method of AI automated security development backend project according to claim 2, characterized in that: In step S12, when the AI ​​analyzes the requirement document, it generates a modular code structure according to the requirement, and designs a data flow diagram and interface definition; When analyzing existing projects, generate a module dependency graph for the existing projects, analyze the existing interface design and database structure, and determine the modules that the new functions need to be associated with.

4. According to claim 3, a method for AI automated security development of backend projects is characterized by: In step S13, when the core code of the new project is automatically generated, security and performance optimization measures are added to the code; When the implementation code of the new function of the existing project is generated, corresponding interface integration and data processing are performed.

5. The method of AI automated security development backend project according to claim 4, characterized in that: In step S14, the test cases include unit tests and integration tests. The unit tests will verify the functional correctness of each module, and the integration tests will ensure the collaborative work of each module to avoid erroneous calls between interfaces. The function integration automatically adapts the calling method of the new function according to the framework of the project to avoid interface conflicts.

6. The method of AI automated security development backend project according to claim 5, characterized in that: In step S15, the generated code includes a complete project structure, and the developer only needs to decompress the file and run the deployment script provided by the system to start the project; The project packaging generates test cases containing new functions and packages the entire project.