Apparatus and method for intelligent code generation based on an evolutionary standard framework

The intelligent code generation device addresses the challenges of missing design documents and access control in software development by using an evolutionary standard framework with hybrid databases and AI to produce high-quality, context-specific code, enhancing productivity and security.

KR102996845B1Active Publication Date: 2026-07-29AJIRANG RANGIRANG INC +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
AJIRANG RANGIRANG INC
Filing Date
2025-11-25
Publication Date
2026-07-29

AI Technical Summary

Technical Problem

Existing software development methods face challenges such as the absence of core design documents, inconsistency with project context due to general-purpose AI models, and complex access control issues, leading to inefficiencies and security risks.

Method used

An intelligent code generation device and method that utilizes an evolutionary standard framework, incorporating a hybrid database structure with RDB and Vector DB for precise access control, and an AI module to analyze queries, generate missing documents, and produce context-specific, high-quality source code.

Benefits of technology

Ensures secure, efficient, and context-specific code generation that adheres to organizational standards, reducing development time and maintaining code quality by automating the generation of design documents and enforcing access controls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 112025132126220-PAT00007_ABST
    Figure 112025132126220-PAT00007_ABST
Patent Text Reader

Abstract

The present invention relates to an intelligent code generation device and method based on an evolutionary standard framework. An electronic device according to one embodiment of the present invention includes a memory and a processor connected to the memory, and the processor may be configured to execute the following steps: (a) storing one or more project-specific related information received from a user terminal in a database; (b) receiving a natural language query from the user terminal; (c) analyzing the natural language query, retrieving a relevant context from the database based on the analyzed natural language query, and generating a new source code corresponding to the query and a screen definition document, a DB definition document, and a technical specification for the source code through an artificial intelligence module by referencing the retrieving context; and (d) providing the generated new source code, screen definition document, DB definition document, and technical specification to the user terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present invention relates to an intelligent code generation device and method based on an evolutionary standard framework. Background Technology

[0003] Unless otherwise indicated in this specification, the contents described in this section are not prior art for the claims of this application, and are not to be recognized as prior art simply because they are included in this section.

[0004] The software development industry is continuously growing due to rapid changes in the business environment, and accordingly, the demand to improve development productivity and ensure code quality is constantly increasing.

[0005] Recently, to meet these demands, active attempts are being made to generate, analyze, or enhance source code by utilizing artificial intelligence (AI), particularly large language models (LLM).

[0006] However, traditional software development methods have several limitations. When developers are assigned to new projects or maintaining existing legacy systems, they spend a significant amount of time analyzing vast amounts of existing source code and identifying the project's unique architecture and coding style.

[0007] In particular, core design documents such as screen definitions, database definitions, and technical specifications that define the project's design and functions are frequently missing, or even if they exist, they are not kept up to date to reflect code changes. The absence of such documentation is a major cause of difficulties in new developers' system onboarding and increased maintenance costs.

[0008] Code generation methods using general-purpose large language models also have fundamental problems. Because these general-purpose AI models are trained on publicly collected data, they are completely unaware of proprietary source code used only within a specific company, internal standard frameworks, or unique business logic.

[0009] Consequently, code generated by general-purpose AI is inconsistent with the actual project context of a company, making it difficult to use as is and requiring extensive modifications by developers. Furthermore, transmitting a company's sensitive source code as queries to external general-purpose AI services can lead to serious security breaches.

[0010] To address these issues, there have been attempts to build AI models on internal corporate networks and train them using internal data; however, this also fails to resolve the complex access control problems within the organization. In an enterprise environment, common components or standards (e.g., the e-Government Standard Framework) that all departments must reference coexist with sensitive business logic that should be accessible only to specific departments, such as finance or human resources.

[0011] With existing simple systems, it is very difficult to dynamically restrict the scope of data access based on user affiliation or authority and to control source code generation by referencing only allowed data (RAG).

[0012] In summary, existing development environments face a complex set of problems, including (1) the limitations of general-purpose AI that cannot reflect the unique context of a project, (2) the absence of core design documents such as screen definitions, database definitions, and technical specifications, and (3) the need for complex role-based access control (RBAC) for internal corporate data.

[0013] Therefore, there is an urgent technical need for an intelligent development assistance system that securely manages source code, which is a corporate asset; uses AI to actively analyze and automatically generate missing design documents; strictly controls the scope of referenceable information based on user access rights; and generates customized source code that fully complies with the project's unique context and standards. Prior art literature

[0015] Korean Registered Patent No. 10-2884836 (2025.11.07.) The problem to be solved

[0016] One embodiment of the present invention provides an intelligent code generation device and method based on an evolutionary standard framework.

[0017] The technical problems to be solved by the present invention are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which the present invention belongs from the description below. means of solving the problem

[0019] To achieve the above-mentioned purpose, an electronic device according to one embodiment of the present invention includes a memory and a processor connected to the memory, and the processor may be configured to execute the following steps: (a) storing one or more project-specific related information received from a user terminal in a database; (b) receiving a natural language query from the user terminal; (c) analyzing the natural language query, retrieving a relevant context from the database based on the analyzed natural language query, and generating a new source code corresponding to the query and a screen definition document, a DB definition document, and a technical specification for the source code through an artificial intelligence module by referencing the retrieving context; and (d) providing the generated new source code, screen definition document, DB definition document, and technical specification to the user terminal.

