A method and system for automatically generating software code

Through the method and system of automatically generating software code, the problems of code consistency and maintainability in large-scale multi-team collaborative projects are solved, an efficient and low-cost development process is achieved, and dependence on professional technicians is reduced.

CN119960760BActive Publication Date: 2025-10-14LONGSHAN YUNCANG (SHANDONG) SHARING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510048487.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-10-14
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

Existing technologies make it difficult to ensure code consistency and maintainability in large-scale, multi-team collaborative projects. They also have long development cycles, consume a lot of resources, and rely heavily on professional technical personnel.

Method used

A method and system for automatically generating software code is adopted. By setting menu tables, field tables and inter-table crossing relationships, using data link models to decompose statements, and combining the software development digital factory model, code is automatically generated, including menu module design, semantic parsing and code generation, and verified and deployed using preset functions and tools.

Benefits of technology

Significantly reduce manual coding workload, shorten development cycle, reduce labor costs, improve code maintainability and consistency, and reduce dependence on professional technicians.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960760B_ABST
    Figure CN119960760B_ABST
Patent Text Reader

Abstract

The application provides a method and system for automatically generating software code, which comprises setting a menu table, a field table and a table interpenetration relationship, the menu table having column title content, module title content and module table name content, a plurality of column titles in the column title content being grouped into a group and corresponding to a module title, the module title corresponding to the module table name one by one; the field table having self-defined field content and module table name content, the self-defined field corresponding to the module table name; the table interpenetration relationship being used for realizing the interpenetration of the menu table and the field table; importing the menu table and the field table into an English-Chinese dictionary, carrying out sentence decomposition, decomposing the sentences in the menu table and the field table into words and graphic icons, realizing the interpenetration of the menu table and the field table; and a data link model automatically generating code according to the imported module menu and field interpretation. The application also provides a system for realizing the above method. The application can improve the development efficiency, reduce the error rate and save the labor cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a method and system for automatically generating software codes. Background Art

[0002] The field of software development has evolved from traditional development models to agile, DevOps, and low-code development. Agile development refers to reducing the impact of changing requirements by regularly delivering working software increments; DevOps (a combination of Development and Operations) is a culture and practice that emphasizes close cooperation and communication between software development (Dev) and information technology operations (Ops) teams, that is, through continuous integration and continuous deployment, rapid feedback and rapid time to market are achieved; low-code development (Low-Code Development) is a method that simplifies the application development process through a graphical interface and pre-built modules, that is, using a low-code development platform to provide visual programming tools and pre-built application templates, so that developers can build applications without writing a lot of code, lowering the development threshold, and through a visual interface and pre-built components, non-professional developers can also participate in application development.

[0003] Traditional models such as the waterfall model and the incremental model are characterized by phased development and strict document control, but they have problems such as long development cycles and high resource consumption. The emergence of agile development and DevOps, by emphasizing iterative collaboration and the integration of development and operation, has increased development speed, but still requires a lot of resources to be invested in code review and quality assurance. There are still problems such as the lack of complex logic and customized requirements. At the same time, existing technologies still find it difficult to ensure code consistency and maintainability when dealing with large-scale, multi-team collaborative projects. Summary of the Invention

[0004] The present invention provides a method and system for automatically generating software codes, which improves development efficiency and saves labor costs.

[0005] A first object of the present invention is to provide a method for automatically generating software codes.

[0006] A second object of the present invention is to provide a system for automatically generating software codes.

[0007] To achieve the first object of the present invention, a method for automatically generating software code includes the following steps:

[0008] S11. Setting a menu table, a field table, and a traversal relationship between the tables. The menu table includes column title content, module title content, and module table name content. Multiple column titles in the column title content are grouped together and correspond to a module title. The module titles correspond to module table names in a one-to-one manner.

[0009] The field table has custom field content and module table name content, and the custom field corresponds to the module table name;

[0010] The inter-table traversal relationship is used to realize the traversal of the menu table and the field table;

[0011] S12. The menu table, field table, and traversal relationship are imported into the data link model. The built-in English-Chinese dictionary of the data link model is used to decompose the sentences in the menu table and field table into words and graphic icons, thereby realizing traversal of the menu table and field table.

[0012] S13. The data link model automatically generates code based on the imported module menu and field definitions.

[0013] In the above solution, the module title table name in the menu table corresponds to the module table name in the field segment. You can use database relationships or use tools such as Excel or programming languages ​​to connect data. In short, as long as you ensure that the same fields in the menu table and the field table have the same data type and format, you can achieve data connection.

[0014] As a further technical solution, the menu table and field table are Excel tables, or Google Sheets, or LibreOffice Calc.

[0015] As a further technical solution, the specific steps for implementing inter-table crossing are: decomposing the statements on the menu table and the field table into data elements, each of which corresponds to a data element ID, and using the data element ID as a data bridge to perform one-to-one or one-to-many crossing management between tables to form a crossing data chain.

