Method, system and electronic device for generating visual programming blocks, and storage medium

By using artificial intelligence to parse program code and generate structured metadata for visual programming blocks, the high threshold, long cycle, and high cost problems in traditional development are solved, and efficient and standardized block configuration is generated automatically.

CN122450433APending Publication Date: 2026-07-24SHENZHEN DIANMAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN DIANMAO TECH CO LTD
Filing Date
2026-04-22
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Traditional visual programming block configuration development has high barriers to entry, long development cycles, high maintenance costs, and a high error rate, making it difficult to meet the needs of rapid iteration and expansion.

Method used

By using artificial intelligence to understand the functional requirements of building blocks in the program code format, the system generates structured metadata for the building blocks, determines the type, attribute information, and configuration parameters of the building blocks, and automatically generates standardized configuration files.

Benefits of technology

It lowers the technical threshold for development, shortens the development cycle, reduces human error, improves the efficiency and standardization of block development, and meets the platform's needs for rapid iteration and expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122450433A_ABST
    Figure CN122450433A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of visual programming, and discloses a generation method and system of visual programming blocks, an electronic device and a storage medium, the method comprising: acquiring block function requirement information in the form of program code; performing artificial intelligence understanding and analysis on the block function requirement information to obtain block structured metadata; determining the block type and attribute information of a target block according to the block structured metadata, and determining the configuration parameters of the target block according to the block type and attribute information; and generating a standardized configuration file of the target block based on the block type, attribute information and configuration parameters. The present application converts the graphical configuration understanding problem, which is not good at artificial intelligence, into the code program semantic understanding, which is good at artificial intelligence, can automatically generate block configuration files conforming to the specification, reduces the block development technical threshold and maintenance cost, reduces the artificial errors caused by manual intervention, shortens the development cycle, improves the development efficiency and standardization, and meets the demand for rapid iteration and expansion of the platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual programming technology, and more specifically to a method, system, electronic device, and storage medium for generating visual programming blocks. Background Technology

[0002] With the increasing popularity of visual programming education, block-based programming platforms have become an important vehicle for programming education for teenagers. During the development of visual programming platforms, various functional blocks require complex JSON configuration files to define their appearance, behavior logic, and interaction methods. Traditional block-based configuration development methods require developers to have a deep understanding of the underlying technical details of graphical programming frameworks. Even implementing simple functions requires writing complex JSON structures containing more than ten configuration parameters, involving multiple technical dimensions such as type definitions, message templates, parameter arrays, and color styles. This development model has a high barrier to entry, requiring only R&D personnel with specialized technical backgrounds to participate in block development. Furthermore, it suffers from long development cycles, high maintenance costs, and high configuration error rates, making it difficult to meet the needs of rapid iteration and expansion of visual programming platforms. Summary of the Invention

[0003] This invention provides a method, system, electronic device, and storage medium for generating visual programming blocks, in order to solve the problems of high technical threshold, long development cycle, high maintenance cost, and high error rate of visual programming.

[0004] In a first aspect, the present invention provides a method for generating visual programming blocks, the method comprising: obtaining block functional requirement information in program code format; performing artificial intelligence understanding and parsing on the block functional requirement information to obtain block structured metadata; determining the block type and attribute information of the target block based on the block structured metadata, and determining the configuration parameters of the target block based on the block type and attribute information; and generating a standardized configuration file of the target block based on the block type, attribute information and configuration parameters.

[0005] The present invention provides a method for generating visual programming blocks. This method uses artificial intelligence to understand and parse the functional requirements information of blocks in program code format, obtaining structured metadata for the blocks. Based on this structured metadata, the block type, attribute information, and configuration parameters of the target block are determined, and then a corresponding standardized configuration file is generated. This invention transforms the problem of graphical configuration understanding, which is not well-suited to artificial intelligence, into the strength of code program semantic understanding. It can automatically generate standardized JSON configuration files for blocks, effectively lowering the technical threshold for developing visual programming blocks, while reducing human intervention, significantly shortening the block development cycle, reducing human error during development, lowering the cost of block development and subsequent maintenance, improving the efficiency and standardization of block development on the visual programming platform, and meeting the needs of rapid platform iteration and expansion.

[0006] In one optional implementation, the functional requirement information of the building blocks is understood and parsed using artificial intelligence to obtain structured metadata of the building blocks. This includes: calling the compiler application programming interface to perform lexical and syntactic analysis on the program code corresponding to the functional requirement information of the building blocks to obtain syntactic units and syntax trees; based on the syntactic units and syntax trees, performing syntax tree node location, function name extraction, and identifier verification to obtain function identifiers; based on the syntactic units and syntax trees, performing parameter node location, type annotation reading, type verification, and confirmation to obtain parameter type information; based on the syntactic units and syntax trees, performing return value node location, return value type reading and derivation, and type consistency verification to obtain return value types; and based on the syntactic units and syntax trees, performing annotation extraction, specific annotation filtering, annotation content parsing and structuring, and annotation format verification to obtain annotation content.

[0007] This invention performs lexical and syntactic analysis through the compiler application programming interface, combined with node location, information extraction and verification steps, which can accurately and efficiently parse the block structured metadata from the program code, ensuring the integrity, accuracy and standardization of the metadata, providing reliable data support for the subsequent determination of the type, attributes and configuration parameters of the target blocks, avoiding block configuration anomalies caused by metadata errors, and improving the stability and reliability of the entire method.

[0008] In one optional implementation, the block type and attribute information of the target block are determined based on the block structured metadata, and the configuration parameters of the target block are determined based on the block type and attribute information, including: determining the target block based on the function identifier; determining the block type of the target block based on the parameter type information and return value type according to a predefined intelligent mapping rule base, wherein the block type includes control type and structure type; determining the attribute information of the target block based on the annotation content, wherein the attribute information includes at least the user interface display text, visual presentation style, and user operation prompt information; and determining the configuration parameters of the target block based on the block type and attribute information, wherein the configuration parameters include at least the connection method and display style of the target block.

[0009] This invention clarifies the correspondence between structured metadata and the type, attributes, and configuration parameters of the target building block, enabling precise identification of the target building block. By relying on an intelligent mapping rule base and annotation content, the type and attributes of the building block are determined, and the configuration parameters are then derived. This achieves an orderly transformation from metadata to building block configuration, ensuring that the function, appearance, and interaction logic of the target building block meet the requirements, and improving the rationality and efficiency of building block configuration.

[0010] In one optional implementation, the intelligent mapping rule base includes at least: basic type mapping rules, union type mapping rules, function type mapping rules, and generic type mapping rules; based on the predefined intelligent mapping rule base, the block type of the target block is determined according to parameter type information and return value type, including: if the target block is determined to be a basic data type according to parameter type information and return value type, then the control type of the target block is mapped to a user input control; if the target block is determined to be a literal union type according to parameter type information and return value type, then the control type of the target block is mapped to an enumeration type input control; if the target block is determined to be a callback function type according to parameter type information and return value type, then the structure type of the target block is mapped to a nested statement structure; if the target block is determined to be a generic type according to parameter type information and return value type, then the optimal control type and / or optimal structure type of the target block is determined according to parameter type information and return value type.