[0020] At this time, the database is divided into a common database accessible to the entire organization and one or more departmental databases accessible only to specific organizational units, and the common database and the departmental database each include a relational database (RDB) for storing structured data and a vector database (Vector DB) for semantic retrieval of unstructured data, and the processor, in step (a), identifies the authority of a user logged in to the user terminal and stores project-related information based on the identified authority, may include the following steps: (a-1) chunking the relevant information into semantic units; (a-2) embedding each of the chunked information to generate a context vector; (a-3) storing the generated context vector in the vector database (Vector DB) corresponding to the identified authority; and (a-4) storing the original or metadata of the relevant information in the relational database (RDB) corresponding to the identified authority.

[0021] At this time, the processor can search for the context by identifying the authority of the user logged into the user terminal during the search of step (c), and searching only for the data of the common database and / or the departmental database that is allowed access according to the identified authority.

[0022] At this time, the project-specific information includes at least one of source code, screen definition document, DB definition document, and technical specification, and the processor may, in step (a), if the screen definition document, DB definition document, and / or technical specification is absent in the received project-specific information, perform (a-5) a step of automatically generating the missing screen definition document, DB definition document, and / or technical specification by statically or dynamically analyzing the source code through the artificial intelligence module, and (a-6) a step of storing the generated screen definition document, DB definition document, and / or technical specification in the database in association with the source code.

[0023] At this time, the processor may generate the new source code by complying with the naming conventions, architecture structure, and code style of the pre-established coding standard or framework when generating step (c).

[0024] At this time, the processor, during the search of step (c), generates a query vector (V_q) by embedding the natural language query, and calculates the cosine similarity (SIM) with the query vector for each context vector (V_d) already stored in the database that is allowed access, according to the following mathematical formula.

[0025]

[0026] Only contexts for context vectors where the calculated cosine similarity value is greater than or equal to a preset threshold similarity can be searched as contexts related to the above natural language query.

[0027] At this time, when generating the technical specification by statically analyzing the source code in step (a-5), the processor may be configured to execute the following steps: (a-5-1) a step of generating an Abstract Syntax Tree (AST) by parsing the source code; (a-5-2) a step of identifying a set of AST nodes corresponding to a function or method declaration in the generated Abstract Syntax Tree; and (a-5-3) a step of generating the technical specification by traversing the identified set of AST nodes to extract the function name (or method name), input parameters, return value, and subordinate API or DB query information called within the function (or method) from each AST node.

[0028] At this time, the processor derives the complexity (M) of the existing source code included in the searched context when generating step (c), and if the complexity exceeds a preset threshold complexity, the artificial intelligence module can generate the new source code in a direction that reduces the complexity by refactoring the logic of the existing source code while complying with the naming conventions, architecture structure, and code style of the preset coding standard or framework.

[0029] At this time, the above complexity is derived by the following mathematical formula,

[0030]

[0031] M represents the complexity of the existing source code included in the searched context, E represents the number of edges of the control-flow graph of the existing source code, and N may represent the number of CFG nodes.

[0032] At this time, the processor can generate the new source code by checking the priority utilization score (S) of the AST nodes associated with the context obtained through the retrieving of the (c) step during the generating of the (c) step, and when generating the new source code through the artificial intelligence module, it can generate the new source code by preferentially referencing the context (i.e., technical specification or source code) associated with the AST node whose confirmed priority utilization score is higher than the preset threshold utilization score, or by prompting to mimic the coding style of the AST node.

[0033] At this time, the above priority utilization score is derived by the following mathematical formula,

[0034]

[0035] S represents the above priority utilization score for the AST node, C_in represents the number of incoming calls from other AST nodes to the AST node, C_out represents the number of outgoing calls for external API or DB access called by the AST node, and M_AFC_node may represent the complexity derived for the AST node. Effects of the invention

[0037] As such, according to one embodiment of the present invention, an intelligent code generation device and method based on an evolutionary standard framework can be provided.

[0038] The effects obtainable from the present invention are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art from the description below. Brief explanation of the drawing

[0040] Other aspects, features, and benefits of specific preferred embodiments of the present invention, as described above, will become more apparent from the following description in conjunction with the accompanying drawings. FIG. 1 is a conceptual diagram of an intelligent code generation device based on an evolutionary standard framework according to one embodiment of the present invention. FIG. 2 is a block diagram of an electronic device according to one embodiment of the present invention. FIG. 3 is a diagram showing a database according to one embodiment of the present invention. FIG. 4 is a diagram showing the derivation of a screen definition document, a DB definition document, and a technical specification according to an embodiment of the present invention. FIG. 5 is a diagram showing the generation of new source code according to one embodiment of the present invention. FIG. 6 is a flowchart of an intelligent code generation method based on an evolutionary standard framework according to an embodiment of the present invention. FIG. 7 is a diagram showing a system architecture according to an embodiment of the present invention. It should be noted that in the drawings above, similar reference numbers are used to illustrate identical or similar elements, features, and structures. Specific details for implementing the invention

[0041] Hereinafter, embodiments of the present invention will be described in detail with reference to the attached drawings.