[0016] As a further technical solution, the data link model is a large model of a digital factory developed by software, or an open source automation server, or a built-in continuous integration and continuous delivery tool, or a continuous integration and continuous deployment server software.

[0017] In the above solution, the open source automation server can be Jenkins, the built-in continuous integration and continuous delivery tool can be the built-in continuous integration and continuous delivery (or deployment) tool (GitLab CI / CD) of Arcfox, and the continuous integration and continuous deployment server software can be Bamboo.

[0018] As a further technical solution, when software is used to develop a large digital factory model, the steps for automatically generating software code are as follows:

[0019] S51. Software development of a digital factory large model with preset table management functions, preset field management functions, preset method interface functions, preset custom form functions, and preset button management functions, wherein the preset functions have software data content corresponding to the semantic content in the menu table and field table;

[0020] S52, importing the user's menu table, field table, and inter-table traversal relationships into the software development digital factory macro model, wherein the menu table and field table contain menu module content input by the user;

[0021] S53: Perform semantic parsing and inter-table traversal based on the menu modules in the menu table and field table, and generate target software data content using preset functions. The target software data content includes functional requirements, business logic, database structure, and user interface layout.

[0022] S54, automatically calling a code generator and a model conversion tool based on the target software data content generated by semantic analysis, compiling the code adapted to the menu module, and generating the software's logical structure, database model, and user interface;

[0023] S55, verifying the logical structure, data model, and user interface of the generated software according to the verification rules and standards preset in the software development digital factory macro model; if the verification fails, repeating S51 to S54 until the verification passes;

[0024] S56. Output compiled code, generate documentation, and prepare deployment packages.

[0025] In the above technical solution, the large model of the digital factory for software development already contains a library of various software automation tools and frameworks, and automatically matches the most suitable tools and frameworks based on the target software data content such as the functional requirements in the form through a matching algorithm.

[0026] In actual operation, specific matching methods include: rule-based matching, such as matching the keywords and descriptions in the functional requirements in the form with the tools and frameworks in the large model; or machine learning matching, such as using a machine learning model to train the model based on historical data to predict the matching degree between project requirements and tools and frameworks; or performance benchmark testing, such as selecting the option with the best performance based on test results. The specific automatic matching method is determined by the user's own choice.

[0027] As a further technical solution, the method for implementing the menu module in the menu table is:

[0028] S61. Designing a module menu that matches the contents of the menu table according to the business logic and menu items in the menu table;

[0029] S62, all module menus form a menu module of a menu table;

[0030] S63: Introduce the designed menu module into the menu table through the import statement.

[0031] As a further technical solution, in step S53, the semantic parsing process includes preprocessing, information recognition, and data mapping steps, specifically:

[0032] Get the content in the menu module, pre-process and clean invalid or redundant data and handle missing values;

[0033] According to the preset table management function and the preset field management function, the data information in the menu table and the preset fields is automatically identified, and the data in the menu table is converted into the fields of the database table or the cell values ​​are converted into the properties of the user interface controls.

[0034] As a further technical solution, in step S54, the process of generating a software structure from the generated target software data content includes the steps of generating a business logic structure, generating a database model, and generating a user interface, specifically:

[0035] According to the business logic and the database architecture, the preset table management function, the preset field management function, the customized form function and the button management function are adopted, the preset method interface function, the code generator and the database architecture are called to automatically generate the logical structure and database model of the software, and the user interface framework interface is called to automatically generate the user interface.

[0036] As a further technical solution, in step S56, the process of outputting the target software file includes code output, documentation, and deployment steps, specifically:

[0037] S91. Compile the generated code file into an executable file or library;

[0038] S92. Submit the version control system of the executable file or library to Git for tracking changes or collaboration;

[0039] S93. Generate software development documentation, including API documentation and user manual;

[0040] S94. Deploy the software code files to the target environment through installation, configuration, and startup.

[0041] To achieve the second objective, the present invention provides a system for automatically generating software code, comprising a menu table, a field table, and a software generation tool. The menu table comprises column title content, module title content, and module table name content. Multiple column titles in the column title content are grouped together and correspond to a module title, and the module title corresponds to the module table name one-to-one. The field table comprises custom field content and module table name content, and the custom field corresponds to the module table name. The traversal relationship is a connection between the menu table and the field table, for achieving traversal between the menu table and the field table.

[0042] The data link model uses a large English-Chinese dictionary to decompose sentences, breaking down the sentences in the menu table and field table into words and graphic icons to achieve traversal of the menu table and field table; the data link model automatically generates code based on the imported module menu and field definitions.

[0043] In summary, automated code generation and system architecture construction significantly reduces the workload of manual coding, shortens the development cycle, reduces dependence on professional technicians, and reduces labor costs. At the same time, the automatically generated code has a unified style, which improves the maintainability of the code.

[0044] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:

[0046] Figure 1 A flowchart of a method for automatically generating software code provided in an embodiment of the present application;

[0047] Figure 2 This is an example diagram of a menu table in a method for automatically generating software code provided in an embodiment of the present application;