[0011] This invention enables precise matching of different data types with building block types by pre-setting multiple mapping rules. It automatically maps the corresponding control type or structure type to different types of target building blocks, eliminating the need for manual judgment and configuration. This further improves the automation and accuracy of building block type determination, while also adapting to various data type scenarios and enhancing the versatility and flexibility of programmable building block generation.

[0012] In one optional implementation, determining the attribute information of the target block based on the annotation content includes: if the annotation content is a preset format annotation, determining the user interface display text of the target block based on the preset format annotation; if the annotation content is a color attribute annotation, determining the visual presentation style of the target block based on the color attribute annotation; if the annotation content is a prompt information annotation, determining the user operation prompt information of the target block based on the prompt information annotation.

[0013] This invention clarifies the correspondence between annotation content and block attribute information, enabling the classification and parsing of different types of annotations. It accurately extracts the display, visual, and operational prompt-related attributes of the blocks, ensuring that the block attribute information meets the requirements, improving the visualization effect of the blocks and the user's operating experience. At the same time, it achieves efficient utilization of annotation information and reduces manual intervention in attribute configuration.

[0014] In one optional implementation, the block functional requirement information is any one of a typed language definition, a structured requirement document, an interactive dialogue definition, and an application programming interface (API) definition file, wherein the typed language definition and the API definition file are program code; before performing artificial intelligence understanding and parsing on the block functional requirement information to obtain the block structured metadata, the method further includes: if the block functional requirement information is a structured requirement document or an interactive dialogue definition, then converting the structured requirement document or interactive dialogue definition into the corresponding typed language definition.

[0015] This invention expands the input types of functional requirement information for building blocks, enabling support for diverse input methods. It is compatible with both program code and non-program code requirement information, and converts non-program code information into code information, ensuring that all types of requirement information can be uniformly parsed and processed. This improves the applicability and compatibility of programmable building block generation, meets the input habits of different users, and lowers the threshold for requirement input.

[0016] In one optional implementation, after generating a standardized configuration file for the target building block based on the building block type, attribute information, and configuration parameters, the method further includes: performing integrity verification, performance optimization, and version compatibility processing on the standardized configuration file; and generating a corresponding type declaration file and technical documentation based on the processed standardized configuration file.

[0017] This invention verifies, optimizes, and performs version compatibility processing on standardized configuration files, ensuring that the configuration files are free of missing or errors, thus improving their stability and executability and preventing the building blocks from malfunctioning due to configuration file issues. Simultaneously, it generates type declaration files and technical documentation, facilitating subsequent maintenance, iteration, and use of the building blocks, further reducing maintenance costs and enhancing the method's practicality and scalability.

[0018] Secondly, this invention provides a system for generating visual programming building blocks. The system includes: an input interface layer for acquiring functional requirement information of building blocks in program code format; an artificial intelligence understanding layer for performing artificial intelligence understanding and parsing of the functional requirement information of building blocks to obtain structured metadata of the building blocks; an intelligent conversion layer for determining the building block type and attribute information of the target building block based on the structured metadata of the building blocks, and determining the configuration parameters of the target building block based on the building block type and attribute information; and an output interface layer for generating a standardized configuration file of the target building block based on the building block type, attribute information, and configuration parameters.

[0019] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method for generating visual programming blocks as described in the first aspect or any corresponding embodiment thereof.

[0020] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for generating visual programming blocks according to the first aspect or any corresponding embodiment thereof. Attached Figure Description

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

[0022] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the architecture of a visual programming block generation system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the first process of generating visual programming blocks according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a second process for generating visual programming blocks according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the technical architecture of a method for generating visual programming blocks according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the third process of generating visual programming blocks according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0025] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0026] As an optional application scenario of this invention, such as Figure 1 As shown, a visual programming block generation system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0027] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0028] Figure 2 For the architecture diagram of the system for generating visual programming blocks, such as Figure 2 As shown, it includes an input interface layer, an AI understanding layer, an intelligent conversion layer, and an output interface layer. The input interface layer supports diverse input methods; the AI ​​understanding layer performs AI-based interpretation of the input information; the intelligent conversion layer matches the target building block and determines its relevant information; and the output interface layer outputs a standardized JSON-formatted building block configuration file.

[0029] The existing visual programming block configuration development method has many shortcomings, as follows: High technical threshold: Traditional block configuration development requires developers to have a deep understanding of the technical details and configuration rules of the graphical programming framework, and requires several days to several weeks of professional training to get started. This makes it impossible for non-technical personnel (such as product designers) to directly participate in the block definition work, thus limiting the scope of participation in block development.

[0030] The development cycle is lengthy: configuring and developing a single simple functional block requires several hours of manually writing configuration parameters, while complex functional blocks require several hours to a working day. The development cycle for a complete functional module can be as long as one week to several weeks, resulting in low development efficiency and an inability to meet the needs of rapid iteration.

[0031] High maintenance costs: When the application programming interface (API) changes, all related block configurations need to be manually modified, which is not only time-consuming and labor-intensive, but also prone to configuration errors and high debugging costs; at the same time, configuration files and technical documents need to be maintained, which further increases the maintenance burden.

[0032] AI-generated configurations lack practicality: Related technologies attempt to generate block configurations using AI, but because AI struggles to understand visual abstract concepts and business semantics, the generated configuration files, while grammatically correct, are out of touch with actual business needs, resulting in poor practicality and inability to be directly used.

[0033] Poor readability and maintainability: Traditional configuration files are filled with a lot of technical implementation details, and business logic is obscured by complicated technical parameters. The code readability is low, which is not conducive to team collaboration and development and the inheritance of technical knowledge. Subsequent iterations and debugging are more difficult.

[0034] Therefore, based on the above-mentioned visual programming block generation system, this embodiment of the invention provides a method for generating visual programming blocks. By transforming the graphical configuration understanding problem, which artificial intelligence is not good at, into the semantic understanding of code programs, it achieves automated and standardized generation of block configuration, reduces development threshold, shortens development cycle, reduces maintenance cost, and improves the practicality and standardization of block configuration.

[0035] According to an embodiment of the present invention, a method for generating visual programming blocks is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0036] This embodiment provides a method for generating visual programming blocks, which can be used on the aforementioned mobile terminals, such as computers. Figure 3 This is a flowchart of a method for generating visual programming blocks according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the block function requirement information in program code format.

