Online programming method based on AI assistance

By using AI models to identify and refine programming requirements and generate program code, the programming difficulties of users with no prior experience are solved, programming efficiency and code quality are improved, and development costs are reduced.

CN120892032APending Publication Date: 2025-11-04HUNAN JIANSI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511032850.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing programming methods present technical barriers for beginners with no programming experience or those without a technical background, making it difficult to express clear programming requirements, leading to logical flaws and repeated modifications.

Method used

The system uses an AI model to identify programming entities in programming requirements, verifies them using formal and substantive principles, automatically improves the requirements, generates prompts to guide users in improving their requirements, and generates program code based on the temporal sequence of the entities.

Benefits of technology

It improves programming efficiency, reduces development costs, helps users with no programming experience to express their programming intentions smoothly, lowers the barrier to entry for programming, and ensures the logic and completeness of the generated code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892032A_ABST
    Figure CN120892032A_ABST
Patent Text Reader

Abstract

The invention discloses an online programming method based on AI assistance, and relates to the technical field of programming assistance. According to the method, the AI model can automatically identify a plurality of programming entities in a programming requirement according to a programming entity principle, and verification is carried out from two dimensions of form and essence; the form principle requires that the programming demand comprises necessary entities, and ensures that the programming demand is structurally complete; whether data flow among necessary entities is reasonable or not is evaluated according to the essential principle, and the requirement is logically feasible; when the demand does not meet the principle, the AI model can accurately position the missing entity, and the programming entity meeting the requirement is analyzed and matched and prompt information is generated to guide the user to perfect the demand; according to the method, the problems of fuzzy demand, logic vulnerability and the like caused by insufficient technical level or limited expression ability of a user are effectively solved, repeated modification caused by undefined demand in a subsequent programming link is avoided, the programming efficiency is greatly improved, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of programming assistance technology, specifically an AI-assisted online programming method. Background Technology

[0002] In the traditional programming field, existing programming methods present significant technical bottlenecks for beginners with no prior experience or those without a technical background. On one hand, programming languages ​​generally employ extensive symbolic syntax, and the rules differ significantly between languages. This requires users to expend considerable effort mastering complex syntax systems and language features, creating a high technical barrier for non-professional users. On the other hand, the programming process requires breaking down real-world problems into computer-executable logical steps. This process relies on "computational thinking," which is difficult for untrained users to grasp, often resulting in logical gaps or incomplete functional descriptions during the requirement expression phase.

[0003] This invention provides an AI-assisted online programming method to solve the above-mentioned technical problems. Summary of the Invention

[0004] This invention aims to address at least one of the technical problems existing in the prior art. To this end, this invention proposes an AI-assisted online programming method. In this invention, the AI ​​model can automatically identify several programming entities in the programming requirements based on the principle of programming entities, and verify them from both formal and substantive dimensions. The formal principle requires that the programming requirements contain necessary entities, ensuring that the programming requirements are structurally complete. The substantive principle evaluates whether the data flow between necessary entities is reasonable, ensuring that the requirements are logically feasible. When the requirements do not meet the principles, the AI ​​model will accurately locate the missing entities, analyze and match the programming entities that meet the requirements, and generate prompt information to guide the user to improve the requirements. This invention effectively solves the problems of ambiguous requirements and logical loopholes caused by insufficient technical level or limited expression ability of users, avoids repeated modifications caused by unclear requirements in subsequent programming stages, significantly improves programming efficiency, and reduces development costs. At the same time, this invention can also help users with zero experience or non-technical background to express their programming intentions more smoothly, lowering the entry barrier to programming.

[0005] To achieve the above objectives, a first aspect of the present invention provides an AI-assisted online programming method, comprising: Receive programming requirements; use an AI model to determine if the programming requirements meet the programming entity principle; if yes, proceed to the programming stage; if no, prompt for improvement of the programming requirements; the programming entity principle includes the formal principle and the substantive principle. In the programming phase, AI models are used to extract programming entities that meet programming requirements; these programming entities are then integrated into a temporal sequence of entities according to the data flow order. The programming entities in the entity time sequence are extracted sequentially, and the program code of the programming entities is output with the help of an AI model; the program code is then adapted according to the order of the programming entities.