[0048] Figure 3 This is an example diagram of a field table in a method for automatically generating software code provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a flow chart for traversing between tables in a method for automatically generating software code provided in an embodiment of the present application;

[0050] Figure 5 A flowchart of another method for automatically generating software code provided in an embodiment of the present application

[0051] Figure 6A flowchart of a menu module in a method for automatically generating software code provided in an embodiment of the present application;

[0052] Figure 7 A flowchart of semantic parsing in a method for automatically generating software code provided in an embodiment of the present application;

[0053] Figure 8 A schematic diagram of a process for outputting target software in a method for automatically generating software code provided in an embodiment of the present application;

[0054] Figure 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.

[0055] Reference numerals:

[0056] 1 Computer device; 2 Processor; 3 Storage medium; 4 Bus. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0058] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.

[0059] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the application is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.

[0060] Moreover, the terms "first", "second", and the like, herein do not necessarily have an ordinal or chronological significance, but are used for the purpose of differentiating between two or more objects, and thus, can be interchanged under appropriate circumstances. Furthermore, the terms "comprise", "include", and the like, are intended to cover non-exclusive inclusions, such that processes, methods, articles, or apparatuses that comprise, include, or are otherwise including items in their processes, methods, articles, or apparatuses are not necessarily limited to those items, but can include other items not expressly listed or inherent to such processes, methods, articles, or apparatuses.

[0061] It should be noted that the features in the embodiments of the present application can be combined with each other without conflict.

[0062] Figure 1 A flowchart of a method for automatically generating software code provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the method comprises the following steps. Figure 1

[0063] S11, set a menu table and a field table and a table traversal relationship, the menu table has column title content, module title content and module table name content, a plurality of column titles in the column title content are grouped into a group corresponding to a module title, the module title corresponds to the module table name one by one.

[0064] The menu table and the field table can be an Excel table, or a variety of table processing software such as Google Sheets or LibreOffice Calc on the market. LibreOffice Calc is a component of LibreOffice, which is a free and open source spreadsheet processing tool with basic functions of Microsoft Excel. In short, as long as the software has powerful data processing and analysis capabilities, it can be used as a substitute for Excel.

[0065] As shown in FIG. 2, the column title content in the menu table can include system such as YCWMS001, custom name such as cloud warehouse WMS, module title content such as module 1, module 2, module 3, module n, etc., and module table name content such as financial account management, report management, comprehensive management, operation and maintenance management, etc., wherein the custom name such as enterprise mall corresponds to M01, sales management corresponds to M02, procurement management corresponds to M03, and contract management corresponds to M04. Figure 2

[0066] ​​Each module title name can also cascade the next module name, such as module 1 includes module M01, M02, M11, module M12, module M13, module M14, module nn, etc. Each module 1 has a corresponding Chinese custom name; module 2 includes module M01 _ 01, M01 _ 02, M02 _ 01. Module M02 _ 02. Module M12 _ 10. Module _ nn _ nn, etc. Each module 2 has a corresponding Chinese custom name; module 3 includes module M12 _ 01 _ 01. M12 _ 01 _ 02. M12 _ 01 _ 03.Mnn _ nn _ nn, etc.; in the above letters, M represents the abbreviation of module, n represents a single-digit integer, and nn represents a two-digit integer.

[0067] The field table has custom field content and module table name content. The custom field corresponds to the module table name. The menu table and the field table are linked to realize the traversal of the menu table and the field table.

[0068] like Figure 3 As shown, the field table includes the module table name such as M01 _ 01, and the module title that corresponds to the module table name, such as module M01 _ 01 corresponds to the module title product category, module M01 _ 02 corresponds to the module title Product Management, module M01 _ 03 corresponds to the module title Order Management, module M12 _ 01 _ 01 corresponds to the title name of the customer, M12 _ 01 _ 02 corresponds to the title name of customer review, M12 _ 01 _ 03The corresponding title name is customer file, etc.

[0069] like Figure 2 and Figure 3 As shown, the custom field content in the field table is as follows: module title, product category and label name M01 _ 01 corresponds to the custom name product category in the menu table and M01 under module 2 _01Corresponding, since the menu table and the same field in the bullet table have the same data type and format, the prior art such as database relationship or using Excel and other tools or programming language is used to carry out data linking processing. For example, in actual operation, using database relationship, the primary key and the foreign key are set to establish the relationship between tables; or table connection, in the SQL query, the JOIN statement can be used to connect two or more tables and match according to the same field; using Excel and other tools, the vlookup function is used, for example, in Excel, the VLOOKUP function can be used to find and return the value of the same field in another table; using the combination of INDEX and MATCH functions, the function similar to VLOOKUP function is realized; using PowerQuery, the data of multiple worksheets is merged into a query, and matching and linking are carried out according to the same field; in programming language, such as Python and other programming languages, multiple data tables are read and processed, and matching and linking are carried out according to the same field.