[0042] In describing the embodiments, technical details that are well known in the art to which the present invention belongs and are not directly related to the present invention are omitted. This is intended to convey the essence of the present invention more clearly without obscuring it by omitting unnecessary explanations.

[0043] For the same reason, some components in the attached drawings have been exaggerated, omitted, or schematically depicted. Additionally, the size of each component does not entirely reflect its actual dimensions. Identical or corresponding components in each drawing have been assigned the same reference numbers.

[0044] The advantages and features of the present invention and the methods for achieving them will become clear by referring to the embodiments described below in detail together with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below but can be implemented in various different forms. These embodiments are provided merely to ensure that the disclosure of the present invention is complete and to fully inform those skilled in the art of the scope of the invention, and the present invention is defined only by the scope of the claims. Throughout the specification, the same reference numerals refer to the same components.

[0045] At this point, it will be understood that each block of the process flow diagrams and combinations of the flow diagrams can be executed by computer program instructions. Since these computer program instructions can be loaded into the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing equipment, the instructions executed through the processor of the computer or other programmable data processing equipment create means to perform the functions described in the flow diagram block(s). Since these computer program instructions can also be stored in computer-available or computer-readable memory that can be directed toward the computer or other programmable data processing equipment to implement the function in a specific way, the instructions stored in computer-available or computer-readable memory can also produce a manufactured item containing the means of instruction to perform the function described in the flow diagram block(s). Since computer program instructions can be loaded onto a computer or other programmable data processing equipment, instructions that perform a series of operation steps on the computer or other programmable data processing equipment to create a process executed by the computer can also provide steps for executing the functions described in the flowchart block(s).

[0046] Additionally, each block may represent a module, segment, or part of code containing one or more executable instructions for executing a specified logical function(s). It should also be noted that in some alternative execution examples, the functions mentioned in the blocks may occur out of order. For instance, two blocks described in succession may actually be executed substantially simultaneously, or the blocks may be executed in reverse order according to their corresponding functions.

[0047] In this embodiment, the term "part" refers to a software or hardware component such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC), and the "part" performs certain roles. However, the meaning of "part" is not limited to software or hardware. The "part" may be configured to reside in an addressable storage medium or configured to run one or more processors. Accordingly, as an example, the "part" includes components such as software components, object-oriented software components, class components, and task components, as well as processes, functions, attributes, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functions provided within the components and "parts" may be combined into a smaller number of components and "parts" or further separated into additional components and "parts." In addition, the components and '~parts' may be implemented to play one or more CPUs within the device or secure multimedia card.

[0048] In describing the embodiments of the present invention in detail, the primary focus will be on examples of specific systems, but the main point claimed in this specification is applicable to other communication systems and services having a similar technical background without significantly departing from the scope disclosed in this specification, and this will be possible at the judgment of a person with skilled technical knowledge in the relevant technical field.

[0049] FIG. 1 is a conceptual diagram of an intelligent code generation device based on an evolutionary standard framework according to one embodiment of the present invention, and FIG. 2 is a block diagram of an electronic device (100) according to one embodiment of the present invention.

[0050] An electronic device (100) according to one embodiment includes a processor (110) and a memory (120). The processor (110) can perform at least one of the methods described above. The memory (120) can store information related to the method described above or store a program in which the method described above is implemented. The memory (120) may be volatile memory or non-volatile memory. The memory (120) may be referred to as a 'database', 'storage unit', etc.

[0051] The processor (110) can execute a program and control the electronic device (100). The code of the program executed by the processor (110) can be stored in memory (120). The device (100) can be connected to an external device (e.g., a personal computer or a network) through an input / output device (not shown) and exchange data.

[0052] At this time, the processor (110) may be configured to execute the following steps: (a) storing one or more project-specific related information received from a user terminal in a database; (b) receiving a natural language query from the user terminal; (c) analyzing the natural language query, retrieving a relevant context from the database based on the analyzed natural language query, and generating a new source code corresponding to the query and a screen definition document, DB definition document, and technical specification for the source code through an artificial intelligence module by referencing the retrieving context; and (d) providing the generated new source code, screen definition document, DB definition document, and technical specification to the user terminal. This will be described in more detail later.

[0053] At this time, the user terminal may include a communication-enabled desktop computer, laptop computer, notebook, smartphone, tablet PC, mobile phone, smart watch, smart glass, e-book reader, PMP (portable multimedia player), portable game console, navigation device, digital camera, DMB (digital multimedia broadcasting) player, digital audio recorder, digital audio player, digital video recorder, digital video player, PDA (Personal Digital Assistant), etc.

[0055] FIG. 3 is a diagram showing a database according to one embodiment of the present invention.

[0056] Referring to FIG. 3, the database is divided into a common database accessible to the entire organization and one or more departmental databases accessible only to specific organizational units, and the common database and the departmental databases may each include a relational database (RDB) for storing structured data and a vector database (Vector DB) for semantic retrieval of unstructured data.

[0057] In this way, the processor, in step (a), identifies the authority of a user logged into the user terminal and stores project-specific related information based on the identified authority, and may include the steps of: (a-1) chunking the relevant information into semantic units; (a-2) embedding each of the chunked information to generate a context vector; (a-3) storing the generated context vector in the vector database (Vector DB) corresponding to the identified authority; and (a-4) storing the original or metadata of the relevant information in the relational database (RDB) corresponding to the identified authority.