[0037] Specifically, in this embodiment of the invention, the system's input interface layer supports diverse input methods. To facilitate unified parsing and processing of requirement information by the artificial intelligence understanding layer, the system automatically converts non-program code format building block functional requirement information into program code format, or directly receives building block functional requirement information input in program code form. For example, users (developers or product designers) can directly write typed language definitions in program code format to describe the functional requirements of the target building block, expressed as follows: / ** * @message outputs @ * @colour 160 / console_log: (VALUE: string) =>void; As can be seen from the above examples, the typed language definition contains specific annotations to describe the content and visual style of the blocks, as well as function declarations to characterize the functions of the blocks, which can provide complete and standardized input information for subsequent artificial intelligence analysis.

[0038] Step S302: Perform artificial intelligence understanding and analysis on the functional requirements information of the building blocks to obtain the structured metadata of the building blocks.

[0039] Specifically, in this embodiment of the invention, the system implements the parsing and processing of input information based on a preset architecture. Its core processing modules include a type definition parsing module, a semantic mapping module, an annotation-driven configuration module, and a configuration generation and optimization module.

[0040] The type definition parsing module is the core parsing unit. This module calls the TypeScript compiler API to perform syntax and semantic analysis on the functional requirement information of the building blocks in the program code format, automatically extracting and generating structured metadata for the building blocks. This structured metadata includes function identifier information, parameter type information, return value type information, and comment information, used to fully represent the functional definition, input / output rules, and interface attribute descriptions of the building blocks. This provides a standardized and structured data foundation for subsequent building block type determination, attribute generation, and configuration file construction. Through this parsing process, the system can automatically transform the original code-based functional requirements into machine-recognizable and processable structured data, achieving standardized expression and intelligent parsing of building block requirements.

[0041] Step S303: Determine the block type and attribute information of the target block based on the block structured metadata, and determine the configuration parameters of the target block based on the block type and attribute information.

[0042] Specifically, in this embodiment of the invention, based on the block structured metadata parsed by the type definition parsing module, the intelligent conversion layer first extracts core identification information from the metadata based on the semantic mapping module and the annotation-driven configuration module, thereby locking the unique target block, clarifying the core functional positioning of the block, ensuring that all subsequent processing revolves around the target block, and avoiding block matching deviations.

[0043] Secondly, the intelligent conversion layer combines various information contained in the structured metadata of the building blocks to determine the building block type and attribute information of the target building block. The building block type defines the core functional attributes and overall structural characteristics of the target building block, clarifying its functional positioning in the visual programming scenario. The attribute information describes the specific characteristics related to the visual presentation and user interaction of the target building block, covering the text content displayed in the user interface, the relevant styles of visual presentation, and prompts during user operation, ensuring that the appearance and interactive experience of the target building block meet user needs.

[0044] After determining the target block's block type and attribute information, the intelligent conversion layer automatically derives and determines the target block's configuration parameters based on the relationship between the two. Configuration parameters are a set of core parameters used to define the target block's appearance, interaction logic, connection methods, etc. Their derivation process strictly adheres to the functional positioning and specific requirements of the block type's attribute information, ensuring that the configuration parameters accurately support the target block's functional implementation and visual presentation, providing a complete and standardized parameter foundation for the subsequent generation of standardized configuration files.

[0045] The entire process is automated through the intelligent conversion layer, which enables the orderly conversion of block structured metadata into block type, attribute information and configuration parameters. No manual definition and configuration are required, which effectively reduces the technical threshold for block development and ensures that all parameters are highly matched with the functional requirements of the target block.

[0046] Step S304: Generate a standardized configuration file for the target block based on the block type, attribute information, and configuration parameters.

[0047] Specifically, in this embodiment of the invention, the output interface layer, in conjunction with the configuration generation and optimization module, integrates the block type, attribute information, and configuration parameters of the target blocks determined by the intelligent conversion layer. The JSON structure generator of the configuration generation and optimization module then fills these various information entries into designated modules of the configuration file according to preset standardized format requirements. Specifically, the block type information defines the functional classification of the configuration file, the attribute information fills in content related to visualization and user interaction, and the configuration parameters clarify the specific rules related to block connections and functional implementation in the configuration file, ensuring the structural integrity and accuracy of the configuration file.

[0048] After the information is populated, the system automatically standardizes the generated configuration file format, for example, by generating a standardized JSON format block configuration file. This ensures that the configuration file meets the compatibility requirements of the visual programming platform, can be quickly recognized and parsed by the platform, and avoids block loading failures or functional abnormalities due to inconsistent formats. At the same time, standardization also ensures that the configuration files for different target blocks have a unified structural specification, facilitating subsequent maintenance, iteration, and reuse.

[0049] The standardized configuration file generated by the embodiments of the present invention can fully characterize the function, appearance and interaction logic of the target building block. It can be directly imported into the visual programming platform without manual modification, enabling the rapid generation and deployment of the target building block, greatly improving the efficiency of building block development, and solving the problems of time-consuming and error-prone traditional manual configuration file writing.

[0050] The present invention provides a method for generating visual programming blocks. This method uses artificial intelligence to understand and parse the functional requirements information of blocks in program code format, obtaining structured metadata for the blocks. Based on this structured metadata, the block type, attribute information, and configuration parameters of the target block are determined, and then a corresponding standardized configuration file is generated. This invention transforms the problem of graphical configuration understanding, which is not well-suited to artificial intelligence, into the strength of code program semantic understanding. It can automatically generate standardized JSON configuration files for blocks, effectively lowering the technical threshold for developing visual programming blocks, while reducing human intervention, significantly shortening the block development cycle, reducing human error during development, lowering the cost of block development and subsequent maintenance, improving the efficiency and standardization of block development on the visual programming platform, and meeting the needs of rapid platform iteration and expansion.

[0051] This embodiment provides a method for generating visual programming blocks, which can be used on the aforementioned mobile terminals, such as computers. Figure 4 This is a flowchart of a method for generating visual programming blocks according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps: Step S401: Obtain the block functional requirements information in program code format. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.

[0052] Step S402: Perform artificial intelligence understanding and analysis on the functional requirements information of the building blocks to obtain the structured metadata of the building blocks.

[0053] Specifically, step S402 includes: Step S4021: Call the compiler application interface to perform lexical and syntactic analysis on the program code corresponding to the block functional requirement information to obtain syntactic units and syntax trees.

[0054] Specifically, in embodiments of the present invention, such as Figure 5 As shown, the AI ​​intelligent understanding layer calls the type definition parsing module, which in turn calls the TypeScript compiler API to perform comprehensive lexical and syntactic analysis on the program code corresponding to the functional requirements of the building blocks. Lexical analysis primarily scans and identifies character sequences in the program code, decomposing them into syntactic units with independent semantics, including keywords, identifiers, constants, operators, and comment fragments. Invalid characters are removed, ensuring the accuracy and standardization of the syntactic units. Syntactic analysis, based on lexical analysis and according to preset program syntax rules, combines the obtained syntactic units into a syntax tree that conforms to the syntax rules. This clearly presents the syntactic structure of the program code, the hierarchical relationships between code units, and logical connections, laying the foundation for subsequent information extraction and verification.