[0070] The inter-table traversal relationship is realized by linking the menu table and the field table, so that the menu table and the field table can be traversed. Specifically, cross-table reference or cross-table lookup can be used to realize the traversal.

[0071] S12, the menu table and the field table are imported into the data link model, the built-in English-Chinese dictionary is used for sentence decomposition, the sentences in the menu table and the field table are decomposed into words and graphic icons, and the traversal of the menu table and the field table is realized;

[0072] In the S12 step, as shown in Figure 4 The steps of the inter-table traversal are as follows: the sentences on the menu table and the field table are decomposed into data elements, each data element corresponds to a data element ID, the data element ID is used as a data bridge to realize one-to-one or one-to-many traversal management between tables, and a traversal data chain is formed.

[0073] In actual operation, through the English-Chinese dictionary, the sentences in the menu table and the field table are decomposed, for example, into words and graphic icon services, the graphic font library is moved into the platform, and the icon mode is used to support the icon demand of the mobile terminal. The data source is associated, the data is loaded into the platform in the form of elements, and the data elements of the platform are fed back.

[0074] For example, the words in the commodity classification and commodity management module unit are decomposed, for example, into category, name, code, creation time, update time and other words and translated into corresponding English.

[0075] S13, the data link model automatically generates code according to the imported module menu and field interpretation.

[0076] In step S13, the data link model can be a large model of a digital factory for software development, or an open source automation server, or a built-in continuous integration and continuous delivery tool, or a continuous integration and continuous deployment server software; the open source automation server can be Jenkins, the built-in continuous integration and continuous delivery tool can be the built-in continuous integration and continuous delivery (or deployment) tool (GitLab CI / CD) of Jifox, and the continuous integration and continuous deployment server software can be Bamboo.

[0077] In a preferred embodiment, Figure 5 As shown, when software is used to develop a large digital factory model, the steps for automatically generating software code are as follows:

[0078] S51. Software development of a digital factory large model with preset table management functions, preset field management functions, preset method interface functions, preset custom form functions, and preset button management functions. The preset functions have software data content corresponding to the semantic content in the menu table and field table.

[0079] Among them, in step S51, the preset table management function includes a table list unit, a table operation unit, a table import unit and a view creation unit, wherein the table list unit includes approval templates, platform advertisements, kanban information, kanban classification, button management, dictionary data, organization price, dictionary type, message, operation log, platform configuration, role information, etc. The table name and table type corresponding to the above table list unit are as shown in wl _ act _ template、BAS E TABLE,wl _ banner, BASETABLE, wl_bulletin _ board, BASE TABLE, etc.; the table operation units corresponding to the above table list units include importing table structure, creating views, deleting, refreshing, code generation, online deployment package and other table operations.

[0080] The preset field management function includes field list unit, field operation unit and logical operation unit; such as title, swagger external title, field name, mapping name as primary key code, primary key code, id, id, template name, template name, name, name, template content, template content, content, content, etc.; the field operation unit includes the addition, deletion, modification and query (CRUD) operations of data in the database table, as well as the definition, verification, indexing and relationship management of fields; the types of fields include integers, strings, dates, etc., and special fields also include floating point numbers, decimal numbers, large text, IP addresses, URLs, etc.; when defining field parameters, you can set a variety of parameters to constrain and describe the behavior of the field, such as maximum length, default value, whether to allow empty values, whether unique, whether to set an index, etc.; the logical operation of the field mainly involves the processing of Boolean values ​​(true or false), and combining simple logical expressions through logical operators to form complex logical judgments. The preset method interface functions include method list unit, method operation unit, method list setting unit, method details setting unit, method button setting unit, and method sorting setting unit. Among them, the method list unit includes material code, location code, drop-down definition, order matching, document code, daily maintenance, material control, material details, storage and sorting rules, etc. The method names include showYcwms001M130207Main, showYcwms001M130206Main, showYcwms001M130205Main, showYcwms001M130202Main, etc. The preset table management function and preset field management function are realized by calling the preset method interface.

[0081] The preset customized form functions include method list units and method operation units, among which the method list includes functional units such as material code, location code, order matching, material price, material details, document code, daily maintenance, etc., and the method operation unit includes operations such as deletion or copying; the preset button management functions include button list units, button operation units, button import units and other functional units, such as button insert (new function), button delete (delete function), button check (review function), button import (import function), button export (export function), button print (print function), etc.

[0082] The dictionary data, dictionary type and other functional units in the preset table list management function, the field list unit, field operation unit and logical operation unit such as field name, template name and other functional units in the preset field management function, through the preset method interface and the preset customized form function, can correspond to the preprocessing, information recognition and data mapping in the semantic parsing process, and realize the mapping of the identified field table and the target software data in the menu table to the corresponding fields or user interface control properties of the database of the software development digital factory model.

[0083] S52. Importing the user's menu table, field table, and inter-table traversal relationships into the software development digital factory macro model, wherein the menu table and field table contain menu module content input by the user;

[0084] In step S52, if Figure 6 As shown, the method to implement the menu module is as follows:

[0085] S61. Based on the business logic and menu items in the menu table, design a module menu that matches the content of the menu table.

[0086] According to the user's business function requirements, that is, the user's actual business logic, check the business logic and menu items in the menu table. For example, if the user's business function requirement is product order management, the menu items that the user needs to check in the menu table include customer management, order management, after-sales management, supplier management, purchase application, purchase plan, supplier side and other businesses, until the user designs and completes the module menu that meets the user's business function requirements.

[0087] S62, all module menus form a menu module of a menu table;

[0088] There are multiple menu modules in the menu table. For example, in the cloud warehouse WMS system, module M01 (Enterprise Mall) includes M01 _ 03 (Order Management); Module M02 (Sales Management) includes M02 _ 01 (Customer Management) Module, M02 _ 02 (Order Management) Module, M02 _ 03 (after-sales management) module; M03 _ 01 (Supplier Management) Module, M03 _ 02 (Purchase Requisition) Module, M03 _ 03 (Purchasing Plan) Module, M03 _ 04 (temporary procurement plan) module, M03 _ 05 (share control) module, M03 _06 (supplier side) module, etc.; one of the large systems, such as the cloud warehouse WMS system, includes several menu modules such as the enterprise mall module, sales management module, procurement management module and other menu modules; each menu module, such as the sales management module, includes customer management, order management, after-sales management and other module menus; menu modules, such as the procurement module, include supplier management, procurement application, procurement plan, forest procurement plan, share control, supplier side and other module menus.

[0089] All of the above menu modules form a menu module of a menu table. Users can reuse modular codes or data in different workbooks, reducing duplication of work.

[0090] S63. Introduce the designed menu module into the menu table through the import statement.

[0091] In steps S62 and S63, according to the menu structure obtained in step S61, the menu module can be introduced into the form through the import statement, thereby completing the construction of the menu module.

[0092] By implementing menu modules in Excel spreadsheets, you can easily select and configure them based on your business needs, such as project functionality. Because each menu module can be modified and updated independently without affecting other components, menu modules offer high maintainability and readability, reducing errors and improving work efficiency, making the workbook structure clearer and easier to manage.

[0093] S53, performing semantic parsing and inter-table traversal based on the menu modules in the menu table and field table, and generating target software data content using preset functions, the target software data content including functional requirements, business logic, database structure, and user interface layout;

[0094] In step S53, semantic parsing and table traversal are performed based on the menu module in the user form to generate target software data content, which includes functional requirements, business logic, database structure and user interface layout;

[0095] In the above steps, if Figure 7 As shown in the figure, the semantic parsing process includes preprocessing, information recognition, and data mapping steps. Specifically:

[0096] Get the content in the menu module, pre-process and clean invalid or redundant data and handle missing values;

[0097] It can be understood as reading Excel files, such as using libraries (such as Apache POI and EasyExcel) in programming languages ​​(such as JAVA) to read data in Excel files, and cleaning the data in Excel files, such as removing invalid or redundant data, processing missing values, and ensuring data consistency and accuracy.

[0098] According to the preset table management function and the preset field management function, the data information in the menu table and the preset fields is automatically identified, and the data in the menu table is converted into the fields of the database table or the cell values ​​are converted into the properties of the user interface controls.

[0099] It can be understood that through the software development digital factory big model and the rule engine, the preset software functions such as the table management function, preset field management function, preset method interface function, preset customized form function and preset button management function of the software development digital factory big model are automatically matched with the target software data content in the menu table, and the above-mentioned preset software functions have included and defined the software functions, database structure and user interface layout, that is, the identified information data is mapped to the corresponding fields of the database or the user interface control properties.

[0100] It can be understood that after the software development digital factory large model is automatically matched, the fields in the Excel table are mapped to the corresponding elements in the software component process, such as converting table rows into fields in the database table, or converting cell values ​​into properties of user interface controls.

[0101] In this embodiment, the software development digital factory model has a modular architecture, that is, different functional modules are designed independently; automated processing, that is, data cleaning, conversion and analysis are automatically completed through algorithm models and data mapping, reducing manual intervention and lowering error rates.

[0102] The software development digital factory model includes functional modules such as data import, data processing, data analysis, and report generation. The data import module includes multi-format support, such as supporting import from various data sources, including but not limited to CSV, Excel, databases, and API interfaces, which users can flexibly select based on their needs. Data mapping provides an intuitive interface, allowing users to customize the mapping of imported fields to ensure accurate data import into the target table. The data processing module includes data cleaning, such as automatically detecting and processing missing values, outliers, and duplicate data to ensure data quality. Data conversion, such as supporting various data conversion operations such as unit conversion, date formatting, and classification coding to improve data consistency. The data analysis module includes statistical analysis, with built-in statistical analysis tools, allowing users to quickly generate data reports such as descriptive statistics and correlation analysis. Visualization functions support intuitive presentation of analysis results through charts (such as bar charts, pie charts, and line charts), helping users quickly understand data trends. The report generation module includes custom reports, such as users can customize report templates according to specific needs, and the system automatically fills in the analysis results. Real-time reporting, such as supporting real-time data updates and dynamic report generation, ensures that users obtain the latest business insights.

