An artificial intelligence assisted programming construction method

By establishing a software function module code database and directed graph database, combining the natural language information input by users, and using the large model interface to generate and test the software function module code, the problems of insufficient code simplification and low operation efficiency in the existing technology are solved, and efficient and clear large-scale software programming is achieved.

CN119179467BActive Publication Date: 2025-04-29WUHAN CITY VOCATIONAL COLLEGE

Patent Information

Application Number
CN202411244668.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-04-29
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The code generated by existing large models has problems such as insufficient simplicity, low operation efficiency, difficulty in dealing with large software, unclear call levels between complex modules, deviations from code and user intentions, many bugs, and difficulty in troubleshooting.

Method used

By establishing a software function module code database and directed graph database, combining the natural language information input by the user, generating directed graphs and performing user confirmation, using the large model interface to generate software function module code, and performing logical and functional tests, and finally integrating the generated code into the target program.

Benefits of technology

It improves the simplicity and operation efficiency of the code, simplifies the programming process of large software, clarifies the call levels between modules, reduces code bugs, and improves the matching between code and user intentions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179467B_ABST
    Figure CN119179467B_ABST
Patent Text Reader

Abstract

The present invention discloses an artificial intelligence-assisted programming construction method. By constructing a software module code library and a directed graph library, directed graph theory is combined with the establishment of a software module code library and software programming, so that users can locate and modify functional modules in the programming process more clearly and conveniently. At the same time, a software testing module and a large model interface are set in the programmer to fully utilize the advantages of the existing large model to generate software module code, and perform logic and functional testing on the software to reduce the defects of the generated software product. Using finished software to cut software module code can improve software code efficiency and better fit user intentions. Generating software code with the help of a graph structure can facilitate the programming of multi-level large-scale software. At the same time, establishing a mapping relationship between software function description information and graph nodes and software function code segments can play a better and clearer annotation, which is convenient for programmers to troubleshoot defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a computer software programming method, and in particular to an artificial intelligence-assisted programming method. Background Art

[0002] With the development of science and technology, artificial intelligence technology is used in more and more fields, helping all walks of life to improve work efficiency. The recently announced big model technology can automatically generate program code, which can help programmers improve work efficiency. However, its shortcomings are also quite obvious. First, the code generated by the current big model technology is not streamlined enough, the program operation efficiency is low, and the program execution requires a large amount of hardware resources, which is still a certain gap from the programming of excellent programmers; second, the program generated by the big model has a good expression for simple small programs, but the effect is poor for larger software programs; third, a single coding segment can have good and clear comments, and it is not difficult to troubleshoot and modify BUGs, but in terms of complex software modules and modules, the hierarchical structure is not clear enough, which is not convenient for programmers to check errors; fourth, the program code generated by the big model often deviates from the user's intention or there are too many code bugs, and users need to make more modifications when using it, so the improvement of work efficiency is limited. Based on the above reasons, it is urgent to provide an artificial intelligence-assisted programming method to solve the above problems. Summary of the invention

[0003] The present invention provides an artificial intelligence-assisted programming construction method, the method comprising: S1: establishing a software function module code database, a directed graph database

[0004] S1-1: Obtain the software product source code and the corresponding programming language and software deployment environment data; S1-2: Classify and store the software product source code according to the application field and programming language, and store the corresponding software deployment environment data at the same time.

[0005] S1-3: Generate a directed graph of the software product based on the architectural functions and control logic of the software product; the graph nodes represent the software functions, and the directions represent the jump logic; generate software function description information for the graph nodes, and associate the directed graph with the graph node software function description information and store them.

[0006] S1-4: Divide the software product source code into software function module codes according to the directed graph nodes; retain the jump logic interface function for the function module codes corresponding to the graph nodes with child nodes; and determine whether the software function module codes have software deployment environment restrictions. If so, store the software function description information, software function module codes, and software deployment environment conditions of the graph nodes accordingly. If not, default the software deployment environment condition data. S1-5: Construct a software function module code database and a software directed graph database according to the software product source code programming language, software application field, and software module functions.

[0007] S2: Establish a user programming information input module, build a programming process framework from natural language to software products, and natural language programming rules