[0055] Step S4022: Based on the syntax unit and syntax tree, perform syntax tree node location, function name extraction and identifier verification to obtain the function identifier.

[0056] Specifically, in this embodiment of the invention, the type definition parsing module performs syntax tree node location, function name extraction, and identifier verification based on syntax units and syntax trees to obtain function identifiers: by traversing the syntax tree, the function node representing the function of the building block in the program code is accurately located, the function name is extracted from the node as the core identification information, and the extracted identifier is verified for format and validity to ensure that the identifier is unique and standardized and can accurately correspond to the target building block, avoiding subsequent building block matching deviations due to incorrect identifiers.

[0057] Step S4023: Based on the syntax unit and syntax tree, parameter node location, type annotation reading, type verification and confirmation are performed to obtain parameter type information.

[0058] Specifically, in embodiments of the present invention, such as Figure 5 As shown, the type definition parsing module performs type reasoning based on syntax units and syntax trees, including parameter node location, type annotation reading, type verification and confirmation, to obtain parameter type information: It locates the parameter node corresponding to the function in the syntax tree, reads the type annotation information of each parameter one by one to clarify the data type of each parameter, and verifies and confirms the read type annotations to check for problems such as non-standard type annotations and type mismatches, ensuring the accuracy of parameter type information and providing a basis for the subsequent configuration of target building blocks.

[0059] Step S4024: Based on the syntax unit and syntax tree, locate the return value node, read and deduce the return value type, and perform type consistency verification to obtain the return value type.

[0060] Specifically, in this embodiment of the invention, the type definition parsing module performs return value node location, return value type reading and deduction, and type consistency verification based on syntax units and syntax trees to obtain the return value type: It locates the return value node of the function in the syntax tree and directly reads the type label of the return value; if the return value does not have an explicitly labeled type, it performs reasonable deduction based on the function's functional logic, parameter types, and other information to determine the return value type; finally, it performs consistency verification on the return value type to ensure that the return value type matches the function's functionality and parameter types, guaranteeing that the extracted return value type is accurate and effective.

[0061] Step S4025 involves extracting annotations based on grammatical units and syntax trees, filtering specific annotations, parsing and structuring annotation content, and validating annotation format to obtain annotation content.

[0062] Specifically, in embodiments of the present invention, such as Figure 5 As shown, the type definition parsing module performs annotation parsing based on syntax units and syntax trees, including: annotation extraction, specific annotation filtering, annotation content parsing and structuring, and annotation format verification, to obtain annotation content: all annotation fragments are extracted from the syntax units, and specific annotations related to block configuration (such as annotations describing block display text, visual styles, and operation prompts) are filtered according to preset rules. The filtered annotation content is parsed and structured, converting unstructured annotation text into standardized structured information. At the same time, the annotation format is verified to ensure that the annotation content is complete, the format is standardized, and it can accurately reflect the relevant attribute requirements of the target block.

[0063] Through the above series of parsing and verification steps, we can obtain block-structured metadata including function identifiers, parameter type information, return value types, and comment content, realizing the standardization and structured transformation of program code format requirements, and providing complete and reliable data support for subsequent processing in the intelligent conversion layer.

[0064] Step S403: Determine the block type and attribute information of the target block based on the block structured metadata, and determine the configuration parameters of the target block based on the block type and attribute information.

[0065] Specifically, step S403 includes: Step S4031: Determine the target block based on the function identifier.

[0066] Specifically, in this embodiment of the invention, the function identifier is the unique core identifier of the target building block, which can accurately correspond to the specific building block function. The intelligent conversion layer first extracts the function identifier from the obtained building block structured metadata and matches it in the system's preset building block function mapping library to lock the uniquely corresponding target building block, clarify the core function positioning of the building block, and ensure that all subsequent processing revolves around the target building block, avoiding building block matching deviations. For example, if the parsed function identifier is "console_log", the system matches the target building block with the core function of "output display" through this identifier, and determines that all subsequent configurations revolve around the "output display" type building block.

[0067] Step S4032: Based on a predefined intelligent mapping rule library, determine the block type of the target block according to the parameter type information and return value type. The block type includes control type and structure type.

[0068] Specifically, in this embodiment of the invention, the intelligent mapping rule base is a set of standardized mapping rules preset by the system, covering the correspondence between different data types and block types, such as... Figure 5 As shown, the intelligent conversion layer extracts parameter type information and return value type from the structured metadata of the building blocks. Combined with the rule base, it automatically matches and determines the control type (used to define the input interaction form of the building blocks) and structure type (used to define the overall logical structure of the building blocks) of the target building blocks.

[0069] In some optional implementations, step S4032 above includes: Step a1: If the target block is determined to be of basic data type based on parameter type information and return value type, then the control type of the target block is mapped to the user input control.

[0070] Step a2: If the target block is determined to be a literal union type based on the parameter type information and return value type, then the control type of the target block is mapped to an enumerated input control.

[0071] Step a3: If the target block is determined to be a callback function type based on the parameter type information and return value type, then the structure type of the target block is mapped to a nested statement structure.

[0072] Step a4: If the target block is determined to be of generic type based on the parameter type information and return value type, then determine the best control type and / or best structure type of the target block based on the parameter type information and return value type.

[0073] Specifically, in this embodiment of the invention, basic data types include common basic types such as string, number, and boolean. When the parameter type information or return value type is one of these basic types, it indicates that the target block requires manual input of relevant data by the user. Therefore, the basic type mapper of the semantic mapping module is used to map its control type to a user input control, making it convenient for the user to directly input the corresponding data on the visual interface. For example, if the function identifier is "input_num", the parameter type information is "number (numerical type)", and the return value type is "void (no return value)", then the target block is determined to be a basic data type, and its control type is mapped to a number input box (a type of user input control), through which the user can manually input specific values.

[0074] In some optional implementations, a literal union type refers to a union type composed of multiple fixed literal values ​​(such as "left|center|right" or "red|blue|green"). Parameters or return values ​​of this type have a fixed range of options and do not require manual user input. Therefore, the union type mapper of the semantic mapping module maps its control type to an enumeration type input control (such as a drop-down selection box or radio button). Users only need to select from preset options, ensuring the legality and standardization of the input. For example, if the function identifier is "set_align", the parameter type information is "'left'|'center'|'right' (literal union type)", and the return value type is "void", then the target block is determined to be a literal union type, and its control type is mapped to a drop-down selection box (enumeration type input control). The drop-down options are preset to "left-aligned", "center-aligned", and "right-aligned", and users can directly select to complete the configuration.