[0103] The software development digital factory model has a built-in comprehensive English-Chinese dictionary and custom algorithms. The English-Chinese dictionary includes automatic translation, such as automatic translation of various input fields and data items, so that multilingual users can use the system without obstacles; standardized naming, such as maintaining the standard names of data items through dictionaries, improving data consistency and readability; custom algorithms include intelligent recommendations, such as providing intelligent recommendation algorithms based on historical data and user behavior analysis to help users make better decisions; prediction functions, such as analyzing and modeling historical data through machine learning algorithms to realize the prediction of future data and enable enterprise data-driven decision support.

[0104] For example, a Java example is constructed to demonstrate how to automatically identify data in a menu table and convert it into database table fields or convert cell values ​​into user interface control properties based on the preset table management function and preset field management function. In this embodiment, the user has preset a menu table and a field table. The menu table includes at least data or data structure information such as the field name and type to be converted, and the field table includes at least data or data structure information such as the type and properties of the defined field. The PRESET_FIELDS statement is used to store the HashMap of field names and their corresponding database types, and then the database table is created. The specific process of creating the database table is as follows:

[0105] (1) The createDatabaseTable method uses StringBuilder to construct the CREATE TABLE SQL statement;

[0106] (2) Connect to the database and execute SQL using JDBC;

[0107] (3) You need to change the database connection information to your own database details.

[0108] It can be understood that after creating the data table above, the user interface is generated. The specific creation steps are as follows:

[0109] (1) The createUserInterface method generates a Swing interface based on the field name and creates the corresponding label and text box.

[0110] (2) Contains a submit button, which can be clicked to add data submission logic.

[0111] It can be understood that the above implementation of the function of automatically identifying the data information in the menu table and preset fields according to the preset table management function and the preset field management function, and converting the data in the menu table into the fields of the database table or converting the cell values ​​into the properties of the user interface control is the basic function implementation. In actual development, input validation, exception handling and function extension should also be considered. Users can handle input validation, exception handling and function extension according to existing technologies and will not go into details here.

[0112] S54. Automatically call the code generator and model conversion tool according to the target software data content generated by semantic analysis, compile the code adapted to the menu module, and generate the software's logical structure, database model, and user interface.

[0113] The process of generating software structure from the generated target software data content includes the steps of logical structure generation, database model generation, and user interface generation, specifically:

[0114] According to the business logic and the database architecture, the preset application development framework is adopted, the code generator and the database architecture are called to automatically generate the logical structure and database model of the software, and the user interface framework interface is called to automatically generate the user interface.

[0115] The software development digital factory big model calls the code generator and model conversion tools such as database architecture based on the target software data content obtained by semantic analysis in step S53, and automatically creates the software class diagram, database architecture and user interface prototype.

[0116] S55, verifying the logical structure, data model, and user interface of the generated software according to the verification rules and standards preset in the software development digital factory macro model; if the verification fails, repeating S51 to S54 until the verification passes;

[0117] It can be understood that the large model of the digital factory for software development calls the code generation interface such as the GPT series model, or calls natural language processing algorithms such as GPT, RERT, etc. or static code analysis algorithms to verify the generated software logical structure; calls the data model generation interface or data verification interface or database schema generation algorithm or entity relationship diagram generation algorithm or data verification algorithm to verify the data model of the generated software; calls the test case generation interface or test execution interface or test data generation algorithm or test script generation algorithm or automated testing algorithm to verify the user interface.

[0118] In actual operation, table analysis algorithms also include image-to-text models of image form types, text-to-text models of text form types, table models of table form types, or file parsing tools of file form types. The specific analysis algorithm is determined by the user's own needs.

[0119] By automatically calling the above interfaces or algorithms, the correctness, completeness and consistency of the software logic, database model and user interface can be checked. The above verification may also include unit testing, integration testing and user acceptance testing. Among them, unit testing refers to: unit testing of the generated software logic, integration testing refers to testing the interaction between different modules of the software, and user acceptance testing refers to whether the software product or system can meet the needs of users or businesses in the actual usage environment. The above tests can ensure that every part of the software works as expected.

[0120] S56. Output compiled code, generate documentation, and prepare deployment packages.

[0121] like Figure 8 As shown in the figure, the target software output file process includes code output, documentation, and deployment steps, specifically:

[0122] S91. Compile the generated code file into an executable file or library;

[0123] Compilation is the process of translating a source program written in a high-level programming language into an equivalent target program in machine language format. This process involves six logical steps: lexical analysis, syntax analysis, semantic analysis, code optimization, memory allocation, and code generation. Compilers convert familiar high-level languages ​​into binary language that computers can understand, enabling them to execute these programs.

[0124] S92, submit the version control system of the execution file or library to Git for tracking changes or collaboration;