[0058] Additionally, the processor may, during the search of step (c), identify the authority of the user logged into the user terminal and search only the data of the common database and / or the departmental database that is allowed access according to the identified authority to search the context.

[0059] Looking at it in more detail, based on the identified authority, the search target can be limited to only the databases for which access is permitted, namely the common database and / or the RDB and Vector DB of specific departmental databases corresponding to the user's affiliation.

[0060] For example, for queries from users belonging to the Finance Team, both the aforementioned common database and the 'Finance Team' departmental database are searched, but for queries from users belonging to the Human Resources Team, the search can be restricted to only the aforementioned common database and the 'Human Resources Team' departmental database.

[0061] This hybrid structure of RDB and Vector DB has the advantage of simultaneously ensuring search accuracy and flexibility.

[0062] The above relational database (RDB) can store clearly structured metadata, such as 'filename', 'project version', 'module name', or the 'AST node' identifier described below. Through this, the processor can perform precise filtering on specific conditions included in the user's query (e.g., "Module B of Project A").

[0063] At this time, the above-mentioned vector database (Vector DB) can store the 'meaning' of the context (source code fragment, definition) partitioned in step (a-1) as a context vector in step (a-2). Through this, even if the user's natural language query is ambiguous or abstract, such as "implementation of login function," the most relevant context can be quickly searched by comparing the semantic similarity (e.g., cosine similarity of claim 6) between the query vector embedding the query and the context vector.

[0064] Consequently, the database structure illustrated in FIG. 3 ensures strict role-based access control (RBAC) for an organization's sensitive data assets (source code, definitions), while enabling hybrid search that combines filtering of structured data and semantic search of unstructured data. Through this, the artificial intelligence module of the present invention can generate high-quality new source code that satisfies both the project context and security requirements by referencing only the most accurate and relevant context within the user's authority.

[0066] FIG. 4 is a diagram showing the derivation of a screen definition document, a DB definition document, and a technical specification according to an embodiment of the present invention.

[0067] Referring to FIG. 4, the project-specific information may include at least one of source code, screen definition document, DB definition document, and technical specification.

[0068] Additionally, in step (a), if the screen definition document, DB definition document, and / or technical specification is absent from the received project-specific information, the processor may execute (a-5) a step of automatically generating the missing screen definition document, DB definition document, and / or technical specification by statically or dynamically analyzing the source code through the artificial intelligence module, and (a-6) a step of storing the generated screen definition document, DB definition document, and / or technical specification in the database in association with the source code.

[0069] In this case, the aforementioned project-specific information serves as the core context that the AI ​​module references when generating new source code. This can encompass all data reflecting the current architecture, coding style, and pre-implemented business logic of a specific project. For example, this may include frontend React code, backend Java Spring code, related SQL schemas, and pre-written API specifications.

[0070] In addition, the aforementioned screen definition document refers to a document that defines the visual layout and user interaction of a user interface (UI). This may include the placement and properties of UI components (e.g., buttons, input fields, grids) that constitute a specific screen, as well as the dynamic response of the screen to user events (e.g., clicks, inputs).

[0071] Furthermore, the aforementioned DB definition refers to a document that defines the logical and physical structure of the database and the relationships between the data. This may include specifications of the tables where data is stored, attributes of the columns constituting each table (e.g., name, data type, length, nullability), constraints such as primary keys and foreign keys, and relationship information between entities. The artificial intelligence module can automatically derive the aforementioned DB definition by analyzing entity class definitions, ORM (Object-Relational Mapping) mapping settings, or SQL DDL (Data Definition Language) scripts within the source code.

[0072] In addition, the above technical specification refers to a document that defines the data processing flow and back-end logic. As defined in Clause 7, this may include input parameters, return values, internal business logic, and information on lower APIs or database queries called by said logic.

[0073] These definition documents are utilized as 'refined knowledge' for the AI ​​module to accurately grasp the project context, and are stored in the database along with the original source code (Raw Data) in accordance with Paragraph 2.

[0074] In this case, an example of an algorithm in which the artificial intelligence module generates the definition documents may be static analysis based on an Abstract Syntax Tree (AST) described below. The artificial intelligence module may include a parser specialized for a specific programming language (e.g., Java, Python).

[0075] At this time, the learning and operation of the artificial intelligence module may be triggered when the source code is saved in step (a). Specifically, the artificial intelligence module can generate an AST by executing the parser on the input source code and traversing the AST nodes according to step (a-5-3) described below to extract logic, parameters, call relationships, etc. by functional unit.

[0076] Subsequently, the extracted information can be structured according to a predefined template to generate a screen definition document, DB definition document, or technical specification document, and then indexed and stored in a database according to steps (a-3) and (a-4) described above.

[0077] Through this automated documentation and indexing process, the present invention has the advantage of enabling search augmentation generation (RAG) based query answering according to step (c) described above immediately upon system implementation, even for existing legacy systems where screen definitions, DB definitions, and / or technical specifications are missing.

[0078] Looking more closely, the processor may be configured to execute the following steps when generating the technical specification by statically analyzing the source code in step (a-5): (a-5-1) a step of generating an Abstract Syntax Tree (AST) by parsing the source code; (a-5-2) a step of identifying a set of AST nodes corresponding to a function or method declaration in the generated Abstract Syntax Tree; and (a-5-3) a step of generating the technical specification by traversing the identified set of AST nodes to extract the function name (or method name), input parameters, return value, and subordinate API or DB query information called within the function (or method) from each AST node.