[0075] In some optional implementations, the callback function type refers to a type that takes a function as a parameter or returns a value. Such target blocks need to support multi-step nested logic. Therefore, the function type mapper of the semantic mapping module is used to map its structure type to a nested statement structure. That is, a nested area is reserved inside the block, allowing users to drag in other functional blocks to achieve complex logical linkages. For example, if the function identifier is "on_click", the parameter type information is "(() => void) (callback function type)", and the return value type is "void", then the target block is determined to be a callback function type, and its structure type is mapped to a nested statement structure. Users can drag in other blocks such as "console_log" and "input_num" within the nested area of ​​this block to achieve the function of "execute nested block logic after clicking".

[0076] In some alternative implementations, a generic type refers to a type with parameterized type constraints (such as "Array"). <t>(T is the generic parameter). The type of this type of target block is flexible. It requires using the generic type mapper of the semantic mapping module, combined with specific parameter type information and return value type, to dynamically deduce the appropriate control type and / or structure type. This ensures that the block configuration conforms to both generic constraints and actual functional requirements. For example, if the function identifier is "filter_array" and the parameter type information is "Array..." <t>(Generic type, T can represent string, number, etc.)", the return type is "Array" <t>When T is a string, the optimal control type is a text input control (used to input filter conditions), and the structure type is a normal structure; when T is a function, the optimal structure type is a nested statement structure (used to nest filter logic), and the control type is none (no manual input is required, only nested blocks are needed).

[0077] Step S4033: Determine the attribute information of the target block based on the annotation content. The attribute information includes at least the user interface display text, visual presentation style, and user operation prompts.

[0078] Specifically, in this embodiment of the invention, the annotation content is key information in the block structured metadata used to describe the appearance and interactive prompts of the blocks. The intelligent conversion layer calls the annotation-driven configuration module to extract the annotation content from the metadata. Based on the type and content of the annotation, it determines the various attribute information of the target blocks to ensure that the visual presentation of the blocks and the user interaction experience meet the requirements.

[0079] In some optional implementations, step S4033 above includes: Step b1: If the annotation content is a preset format annotation, then determine the user interface display text of the target block according to the preset format annotation.

[0080] Step b2: If the annotation is a color attribute annotation, then determine the visual presentation style of the target block based on the color attribute annotation.

[0081] Step b3: If the annotation is a prompt message, then determine the user operation prompt message for the target block based on the prompt message annotation.

[0082] Specifically, in this embodiment of the invention, preset format annotations refer to annotations with pre-defined formats (such as @message, @title, etc.) that are specifically used to define the text content displayed by the building blocks on the visual interface, including the building block name, button text, and prompt text. The annotation-driven configuration module parses these annotations and directly extracts their text content as the user interface display text for the target building block. For example, if the parsed annotation content contains "@message Output text content", then the annotation is a preset format annotation. Based on this annotation, the system determines that the user interface display text for the target building block is "output text content", meaning that the text displayed on the building block by the user on the visualization platform is "output text content".