[0125] Wherein, Git is an open source distributed version control system for agile and efficient handling of version management of projects of any size, under the premise of installing Git, initializing the Git repository using the git init command in the root directory of the execution file or library, adding the above execution file, library version control system and related configuration files to the Git repository using the git add command, submitting changes using the git commit-m "commit information" command and attaching commit information, if collaboration in the team is required, a remote repository can be added using the git remote add origin <remote repository address> command, and then the changes in the local repository are pushed to the remote repository using the git push-u origin master command.

[0126] S93, generate software development documents, including API documents and user manuals;

[0127] Wherein, the software development digital factory large model automatically generates development documents according to the imported user menu table and field table, the development documents including API documents and user manuals, wherein the API documents usually include interface overview, interface address, request parameter, corresponding format, error code, authentication and authorization, example code and the like, and the user manual includes preface, software overview, running environment, installation and initialization, usage instruction, troubleshooting and problem solving, version update and upgrade, additional information and resources, appendix and the like, mainly used to help users quickly start and use the software skillfully.

[0128] S94, deploy the software code file to the target environment through installation, configuration and startup.

[0129] In step S94, it includes the preparation stage, installation stage, configuration stage, startup stage and subsequent steps; among them, the preparation stage includes collecting necessary files and dependencies, understanding the target environment, such as being familiar with the software and hardware configuration, network configuration, etc. of the target environment; the installation stage includes operating system-level software packages, programming language dependency management tools, etc., copying the software code files to the specified directory of the target environment. If the software is packaged and released (such as Java JAR packages, Python wheel packages, etc.), the packaged files are deployed directly; then, according to the specific needs of the target environment, the software configuration files are modified. The above configuration files usually include database connection information, network settings, log levels, etc.; during the configuration stage, the environment variables need to be configured to ensure that the software can correctly find its dependencies and configuration files; for database configuration, the necessary database and table structures are created, and any Any initial data or configuration database connection information, as well as network configuration such as configuring firewall rules to allow network communication required by the software; during the startup phase, start the software with appropriate commands or scripts to ensure that no errors occur; and verify the installation, such as checking the software's log files to ensure that there are no errors or warning messages, and verifying whether the software works as expected by accessing the software interface or using command line tools. If possible, performance testing is also required to ensure that the software has sufficient performance and stability in the target environment; subsequent steps involve document updates, such as updating any relevant deployment documents or guides to reflect changes and precautions for this deployment; monitoring and maintenance, such as setting up monitoring tools to track the software's operating status and performance indicators, and regularly updating the software to fix vulnerabilities or add new features; user training and support, such as providing necessary training and support to ensure that they can use the software correctly.

[0130] After introducing the method for automatically generating software codes according to the above embodiment, a system for generating software codes according to another embodiment will be described.

[0131] A system for automatically generating software code includes a menu table, a field table, and a software generation tool. The menu table contains column title content, module title content, and module table name content. Multiple column titles in the column title content are grouped together and correspond to a module title. The module title corresponds to the module table name one-to-one. The field table contains custom field content and module table name content. The custom field corresponds to the module table name. The menu table and the field table are linked to achieve traversal between the menu table and the field table.

[0132] The data link model uses a built-in English-Chinese dictionary to decompose sentences, breaking down the sentences in the menu table and field table into words and graphic icons to achieve traversal of the menu table and field table; the data link model automatically generates code based on the imported module menu and field definitions.

[0133] The software generation tool can be a software development digital factory large model, an open-source automation server (such as Jenkins), a built-in continuous integration and continuous delivery tool (such as GitLab CI / CD), or a continuous integration and continuous deployment server software (such as Bamboo).

[0134] The system for automatically generating software code described above is implemented by using a software generation tool, and has similar principles and technical effects to automatically generate software code, which will not be described here.

[0135] Figure 9 A schematic diagram of a computer device 1 is provided for the embodiments of the present application. The device can be integrated into a terminal device or a chip of a terminal device. The terminal can be a computer device 1 with data processing function.

[0136] The computer device 1 includes a processor 2, a storage medium 3, and a bus 4.

[0137] The storage medium 3 stores program instructions executable by the processor 2. When the computer device 1 is running, the processor 2 communicates with the storage medium 3 through the bus 4. The processor 2 executes the program instructions to perform the above-mentioned method or system embodiments. The specific implementation and technical effects are similar, which will not be described here.

[0138] Optionally, the present application also provides a program product, such as a computer readable storage medium, including a program which, when executed by a processor, is used to execute the above-mentioned method embodiments.

[0139] In addition, the functional units for automatically generating software code in various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software functional units.

[0140] The integrated unit realized in the form of software functional units can be stored in a computer readable storage medium. The software functional units stored in a storage medium include a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute part of the steps of the method of various embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0141] While embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely divergences of the principles and application of the present application and that numerous modifications, changes, substitutions, and alterations can be made thereto without departing from the spirit and scope of the present application, which is defined by the following claims and their equivalents.