[0008] S2-1: Establish a software programming process of user input information, generate a directed graph, user modify and confirm the directed graph, generate program code, logic test, compile into software, and software test. S2-2: Obtain the collected software function description information, extract software function description keywords, and establish a software function description keyword data set.

[0009] S2-3: Establish a mapping relationship between the input information keywords of the user-generated target software and the software function description keywords and graph nodes; include the functional role, application field, and software deployment environment of the target software as necessary input information.

[0010] S3: Establish software testing module

[0011] A software testing module is set up, which includes a logic testing module and a software function testing module. The logic testing module tests the program code according to the logic rules of the software programming language; the software function testing module obtains relevant test cases from the test case library for testing according to the functions of the software.

[0012] S4: Establishing a large model interface for software programming

[0013] When there is no software function module code matching the user's needs in the database, the user's needs information is converted into the standardized language of the corresponding large model and input into the corresponding large model through the large model interface to obtain the software function module code output by the large model and transmit it to the software testing module for testing. If the test passes, the software function module code generated by the large model is applied to the target program and temporarily stored in the software function module code database. After the target software is completed and manually reviewed and confirmed, the output software function module code generated by the large model is officially stored in the database. S5: Users use natural language for auxiliary programming

[0014] S5-1: Obtain software programming information input by the user.

[0015] S5-2: Generate a directed graph based on the user input information for display.

[0016] S5-3: The user modifies and confirms the generated directed graph to obtain the target directed graph.

[0017] The user confirms the generated directed graph. If the user needs to delete, insert or modify the graph node, the user locates the node according to the displayed graph node identification information. For inserting or modifying the graph node, the user turns to step S5-2.

[0018] S5-4: Search for matching graph nodes in the directed graph database according to the target directed graph and user input information, obtain the software function module code corresponding to the graph node, and proceed to step S5-5; when no matching graph node is found in the graph database, go to step S5-6.

[0019] S5-5: The acquired software function module codes are integrated and combined according to the target directed graph, and the process proceeds to step S5-7.

[0020] S5-6: Convert the user demand information of the unmatched graph nodes of the target directed graph into the standardized language of the corresponding large model and input it into the corresponding large model through the large model interface, obtain the software function module code output by the large model, and transmit it to the software testing module for testing. After the test passes, map the software function module code generated by the large model to the corresponding graph node of the target directed graph, and go to step S5-5.

[0021] S5-7: Input the fused software program code into the software testing module for logic testing.

[0022] S5-8: Compile the software program code that passes the logic test into software.

[0023] S5-9: The testing module obtains test cases based on user input information to test the software product.

[0024] The present invention further discloses an artificial intelligence programming method, which includes steps S5-1 to S5-9.

[0025] Further, the present invention discloses an artificial intelligence (AI) assisted programmer, which includes a software function module code database, a directed graph database, a user programming information input module, a software testing module, and a software programming large model interface, and is used to execute the method of steps S5-1 to S5-9.

[0026] Beneficial effects: The present invention combines directed graph theory with software module code library establishment and software programming by constructing a software module code library and a directed graph library, so that users can locate and modify functional modules more clearly and conveniently during the programming process. At the same time, a software testing module and a large model interface are set in the programmer to fully utilize the advantages of the existing large model to generate software module code, and perform logic and functional testing on the software to reduce the defects of the generated software product. Using finished software to split software module code can improve the efficiency of software code and better fit the user's intentions. Generating software code with the help of graph structure can facilitate the programming of multi-level large-scale software. At the same time, establishing a mapping relationship between software function description information and graph nodes and software function code segments can play a better role in clear annotation, making it convenient for programmers to troubleshoot defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 Building flowcharts for AI-assisted programming

[0028] Figure 2 Programming Flowchart for Artificial Intelligence DETAILED DESCRIPTION

[0029] Embodiment 1: Figure 1 As shown, the present invention provides an artificial intelligence (AI) assisted programming construction method, the method comprising:

[0030] S1: Establish software function module code database and directed graph database

[0031] S1-1: Obtain software product source code and corresponding programming language, and software deployment environment data.

[0032] The software product source code may be obtained through purchase, paid collection, web crawler, etc., and also includes program code written by a user development team.