[0079] In this case, the static analysis technique described in step (a-5) above refers to identifying the characteristics of the code by analyzing the text and structure of the code itself without actually running the source code. This is a concept contrasted with 'dynamic analysis,' which analyzes behavior while executing the code, and in the present invention, it can be used to identify the grammatical structure and data flow of the code in a manner similar to how a compiler understands code.

[0080] The most preliminary step of this static analysis is the parsing process described in (a-5-1). Parsing refers to reading source code in the form of a simple text file, interpreting it, and breaking it down according to the specific 'syntax rules' of the programming language. It serves the role of converting the code into 'meaningful pieces' that the computer (processor) can understand the structure of.

[0081] An Abstract Syntax Tree (AST) is generated as a result of the above parsing process. This represents the grammatical structure of the source code as a hierarchical data structure, such as a 'tree'. Here, the term 'Abstract' means that it does not include all details of the code (e.g., parentheses, semicolons), but rather extracts and represents only the core structure of the 'Syntax' (e.g., declarations, operations, control statements) that is essential for understanding the logic.

[0082] The above abstract syntax tree consists of multiple AST nodes, which represent the basic unit elements of the tree. Each AST node corresponds to a specific syntax element within the source code (e.g., 'variable declaration statement node', 'if control statement node'). In step (a-5-2) of the present invention, among these various node types, only specific types of nodes that are key to generating a technical specification, such as 'function declaration node' or 'method declaration node', can be identified and organized into a set.

[0083] Finally, the traversing operation of step (a-5-3) means visiting the set of AST nodes identified through step (a-5-2) (e.g., the 'login function' node) and systematically traversing the child nodes of that node. For example, by traversing the 'login function' AST node, the function name and parameter information can be accurately extracted from its child nodes, such as the 'input parameter node', the return value information from the 'return statement node', and the internally called API or DB query information from the 'method call node', thereby ultimately generating a technical specification.

[0085] FIG. 5 is a diagram showing the generation of new source code according to one embodiment of the present invention.

[0086] Referring to FIG. 5, the processor can generate the new source code by complying with the naming conventions, architecture structure, and code style of a pre-established coding standard or framework when generating step (c).

[0087] This means that the artificial intelligence module of the present invention can go beyond simply generating functionally operating code and can generate high-quality code that follows the unique development protocols required by a specific organization or project.

[0088] In this context, the aforementioned established coding standard or framework refers to a set of predefined rules designed to maintain code consistency and improve readability and maintainability. This may encompass naming conventions for variables or functions, code styles defining indentation and line breaks, and architectural structures defining the overall design of the system.

[0089] For example, the aforementioned framework may be the 'e-Government Standard Framework,' which is widely used in public sector informatization projects in South Korea. In this case, when generating new source code, the AI ​​module may comply with the architecture prescribed by the e-Government Standard Framework, namely the Layered Architecture, which is divided into Presentation, Business, and Persistence layers.

[0090] More specifically, the AI ​​module can accurately identify the logic to be located in the Service class, ServiceImpl class, Data Access Object (DAO), or Controller, respectively, based on the user's natural language query, and generate files and code that conform to the naming conventions of the corresponding framework (e.g., XxxService.java, XxxDAO.java).

[0091] In addition, the artificial intelligence module can utilize the principles of this pre-established framework as constraints or guidelines during the generating process of step (c). That is, as illustrated in FIG. 5, the artificial intelligence module receives (1) a user's natural language query, (2) context retrieved from a database, and (3) pre-established coding standard framework information, and can derive optimal new source code that satisfies all three of these conditions.

[0092] Consequently, the present invention has the advantage of maximizing development productivity by minimizing the effort required for developers to modify or refactor generated code and automatically generating 'production-ready' code that complies with organizational standards.

[0094] In addition, the processor may, during the search of step (c), embed the natural language query to generate a query vector (V_q) and calculate the cosine similarity (SIM) between the query vector and each context vector (V_d) stored in the database that is allowed access, according to the following mathematical formula.

[0095] [Mathematical Formula 1]

[0096]

[0097] At this time, the processor can search for contexts related to the natural language query only for contexts of context vectors where the calculated cosine similarity value is greater than or equal to a preset threshold similarity.

[0098] In addition, it means that the above artificial intelligence module performs semantic search.

[0099] The above query vector (V_q) represents the semantic directionality of the user's 'natural language query', and the above context vector (V_d) represents the semantic directionality of the 'source code snippet' or 'definition document' stored in the database.

[0100] The cosine similarity in the above mathematical formula 1 is not merely a measure of determining whether keywords match, but rather a metric that quantifies, with a value between -1 and 1, how similar the directions these two vectors (V_q, V_d) point in a multidimensional space (i.e., how semantically close they are). The advantage of using this method is that even if the user's query and the database context do not use exactly the same word (Keyword), if they are highly contextually and semantically related, they can be judged as 'similar' and retrieved.

[0101] For example, even if a user queries for "sign-up logic," it can be searched by identifying contexts stored in the context vector as "Authentication function" or "Account Creation code" with high similarity.