[0083] In some optional implementations, color attribute annotations refer to comments (such as @colour, @bgColor, etc.) used to define the visual style of blocks, covering the background color, text color, border color, etc. of the blocks. The annotation-driven configuration module parses these annotations, extracts color parameters (such as hexadecimal color values, color value numbers), and determines the visual presentation style of the target blocks, ensuring that the appearance of the blocks is consistent and meets the requirements. For example, if the annotation content contains "@colour 160" (160 corresponds to the hexadecimal color #A0A0A0, light gray), then this annotation is a color attribute annotation. Based on this annotation, the system determines that the text color of the target block is light gray, and the background color adopts the platform's default light color, forming a clear visual presentation effect.

[0084] In some optional implementations, prompt annotations refer to comments (such as @tip, @prompt, etc.) used to describe user operation methods and precautions. The annotation-driven configuration module parses these annotations, extracts the prompt text, and uses it as the user operation prompt information for the target block. When the user hovers the mouse over or clicks the block, this prompt information will be displayed to guide the user to operate correctly. For example, if the annotation content contains "@tip Please enter a value between 1 and 100", then this annotation is a prompt annotation. Based on this annotation, the system determines that the user operation prompt information for the target block is "Please enter a value between 1 and 100". When the user operates the block, this prompt will be displayed to avoid user input errors. In addition, the annotation-driven configuration module supports custom extended annotations to adapt to different platform requirements.

[0085] Step S4034: Determine the configuration parameters of the target block based on the block type and attribute information. The configuration parameters include at least the connection method and display style of the target block.

[0086] Specifically, in this embodiment of the invention, after the block type (control type, structure type) and attribute information (display text, visual style, operation prompts) of the target block are determined, the intelligent conversion layer automatically derives and integrates the configuration parameters of the target block based on the relationship between the two. The configuration parameters are a set of core parameters used to define the appearance display, interaction logic and connection method of the block, ensuring that the block can be displayed normally, realize the preset function, and can be smoothly connected with other blocks.

[0087] The connection method is determined based on the structure type of the blocks. For example, blocks with nested statement structures are set to "support vertical nesting and horizontal splicing" to allow logical interaction with other blocks; blocks with ordinary structures are set to "support vertical splicing only" to ensure standardized block layout. The display style is determined by combining attribute information and control type. For example, the display style of user input controls (number input boxes) is set to "light gray text, white background, rounded corners" based on color attribute annotations, while simultaneously displaying user interface text and operation prompts to ensure visual clarity and ease of operation.

[0088] For example, such as Figure 5 As shown, based on the relevant information of the "console_log" block mentioned above, the function identifier determines that the target block is the "output display" block, the parameter type is string (basic data type), the control type is mapped to a text input control, and the comment content includes "@message output", "@colour 160", and "@tip please enter the text to be output". The derived configuration parameters are: the connection method is "top and bottom splicing", the display style is "light gray text color, white background color, rounded border", the user interface displays the text "output", the operation prompt is "please enter the text to be output", and the length of the text input control is adapted to the input requirements, ensuring that this block can be used directly on the visualization platform and smoothly connected with other blocks.

[0089] As can be seen, in the traditional way, users need to write configuration files containing more than ten lines of complex configuration: { "type": "console_log", "message0": "Output %1", "args0": [ { "type": "input_value", "name": "VALUE", "check": "String", "align": "RIGHT" } ], "inputsInline": true, "previousStatement": true, "nextStatement": true, "colour": 160, "tooltip": Outputs information to the console. } Based on the system provided in this embodiment of the invention, users only need to write a few lines of concise definition: / ** * @message outputs @ * @colour 160 / console_log: (VALUE: string) =>void; The system can automatically generate complete standardized configuration files based on concise definitions, significantly reducing code complexity and greatly improving readability and maintainability.

[0090] Furthermore, the intelligent conversion layer can also utilize a context optimizer to optimize configurations based on contextual information, such as categorizing block functions, unifying visual themes, and standardizing naming conventions; it can also utilize a configuration specification checker to ensure that the generated configurations conform to the technical specifications of the target platform.

[0091] Compared to existing visual block systems, which generally solve the core logic of "how to convert existing block UIs into underlying program code" and rely on manually pre-defining and maintaining complex block UI configuration files, this invention achieves reverse reconstruction of the execution logic. By parsing the underlying typed code definition (such as TypeScript) and metadata annotations, and using an AI system to infer structural relationships and semantic mapping, it automatically generates the complex UI block configuration file itself (such as a standard JSON structure), completely eliminating the complex work of manually maintaining the technical details of the graphical framework and breaking the current technical limitation that requires manual UI configuration.

[0092] Existing AI-assisted code generation systems typically rely on large language models and a pure black-box reasoning generation mode that directly converts natural language descriptions into target code. When faced with the unique "visual abstract concepts," "spatial geometric constraints," and "multi-dimensional UI parameter configurations" of visual programming blocks, they are prone to illusions and uncontrollable structural errors. The execution logic of this invention abandons the approach of having large models directly "guess" the UI interface. Instead, it utilizes a defined compiler application programming interface for pre-parsing, accurately extracting the syntax tree and type information. Coupled with an extremely strict type semantic mapping mechanism, the AI's role in this process is precisely constrained to context optimization, semantic inference, and document classification. This ensures that the block UI configuration fully conforms to the technical specifications of the target platform, solving the technical problems of poor practicality and low accuracy in UI configuration generation from pure large models.

[0093] The embodiments of this invention, through the complete block generation and optimization process described above, can achieve full automation of the visual programming block development process. Compared with the traditional manual configuration method, it can significantly improve development efficiency, lower the technical threshold, improve configuration quality, and accelerate iteration speed. At the same time, it has innovative AI application paradigms, automated maintenance capabilities, and significant commercial value, which are summarized as follows: This invention significantly improves development efficiency. The development time for simple functional blocks is reduced from hours to minutes, for complex functional blocks from hours to a day to just over ten minutes, and for complete functional modules from a week to several weeks to hours, with efficiency improvements reaching an order of magnitude. The technical barrier to entry is significantly lowered, allowing non-technical personnel to directly participate in block function definition, reducing new employee training time from weeks to hours, and effectively enabling efficient cross-functional team collaboration. Configuration quality is significantly improved, with configuration error rates reduced to extremely low levels, near-perfect consistency in configuration specifications, and maintenance costs reduced by approximately an order of magnitude, resulting in a substantial reduction in technical debt. Iteration speed achieves a qualitative leap, upgrading the development model from "weekly iterations" to "hourly iterations," significantly reducing product trial-and-error costs and enabling rapid response to changes in market demands.

[0094] In terms of technological innovation and practicality, the embodiments of this invention innovate the application paradigm of artificial intelligence, giving full play to the advantages of artificial intelligence in code semantic understanding, rather than forcing it to adapt to complex graphical configuration understanding tasks. The design concept has strong versatility and expansion potential. At the same time, it has automated maintenance capabilities. When the API changes, only the type definition file needs to be updated, and the system can automatically regenerate the standardized configuration, realizing automatic synchronization and maintenance of configuration files and documents.

[0095] In terms of commercial value, the embodiments of the present invention can significantly save the human cost of repetitive configuration development, significantly shorten the project delivery cycle, provide enterprises with an important differentiated competitive advantage in the technological competition in the era of artificial intelligence, and improve the overall development efficiency and market competitiveness of enterprises. It solves the core pain points of traditional manual block configuration, such as time consumption, easy error, high threshold and difficult maintenance.

[0096] Step S404: Generate a standardized configuration file for the target block based on the block type, attribute information, and configuration parameters. For details, please refer to [link to relevant documentation]. Figure 3 Step S304 of the illustrated embodiment will not be described again here.

[0097] The present invention provides a method for generating visual programming blocks. This method uses artificial intelligence to understand and parse the functional requirements information of blocks in program code format, obtaining structured metadata for the blocks. Based on this structured metadata, the block type, attribute information, and configuration parameters of the target block are determined, and then a corresponding standardized configuration file is generated. This invention transforms the problem of graphical configuration understanding, which is not well-suited to artificial intelligence, into the strength of code program semantic understanding. It can automatically generate standardized JSON configuration files for blocks, effectively lowering the technical threshold for developing visual programming blocks, while reducing human intervention, significantly shortening the block development cycle, reducing human error during development, lowering the cost of block development and subsequent maintenance, improving the efficiency and standardization of block development on the visual programming platform, and meeting the needs of rapid platform iteration and expansion.

[0098] This embodiment provides a method for generating visual programming blocks, which can be used on the aforementioned mobile terminals, such as computers. Figure 6 This is a flowchart of a method for generating visual programming blocks according to an embodiment of the present invention, such as... Figure 6 As shown, the process includes the following steps: Step S601: Obtain the block functional requirements information in program code format. For details, please refer to [link to relevant documentation]. Figure 4 Step S401 of the illustrated embodiment will not be described again here.

[0099] Step S602: If the functional requirement information of the building blocks is a structured requirement document or an interactive dialogue definition, then the structured requirement document or interactive dialogue definition is converted into the corresponding typed language definition.

[0100] Specifically, in this embodiment of the invention, the input interface layer supports diverse input methods, including: typed language definitions (such as TypeScript function signatures with specific annotations), structured requirement documents (product function descriptions based on natural language), interactive dialogue definitions (descriptions of functional requirements through human-computer dialogue), and existing application programming interface (API) definition files. Among these, typed language definitions and API definition files are program code, which can be directly imported into the system and subsequently parsed and converted without additional processing. However, structured requirement documents or interactive dialogue definitions are non-program code requirement information and cannot be directly parsed and processed by the system's AI understanding layer. Therefore, they need to be pre-processed through the AI ​​understanding module for semantic analysis, function extraction, and format conversion, transforming them into standardized typed language definitions to ensure the smooth execution of subsequent steps.

[0101] For example, suppose the structured requirements document entered by the user contains the following: "Develop an output display block that receives text input from the user and displays it in a visual programming interface; the block displays the text 'Text Output' in light gray (color value number 160); the user is prompted 'Please enter the text to be displayed'; the block receives a string input parameter and has no return value." The system's AI understanding module first performs natural language parsing on the structured requirements document, extracting core functional information (output display, receiving string parameters, no return value) and attribute information (display text, text color, operation prompts). Then, according to a preset typed language definition format (such as TypeScript function signature + specific comments), it converts it into the corresponding typed language definition. The converted content is as follows: / ** * @message Text output * @colour 160 * @tip Please enter the text content you want to display. / text_output: (inputText: string) =>void; The transformed typed language definition fully retains all the functional and attribute requirements of the structured requirements document, including specific comments and function signatures, and can be directly imported by the system for subsequent artificial intelligence understanding and parsing. For example, suppose a user describes their needs through human-computer dialogue (interactive dialogue definition), and the dialogue process is as follows: User: I need an alignment setting block; System: Please explain the specific function and requirements of this block; User: The function is to set the alignment of text, and only three alignment options are available: left alignment, center alignment, and right alignment; The block displays the text "Set Alignment" and the operation prompt is "Select Text Alignment"; No input parameters are required, and there is no return value.

[0102] The system's AI understanding module semantically analyzes the interactive dialogue, extracting core information: the block function sets text alignment, with three fixed, selectable alignment options (literal union type), no return value, displayed text "Set alignment," and the operation prompt "Select text alignment." This information is then converted into a standardized, typed language definition, as follows: / ** * @message sets the alignment. * @tip: Select text alignment / set_align: (alignType: 'left'|'center'|'right') =>void; The transformation result accurately maps all the requirements in the interactive dialogue, forming a program code format that the system can parse. This ensures that subsequent steps can smoothly extract the structured metadata of the building blocks based on this typed language definition, and complete the automatic generation of the building blocks.

[0103] Through the above AI transformation process, the unification of non-program code requirement information and program code requirement information can be achieved, reducing the technical threshold for users to input requirements. This allows non-technical personnel (such as product designers) to define the functional requirements of building blocks without writing program code, simply through natural language description or human-computer dialogue. At the same time, it ensures that the requirement information can be accurately parsed by the system, providing reliable support for the subsequent building block generation process.

[0104] Step S603 involves using artificial intelligence to understand and parse the functional requirements information of the building blocks, obtaining structured metadata for the blocks. For details, please refer to [link to relevant documentation]. Figure 4 Step S402 of the illustrated embodiment will not be described again here.

[0105] Step S604: Determine the block type and attribute information of the target block based on the block structured metadata, and determine the configuration parameters of the target block based on the block type and attribute information. For details, please refer to [link to relevant documentation]. Figure 4 Step S403 of the illustrated embodiment will not be described again here.

[0106] Step S605: Generate a standardized configuration file for the target block based on the block type, attribute information, and configuration parameters. For details, please refer to [link to relevant documentation]. Figure 4 Step S404 of the illustrated embodiment will not be described again here.

[0107] Step S606: Perform integrity verification, performance optimization, and version compatibility processing on the standardized configuration file; generate corresponding type declaration files and technical documents based on the processed standardized configuration file.

[0108] Specifically, in this embodiment of the invention, the system's output interface layer and configuration generation and optimization module work together to complete the subsequent optimization and supporting document generation after the standardized configuration file is generated. The core purpose is to ensure the stability, availability and maintainability of the standardized configuration file, and at the same time generate supporting documents to provide support for the subsequent use, maintenance and iteration of the building blocks.

[0109] In some optional implementations, the configuration integrity checker of the configuration generation and optimization module automatically performs a comprehensive check on the content of the standardized configuration file. It focuses on verifying whether the configuration file contains missing core parameters (such as block type, connection method, display style, etc.), whether the parameter format is standardized, and whether there are logical contradictions between parameters. Simultaneously, it checks whether the configuration file is completely consistent with the determined block type, attribute information, and configuration parameters, and whether there are any omissions or mismatches. If the check finds missing core parameters (such as no block connection method configured), incorrect parameter format (such as an invalid color value input for color parameters), or logical contradictions (such as a nested statement structure without configured nested area parameters), the system will automatically mark the exception and provide feedback on the check results, ensuring that the configuration file content is complete, logically coherent, and error-free. For example, for the generated "text_output" standardized block configuration file, the integrity check will verify whether it contains core parameters such as "control type (text input control)," "display style (light gray text, white background)," and "connection method (top and bottom splicing)," while also verifying whether the attribute information corresponding to the comments is fully mapped, ensuring no parameters are missing or mismatched.

[0110] In some optional implementations, the performance optimization processor of the configuration generation and optimization module performs lightweight and efficient optimization on standardized configuration files, eliminating redundant and invalid parameter configurations (such as duplicated display style parameters), compressing the configuration file size, and improving the loading speed and parsing efficiency of the configuration file. Simultaneously, it optimizes the execution logic of configuration parameters, reducing resource consumption when the visual programming platform loads blocks, ensuring smooth operation of blocks on the platform, and avoiding problems such as lag and loading failures. For example, if the configuration file defines both "text color #A0A0A0" and "text color 160" (both corresponding to the same color), the performance optimization will automatically eliminate duplicate parameters, retaining only one standardized format and compressing the file size; it will also optimize the rendering logic of the block display style, ensuring that the preset appearance is quickly presented when the block is loaded.

[0111] In some optional implementations, the version compatibility processor of the configuration generation and optimization module, in conjunction with different versions of the visual programming platform, performs compatibility adaptation on standardized configuration files. This ensures that the configuration files can be loaded and run correctly in all historical and latest versions of the platform, avoiding configuration file failures due to version differences. Specifically, the system presets compatibility rules for different platform versions, adjusts version-sensitive parameters in the configuration files, and retains backward compatibility, ensuring that building blocks developed on older platform versions can still be used normally on upgraded platforms, and vice versa. For example, if an older version of the visual programming platform only supports color value number format (e.g., 160), while a newer version supports both color value number and hexadecimal format (e.g., #A0A0A0), the version compatibility processing ensures that the color parameters in the configuration file adapt to both formats, supporting both the new and older platform versions.

[0112] Furthermore, the interface output layer of this embodiment generates a matching type declaration file and technical documentation based on the processed standardized configuration file, thereby achieving synchronous generation of the configuration file and the matching documentation and reducing subsequent maintenance costs.

[0113] The type declaration file is used to clearly define the type, value range, default value, and relationships of all parameters in the standardized configuration file. This provides type constraints for subsequent secondary development and parameter modification of the building blocks, preventing configuration anomalies caused by incorrect parameter types. The type declaration file uses a format consistent with the typed language definition (such as TypeScript type declarations), clearly annotating the relevant information for each configuration parameter, ensuring developers can quickly understand the meaning and usage specifications of the parameters. For example, based on the standardized configuration file processed by the "set_align" building block, the generated type declaration file will clearly indicate that the type of the "alignType" parameter is "'left'|'center'|'right'", the type of the "display text" parameter is "string", and the value range of the "connection method" parameter is "['top and bottom concatenation']", providing developers with clear type guidance for modifying parameters.

[0114] Technical documentation details the functionality, configuration parameters, usage methods, precautions, and maintenance points of each target block. It covers the core functional descriptions of the block, the specific meanings of configuration parameters, visual presentation effects, connection rules with other blocks, methods for modifying configuration files, and troubleshooting techniques. The documentation uses a standardized format, concise language, and clear logic, catering to both technical personnel's maintenance needs and non-technical personnel's understanding of the block's usage guidelines. For example, for the "console_log" block, the documentation details its core "output display" function, lists the specific meanings of all configuration parameters (such as display style, connection method, and operation prompts), explains the block's use cases (such as outputting user-inputted text), and marks common anomalies (such as loading failures potentially due to incorrect color parameters) and troubleshooting methods, providing comprehensive support for the use and maintenance of the block.

[0115] The present invention provides a method for generating visual programming blocks. This method uses artificial intelligence to understand and parse the functional requirements information of blocks in program code format, obtaining structured metadata for the blocks. Based on this structured metadata, the block type, attribute information, and configuration parameters of the target block are determined, and then a corresponding standardized configuration file is generated. This invention transforms the problem of graphical configuration understanding, which is not well-suited to artificial intelligence, into the strength of code program semantic understanding. It can automatically generate standardized JSON configuration files for blocks, effectively lowering the technical threshold for developing visual programming blocks, while reducing human intervention, significantly shortening the block development cycle, reducing human error during development, lowering the cost of block development and subsequent maintenance, improving the efficiency and standardization of block development on the visual programming platform, and meeting the needs of rapid platform iteration and expansion.

[0116] The visual programming block generation system provided in this embodiment is used to implement the above embodiments and preferred embodiments, and will not be repeated here as already described. As used above, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated. The visual programming block generation system provided in this embodiment can execute the visual programming block generation method provided in any embodiment of this invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0117] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0118] The following is a detailed reference. Figure 7 This diagram illustrates a suitable structural schematic for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 701, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 702 or a program loaded from memory 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device. The processor 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0119] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 7 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0120] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 709, or installed from a memory 708, or installed from a ROM 702. When the computer program is executed by the processor 701, it performs the functions defined in the method for generating visual programming blocks according to embodiments of the present invention.