[0033] The programming language may be obtained by entering and collecting data from a software product document, or may be identified by identifying the source code of the software product through a language recognition model.

[0034] The software deployment environment includes hardware environment and software environment. The hardware environment includes server processing power, storage capacity, and network bandwidth; the software environment includes operating system platforms such as macOS, Windows, Linux, Unix, Android, and Hongmeng, and software operation conflict information.

[0035] The source code of software products has its corresponding programming language. Common programming languages ​​include Java, C / C++, Python, etc. Program codes written in different languages ​​cannot be interchangeable. Usually a larger software product will include multiple programming languages. At this time, it is necessary to identify the programming language used by each code segment for classification, segmentation and storage, and to facilitate subsequent model training, learning and calling.

[0036] The software deployment environment has a great impact on software programming. The hardware environment will affect the efficiency of software operation, software failures, and the software environment will also cause software failures and conflicts, as well as the required programming language, etc. Therefore, the software deployment environment is one of the key factors to be considered in software programming.

[0037] The purpose of using the source code of software products is that software products are generally already on the market and have been rigorously tested and inspected by users, with fewer program efficiencies and defects, high software code execution efficiency, and each functional module of the software has been tested by users to be closer to the actual use of users and more practical.

[0038] S1-2: Classify and store the software product source code according to the application field and programming language, and store the software deployment environment data accordingly. For example, software products can be classified and stored according to the fields of government affairs, finance, medical care, education, transportation, petroleum, telecommunications, industrial control, warehousing, retail, etc.

[0039] S1-3: Generate a directed graph of the software product based on the architecture function and control logic of the software product; the graph nodes represent the software functions, and the directions represent the jump logic; generate software function description information for the graph nodes, and associate the directed graph with the graph node software function description information for storage;

[0040] The software function description information can be manually input or generated by a software function recognition model. In the early stage, it can be manually input according to the software professional vocabulary specification. After a certain amount of data is input, the software function recognition model is trained with the manual data. The subsequent use of the software function recognition model to identify and generate software function description information can greatly improve the recognition efficiency.

[0041] S1-4: Divide the source code of the software product into software function module codes according to the directed graph nodes; retain the jump logic interface function for the function module codes corresponding to the graph nodes with child nodes; and determine whether the software function module codes have software deployment environment restrictions. If so, store the software function description information, software function module codes, and software deployment environment conditions of the graph nodes accordingly. If not, process the software deployment environment condition data by default. The software deployment environment restriction means that the divided software function module codes need to run under certain hardware conditions. For example, the data processing module code needs to apply for 10G cache space when it runs, and the software deployment environment that the user needs to program is an embedded system with a cache of less than 10G. In this case, the code segment cannot be used even if the functions are the same.

[0042] S1-5: Construct a software function module code database and a software directed graph database according to the source code programming language of the software product, the software application field, and the software module function; for the newly segmented software function module code, check for duplicates before including it in the database. If there is the same program code, discard it. If there is no same code, include it and assign a corresponding identification number. At the same time, establish a mapping relationship between the directed graph nodes and the software function module code;

[0043] The software function module code database includes software function module codes, software function description information, and software deployment environment condition data;

[0044] The directed graph database includes directed graphs, graph node software function description information, and mapping relationship data between graph nodes and software function module codes.

[0045] S2: Establish a user programming information input module, build a programming process framework from natural language to software products, and natural language programming rules

[0046] S2-1: Establish a software programming process of user input information, generate a directed graph, user modify and confirm the directed graph, generate program code, logic test, compile into software, and software test. S2-2: Obtain the collected software function description information, extract software function description keywords, and establish a software function description keyword data set.

[0047] S2-3: Establish a mapping relationship between the input information keywords of the user-generated target software and the software function description keywords and graph nodes; include the functional role, application field, and software deployment environment of the target software as necessary input information.

[0048] The mapping relationship between the user-generated target software input information keywords and the software function description keywords and graph nodes can be a mapping relationship generation rule. For example, the keywords of the user input information can be identified through a semantic analysis module, and the keywords of the user input information can be matched with the software function description keywords and graph nodes.

[0049] S3: Establish software testing module