[0102] Therefore, filtering utilizing the aforementioned critical similarity can play a key role in accurately identifying the user's ambiguous natural language query intent and efficiently selecting only the most relevant contexts from a vast database, thereby maximizing the quality of new source code generation in the subsequent (c) step.

[0103] At this time, the above threshold similarity refers to a pre-set cutoff value for determining that the cosine similarity value calculated according to mathematical formula 1 is 'semantically related' to the above natural language query.

[0104] Rather than having a fixed industry standard, this value is typically set empirically based on the characteristics of the dataset the system possesses and the performance of the embedding model used in step (a-2). For example, if normalized to a value between 0 and 1 (1 being the most similar), the system administrator can set it to a value that can control the system's precision and recall, such as '0.7', '0.75', '0.8', etc.

[0105] These threshold similarity settings have a direct impact on the quality of the search results. If the threshold similarity is set too high (e.g., 0.9), only contexts very similar to the query are retrieved, which increases precision, but may miss contexts useful for generating code in step (c) even if they are somewhat less relevant (low recall). Conversely, if the threshold similarity is set too low (e.g., 0.5), many 'noise' contexts with low relevance are retrieved, which may cause confusion in the AI ​​module during the generation of new source code in step (c) and degrade the quality of the final result.

[0106] Therefore, the critical similarity in the present invention plays a key role in efficiently filtering only contexts with optimal relevance. Through this, it prevents 'Garbage In, Garbage Out' in the artificial intelligence module (LLM) and provides only high-quality, refined contexts, thereby serving as a device that guarantees the accuracy and quality of the newly generated source code.

[0108] Additionally, when generating step (c), the processor derives the complexity (M) of the existing source code included in the searched context, and if the complexity exceeds a preset threshold complexity, the artificial intelligence module can generate the new source code in a direction that reduces the complexity by refactoring the logic of the existing source code while complying with the naming conventions, architecture structure, and code style of the preset coding standard or framework.

[0109] At this time, the above complexity can be derived by the following mathematical formula 2.

[0110] [Mathematical Formula 2]

[0111]

[0112] In this case, M represents the complexity of the existing source code included in the searched context, E represents the number of edges of the control-flow graph of the existing source code, and N represents the number of CFG nodes.

[0113] At this time, the above mathematical formula 2 represents the standard formula for calculating cyclomatic complexity when P=1 (one connected component). Here, the complexity (M) is a value that quantitatively measures how complexly the control flow of the code branches.

[0114] At this time, in the control flow graph (CFG) above, the value of M increases proportionally as the number of execution paths (E) increases relative to the instruction block (N) due to control statements such as 'if', 'else', 'for', and 'while', rather than the program being a simple sequential execution (where the number of CFG edges E and the number of CFG nodes N are similar).

[0115] In other words, M represents the number of independent execution paths or 'decision points' existing in the code; a higher M indicates that the code is more complex, requires more test cases, and is more difficult to maintain.

[0116] At this time, the key advantage of the present invention in measuring and using such complexity (M) lies in the 'automatic improvement of code quality' and the suppression of 'technical debt'. If an artificial intelligence module simply adds new functions to existing source code (which is already complex) that exceeds the aforementioned critical complexity, the complexity of the code increases exponentially and may become 'spaghetti code' that is impossible to maintain in the future.

[0117] However, the present invention diagnoses the complexity (M) of the corresponding context at the time of generation in step (c), and if it exceeds a threshold, induces the AI ​​module to perform 'refactoring' in parallel, going beyond simple feature addition. As a result, the AI ​​module operates like a skilled senior developer, generating new source code while simultaneously improving the structure of existing code (leading to a lower M value), thereby providing an excellent effect that ensures the readability, testability, and long-term maintainability of the generated code.

[0118] In this case, the above critical complexity may refer to an acceptable standard value set in advance by a system administrator or development organization to judge the quality and maintainability of the source code.

[0119] In this case, this value is not determined arbitrarily, but can be set according to industry standards widely accepted in the field of software engineering or internal coding quality guidelines. For example, many static analysis tools and quality management standards (e.g., NIST) strongly recommend that the complexity (M) value calculated by the above Equation 2 not exceed 10.

[0120] Generally, code with a complexity (M) value between 1 and 10 can be classified as 'simple and easy to test,' code between 11 and 20 as 'somewhat complex and requiring caution,' and code exceeding 20 as 'very complex and prone to errors, and immediate refactoring is recommended.'

[0121] Accordingly, the critical complexity in the present invention can be set to a specific integer value, such as '10' or '15', depending on the organization's quality policy.

[0122] Through this, the artificial intelligence module can automatically enforce code quality standards that the organization previously managed manually at the time of code generation in step (c), thereby systematically suppressing the increase in overall system complexity and preventing the accumulation of technical debt.

[0124] In addition, the processor can generate new source code by checking the priority utilization score (S) of each AST node associated with the context obtained through the retrieving of step (c) during the generating of step (c), and when generating the new source code through the artificial intelligence module, by preferentially referencing the context (i.e., program definition or source code) associated with the AST node whose confirmed priority utilization score is higher than the preset threshold utilization score, or by prompting to mimic the coding style of the AST node.

[0125] At this time, the above priority utilization score can be derived by the following mathematical formula 3.

[0126] [Mathematical Formula 3]

[0127]