[0121] Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0122] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the method for generating visual programming blocks shown in the above embodiments is implemented.

[0123] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0124] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.< / t> < / t> < / t>

Claims

1. A method for generating visual programming blocks, characterized in that, The method includes: Obtain the functional requirements information of the building blocks in the program code format; The functional requirements information of the building blocks is understood and analyzed using artificial intelligence to obtain the structured metadata of the building blocks; The block type and attribute information of the target block are determined based on the block structured metadata, and the configuration parameters of the target block are determined based on the block type and the attribute information. A standardized configuration file for the target block is generated based on the block type, the attribute information, and the configuration parameters.

2. The method according to claim 1, characterized in that, The process of performing artificial intelligence understanding and parsing on the functional requirements information of the building blocks to obtain structured metadata of the building blocks includes: The compiler application programming interface is invoked to perform lexical and syntactic analysis on the program code corresponding to the functional requirements of the building blocks, so as to obtain syntactic units and syntax trees; Based on the grammar unit and the syntax tree, perform syntax tree node location, function name extraction and identifier verification to obtain the function identifier; Based on the grammar unit and the syntax tree, parameter node location, type annotation reading, type verification and confirmation are performed to obtain parameter type information; Based on the syntax unit and the syntax tree, return value node location, return value type reading and deduction, and type consistency verification are performed to obtain the return value type; Based on the grammatical units and the syntax tree, annotation extraction, specific annotation filtering, annotation content parsing and structuring, and annotation format verification are performed to obtain the annotation content.