[0050] A software testing module is set up, which includes a logic testing module and a software function testing module. The logic testing module tests the program code according to the logic rules of the software programming language; the software function testing module obtains relevant test cases from the test case library for testing according to the functions of the software.

[0051] S4: Establishing a large model interface for software programming

[0052] When there is no software function module code matching the user's needs in the database, the user's needs information is converted into the standardized language of the corresponding large model and input into the corresponding large model through the large model interface to obtain the software function module code output by the large model and transmit it to the software testing module for testing. If the test passes, the software function module code generated by the large model is applied to the target program and temporarily stored in the software function module code database. After the target software is completed and manually reviewed and confirmed, the output software function module code generated by the large model is officially stored in the database. S5: Users use natural language for auxiliary programming

[0053] like Figure 2 As shown, S5-1: obtaining software programming information input by the user.

[0054] The user enters programming information in the information input box. The programming information must include the function of the target software, the application field, and the software deployment environment. The software function includes the overall function of the software and the software module function. When modifying, deleting, or inserting software module code, the programming information entered by the user only needs to enter the function. The software deployment environment includes information such as the deployed system software platform, processor processing power, memory capacity, and network bandwidth.

[0055] S5-2: Generate a directed graph based on the user input information for display.

[0056] Use the semantic analysis module to extract keywords from the user input information and match them with the software function description information keywords and graph nodes in the database to generate a directed graph, and use the identification information to identify the graph nodes. For software function descriptions that cannot be matched, directly generate graph nodes and insert them into the directed graph. The identification information can be a number or a text description information. S5-3: The user modifies the generated directed graph and confirms that the target directed graph is obtained.

[0057] The user confirms the generated directed graph. If the graph node needs to be deleted, inserted, or modified, the node is located according to the displayed graph node identification information. For example, the input information can be: delete the "XX identification" graph node; insert a graph node between the "XX identification" graph node and the "XX identification" graph node, and the function of the inserted graph node is "XX"; modify the "XX identification" graph node, and the function of the modified graph node is "XX"; for inserting a graph node and modifying a graph node, go to step S5-2.

[0058] S5-4: Search for matching graph nodes in the directed graph database according to the target directed graph and user input information, obtain the software function module code corresponding to the graph node, and proceed to step S5-5; when no matching graph node is found in the graph database, go to step S5-6.

[0059] S5-5: fusing and combining the acquired software function module codes according to the target directed graph, and proceeding to step S5-7;

[0060] The fusion combination includes operations of adding a jump logic function to a graph node, removing a jump logic function, and modifying a jump logic function parameter.

[0061] S5-6: Convert the user demand information of the unmatched graph nodes of the target directed graph into the standardized language of the corresponding big model and input it into the corresponding big model through the big model interface, obtain the software function module code output by the big model, and transmit it to the software testing module for testing. After the test passes, map the software function module code generated by the big model to the corresponding graph node of the target directed graph, and go to step S5-5. At the same time, temporarily store the software function module code generated by the big model in the software function module code database. After the target software is completed and manually reviewed and confirmed, the output software function module code generated by the big model will be officially stored in the database.

[0062] S5-7: inputting the fused software program code into a software testing module for logic testing;

[0063] The software testing module selects the corresponding software programming language logic rules to test the program code according to the programming language of the software program code. Different programming languages ​​have different grammatical logics and need to use different logic rules for testing.

[0064] S5-8: compiling the software program code that passes the logic test into software;

[0065] S5-9: The test module obtains test cases according to the user input information to test the software product. The test cases can be obtained from a public test case library or a self-built test case library.

[0066] Embodiment 2: An artificial intelligence programming method, the method comprising steps S5-1 to S5-9.

[0067] Embodiment three: An artificial intelligence-assisted programmer, which includes a software function module code database, a directed graph database, a user programming information input module, a software testing module, and a software programming large model interface, and is used to execute the method of steps S5-1 to S5-9.