[0128] In this case, S represents the priority utilization score for the AST node, C_in represents the number of incoming calls from other AST nodes to the AST node, C_out represents the number of outgoing calls for external API or DB access called by the AST node, and M_AFC_node represents the complexity derived for the AST node.

[0129] At this time, the above priority utilization score (S) functions as a quantitative measure to identify 'canonical' or 'core' code that the artificial intelligence module should refer to first when generating new code among the numerous AST nodes (functions or methods) stored in the database.

[0130] In this case, Equation 3 defines a method for calculating these priority utilization scores as objective indicators. The numerator of Equation 3 represents the 'importance' or influence of the corresponding AST node. C_in represents how often it is called by other nodes (i.e., reusability), and C_out represents how often it calls core resources such as external APIs or DBs (i.e., external connectivity); the higher these values ​​are, the more important the role the node plays in the system.

[0131] On the other hand, the denominator of the above mathematical formula 3 represents the 'cognitive load' or 'maintenance cost' of the corresponding AST node. M_AFC_node represents the complexity derived according to the method of the aforementioned mathematical formula 2, and a larger value indicates that the code is more complex and difficult to understand or imitate (in this case, adding 1 to the values ​​of C_in, C_out, and M_AFC_node and taking the logarithm is intended to prevent specific values ​​from becoming zero or excessively large and to normalize the scale of the data).

[0132] Consequently, the above priority utilization score (S) becomes an objective score representing importance relative to complexity.

[0133] The key advantage of this configuration lies in actively improving the quality of the code generated by the AI ​​module. If the AI ​​module generates new code by referencing complex or rarely used code, 'bad' coding styles or anti-patterns can spread throughout the entire project.

[0134] However, the present invention induces the best AST nodes (code) with a high S score, that is, 'low complexity (low M) and high reusability and impact (high C),' to be imitated preferentially. This ensures that the artificial intelligence module learns the 'Best Practice' within the project on its own and consistently applies it to the generation of new code, thereby improving the code quality and consistency of the entire system.

[0135] In addition, the above threshold utilization score represents a baseline that is judged to be 'worthy of preferential reference.' This value can be empirically set by a system administrator or development organization by considering the overall distribution of S values ​​calculated by [Equation 3]. For example, the threshold can be set to the top 20% of the S score distribution to ensure that only the best code patterns are referenced for the next generation of code generation.

[0137] As a specific embodiment of the content of the present invention, the operating principles and procedures of an intelligent code generation system based on an evolutionary standard framework are broadly divided into an environment verification stage and a source code generation stage. This system aims to improve development productivity and quality by standardizing and automating the entire process of software development.

[0139] 1. Specific details of the environmental verification phase

[0140] Prior to source code generation, environment verification is mandatory to confirm that the development and execution environments meet predefined standards and regulations.

[0141] This process undergoes a multi-stage verification process, first establishing the e-Government Standard Framework as the basic standard.

[0142] Subsequently, compliance with these basic requirements is automatically verified through the first round of AI verification, and the results are derived. For environments that pass the first round of verification, each institution's unique internal standards are additionally applied for comparative analysis, enabling the system to reflect the specific characteristics of each institution.

[0143] Next, AI performs a secondary verification on environments that incorporate internal standards to detect in-depth compliance and potential conflict issues. Finally, environments that pass all verification stages have their conformity finally confirmed through the DCFC checklist, and all verification details are recorded.

[0145] 2. Specific details of the source code generation stage

[0146] Once environment verification is complete, the source code generation phase is executed according to user requirements. In particular, an automated code generation process is applied when developing a new business model (BM).

[0147] First, the system automatically generates an environment, which means that the basic environment required for development is automatically configured based on the specification of key environment variables such as the JDK version and the e-Government Framework version.

[0148] Subsequently, code generation utilizing RAG (Retrieval-Augmented Generation) technology begins. The RAG system analyzes requirements using input data such as screen definitions, source code generation technical documents, and database design documents, and can generate the basic framework of a Java program (program(java)) based on the analysis.

[0149] In this process, workflow engines such as LangGraph can be integrated to coordinate the generation of complex logic, enabling a high level of automation.

[0150] Based on the generated base code, code detailing is achieved through interaction with the user.

[0151] The system first displays a list of DB schemas related to logins for various projects (e.g., Project 1 login, Project 2 login, etc.), and the user selects the desired DB schema.

[0152] Next, a list of screens related to the schema is displayed, followed by the selection of a project and screen, a related source code template is shown, and the user is guided to finally select the source code and program.

[0153] Finally, the user can execute code generation through a command such as, "Implement the code according to the plan above. Show the results for each step," and the system can display the generated results for each step to the user.

[0154] In addition, the system supports programmers in directly developing and adding new templates as needed, which contributes to the continuous expansion of code generation capabilities.

[0155] Meanwhile, during existing updates (operation), unlike the creation of a new BM, there is a difference in that past frameworks cannot be automatically generated, and updates can be performed through the RAG search and generation process by utilizing existing source code and definition documents stored in the database as context.

[0157] FIG. 6 is a flowchart of an intelligent code generation method based on an evolutionary standard framework according to an embodiment of the present invention.

[0158] Referring to FIG. 6, an intelligent code generation method based on an evolutionary standard framework according to one embodiment of the present invention can store one or more project-specific related information received from a user terminal in a database (S101).