Claims

1. A method for automatically generating software code, characterized in that: The following steps are involved: S11. Setting a menu table, a field table, and a traversal relationship between the tables. The menu table includes column title content, module title content, and module table name content. Multiple column titles in the column title content are grouped together and correspond to a module title. The module title corresponds one-to-one to the module table name. The field table has custom field content and module table name content, and the custom field corresponds to the module table name through the table name; The inter-table traversal relationship is used to realize the traversal of the menu table and the field table; S12. Importing the menu table, field table, and traversal relationships into a data link model, where the data link model is a large model of a digital factory for software development, or an open source automation server, or a built-in continuous integration and continuous delivery tool, or continuous integration and continuous deployment server software; performing sentence decomposition using a built-in English-Chinese dictionary in the data link model, decomposing the sentences in the menu table and field table into words and graphic icons, and implementing traversal of the menu table and field table; S13, the data link model automatically generates code based on the imported module menu and field definitions; When using software to develop a large digital factory model, the steps for automatically generating software code are as follows: S121. Software development of a digital factory large model with preset table management functions, preset field management functions, preset method interface functions, preset custom form functions, and preset button management functions, wherein the preset functions have software data content corresponding to the semantic content in the menu table and field table; S122. Importing the user's menu table, field table, and inter-table traversal relationships into the software development digital factory macro model, wherein the menu table and field table contain menu module content input by the user; S123. Perform semantic parsing and inter-table traversal based on the menu modules in the menu table and field table, and generate target software data content using preset functions. The target software data content includes functional requirements, business logic, database structure, and user interface layout. S124. Automatically call a code generator and a model conversion tool based on the target software data content generated by semantic analysis, compile the code adapted to the menu module, and generate the software's logical structure, database model, and user interface; S125, verifying the logical structure, database model, and user interface of the generated software according to the verification rules and inspection standards preset in the software development digital factory macro model; if the verification fails, repeating S121 to S124 until the verification passes; S126. Output compiled code, generate documentation, and prepare deployment packages.

2. The method for automatically generating software code according to claim 1, wherein: The menu table and the field table are Excel tables, Google Sheets, or LibreOffice Calc.

3. The method for automatically generating software code according to claim 1, wherein: The specific steps for implementing the inter-table traversal are as follows: The statements on the menu table and the field table are decomposed into data elements, each of which corresponds to a data element ID. The data element ID is used as a data bridge to perform one-to-one or one-to-many crossing management between tables to form a crossing data chain.

4. The method for automatically generating software code according to claim 1, wherein: The method for implementing the menu module in the menu table is: S41. Designing a module menu that matches the contents of the menu table according to the business logic and menu items in the menu table; S42, all module menus form a menu module of a menu table; S43. Introduce the designed menu module into the menu table through the import statement.

5. The method for automatically generating software code according to claim 1, wherein: In step S123, the semantic parsing process includes preprocessing, information recognition and data mapping, and the specific steps are as follows: Get the content in the menu module, pre-process and clean invalid or redundant data and handle missing values; According to the preset table management function and the preset field management function, the data information in the menu table and the preset fields is automatically identified, and the data in the menu table is converted into the fields of the database table or the cell values ​​are converted into the properties of the user interface controls.

6. The method for automatically generating software code according to claim 1, wherein: In step S124, the process of generating a software structure from the generated target software data content includes the steps of generating a business logic structure, generating a database model, and generating a user interface, specifically: According to the business logic and database structure, the preset table management function, the preset field management function, the preset customized form function and the preset button management function are adopted, and the preset method interface function, code generator and database structure are called to automatically generate the logical structure and database model of the software, and the user interface framework interface is called to automatically generate the user interface.

7. The method for automatically generating software code according to claim 1, wherein: In step S126, the process of outputting the target software file includes code output, documentation, and deployment steps, specifically: S71. Compile the generated code file into an executable file or library; S72. Submit the executable file or library's own version control system to Git for tracking, modification, or collaboration; S73. Generate software development documentation, including API documentation and user manual; S74. Deploy the software code files to the target environment through installation, configuration, and startup.

8. A system for automatically generating software code using the method for automatically generating software code according to any one of claims 1 to 7, characterized in that: It includes a menu table, a field table and a software generation tool. The menu table has column title content, module title content and module table name content. In the column title content, multiple column titles are grouped together and correspond to a module title. The module title and the module table name have a one-to-one correspondence. The field table has custom field content and module table name content. The custom field corresponds to the module table name. The menu table and the field table are linked to realize the traversal of the menu table and the field table. The data link model uses a large English-Chinese dictionary to decompose sentences, breaking down the sentences in the menu table and field table into words and graphic icons to achieve traversal of the menu table and field table; The data link model automatically generates code based on the imported module menu and field definitions.

Citation Information

Patent Citations

  • Method and apparatus for automatically generating software item encoding file by metadata

    CN105224377A

  • Method for quickly configuring table fields, and page field generation mode and system

    CN116956845A