[0068] The above is only a specific embodiment of the present invention or an explanation of a specific embodiment. The protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An artificial intelligence-assisted programming construction method, characterized in that The following steps are involved: S1: Establish software function module code database and directed graph database; S2: Establish a user programming information input module, build a natural language to software product programming process framework, and natural language programming rules; S3: Establish a software testing module and set up a software soft testing module, wherein the software testing module includes a logic testing module and a software functional testing module, wherein the logic testing module tests the program code according to the logic rules of the software programming language; and the software functional testing module obtains relevant test cases from the test case library for testing according to the functions of the software; S4: Establish a software programming big model interface. When there is no software function module code matching the user's needs in the database, convert the user's needs information into the standardized language of the corresponding big model and input it into the corresponding big model through the big model interface. Obtain the software function module code output by the big model and transfer it to the software testing module for testing. If the test passes, apply the software function module code generated by the big model to the target program and temporarily store it in the software function module code database. After the target software is completed and manually reviewed and confirmed, the output software function module code generated by the big model will be officially stored in the database. S5: The user uses natural language to assist programming; The step S1 comprises: S1-1: Obtain software product source code and corresponding programming language, software deployment environment data; S1-2: Classify and store the software product source code according to the application field and programming language, and store the software deployment environment data accordingly; S1-3: Generate a directed graph of the software product based on the architecture function and control logic of the software product; the graph nodes represent the software functions, and the directions represent the jump logic; generate software function description information for the graph nodes, and associate the directed graph with the graph node software function description information for storage; S1-4: According to the directed graph nodes, the software product source code is divided into software function module codes, and the jump logic interface function is retained for the function module codes corresponding to the graph nodes with child nodes, and at the same time, it is determined whether the software function module codes have software deployment environment restrictions. If so, the software function description information, software function module codes, and software deployment environment conditions of the graph nodes are stored accordingly. If not, the software deployment environment condition data is processed by default; S1-5: Construct software function module code database and software directed graph database according to the software product source code programming language, software application field, and software module functions.

2. The artificial intelligence-assisted programming construction method according to claim 1, wherein step S2 comprises: S2-1: establishing a software programming process of user input information, generating a directed graph, user modification confirmation directed graph, generating program code, logic testing, compiling into software, and software testing; S2-2: Obtain the collected software function description information, extract the software function description keywords, and establish a software function description keyword data set; S2-3: Establish a mapping relationship between the input information keywords of the user-generated target software and the software function description keywords and graph nodes; include the functional role, application field, and software deployment environment of the target software as necessary input information.

3. The artificial intelligence-assisted programming construction method according to claim 1, wherein step S5 comprises: S5-1: obtaining software programming information input by the user; S5-2: Generate a directed graph based on user input information for display; S5-3: The user modifies the generated directed graph to confirm the target directed graph, the user confirms the generated directed graph, if the graph node needs to be deleted, inserted, or modified, the node identification information is displayed and located, for inserting and modifying graph nodes, go to step S5-2; S5-4: Search for matching graph nodes in the directed graph database according to the target directed graph and user input information, obtain the software function module code corresponding to the graph node, and proceed to step S5-5; when no matching graph node is found in the graph database, go to step S5-6; S5-5: The obtained software function module code is fused and combined according to the target directed graph, and proceeds to step S5-7; S5-6: Convert the user demand information of the unmatched graph nodes of the target directed graph into the standardized language of the corresponding large model and input it into the corresponding large model through the large model interface, obtain the software function module code output by the large model, and transmit it to the software testing module for testing. After the test passes, map the software function module code generated by the large model to the corresponding graph node of the target directed graph, and turn to step S5-5; S5-7: Input the fused combined software program code into the software testing module for logic testing; S5-8: Compile the software program code that passes the logic test into software; S5-9: The testing module obtains test cases based on user input information to test the software product.

4. An artificial intelligence programming method, comprising steps S5-1 to S5-9 in claim 3.

5. An artificial intelligence (AI) assisted programmer, which includes a software function module code database, a directed graph database, a user programming information input module, a software testing module, and a software programming large model interface, and is used to execute an artificial intelligence programming method as described in claim 4.

Citation Information

Patent Citations

  • Enterprise application system software product intelligent construction method and device

    CN118051206A

  • Machine Learning-Assisted Code Generation in Directed Acyclic Graph-Driven Notebook Environment

    US20240256228A1

Cited By

  • Code generation method and device based on LLM multi-agent cooperation and computer equipment

    CN120122931A