[0006] Preferably, AI models are used to determine whether programming requirements meet the programming entity principle, including: Identify and extract several programming entities from the programming requirements; Determine whether several programming entities satisfy the formal and substantive principles; if yes, the programming requirements satisfy the programming entity principle; otherwise, they do not satisfy the programming entity principle.

[0007] Preferably, determining whether several programming entities satisfy formal and substantive principles includes: Determine whether several programming entities contain the necessary entities required by the programming entity principles; If yes, then the formal principle is satisfied; whereby the formal principle is used to evaluate the composition of the programming entity; No, then it is determined that the formal principle is not satisfied; Determine whether the data flow between several necessary entities is reasonable; If yes, then the substance principle is satisfied; the substance principle is used to evaluate the data interaction between programming entities. If not, then the substantive principle is not met.

[0008] Preferably, suggestions for improving programming requirements include: Extract programming entities from the programming requirements that do not meet the programming entity principle, and treat them as missing entities; Based on the missing entity, generate prompts and suggestions to improve the programming requirements.

[0009] Preferably, before generating prompt information based on missing entities, the missing entities are analyzed using an AI model to match programming entities that conform to the principles of programming entities, including: Identify the necessary entities in the programming requirements based on the programming entity principle; Identify programming entity principles violated by missing entities, generate matching information by combining necessary entities, and perform entity matching in the programming scenario based on the matching information to obtain the programming entity.

[0010] Preferably, the programming entities with missing entity matches are sorted to obtain an entity matching sequence; wherein, the sorting of programming entities is based on usage frequency or processing efficiency. Prompt information is generated based on the entity matching sequence; or, programming entities are selected from the entity matching sequence, programming requirements are improved, and prompt information is generated based on the improved programming requirements.

[0011] Preferably, after the user selects or confirms the programming entity in response to the prompt, the missing entity in the programming requirements is replaced with the programming entity to obtain complete programming requirements.

[0012] Preferably, the program code for the programming entity is output with the assistance of an AI model, including: Mark the necessary entities in the programming entity and output the program code of the necessary entities; Extract unnecessary entities between adjacent necessary entities based on entity time sequence; determine whether the unnecessary entities meet the data connection requirements of adjacent necessary entities; If yes, then output the program code for the unnecessary entity; If not, then the programming entity is matched based on the data connection requirements between adjacent necessary entities, and the program code of the matched programming entity is output.

[0013] Preferably, the program code is adapted according to the order of the programming entities, including: The adjacent programming entities are determined according to the order of the programming entities and marked as adjacent entities; Starting with the first programming entity, the parameters of the program code for each programming entity are adjusted according to the direction of data flow to obtain the complete program code.

[0014] Preferably, the parameters of the program code for each programming entity are adjusted according to the direction of data flow, including: Mark the programming entity as the target entity; Adjust the input parameters of the target entity based on the output parameters of the previous programming entity; adjust the output parameters of the target entity based on the input parameters of the next programming entity.

[0015] Preferably, adjusting the output parameters of the target entity includes: Determine whether the output function of the program code corresponding to the target entity meets the input parameter requirements of the subsequent programming entity; If yes, then adjust the output parameters of the target entity; If not, match the data transformation code and adjust the output parameters of the target entity according to the data transformation code.