3. The method according to claim 2, characterized in that, The step of determining the block type and attribute information of the target block based on the block structured metadata, and determining the configuration parameters of the target block based on the block type and the attribute information, includes: The target building block is determined based on the function identifier; Based on a predefined intelligent mapping rule library, the block type of the target block is determined according to the parameter type information and the return value type. The block type includes control type and structure type. The attribute information of the target block is determined based on the annotation content, and the attribute information includes at least the user interface display text, visual presentation style, and user operation prompt information; The configuration parameters of the target block are determined based on the block type and the attribute information. The configuration parameters include at least the connection method and display style of the target block.

4. The method according to claim 3, characterized in that, The intelligent mapping rule base includes at least: basic type mapping rules, union type mapping rules, function type mapping rules, and generic type mapping rules; The method of determining the block type of the target block based on the predefined intelligent mapping rule base, according to the parameter type information and the return value type, includes: If the target block is determined to be of basic data type based on the parameter type information and the return value type, then the control type of the target block is mapped to a user input control; If the target block is determined to be a literal union type based on the parameter type information and the return value type, then the control type of the target block is mapped to an enumerated input control; If the target block is determined to be a callback function type based on the parameter type information and the return value type, then the structure type of the target block is mapped to a nested statement structure; If the target block is determined to be a generic type based on the parameter type information and the return value type, then the optimal control type and / or optimal structure type of the target block is determined based on the parameter type information and the return value type.

5. The method according to claim 3, characterized in that, Determining the attribute information of the target block based on the annotation content includes: If the annotation content is a preset format annotation, then the user interface display text of the target block is determined according to the preset format annotation; If the annotation is a color attribute annotation, then the visual presentation style of the target block is determined according to the color attribute annotation; If the annotation content is a prompt message annotation, then the user operation prompt message for the target block is determined based on the prompt message annotation.

6. The method according to any one of claims 1 to 5, characterized in that, The functional requirements information of the building blocks can be any one of the following: typed language definition, structured requirements document, interactive dialogue definition, and application programming interface definition file, wherein the typed language definition and the application programming interface definition file are program code; Before performing artificial intelligence understanding and parsing on the functional requirements information of the building blocks to obtain structured metadata of the building blocks, the method further includes: If the block functional requirement information is the structured requirement document or the interactive dialogue definition, then the structured requirement document or the interactive dialogue definition is converted into the corresponding typed language definition.

7. The method according to claim 1, characterized in that, After generating a standardized configuration file for the target block based on the block type, the attribute information, and the configuration parameters, the method further includes: The standardized configuration file is subjected to integrity verification, performance optimization, and version compatibility processing. Based on the processed standardized configuration file, corresponding type declaration files and technical documents are generated.

8. A system for generating visual programming blocks, characterized in that, The system includes: The input interface layer is used to obtain the functional requirements information of the building blocks in the form of program code; The artificial intelligence understanding layer is used to perform artificial intelligence understanding and parsing of the functional requirement information of the building blocks to obtain the structured metadata of the building blocks. The intelligent conversion layer is used to determine the block type and attribute information of the target block based on the block structured metadata, and to determine the configuration parameters of the target block based on the block type and the attribute information. The output interface layer is used to generate a standardized configuration file for the target block based on the block type, the attribute information, and the configuration parameters.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the method for generating visual programming blocks according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the method for generating visual programming blocks according to any one of claims 1 to 7.