[0159] In addition, an intelligent code generation method based on an evolutionary standard framework according to one embodiment of the present invention can receive a natural language query from the user terminal (S103).

[0160] In addition, an intelligent code generation method based on an evolutionary standard framework according to an embodiment of the present invention analyzes the natural language query, retrieving a relevant context from the database based on the analyzed natural language query, and generates a new source code corresponding to the query and a screen definition document, DB definition document, and technical specification for the source code through an artificial intelligence module by referencing the retrieving context (S105).

[0161] In addition, the intelligent code generation method based on an evolutionary standard framework according to one embodiment of the present invention can provide the generated new source code, screen definition document, DB definition document, and technical specification to the user terminal (S107).

[0162] In addition, the intelligent code generation method based on an evolutionary standard framework according to one embodiment of the present invention may be configured in the same way as the intelligent code generation device based on an evolutionary standard framework disclosed in FIGS. 1 to 5.

[0164] FIG. 7 is a diagram showing a system architecture according to an embodiment of the present invention.

[0165] Referring to FIG. 7, the device of the present invention is configured with a multi-layered structure extending from the user access layer to the operation and control layer, and is designed to stably and efficiently process the generation of new source code and design documents for natural language queries.

[0166] The top-level Access Layer and Presentation Layer are responsible for the interface with the user terminal. Through this layer, the user uploads project-related information or inputs natural language queries such as "implement the login function." Additionally, an environment is provided that allows the user to visually view and download the new source code, screen definition document, DB definition document, and technical specification generated in step (d) of claim 1.

[0167] The API Gateway Layer acts as a gateway connecting external requests to internal systems and protects the system by applying user authentication, traffic control, and security policies.

[0168] The Business Logic Layer, which performs the core functions of the system, consists of an Auth Service that manages user rights, a Document Management Service that manages project-specific documents and source code, and a RAG Search Service, which is the core of the present invention. The RAG Search Service analyzes a user's natural language query according to step (c) of claim 1 and performs the role of searching for the most relevant context (existing source code, design documents, etc.) in the database and providing it to the artificial intelligence module.

[0169] The Processing Engine Layer below it is responsible for the actual computation and generation tasks. The AI ​​Inference Engine runs a Large Language Model (LLM) to generate new source code that responds to user queries based on retrieved context, and also performs the function of collectively generating corresponding screen definitions, database definitions, and technical specifications. The OCR processing engine converts image-based design documents or other materials into text, supporting the AI ​​for learning and reference.

[0170] The Data Storage Layer is a space for storing project-specific relevant information received in step (a) of claim 1. The relational DB (MariaDB) stores project metadata, user information, and structured information of generated documents, while the vector DB (ChromaDB) stores the contents of source code and design documents in the form of embedding vectors to enable RAG-based similarity search. In addition, the cache storage (Redis) and file storage increase the response speed for frequent query requests and efficiently manage large files.

[0171] Finally, the Operations & Monitoring Layer supports the stable operation of the system. Through log collection (ELK Stack) and performance monitoring (Prometheus), it monitors resource usage and errors occurring during the code and documentation generation process in real time, while ensuring the secure protection of project assets through data backup and security monitoring functions.

[0172] The embodiments described above may be implemented as hardware components, software components, and / or combinations of hardware and software components. For example, the devices, methods, and components described in the embodiments may be implemented using one or more general-purpose or special-purpose computers, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions. The processing unit may execute an operating system (OS) and one or more software applications executed on said operating system. Additionally, the processing unit may access, store, manipulate, process, and generate data in response to the execution of the software. For ease of understanding, the processing unit may be described as being used as a single unit, but those skilled in the art will understand that the processing unit may include multiple processing elements and / or multiple types of processing elements. For example, the processing unit may include multiple processors or one processor and one controller. Additionally, other processing configurations, such as parallel processors, are also possible.

[0173] The method according to the embodiment may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, etc., either alone or in combination. The program instructions recorded on the medium may be those specifically designed and configured for the embodiment, or they may be those known and available to those skilled in the art of computer software. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, and flash memory. Examples of program instructions include machine code, such as that generated by a compiler, as well as high-level language code that can be executed by a computer using an interpreter, etc. The hardware devices described above may be configured to operate as one or more software modules to perform the operation of the embodiment, and vice versa.

[0174] Software may include computer programs, code, instructions, or a combination of one or more of these, and may configure a processing unit to operate as desired or command the processing unit independently or collectively. Software and / or data may be permanently or temporarily embodied in any type of machine, component, physical device, virtual equipment, computer storage medium or device, or transmitted signal wave so as to be interpreted by the processing unit or to provide instructions or data to the processing unit. Software may be distributed over networked computer systems and may be stored or executed in a distributed manner. Software and data may be stored on one or more computer-readable recording media.

[0175] Although the embodiments have been described above with reference to the limited drawings, those skilled in the art can apply various technical modifications and variations based on the above. For example, suitable results may be achieved even if the described techniques are performed in a different order than described, and / or if the components of the described system, structure, device, circuit, etc. are combined or assembled in a form different from described, or replaced or substituted by other components or equivalents.

[0176] Therefore, other implementations, other embodiments, and equivalents to the claims also fall within the scope of the claims set forth below.