Automatic programming method and device, electronic equipment and storage medium
By combining predictors and editors, and integrating device knowledge and implicit prompts, project applications for automated control systems are generated. This solves the problems of poor adaptability and low programming efficiency of existing AI programming tools in complex automated control scenarios, and achieves an efficient and flexible programming solution.
Patent Information
- Application Number
- CN202511040382.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-25
AI Technical Summary
Existing AI programming tools cannot deeply understand the overall structure and industry knowledge of automated control systems in the field of automation control. They cannot program and configure equipment in a targeted manner according to the user's application intentions, making it difficult to meet the design requirements of complex automated control scenarios.
By working together with the predictor and editor, the system obtains project design requirements, identifies equipment configuration information and control programs, and generates multiple project design intents by combining basic equipment knowledge, specialized equipment knowledge and implicit prompts. The system then selects the target design intent through the editor to generate the project application, supporting visual programming and simulated operation verification.
It improves the professionalism and accuracy of programming, lowers the programming threshold, enhances the flexibility and interactivity of programming, improves the adaptability and scalability of programs, and ensures that programs meet preset operating requirements.
Smart Images

Figure CN121008778A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer programming, and more particularly to an automated programming method, apparatus, electronic device, storage medium, and computer program product. Background Technology
[0002] With the development of artificial intelligence technology, AI-assisted programming tools (AI programming tools) have been widely used in the field of computer programming. They can significantly improve programming efficiency and make up for developers' shortcomings in syntax details and algorithm design.
[0003] In the field of automation control, program writing typically involves not only pure syntax and algorithm design, but also comprehensive consideration of technical knowledge related to automation control and equipment configuration information (such as in the HVAC industry). Current AI programming tools mainly remain at the syntax level and simple algorithm design, lacking a deep understanding of the overall structure of automation control systems and industry knowledge. They cannot program and configure equipment in a targeted manner according to the user's application intent, making it difficult to meet the needs of complex automation control scenarios.
[0004] Therefore, providing an automatic programming solution that can meet the design requirements of the field of automation control is the technical problem to be solved in this application. Summary of the Invention
[0005] In view of this, this application aims to provide an automated programming solution to solve the problems of traditional auxiliary programming tools being unable to program and configure devices in a targeted manner according to actual program design needs, resulting in poor adaptability and low programming efficiency.
[0006] According to a first aspect of the embodiments of this application, an automated programming method is provided, applied to a programming system including a predictor and an editor. The method includes: obtaining design requirements for a project through the editor, and sending a project design request containing the design requirements to the predictor; performing a prediction on the design requirements through the predictor in response to the project design request, and returning multiple project design intentions to the editor; determining a target design intention from the multiple project design intentions through the editor, and sending a project programming request containing the target design intention to the predictor; performing programming design according to the target design intention through the predictor in response to the project programming request, and returning programming data to the editor; and generating an application program for the project through the editor based on the programming data.
[0007] In some embodiments, the design requirements of the project include equipment configuration information and / or equipment control programs for automated equipment.
[0008] In some embodiments, the predictor obtains the equipment category and equipment specifications of the automated equipment by identifying the equipment configuration information and / or the equipment control program in the design requirements, acquires basic equipment knowledge corresponding to the equipment category and special equipment knowledge corresponding to the equipment specifications, extracts implicit hints in the design requirements, and combines the basic equipment knowledge, the special equipment knowledge, and the implicit hints to perform prediction on the design requirements in the design prediction request to obtain the design intent of the multiple projects.
[0009] In some embodiments, after the editor determines the target design intent, the design requirements can be re-edited according to the target design intent; and the project programming request is generated based on the re-edited result of the target design intent and the design requirements.
[0010] In some embodiments, the programming data generated by the predictor includes program configuration data and program code data.
[0011] In some embodiments, the predictor can be programmed in the following ways:
[0012] Implicit hints are extracted from the design requirements of the project programming request; combined with the basic equipment knowledge, the special equipment knowledge, the implicit hints, and the target design intent, programming design is performed to obtain the project's program configuration data and program code data.
[0013] In some embodiments, after the editor obtains the programming data, it further includes performing any of the following operations:
[0014] Modify the interface functions of each calling interface in the programming data;
[0015] Adjust the calling order of each interface in the programming data;
[0016] In response to the interface call commands of each call interface in the programming data, the test call operation of each call interface is executed.
[0017] In some embodiments, the editor is a visual programming tool, which includes a screen rendering module and a graphical editing interface. After the editor obtains the programming data, the screen rendering module can render the programming data to obtain multiple concatenated graphical program blocks; and the graphical editing interface can then display these concatenated graphical program blocks.
[0018] In some embodiments, the method further includes: using the predictor, according to a historical data recording strategy, obtaining prediction data that satisfies the historical data recording strategy from the plurality of project design intentions corresponding to the project design request and / or the programming data corresponding to the project programming request, and generating a historical prediction data package.
[0019] In some embodiments, the method further includes:
[0020] In response to a new project design request, the predictor retrieves the prediction data associated with the new project design request from the historical prediction data package, and performs a prediction of design intent based on the design requirements in the new project design request and the prediction data associated with the new project design request, returning multiple project design intents to the editor; or
[0021] In response to a new project programming request, the predictor retrieves the prediction data associated with the new project programming request from the historical prediction data package, performs the programming design based on the target design intent in the new project programming request and the prediction data associated with the new project programming request, and returns the programming data to the editor.
[0022] In some embodiments, after the editor obtains the application of the project, the application of the project can be simulated to obtain the simulation results; if the simulation results do not meet the preset results of the project, the process returns to the step of sending a project design request containing the design requirements to the predictor through the editor until the simulation results meet the preset results.
[0023] According to a second aspect of this application, an automated programming apparatus is provided, comprising an editor and a predictor, wherein:
[0024] The editor is configured to: obtain the design requirements of the project, send a project design request containing the design requirements to the predictor, determine a target design intent from multiple project design intents returned by the predictor, send a project programming request containing the target design intent to the predictor, and generate the application of the project based on the programming data returned by the predictor.
[0025] The predictor is configured to: in response to a project design request from the editor, perform predictions on the design requirements in the project design request, return multiple project design intentions to the editor, in response to a project programming request from the editor, perform programming design according to the target design intentions in the project programming request, and return the programming data of the project programming request to the editor.
[0026] According to a third aspect of this application, an electronic device is provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory is used to store at least one executable instruction, the executable instruction causing the processor to perform an operation corresponding to the automated programming method described in the first aspect.
[0027] According to a fourth aspect of this application, a computer-readable storage medium is provided, wherein computer instructions are stored on the computer-readable storage medium, and when executed by a processor, the computer instructions cause the processor to perform the automated programming method as described in the first aspect.
[0028] According to a fifth aspect of this application, a computer program product is provided, including computer instructions that instruct a computing device to perform operations corresponding to the automated programming method described in the first aspect.
[0029] The automated programming solutions provided in this application, through the collaborative work of an editor and a predictor, can automate the process from obtaining project design requirements to generating project applications. They not only assist in writing syntax and algorithms but also compensate for developers' lack of knowledge in the field of automation control, thus lowering the programming threshold.
[0030] The automated programming solutions provided in this application identify the equipment configuration information and equipment control programs of a project, extract basic equipment knowledge, special equipment knowledge and implicit prompts related to the project to predict the project's design intent, thereby improving the professionalism and accuracy of design intent prediction by integrating professional domain knowledge and contextual understanding.
[0031] The automated programming solutions provided in this application allow users to select the target design intent that best matches the actual design requirements from multiple intent options, and then selectively edit the design requirements based on this. This not only reduces the complexity of prompt input operations but also enhances the flexibility and interactivity of programming, making the project programming results more in line with the actual expectations of developers and improving the quality of program programming.
[0032] The automated programming solutions provided in this application integrate multi-dimensional information such as implicit prompts, basic equipment knowledge, specialized equipment knowledge, and target design intent to execute project programming design. This can improve the accuracy and adaptability of project configuration data and program code data, and reduce the cost of program adjustment and modification.
[0033] The automated programming solutions provided in this application balance the inaccuracy of the programming data generated by the predictor with the accuracy requirements of the programmer by modifying the interface functions, adjusting the interface call order, and conducting interface call testing. Simultaneously, they increase the customizability and flexibility of the program, allowing developers to personalize the interfaces according to actual application scenarios to meet different calling logic or extension needs, further improving the program's adaptability and scalability.
[0034] The automated programming solutions provided in this application reduce the programming skill threshold for developers by transforming abstract programming data into intuitive graphical content, making it easier for developers (especially non-professional programmers) to understand and operate the program.
[0035] The automated programming solutions provided in this application generate historical prediction data packages by filtering prediction data that meets the historical data recording strategy from the historical project design intent and / or historical programming data generated by the predictor. When executing a new project design request or project programming request through the predictor, the predictor can directly obtain the basic programming data related to the project design request or project programming request from the historical prediction data packages to execute the relevant predictions, without having to package the basic programming data of the project into the project design request or project programming request each time. This reduces the amount of data transfer between the editor and the predictor, improves the data processing speed of the predictor, and enhances the prediction execution efficiency.
[0036] The automated programming solutions provided in this application, through simulated operation and verification programs, can ensure that the final generated project application meets the preset operating requirements, thereby improving the reliability of the programming results. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating an automated programming method as an exemplary embodiment of this application.
[0038] Figure 2 This is a flowchart illustrating an automated programming method as another exemplary embodiment of this application.
[0039] Figure 3 This is a structural block diagram of an automated programming apparatus that is an exemplary embodiment of this application.
[0040] Figure 4 This is a schematic diagram of an electronic device that is an exemplary embodiment of this application.
[0041] List of reference numerals in the attached diagram:
[0042] 100. Automation Programming Methods
[0043] 102. Using the editor, obtain the project's design requirements and send a project design request containing these requirements to the predictor.
[0044] 104. Using the predictor, in response to project design requests, perform predictions on design requirements and return multiple project design intents to the editor.
[0045] 106. Using an editor, determine a target design intent from the plurality of project design intents, and send a project programming request containing the target design intent to the predictor.
[0046] 108. Using the predictor, respond to project programming requests, execute programming designs according to the target design intent, and return programming data to the editor.
[0047] 110. Using the editor, generate the project's application based on the programming data.
[0048] 200. Automation Programming Methods
[0049] 202. Simulate the application running of the project and obtain the simulation results.
[0050] 204. If the simulation results do not meet the preset results of the project, return to step 102 until the simulation results meet the preset results.
[0051] 300. Automated programming device; 404. Communication interface
[0052] 302, Editor; 406, Memory
[0053] 304, Predictor; 408, Communication Bus
[0054] 400. Electronic devices; 410. Programs
[0055] 402. Processor Detailed Implementation
[0056] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.
[0057] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. The steps in the following method embodiments are for illustrative purposes only and are not intended to limit the invention.
[0058] With the development of artificial intelligence (AI) technology, AI-assisted programming tools have been widely used in the information technology (IT) field. For example, GitHub Copilot can generate code suggestions based on the code and comments entered by developers, and supports multiple programming languages such as Python, JavaScript, and Java, thereby accelerating code development and reducing errors. In the field of automation control, tools such as Codesys AI and Siemens Industrial Copilot have also initially achieved the function of generating control programs based on user instructions.
[0059] However, existing AI-assisted programming technologies mainly focus on syntax and simple algorithm design, and are only suitable for small-scale equipment control scenarios. They cannot understand the user's design intent and assist the software in completing related programming work based on the upper-level application logic of automation control, making it difficult to meet the design requirements of complex automation control scenarios (such as HVAC systems).
[0060] Specifically, in the field of automation control, program writing typically involves not only pure syntax and algorithm design, but also comprehensive consideration of domain knowledge related to automation control and equipment configuration information (such as in the HVAC industry). Existing AI-assisted programming tools lack an understanding of the overall structure of automation control systems and industry knowledge, and cannot accurately identify the developer's true intent in specific application scenarios. This results in applications that often fail to meet the needs of complex control logic scenarios. Furthermore, the generated applications are prone to control errors or executability issues.
[0061] In view of this, this application proposes an automated programming scheme to solve various problems existing in the prior art.
[0062] The specific implementation of each embodiment of this application will be described in detail below with reference to the accompanying drawings.
[0063] Automation programming methods
[0064] Figure 1 This is a flowchart illustrating an automated programming method as an exemplary embodiment of this application, which can be applied to programming systems including predictors and editors.
[0065] The predictor and editor in this embodiment can be deployed in different ways. For example, both the editor and the predictor can be deployed locally; or the editor can be deployed locally and the predictor can be deployed in the cloud; or both the editor and the predictor can be deployed in the cloud. Those skilled in the art can plan according to actual needs, and this application does not impose any restrictions on this.
[0066] In some embodiments, the predictor includes a neural network model, or the predictor has the function of calling a neural network model to perform relevant prediction operations in the automated programming process.
[0067] In this embodiment, the neural network model is any model with natural language understanding capabilities, including but not limited to: Large Language Model (LLM).
[0068] In some embodiments, the editor is a various code editor. Preferably, the editor is a visual programming tool (e.g., Blockly, etc.) to lower the technical threshold for implementing the technical solutions of this application and allow non-programming professionals to participate in programming work for complex logic control scenarios.
[0069] like Figure 1 As shown, this embodiment mainly includes the following steps:
[0070] Step 102: Using the editor, obtain the project's design requirements and send a project design request containing the design requirements to the predictor.
[0071] In some embodiments, where this embodiment is applied to the field of automated equipment control, the design requirements of the project may include equipment configuration information and / or equipment control programs for the automated equipment.
[0072] In some embodiments, the design requirements for a project may be generated through manual editing and / or automatically obtained from external sources.
[0073] Step 104: Using the predictor, in response to the project design request, perform predictions on the design requirements and return multiple project design intents to the editor.
[0074] In some embodiments, the predictor can identify equipment configuration information and / or equipment control programs in the design requirements, obtain the equipment category and equipment specifications of the automated equipment, acquire basic equipment knowledge corresponding to the equipment category and special equipment knowledge corresponding to the equipment specifications, extract implicit hints in the design requirements, and predict the design intent of the project by combining basic equipment knowledge, special equipment knowledge and implicit hints, thereby obtaining multiple project design intents.
[0075] Specifically, equipment categories are used to identify the type of automated equipment and are essential foundational information for predictors to acquire basic equipment knowledge for intent prediction and programming design. For example, in the field of building automation control, equipment categories for automated equipment may include, but are not limited to: HVAC control systems, water supply and drainage control systems, lighting control systems, power supply control systems, elevator operation control systems, fire monitoring systems, etc.
[0076] Equipment specifications identify the specific parameters, performance indicators, or model differences of automated equipment within the same category. They are crucial information for the predictor to acquire specialized equipment knowledge for automated equipment, enabling precise programming design. For example, specialized equipment knowledge for HVAC control systems may include: typical VAV (Variable Air Volume) or HVAC application templates, national standards, controller data sheets, and performance parameters. In this embodiment, some specialized equipment knowledge can be uploaded to the Retrieval Enhanced Generation (RAG) agent in file format, while other specialized equipment knowledge can be combined with information from design requirements as additional context.
[0077] Furthermore, predictors can extract implicit cues from design requirements that are not explicitly stated but are relevant to the project design. For example, in the control application scenarios of automated equipment, implicit cues may include the environmental adaptability requirements of the automated equipment (e.g., outdoor scenarios, high-temperature scenarios), redundancy safety measures requirements (e.g., hierarchical display of equipment permissions, mistake-proof design, etc.), and equipment compatibility requirements.
[0078] By combining basic equipment knowledge associated with equipment categories, specialized equipment knowledge associated with equipment specifications, and implicit hints in design requirements, the predictor can more accurately analyze and predict design requirements, thereby generating multiple project design intentions that are more in line with equipment characteristics. This provides directional guidance for subsequent programming design that conforms to the characteristics of equipment type, ensuring that the entire automated programming process is more in line with the essential attributes and application needs of the equipment.
[0079] Step 106: Using the editor, send a project programming request containing the target design intent to the predictor based on a selected target design intent from multiple project design intents.
[0080] In some embodiments, the editor can also re-edit the project's design requirements based on the determined target design intent, and generate project programming requests based on the re-edited results of the target design intent and design requirements.
[0081] Specifically, if the developer believes that there are deviations between the various project design intentions provided by the editor and the project design requirements in step 102, the project design intention that is closest to the project design requirements can be selected from the various project design intentions and determined as the target design intention. Based on the determined target design intention, the project design requirements in step 102 are edited again so that the re-edited design requirements are more closely aligned with the target design intention, providing more accurate input information for the subsequent predictor to execute programming design.
[0082] In some embodiments, if there is still a significant difference between the selected target design intent and the project design requirements, the project design request can be regenerated based on the re-edited results of the selected target design intent and design requirements, and the process returns to step 104 to re-execute the prediction of the project design intent through the predictor.
[0083] Step 108: In response to the project programming request, the predictor executes the programming design according to the target design intent and returns the programming data to the editor.
[0084] In some embodiments, the programming data generated by the predictor includes program configuration data and program code data.
[0085] In some embodiments, the predictor can extract implicit hints of design requirements from the project programming request, and combine basic equipment knowledge, special equipment knowledge, implicit hints and target design intent to perform programming design, thereby obtaining the project's program configuration data and program code data.
[0086] Specifically, by integrating information from multiple dimensions such as basic equipment knowledge, specialized equipment knowledge, implicit hints, and target design intent, the predictor enables the generated program configuration data and program code data to be accurately adapted to the specific application scenarios of the project. Whether it is equipment operating parameters, interface adaptation, or function implementation, it is more in line with the actual application requirements, reducing the cost of subsequent program adjustments.
[0087] Step 110: Using the editor, generate the project's application based on the program configuration data and program code data.
[0088] In some embodiments, when the editor is a visual programming tool (e.g., the Blockly programming tool), it may further include a screen rendering module and a graphical editing interface to present the project's application graphically. Specifically, after the visual programming tool obtains the programming data, the screen rendering module can render the programming data to obtain multiple spliced graphical program blocks, and the spliced graphical program blocks can be displayed through the graphical editing interface.
[0089] In some embodiments, after obtaining the project's programming data, the editor may further perform any of the following operations:
[0090] (1) Modify the interface functions of each calling interface in the programming data;
[0091] (2) Adjust the calling order of each calling interface in the programming data;
[0092] (3) Responding to the interface call commands of each call interface in the programming data, execute the test call operation of each call interface.
[0093] In some embodiments, after generating multiple project design intentions corresponding to a project design request, or generating programming data corresponding to a project programming request, the predictor may, according to a historical data recording strategy, filter out prediction data that meets the historical data recording strategy from each project design intention corresponding to the project design request and / or from the programming data corresponding to the project programming request, so as to generate a historical prediction data package.
[0094] In some embodiments, when a predictor receives a new project design request, it may obtain the prediction data associated with the new project design request from the historical prediction data packet, and combine it with the prediction data associated with the new project design request based on the design requirements in the new project design request to perform a prediction of the design intent, thereby obtaining multiple project design intents for the new project design request.
[0095] In other embodiments, when the predictor receives a new project programming request, it can obtain the prediction data associated with the new project programming request from the historical prediction data packet, and combine it with the prediction data associated with the new project programming request to perform programming design based on the target design intent in the new project programming request, thereby obtaining the programming data corresponding to the new project programming request.
[0096] Specifically, in the field of programming design for automated equipment, there are many similar programming steps for different types of automated equipment, or automated equipment of the same type but different specifications, such as tool function definition, programming rule definition, equipment parameter configuration rule definition, and equipment alarm rule definition. To address this, this application embodiment establishes a historical data recording strategy to retain basic prediction data from historical prediction tasks (project design intent prediction tasks, programming design prediction tasks) executed by the predictor. This eliminates the need for developers to manually edit the basic programming design requirements of new projects into the project design requirements when executing new project development and design tasks, simplifying the complexity of editing project design requirements and reducing the amount of data transfer between the editor and the predictor. Simultaneously, when executing new project design requests or new project programming requests, the predictor can directly retrieve the basic programming data related to the project design request or project programming request from the historical prediction data package to execute relevant predictions, thereby improving the predictor's data processing speed and enhancing prediction execution efficiency.
[0097] In summary, the automated programming method of this embodiment, through the collaborative work of the editor and the predictor, can automate the process from obtaining project design requirements to generating project applications, thereby enabling assisted writing of syntax and algorithms, reducing the workload of manual code editing, and lowering the technical threshold for programming.
[0098] The automated programming method in this embodiment improves the professionalism and accuracy of design intent prediction by extracting basic equipment knowledge corresponding to equipment categories, special equipment knowledge corresponding to equipment specifications, and implicit hints in design requirements.
[0099] The automated programming method in this embodiment, by determining the target design intent and selectively editing the design requirements on this basis, not only reduces the complexity of the design requirement input operation, but also enhances the flexibility and interactivity of programming, making the project programming results more in line with the actual expectations of developers and improving the quality of subsequent program programming.
[0100] The automated programming method in this embodiment can improve the accuracy and adaptability of programming data by integrating multiple dimensions of information, including implicit prompts, basic equipment knowledge, specialized equipment knowledge, and target design intent.
[0101] The automated programming method in this embodiment balances the inaccuracy of the programming data output by the predictor with the accuracy requirements of the programmer by selectively modifying the functions of the calling interfaces, adjusting the order of interface calls, and performing interface call tests on each interface. Simultaneously, it can flexibly meet different calling logic or extension needs, further improving the adaptability and scalability of the program editor.
[0102] The automated programming method in this embodiment transforms abstract programming data into intuitive graphical content, lowering the programming skill threshold for developers and making it easier for developers (especially non-professional programmers) to understand and operate the program.
[0103] Figure 2 This is a flowchart illustrating the processing of an automated programming method according to another embodiment of this application. This embodiment can be continued... Figure 1 Continue with step 110. For example... Figure 2 As shown, the automated programming method 200 in this embodiment mainly includes:
[0104] Step 202: Simulate the running of the project's application and obtain the simulation results.
[0105] In some embodiments, the application of the project can be simulated by the built-in simulation run function of the editor, or the application can be simulated by importing it into an external simulation runner. This application does not limit this.
[0106] Step 204: Determine whether the simulation results meet the project's preset results.
[0107] In some embodiments, the simulated running parameters in the simulated running results can be compared with the preset running parameters in the preset running results. If the deviation between the two falls within the allowable deviation range, the result is that the simulated running results meet the preset running results; if the deviation between the two does not fall within the allowable deviation range, the result is that the simulated running results do not meet the preset running results.
[0108] In this embodiment, if the simulation result does not meet the preset result, execution can be returned. Figure 1 Step 102 is used to optimize and adjust the project application; if the simulation results meet the preset results, then step 206 is performed.
[0109] Step 206: Output the final application of the project.
[0110] In summary, the automated programming scheme of this embodiment, by simulating the running of the verification program, can ensure that the final generated project application meets the preset running requirements and improve the reliability of the program programming results.
[0111] Automated programming device
[0112] Figure 3 This is a structural block diagram of an automated programming apparatus 300 as an exemplary embodiment of this application. As shown, the automated programming apparatus 300 of this embodiment includes an editor 302 and a predictor 304.
[0113] The editor 302 is configured to: obtain the design requirements of the project, send a project design request containing the design requirements to the predictor 304, determine a target design intent from multiple project design intents returned by the predictor 304, send a project programming request containing the target design intent to the predictor 304, and generate the application of the project according to the programming data of the project returned by the predictor 304.
[0114] The predictor 304 is configured to: perform predictions on the design requirements in the project design request in response to the project design request of the editor 302, return multiple project design intentions to the editor 302, perform programming design according to the target design intentions in the project programming request in response to the project programming request of the editor 302, and return the programming data of the project programming request to the editor 302.
[0115] In some embodiments, the design requirements of the project include equipment configuration information and / or equipment control programs for automated equipment.
[0116] In some embodiments, the predictor 304 is configured to: obtain the equipment category and equipment specifications of the automated equipment by identifying the equipment configuration information and / or the equipment control program in the design requirements; acquire basic equipment knowledge corresponding to the equipment category and special equipment knowledge corresponding to the equipment specifications; extract implicit hints in the design requirements; and combine the basic equipment knowledge, the special equipment knowledge, and the implicit hints to perform prediction on the design requirements in the design prediction request to obtain the design intent of the plurality of projects.
[0117] In some embodiments, the editor 302 is configured to: after determining the target design intent, re-edit the design requirements according to the target design intent; and generate the project programming request based on the re-edited result of the target design intent and the design requirements.
[0118] In some embodiments, the programming data generated by the predictor 304 includes program configuration data and program code data.
[0119] In some embodiments, the predictor 304 is configured to: extract implicit hints from the design requirements of the project programming request; combine the basic equipment knowledge, the special equipment knowledge, the implicit hints, and the target design intent to perform programming design and obtain the project's program configuration data and program code data.
[0120] In some embodiments, the editor 302 is configured to, after obtaining the programming data, further perform any of the following operations:
[0121] Modify the interface functions of each calling interface in the programming data;
[0122] Adjust the calling order of each interface in the programming data;
[0123] In response to the interface call commands of each call interface in the programming data, the test call operation of each call interface is executed.
[0124] In some embodiments, the editor 302 is a visual programming tool and includes a screen rendering module and a graphical editing interface (not shown). After the editor 302 obtains the programming data, the screen rendering module can render the programming data to obtain multiple spliced graphical program blocks; and the graphical editing interface can display the spliced graphical program blocks.
[0125] In some embodiments, the predictor 304 is configured to: obtain prediction data that satisfies the historical data recording strategy from the plurality of project design intentions corresponding to the project design request and / or the programming data corresponding to the project programming request, and generate a historical prediction data package according to the historical data recording strategy.
[0126] In some embodiments, predictor 304 is configured to: in response to a new project design request, retrieve prediction data associated with the new project design request from the historical prediction data packet, and perform a prediction of design intent based on the design requirements in the new project design request and the prediction data associated with the new project design request, and return multiple project design intents to the editor; or
[0127] In some embodiments, the predictor 304 is configured to: in response to a new project programming request, obtain prediction data associated with the new project programming request from the historical prediction data packet, perform programming design based on the target design intent in the new project programming request and the prediction data associated with the new project programming request, and return programming data to the editor.
[0128] In some embodiments, the editor 302 is configured to: after obtaining the application of the project, simulate running the application of the project to obtain the simulation running result; if the simulation running result does not meet the preset running result of the project, return to the step of sending a project design request containing the design requirements to the predictor through the editor, until the simulation running result meets the preset running result.
[0129] electronic devices
[0130] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device. See also... Figure 4 The electronic device 400 provided in this application embodiment includes: a processor 402, a communications interface 404, a memory 406, and a bus 408. Wherein:
[0131] The processor 402, communication interface 404, and memory 406 communicate with each other via bus 408.
[0132] Communication interface 404 is used to communicate with other electronic devices or servers.
[0133] The processor 402 is used to execute program 410, specifically to perform the relevant steps in the above-described automated programming method embodiment.
[0134] Specifically, program 410 may include program code data, which includes computer operation instructions.
[0135] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0136] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0137] Specifically, program 410 can be used to cause processor 402 to execute the automated programming method in any of the foregoing embodiments.
[0138] The specific implementation of each step in program 410 can be found in the corresponding steps and units described in the above-described automated programming method embodiments, and will not be repeated here. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding process descriptions in the aforementioned method embodiments, and will not be repeated here.
[0139] Computer-readable storage media
[0140] This application also provides a computer-readable storage medium storing instructions for causing a machine to execute the automated programming methods described herein. Specifically, a system or apparatus equipped with a storage medium storing software program code data that implements the functions of any of the embodiments described above, and enabling the computer (or CPU or MPU) of the system or apparatus to read and execute the program code data stored in the storage medium.
[0141] In this case, the program code data read from the storage medium can itself achieve the function of any of the above embodiments, so the program code data and the storage medium storing the program code data constitute a part of this application.
[0142] Storage media embodiments for providing program code data include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code data can be downloaded from a server computer via a communication network.
[0143] Computer program products
[0144] This application also provides a computer program product, including computer instructions that instruct a computing device to perform any corresponding operation in the above-described plurality of method embodiments.
[0145] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.
[0146] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0147] It should be noted that not all steps and modules in the above processes and system structure diagrams are mandatory; some steps or modules can be omitted as needed. The execution order of each step is not fixed and can be adjusted as required. The system structure described in the above embodiments can be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.
[0148] In this patent application, nouns and pronouns relating to people are not limited to specific genders.
[0149] In the above embodiments, the hardware modules can be implemented mechanically or electrically. For example, a hardware module may include permanent dedicated circuitry or logic (such as a dedicated processor, FPGA, or ASIC) to perform the corresponding operations. The hardware module may also include programmable logic or circuitry (such as a general-purpose processor or other programmable processor), which can be temporarily configured by software to perform the corresponding operations. The specific implementation method (mechanical, dedicated permanent circuitry, or temporarily configured circuitry) can be determined based on cost and time considerations.
[0150] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments above. These embodiments are also within the protection scope of the present invention.
Claims
1. An automated programming method (100) applied to a programming system including a predictor and an editor, the method comprising: The editor is used to obtain the design requirements of the project and send a project design request containing the design requirements to the predictor (102). The predictor performs a prediction on the design requirements in response to the project design request and returns multiple project design intentions (104) to the editor. Using the editor, a target design intent is determined from the plurality of project design intents, and a project programming request containing the target design intent is sent to the predictor (106); In response to the project programming request, the predictor executes the programming design according to the target design intent and returns the programming data (108) to the editor. The editor generates the application (110) for the project based on the programming data.
2. The automated programming method according to claim 1, wherein, The design requirements for the project include equipment configuration information and / or equipment control programs for automated equipment; The predictor obtains the design intent of the multiple projects in the following way: Identify the equipment configuration information and / or the equipment control program in the design requirements to obtain the equipment category and equipment specifications of the automated equipment; Acquire basic equipment knowledge corresponding to the equipment category and specialized equipment knowledge corresponding to the equipment specifications, extract implicit hints from the design requirements, and combine the basic equipment knowledge, specialized equipment knowledge, and implicit hints to perform a prediction on the design requirements in the design prediction request to obtain the design intent of the multiple projects.
3. The automated programming method according to claim 2, wherein, After the editor determines the target design intent, the method further includes: Based on the stated design intent, the design requirements were revised. Based on the revised results of the target design intent and the design requirements, the project programming request is generated.
4. The automated programming method according to claim 3, wherein, The programming data generated by the predictor includes program configuration data and program code data; The predictor performs its programming design in the following manner: Extract implicit hints from the design requirements of the project's programming request; By combining the basic equipment knowledge, the specialized equipment knowledge, the implicit prompts, and the target design intent, programming design is performed to obtain the project's program configuration data and program code data.
5. The automated programming method according to claim 1 or 4, wherein, After the editor obtains the programming data, it also includes performing any of the following operations: Modify the interface functions of each calling interface in the programming data; Adjust the calling order of each interface in the programming data; In response to the interface call commands of each call interface in the programming data, the test call operation of each call interface is executed.
6. The automated programming method according to claim 1 or 4, wherein, The editor is a visual programming tool, and includes a screen rendering module and a graphical editing interface; The method further includes, after the editor obtains the programming data: The programming data is rendered using the image rendering module to obtain multiple spliced graphic program blocks; The graphical editing interface displays the assembled graphical program blocks.
7. The automated programming method according to claim 1, wherein, The method further includes: The predictor obtains predictive data that satisfies the historical data recording strategy from the multiple project design intentions corresponding to the project design request and / or the programming data corresponding to the project programming request, based on the historical data recording strategy, and generates a historical prediction data package.
8. The automated programming method according to claim 7, wherein, The method further includes: In response to a new project design request, the predictor retrieves the prediction data associated with the new project design request from the historical prediction data package, and performs a prediction of design intent based on the design requirements in the new project design request and the prediction data associated with the new project design request, returning multiple project design intents to the editor; or In response to a new project programming request, the predictor retrieves the prediction data associated with the new project programming request from the historical prediction data package, performs the programming design based on the target design intent in the new project programming request and the prediction data associated with the new project programming request, and returns the programming data to the editor.
9. The automated programming method according to claim 1, wherein, After the editor obtains the application of the project, the method further includes (200): The application of the project was run in a simulation, and the simulation results (202) were obtained. If the simulation results do not meet the preset results of the project, return to the step of sending a project design request containing the design requirements to the predictor through the editor, until the simulation results meet the preset results (204).
10. An automated programming apparatus (300) comprising an editor (302) and a predictor (304), wherein: The editor is configured to: obtain the design requirements of the project, send a project design request containing the design requirements to the predictor, determine a target design intent from multiple project design intents returned by the predictor, send a project programming request containing the target design intent to the predictor, and generate the application of the project based on the programming data returned by the predictor. The predictor is configured to: in response to a project design request from the editor, perform predictions on the design requirements in the project design request, return multiple project design intentions to the editor, in response to a project programming request from the editor, perform programming design according to the target design intentions in the project programming request, and return the programming data of the project programming request to the editor.
11. An electronic device (400), comprising: The processor (402), communication interface (404), memory (406), and communication bus (408) communicate with each other through the communication bus (408). The memory (406) is used to store at least one executable instruction that causes the processor (402) to perform an operation corresponding to the automated programming method as described in any one of claims 1 to 9.
12. A computer-readable storage medium storing computer instructions that, when executed by a processor, cause the processor to perform an automated programming method as described in any one of claims 1 to 9.
13. A computer program product comprising computer instructions that instruct a computing device to perform an operation corresponding to the automated programming method as described in any one of claims 1 to 9.