[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention utilizes an AI model to intelligently assess and refine programming requirements, significantly improving their accuracy and feasibility. Specifically, the AI ​​model automatically identifies several programming entities within the requirements based on the principle of programming entities, validating them from both formal and substantive dimensions. The formal principle requires the programming requirements to include necessary entities, ensuring structural completeness. The substantive principle assesses the rationality of data flow between necessary entities, guaranteeing logical feasibility. When a requirement fails to meet these principles, the AI ​​model accurately locates the missing entity, analyzes and matches matching entities, and generates prompts to guide the user in refining the requirements. This invention effectively solves problems such as ambiguous requirements and logical loopholes caused by insufficient technical skills or limited expressive abilities, avoiding repeated modifications due to unclear requirements in subsequent programming stages, significantly improving programming efficiency and reducing development costs. Furthermore, this invention helps users with no prior technical experience or those without a technical background to express their programming intentions more smoothly, lowering the barrier to entry for programming.

[0017] 2. This invention leverages AI models and entity time sequences in the code generation and adaptation process to achieve efficient generation and precise integration of program code. The AI ​​model first extracts programming entities from the programming requirements and integrates them into a time sequence according to the data flow order. Based on this, program code for each entity is generated sequentially. During the generation process, the AI ​​model prioritizes necessary entities to construct the main framework of the program, and then verifies and matches non-essential entities between adjacent necessary entities to ensure the integrity and logic of the code. Subsequently, the program code is adapted according to the entity order, and the input and output parameters of each entity's code are adjusted according to the data flow direction. If the output function does not meet the input requirements of subsequent entities, data conversion code is matched and adjusted. This series of operations ensures that the generated program code closely matches the programming requirements, and parameter matching and data flow between modules are smooth, significantly reducing the workload of code debugging and modification. Compared with traditional programming methods, this method eliminates the need for manual handling of complex parameter adaptation and logical connection issues, significantly improving the efficiency and accuracy of code generation, and is particularly suitable for rapid development scenarios and applications with high requirements for programming efficiency. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the method steps of the AI-assisted online programming method in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the method steps for determining whether programming requirements satisfy the programming entity principle in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the method steps for improving programming requirements in an embodiment of the present invention. Detailed Implementation

[0020] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Existing programming methods present multiple cognitive and practical challenges for beginners or those without a technical background. For example, programming languages ​​employ extensive symbolic syntax, and their rules differ significantly; programming requires breaking down real-world problems into computer-executable logical steps, a skill difficult to cultivate without training; and programming necessitates environment setup and tool installation, a complex and error-prone process. Due to these difficulties, ordinary people struggle to complete programming tasks. This invention aims to solve these technical problems.

[0022] Please see Figure 1 The first aspect of this invention provides an AI-assisted online programming method, comprising: S100: Receive programming requirements; determine whether the programming requirements meet the programming entity principle through the AI ​​model; if yes, proceed to the programming stage; if no, prompt for improvement of the programming requirements; the programming entity principle includes the formal principle and the substantive principle. S200: In the programming phase, the programming entities required for programming are extracted using an AI model; these programming entities are then integrated into an entity time sequence according to the data flow order. S300: Extract the programming entities from the entity time sequence in sequence, and output the program code of the programming entities with the assistance of AI model; adapt the program code according to the order of the programming entities.

[0023] S100: Receive programming requirements; determine whether the programming requirements meet the programming entity principle through the AI ​​model; if yes, proceed to the programming stage; if no, prompt for improvement of the programming requirements.

[0024] The AI ​​models in this invention are generative large models that can interact with the programming environment, such as GPT model, Doubao, and Wenxin Yiyan. These AI large models are trained with a large amount of data and can be fine-tuned after being combined with specific scenarios, that is, the development cost is reduced by "basic capabilities + scenario adaptation".

[0025] Users input code requirements through various means on the interactive interface. Data processing technology processes these code requirements into text data, which is then confirmed by the user as the programming requirement and sent to the AI ​​model.

[0026] The types of code input methods mentioned above mainly depend on the input methods supported by the interactive interface. For example, if a user wants to write code for a specific function on a computer, the user can enter text requirements in the input box of the corresponding program on the computer. Data processing technology will then be used to organize and refine the text requirements to obtain text data. In this scenario, the user can also input code requirements via voice input. Natural language processing technology will then be used to process and refine the input code requirements to obtain text data. In other scenarios, such as importing pre-written code onto a device, this pre-written code can also serve as a code requirement.

[0027] Upon receiving programming requirements, the diverse input methods and varying user skill levels and ability to express their needs can lead to various issues that prevent their conversion into concrete code. Therefore, rapid validation of programming requirements is necessary to improve their completeness and increase the efficiency of transforming them into program code.

[0028] In a preferred embodiment, determining whether programming requirements satisfy the programming entity principle using an AI model includes: S111: Identify and extract several programming entities from the programming requirements; S112: Determine whether several programming entities satisfy the formal and substantive principles; If yes, then the programming requirements are deemed to satisfy the programming entity principle; No, then it is determined that the programming entity principle is not met.

[0029] In this invention, the verification of programming requirements is achieved through an AI model. It mainly determines whether each programming entity within the programming requirement and the relationships between them meet the preset programming entity principles. If the programming entity principles are met, the programming requirement is deemed to have passed the verification. The content requirements of the programming requirement are clear and the logical relationships are reasonable.

[0030] To determine whether programming requirements meet the programming entity principle, it is necessary to first extract the programming entities from the programming requirements. Programming entities refer to explicit functional descriptions or explicit data carriers in programming requirements. These programming entities will ultimately be transformed into program code or serve as the main data for program code execution.

[0031] For example, the programming requirement is "Extract all products and their corresponding production dates from the XXX.docx document". In this requirement, "XXX.docx document" is a specific data carrier and can be used as a programming entity; "extract" is a specific function description and can be used as a programming entity; "products and their corresponding production dates" are also specific data carriers and can be used as programming entities. The programming entities corresponding to this requirement are: "XXX.docx document", "extract", and "products and their corresponding production dates".

[0032] When validating programming requirements, the primary focus is on whether they meet the Programming Entity Principle, which includes both formal and substantive principles. Only when a programming requirement satisfies both formal and substantive principles can it be considered valid, allowing subsequent programming support operations to proceed.

[0033] In a preferred embodiment, please refer to Figure 2 Determine whether several programming entities satisfy the formal and substantive principles, including: S121: Determine whether several programming entities contain the necessary entities required by the programming entity principle; If yes, then the formal principle is satisfied; whereby the formal principle is used to evaluate the composition of the programming entity; No, then it is determined that the formal principle is not satisfied; S122: Determine whether the data flow between several necessary entities is reasonable; If yes, then the substance principle is satisfied; the substance principle is used to evaluate the data interaction between programming entities. If not, then the substantive principle is not met.

[0034] Verifying whether programming requirements satisfy the formal principle mainly involves verifying whether the programming requirements contain the programming entities required by the programming entity principle, that is, determining whether several programming entities contain the necessary entities required by the programming entity principle.

[0035] To ensure the logical consistency of the output program code and its alignment with programming requirements, the programming requirements must be clearly defined and logically sound. Specifically, they must include at least data, analysis, and application-related programming entities. Data refers to the data carrier in the programming requirements, such as the "XXX.docx document" in the previous example; analysis refers to the methods used to process or analyze the data, such as "extraction" in the previous example; and application refers to the results of the data processing and their display and storage, such as "all products and their corresponding production dates" in the previous example, which is stored in the cache by default.

[0036] If a programming requirement contains at least one data-related programming entity, at least one analysis-related programming entity, and at least one application-related programming entity, then the programming requirement is deemed to satisfy the formal principle of the programming entity principle. It should be noted that the analysis-related programming entity in the programming requirement should ideally be somewhere between the data-related and application-related programming entities to ensure the smoothness of the data processing flow.

[0037] Verifying whether programming requirements satisfy the substance principle primarily involves verifying whether the programming entities, as per the requirements, can guarantee the reasonableness of data processing. This reasonableness refers to the matching of data, analysis, and application. The substance principle mainly aims to determine whether the necessary entities in the programming requirements can process the data into the desired result. If they can, the programming requirements are deemed to satisfy the substance principle.

[0038] For example, a programming requirement might be "Extract all products and their corresponding production dates from the document XXX.docx". Extracting "all products and their corresponding production dates" from the data carrier "XXX.docx document" is logically complete and clear, without any logical inconsistencies. Conversely, if the programming requirement is "Simulate all products and their corresponding production dates from the document XXX.docx", it's clear that it's impossible to know how to simulate products and their corresponding production dates from the document. Therefore, while this programming requirement satisfies the formal principle, it does not satisfy the substance principle because the overall logic is unrealizable, and thus does not satisfy the entity principle of programming.

[0039] It is worth noting that when verifying whether programming requirements meet the programming entity principle, there is no restriction on whether to verify the formal principle first and then the substantive principle, or vice versa.

[0040] In a preferred embodiment, prompts are provided to refine programming requirements, including: S131: Extract programming entities from programming requirements that do not satisfy the programming entity principle, and treat them as missing entities; S132: Generate prompt information based on missing entities, and improve the programming requirements based on the prompt information.

[0041] When programming requirements do not meet the programming entity principle, it means that the programming requirements either do not meet the formal principle or the substance principle.

[0042] Failure to meet the formality principle indicates that the programming requirement is missing a necessary entity. For example, if the programming requirement includes data-related and analysis-related programming entities, but lacks an analysis-related programming entity, then that analysis-related programming entity will be considered a missing entity. For instance, if the programming requirement is "Extract all products and their corresponding production dates," clearly, the data source is not explicitly stated. Based on the missing entity, i.e., the analysis-related programming entity, a prompt message can be generated. This prompt message could be something like "From which file were all products and their corresponding production dates extracted?" Users can then refine their programming requirement based on this prompt message.

[0043] Failure to meet the substance principle indicates that a necessary entity in the programming entity does not match the other necessary entities. For example, the programming requirement includes data-related, analysis-related, and application-related programming entities, but the analysis-related programming entity cannot match the other two necessary entities. As in the aforementioned programming requirement "Simulate all products and their corresponding production dates from the XXX.docx document," although the programming entity exists, it is clearly unreasonable. A prompt message can be generated: "Unable to simulate all products and their corresponding production dates from the XXX.docx document; can they be directly extracted from the XXX.docx document?" This prompt message can be used to refine the programming requirement.

[0044] In a preferred embodiment, please refer to Figure 3 Before generating prompts based on missing entities, an AI model analyzes the missing entities and matches them with programming entities that conform to the principles of programming entities, including: S141: Determine the necessary entities in programming requirements based on the programming entity principle; S142: Identify the programming entity principles violated by the missing entity, generate matching information by combining the necessary entities; perform entity matching in the programming scenario based on the matching information to obtain the programming entity.

[0045] Considering users' technical skills and expressive abilities, the quality and efficiency of users completing their programming requirements cannot be guaranteed. Therefore, after identifying the missing entity, an AI model is used to match the programming entity that can fulfill the missing entity's function based on other necessary entities, and a prompt message is generated based on the matched programming entity.

[0046] For example, the programming requirement is "Extract all products and their corresponding production dates from the XXX.docx document and store the sorted results in disk XX." Based on other necessary entities, it can be determined that this programming requirement does not explicitly specify how to analyze the data, i.e., how the sorting results are obtained. It can be matched that the products can be sorted according to their production dates; that is, the matching programming entity is "Sort products according to their production dates." Based on this, the following prompt message can be generated: "The method for obtaining the sorting results is missing. Can the products be sorted according to their production dates to obtain the sorting results?"

[0047] In a preferred embodiment, the programming entities with missing entity matches are sorted to obtain an entity matching sequence; wherein, the sorting of programming entities is based on usage frequency or processing efficiency. Prompt information is generated based on the entity matching sequence; or, programming entities are selected from the entity matching sequence, programming requirements are improved, and prompt information is generated based on the improved programming requirements.

[0048] Since it's based on fuzzy matching of necessary entities and programming scenarios, multiple programming entities corresponding to the missing entity can be matched. These entities are then sorted according to usage frequency or processing efficiency. At least one entity is selected from the sorted results and merged to generate a prompt message, which is sent to the user for confirmation to refine the programming requirements. Alternatively, the matched programming entities can be used directly to refine the programming requirements, which are then sent to the user for confirmation.

[0049] In a preferred embodiment, after the user selects or confirms a programming entity in response to the prompt, the missing entity in the programming requirements is replaced with the programming entity to obtain complete programming requirements.

[0050] Based on the analysis of other necessary entities in the programming requirements, the missing entity may correspond to a programming entity. This programming entity is then integrated into the prompt information for the user to choose from. If the user selects a matching programming entity, that programming entity is used to replace the missing entity in the programming requirements. This can improve the efficiency of completing programming requirements and reduce the difficulty of completing them.

[0051] S200: In the programming phase, the programming entities required for programming are extracted through an AI model; the programming entities are then integrated into an entity time sequence according to the data flow order.

[0052] After entering the programming phase, it is necessary to extract programming entities from the programming requirements using an AI model. This involves extracting all programming entities from the requirements, including both necessary and unnecessary entities. The extracted programming entities are then integrated into an entity time-series sequence according to the data flow order. The programming entities in this entity time-series sequence must satisfy the programming entity principle.

[0053] Data flow sequence refers to the direction of data flow during analysis and processing. For example, if the programming requirement is "Extract all products and their corresponding production dates from the XXX.docx document", the data flow sequence in this programming requirement would be "XXX.docx document" → "Extract" → "All products and their corresponding production dates".

[0054] The necessary entities in the entity time sequence are linked together to form the main logic of the entire programming requirement, while non-essential entities refer to one of the ways to link the necessary entities.

[0055] S300: Extract the programming entities from the entity time sequence in sequence, and output the program code of the programming entities with the assistance of AI model; adapt the program code according to the order of the programming entities.

[0056] After determining the time-series entity sequence, the data processing flow in the entire programming requirements is essentially defined. The next step is to output program code for each data processing flow, concatenate the code snippets, and adjust the parameters to obtain program code that meets the programming requirements.

[0057] In a preferred embodiment, the program code of the programming entity is output with the assistance of an AI model, including: S311: Mark the necessary entities in the programming entity and output the program code of the necessary entities; S312: Extract unnecessary entities between adjacent necessary entities based on entity time sequence; determine whether the unnecessary entities meet the data connection requirements of adjacent necessary entities; If yes, then output the program code for the unnecessary entity; If not, then the programming entity is matched based on the data connection requirements between adjacent necessary entities, and the program code of the matched programming entity is output.

[0058] After extracting the programming entities from the entity time sequence, necessary entities are processed first, meaning the program code for necessary entities is output first. The program code corresponding to the necessary entities is equivalent to the main framework of the entire program. After determining the main framework, filling in the main framework completes the entire program code.

[0059] It should be noted that the program code that outputs the necessary entities refers to the output code framework. Since the program's input and output are not explicitly defined, there is no need to set relevant parameters for the program code. Therefore, the program code can be a pre-defined code block, which can be directly called when the corresponding function needs to be implemented.

[0060] After outputting the program code for the necessary entities, it is necessary to connect these program codes, that is, to output the program code for the non-necessary entities between the necessary entities. However, before outputting the program code for the necessary entities, it is also necessary to verify whether the non-necessary entities can be connected to the necessary entities. If they cannot be connected, it is necessary to re-match programming entities that meet the data requirements.

[0061] For example, the programming requirement is "to obtain standard data after normalizing the data using method A". The programming entities in this requirement are: data, normalization, and standard data. The data flow order is data → normalization → standard data. Since there are various normalization methods, method A is not a necessary entity. However, if method A is not a normalization method, then it is not qualified as a non-necessary entity. In this case, it is necessary to match the normalization method used based on "data, normalization, and standard data" and directly output the program code for the matched normalization method.

[0062] In a preferred embodiment, the program code is adapted according to the order of the programming entities, including: S321: Determine the adjacent programming entities of each programming entity according to the order of the programming entities, and mark them as adjacent entities; S322: Starting from the first programming entity, adjust the parameters of the program code of each programming entity according to the data flow direction to obtain the complete program code.

[0063] After identifying several programming entities according to programming requirements, sorting these entities according to data flow yields their adjacency relationships. Similarly, their corresponding program codes also have adjacency relationships. After the program codes for each programming entity are output, data interactions between adjacent program codes may require conversion or adjustment. Therefore, adjustments are made starting with the program code corresponding to the first programming entity. After all adjustments are completed, the complete program code is obtained.

[0064] In a preferred embodiment, parameter adjustments are made to the program code of each programming entity according to the data flow direction, including: S331: Mark the programming entity as the target entity; S332: Adjust the input parameters of the target entity based on the output parameters of the previous programming entity; adjust the output parameters of the target entity based on the input parameters of the next programming entity.

[0065] In a preferred embodiment, adjusting the output parameters of the target entity includes: Determine whether the output function of the program code corresponding to the target entity meets the input parameter requirements of the subsequent programming entity; If yes, then adjust the output parameters of the target entity; If not, match the data transformation code and adjust the output parameters of the target entity according to the data transformation code.

[0066] If the output function of the program code corresponding to the target entity does not meet the input parameter requirements of the subsequent programming entity, including formal requirements and dimensional requirements, the data output by the output function of the target entity's program code can be converted into the data required by the input parameters of the subsequent programming entity by matching the response data conversion code.

[0067] Taking the programming requirement "Extract all products and their corresponding production dates from the XXX.docx document" as an example, the programming entities are "XXX.docx document", "extract", and "products and their corresponding production dates". For the "XXX.docx document", the output program code (Code 1) is used to read the "XXX.docx document"; for "extract", the output program code (Code 2) can be a function that reads data from the document; for "products and their corresponding production dates", the output program code (Code 3) can be a function that saves the extracted data to the cache.

[0068] During the adaptation process, Code 1 sets its code parameters according to the "XXX.docx document" to be read, including the input path, output name, etc.; Code 2 sets the input path and extracts information according to the output name of Code 1; and Code 3 stores the file in the cache according to the output parameters of Code 2.

[0069] It should be noted that in actual programming, the output and input of some adjacent program code are related. For example, after code 2 extracts relevant data, it stores it in the cache. If the input parameter of code 3 is cached data by default, there is no need to set the input parameter of code 3.

[0070] In some scenarios, adjusting input and output parameters also includes adjusting data dimensions. For example, after "XXX.docx document" is read into the cache by code one, code two needs to extract the corresponding parameters. In this case, the input parameters of code two can be set to the row or column corresponding to the product and its production date.

[0071] It is worth noting that the AI-assisted online programming method provided by this invention can not only be applied to professional programming fields, but also combined with other programming-related fields. For example, in the field of smart buildings, property management personnel are typically not professional programmers, but they need to intelligently control and manage the complex equipment systems within the building. Property management personnel only need to describe their needs in Chinese, such as "When the population density in a certain area of ​​the building reaches a certain value, automatically turn on the fresh air system and adjust the lighting brightness." The system can then automatically generate the corresponding program code based on the identification and extraction of objects (area, fresh air system, lighting, etc.) in the business text, combined with the analysis of actions (turning on, adjusting) and states (population density value). This greatly simplifies the programming process of smart building control systems, enabling non-technical personnel to easily achieve intelligent linkage control of various devices, improving the efficiency and intelligence level of building management, and reducing operating costs.

[0072] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. An AI-assisted online programming method, characterized in that, include: Receive programming requests; The AI ​​model determines whether the programming requirements meet the programming entity principle; if so, the programming process begins. No, it prompts you to improve your programming requirements; among them, the programming entity principle includes the formal principle and the substantive principle; In the programming phase, the programming entities required by the programming requirements are extracted using an AI model; these programming entities are then integrated into an entity time sequence according to the data flow order. The programming entities in the time sequence of the entities are extracted sequentially, and the program code of the programming entities is output with the assistance of an AI model; the program code is then adapted according to the order of the programming entities.

2. The AI-assisted online programming method according to claim 1, characterized in that, The AI ​​model is used to determine whether the programming requirements meet the programming entity principle, including: Identify and extract several programming entities from the programming requirements; Determine whether several programming entities satisfy the formal principle and the substance principle; if yes, then the programming requirement satisfies the programming entity principle; if no, then it does not satisfy the programming entity principle.

3. The AI-assisted online programming method according to claim 2, characterized in that, Determine whether several programming entities satisfy the formal and substantive principles, including: Determine whether a plurality of the programming entities contain the necessary entities required by the programming entity principles; If yes, then the formal principle is satisfied; whereby the formal principle is used to evaluate the composition of the programming entity; No, then it is determined that the formal principle is not satisfied; Determine whether the data flow between the necessary entities is reasonable; If yes, then the substance principle is satisfied; the substance principle is used to evaluate the data interaction between programming entities. No, then the substantive principle is not met.

4. The AI-assisted online programming method according to claim 1 or 3, characterized in that, The suggested improvements to the programming requirements include: Extract programming entities from the programming requirements that do not satisfy the programming entity principles, and designate them as missing entities; Based on the missing entity, a prompt message is generated, and the programming requirements are improved according to the prompt message.

5. The AI-assisted online programming method according to claim 4, characterized in that, Before generating a prompt message based on the missing entity, the missing entity is analyzed using an AI model to match programming entities that conform to the programming entity principles, including: Based on the aforementioned programming entity principles, the necessary entities in the programming requirements are determined. Identify the programming entity principles violated by the missing entity, generate matching information by combining the necessary entity, and perform entity matching in the programming scenario based on the matching information to obtain the programming entity.

6. The AI-assisted online programming method according to claim 5, characterized in that, The programming entities that match the missing entity are sorted to obtain an entity matching sequence; wherein, the sorting of programming entities is based on usage frequency or processing efficiency. A prompt message is generated based on the entity matching sequence; or, a programming entity is selected from the entity matching sequence, the programming requirements are improved, and a prompt message is generated based on the improved programming requirements.

7. The AI-assisted online programming method according to claim 1, characterized in that, The program code of the programming entity is output with the assistance of an AI model, including: Mark the necessary entities in the programming entity and output the program code of the necessary entities; Based on the entity time sequence, extract the non-essential entities between adjacent essential entities; determine whether the non-essential entities meet the data connection requirements of adjacent essential entities; If yes, then output the program code for the unnecessary entity; If not, then the programming entity is matched based on the data connection requirements between adjacent necessary entities, and the program code of the matched programming entity is output.

8. The AI-assisted online programming method according to claim 7, characterized in that, Adapting the program code according to the order of the programming entities includes: The adjacent programming entities are determined according to the order of the programming entities and marked as adjacent entities; Starting with the first programming entity, the parameters of the program code for each programming entity are adjusted according to the direction of data flow to obtain the complete program code.

9. The AI-assisted online programming method according to claim 8, characterized in that, Adjust the parameters of the program code for each programming entity according to the direction of data flow, including: Mark the programmed entity as the target entity; Adjust the input parameters of the target entity based on the output parameters of the previous programming entity; adjust the output parameters of the target entity based on the input parameters of the next programming entity.

10. The AI-assisted online programming method according to claim 9, characterized in that, Adjust the output parameters of the target entity, including: Determine whether the output function of the program code corresponding to the target entity satisfies the input parameter requirements of the subsequent programming entity; If yes, then adjust the output parameters of the target entity; If not, match the data transformation code and adjust the output parameters of the target entity according to the data transformation code.