Form generation method and system for APP development, electronic equipment and product
By obtaining and formatting form description information and generating forms, it solves the problems of heavy software development workload and poor maintainability, and achieves a more efficient development and maintenance process.
Patent Information
- Application Number
- CN202410809475.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-01
AI Technical Summary
As software functions increase, the number and calling forms of underlying functions increase, resulting in a huge workload in software development and poor maintainability of the software. Especially when the underlying functions are updated, the corresponding form interface needs to be updated simultaneously.
By obtaining the form description information, formatting it and inputting it into the form generation module, the form is generated, which reduces repeated coding work and improves the maintainability and scalability of the software.
It reduces software development time, improves development efficiency, simplifies the form update process, enhances code reusability and maintainability, and reduces the user's workload of manually writing code.
Smart Images

Figure CN118733148A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer software technology, and specifically relates to a form generation method, system, electronic equipment and product for APP development. Background Art
[0002] In the field of industrial software development, the underlying functions of the software are usually implemented through independent applications (APPlication program, APP). For example, the requirement of the filter design tool is to call the underlying function through the form option on the APP user interface and feed back the function calculation results to the APP user interface. In the prior art, a corresponding form (an interface element for collecting user input information) is usually developed for each function, so that the user can select parameters through the from form on the APP user interface, and the parameters are used to call the corresponding underlying function. However, in the process of using the prior art, the inventor found that there are at least the following problems in the prior art:
[0003] As software functions increase, the number and calling forms of underlying functions increase, and a large number of APP user interfaces need to be developed accordingly, which makes the software development workload huge; in addition, when the underlying functions are updated, it is usually necessary to synchronously update the form corresponding to the function and the APP user interface corresponding to the from form, which makes the software maintainability poor. Summary of the invention
[0004] The present invention aims to solve the above technical problems at least to a certain extent. The present invention provides a form generation method, system, electronic device and product for APP development.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a method for generating a form for APP development, comprising:
[0007] Acquire form description information, and transmit the form description information to a preset collection management module;
[0008] Formatting the form description information based on the collection management module to obtain formatted form description information;
[0009] The formatted form description information is input into a preset form generation module, so that the form generation module generates a form according to the formatted form description information.
[0010] In a possible design, the form description information includes a calling code template, parameters, and parameter attributes of a function corresponding to the specified form.
[0011] In one possible design, the parameter attributes include title, name, and type.
[0012] In a possible design, the form description information is in JSON format.
[0013] In a possible design, there are multiple forms of form description information, and the multiple forms of form description information correspond to multiple forms; correspondingly, after the collection management module formats the multiple forms of form description information, multiple formatted form description information are obtained, and the multiple formatted form description information constitute a form information set.
[0014] In a possible design, the form generation module uses a form generation function or a form generation interface tool.
[0015] In a possible design, the form generation module generates a form according to the formatted form description information, including:
[0016] Traversing the parameters in the formatted form description information, and generating a form item code matching the parameters in the formatted form description information;
[0017] Receive the parameter value input by the user, and generate the form submission code by using the calling code template in the formatted form description information and the parameter value;
[0018] Merge the form item code and the form submission code to obtain a form code;
[0019] A form is generated according to the form code.
[0020] In a second aspect, the present invention provides a form generation system for APP development, which is used to implement the form generation method for APP development as described in any one of the above; the form generation system for APP development includes:
[0021] A form information acquisition module, used to acquire form description information and transmit the form description information to a preset collection management module;
[0022] A form information formatting module, which is in communication with the form information acquisition module and is used to format the form description information based on the collection management module to obtain formatted form description information;
[0023] The form generation module is in communication with the form information formatting module and is used to input the formatted form description information into a preset form generation module so that the form generation module generates a form according to the formatted form description information.
[0024] In a third aspect, the present invention provides an electronic device, comprising:
[0025] a memory for storing computer program instructions; and,
[0026] A processor is used to execute the computer program instructions to complete the operation of the form generation method for APP development as described in any one of the above.
[0027] In a fourth aspect, the present invention provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements a form generation method for APP development as described in any one of the above.
[0028] The beneficial effects of the present invention are:
[0029] The present invention discloses a form generation method, system, electronic device and product for APP development, which can greatly reduce the development time of software, and the software is easy to maintain and has stronger scalability. In the implementation process of the present invention, first, form description information is obtained, and the form description information is transmitted to a preset collection management module; then, the form description information is formatted based on the collection management module to obtain the formatted form description information; finally, the formatted form description information is input into a preset form generation module, so that the form generation module generates a form according to the formatted form description information. In this process, all form description information can be stored and managed by the collection management module, which is conducive to improving the convenience and efficiency of adding, deleting, checking and modifying form description information. If a form needs to be updated, it is only necessary to adjust the form description information corresponding to the form in the collection management module, and then re-export the adjusted data, and re-generate the form based on the form generation module, which saves a lot of repeated coding work, and only needs to enter the form description information into the collection management module, and generate the form through the form generation module, which improves the reusability and maintainability of the software code, and reduces the workload of the user to manually write code, and the software development efficiency is improved.
[0030] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of a method for generating a form for APP development in an embodiment;
[0032] Figure 2 It is a module block diagram of a form generation method for APP development in an embodiment;
[0033] Figure 3 It is a module block diagram of an electronic device in an embodiment. DETAILED DESCRIPTION
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0035] Embodiment 1:
[0036] This embodiment discloses a form generation method for APP development, which can be executed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or by a virtual machine.
[0037] like Figure 1 As shown, a form generation method for APP development may include but is not limited to the following steps:
[0038] S1. Obtain form description information, and transmit the form description information to a preset collection management module, wherein the collection management module may also be referred to as a collection management tool; it should be noted that the collection management module is used to enter and manage form description information. In this embodiment, the form description information may be manually entered or directly imported through an entry interface to be transmitted to the preset collection management module, which is not limited here.
[0039] In step S1, the form description information includes a calling code template, parameters and parameter attributes of a function corresponding to the specified form.
[0040] Specifically, the parameter attributes include title, name and type.
[0041] In step S1, the form description information is in JSON (a lightweight text data exchange format). That is, JSON formatted data is used to add information such as calling code templates, parameters, and parameter attributes of functions corresponding to various forms, so as to generate dynamic forms or parameter configurations for function calls.
[0042] Specifically, in this embodiment, the form description information represented in JSON format includes:
[0043] 1) lfunctionTemplate (function template string), which is a function calling code template, usually a string, used to indicate how to call a function. It contains the function name and parameter placeholders, and can be used to generate specific function calling statements;
[0044] 2) paramslist (parameter list), which contains detailed information about all the parameters required for the function call. The form description includes parameters and parameter attributes. Specifically, each parameter has attributes such as title, name, type, and default value;
[0045] Among them, paramslist (parameter list) includes paramItem (parameter item). ParamItem (parameter item) represents a specific parameter and has basic attributes such as type (parameter type), name (parameter name) and title (parameter title, which is displayed to users in the form and is used to describe the meaning of the parameter). There are also attributes such as options (drop-down option list configuration information). The default is the input box. If there is an options attribute, it is considered to be a drop-down selection box.
[0046] Specifically, paramItem.type: defines the parameter type, which may be string, number, boolean, etc.
[0047] ParamItem.name: defines the parameter name, which is needed in the program;
[0048] ParamItem.title: the title of the form item in the form;
[0049] ParamItem.options: Drop-down option list configuration information.
[0050] In this embodiment, the form description information is represented in JSON format, so various types of forms and parameter configurations required for function calls can be defined very flexibly, which facilitates the front-end to generate the APP user interface and the back-end to process these parameters. This method not only improves the maintainability of the code, but also makes the expansion of the APP user interface and functions easier.
[0051] S2. Based on the collection management module, the form description information is formatted to obtain formatted form description information; it should be noted that after receiving the form description information, the collection management module saves the form description information, and then formats the form description information to obtain formatted form description information in a preset standard format, so that the collection management module can uniformly manage each form description information.
[0052] In step S1, the form description information is provided in multiple forms, and the multiple form description information corresponds to multiple forms; correspondingly, in step S2, the collection management module formats the multiple form description information to obtain multiple formatted form description information, and the multiple formatted form description information constitute a form information set. The collection management module stores the form information set including the multiple form description information to facilitate the subsequent rapid generation of multiple forms.
[0053] S3. Input the formatted form description information into a preset form generation module, so that the form generation module generates a form according to the formatted form description information, wherein the form generation module can also be referred to as a form generation tool.
[0054] In step S3, the form generation module uses a form generation function or a form generation interface tool. Specifically, in this embodiment, the form generation module can be embodied as a function library, which is called by the developer in the code to dynamically generate a form, or it can be a graphical form generation interface tool, allowing non-technical users to design forms by dragging and dropping.
[0055] Specifically, in step S3, the form generation module generates a form according to the formatted form description information, including:
[0056] S301. Traverse the parameters in the formatted form description information, and generate form item codes that match the parameters in the formatted form description information; specifically, in this embodiment, the form generation module reads each parameter in the parameter list of the formatted form description information, and generates corresponding HTML (HyperText Markup Language) or other formats of form item codes according to the type and attributes of each parameter (such as an input box, a drop-down selection box, etc.), so that each parameter corresponds to a specific input control on the form.
[0057] S302. Receive the parameter values input by the user, and generate the form submission code with the calling code template in the formatted form description information and the parameter values; it should be noted that, in this embodiment, the parameter values input by the user are received based on the UI (User Interface) to facilitate the user to design the form; when the user fills in the form and submits it, the form generation module will use the function calling code template in the formatted form description information described above, and combine the actual parameter values entered by the user in each form item to generate the form submission code, that is, the final function calling code or request data; step S302 ensures that the parameter values entered by the user can be correctly mapped to the parameters required by the back-end service.
[0058] S303. The form item code and the form submission code are merged to obtain a form code;
[0059] S304. Generate a form according to the form code. Specifically, in this embodiment, the generated form code is deployed according to business needs, and the corresponding form can be used in the application. This process may involve code synthesis in multiple languages such as HTML, CSS (Cascading Style Sheets) and JavaScript (a scripting language), depending on the needs of the target platform.
[0060] It should be understood that the execution body of the above steps S301-S304 is the form generation module.
[0061] This embodiment can greatly reduce the development time of software, and the software is easy to maintain and has stronger scalability. In the implementation process of this embodiment, first, the form description information is obtained, and the form description information is transmitted to the preset collection management module; then, the form description information is formatted based on the collection management module to obtain the formatted form description information; finally, the formatted form description information is input into the preset form generation module, so that the form generation module generates a form according to the formatted form description information. In this process, all form description information can be stored and managed by the collection management module, which is conducive to improving the convenience and efficiency of adding, deleting, checking and modifying form description information. If a form needs to be updated, it is only necessary to adjust the form description information corresponding to the form in the collection management module, and then re-export the adjusted data, and re-generate the form based on the form generation module, which saves a lot of repeated coding work. It is only necessary to enter the form description information into the collection management module and generate the form through the form generation module, which improves the reusability and maintainability of the software code, and at the same time reduces the workload of users manually writing code, and the software development efficiency is improved.
[0062] As an example, an example of the formatted form description information exported by the collection management module is given below:
[0063]
[0064] As an example, a pseudo code example of the form generation module generating a form according to the formatted form description information is given below:
[0065]
[0066] <input type="${item.type}"class="form-control"id="${item.name}"placeholder="${item.placeholder}">
[0067] `
[0068] })
[0069] return <form> ${formItems.join(”)}< / form> `
[0070] }
[0071] / / Combine template and data and execute
[0072] const submitForm=(functionTemplate,fromModel)=>{
[0073] for(const key in fromModel){
[0074] functionTemplate=functionTemplate.replace(`{{${key}}}`,fromModel[key])
[0075] }
[0076] postMessage({
[0077] excuteScript:functionTemplate
[0078] })
[0079] }
[0080] Embodiment 2:
[0081] This embodiment discloses a form generation system for APP development, which is used to implement the form generation method for APP development in embodiment 1; Figure 2 As shown, the form generation system for APP development includes:
[0082] A form information acquisition module, used to acquire form description information and transmit the form description information to a preset collection management module;
[0083] A form information formatting module, which is in communication with the form information acquisition module and is used to format the form description information based on the collection management module to obtain formatted form description information;
[0084] The form generation module is in communication with the form information formatting module and is used to input the formatted form description information into a preset form generation module so that the form generation module generates a form according to the formatted form description information.
[0085] It should be noted that the working process, working details and technical effects of the form generation system for APP development provided in this embodiment 2 can be found in embodiment 1 and will not be repeated here.
[0086] Embodiment 3:
[0087] Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a laptop computer, or a desktop computer. The electronic device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc. Figure 3 As shown, the electronic equipment includes:
[0088] a memory for storing computer program instructions; and,
[0089] The processor is used to execute the computer program instructions to complete the operation of the form generation method for APP development as described in any one of Example 1.
[0090] Specifically, the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen.
[0091] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the form generation method for APP development provided in Example 1 of this application.
[0092] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.
[0093] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0094] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals.
[0095] The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof.
[0096] The power supply 306 is used to supply power to various components in the electronic device.
[0097] Embodiment 4:
[0098] Based on any one of Examples 1 to 3, this embodiment discloses a computer program product, including a computer program or instructions, which, when executed by a computer, implements the form generation method for APP development as described in any one of Example 1.
[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A form generation method for APP development, characterized in that: include: Acquire form description information, and transmit the form description information to a preset collection management module; Formatting the form description information based on the collection management module to obtain formatted form description information; The formatted form description information is input into a preset form generation module, so that the form generation module generates a form according to the formatted form description information.
2. A form generation method for APP development according to claim 1, characterized in that: The form description information includes a calling code template, parameters and parameter attributes of a function corresponding to the specified form.
3. A form generation method for APP development according to claim 2, characterized in that: The parameter attributes include title, name and type.
4. A form generation method for APP development according to claim 1, characterized in that: The form description information is in JSON format.
5. The form generation method for APP development according to claim 1, characterized in that: There are multiple forms of form description information, and the multiple forms of form description information correspond to multiple forms; correspondingly, after the collection management module formats the multiple forms of form description information, multiple formatted form description information are obtained, and the multiple formatted form description information constitute a form information set.
6. A form generation method for APP development according to claim 1, characterized in that: The form generation module adopts a form generation function or a form generation interface tool.
7. A form generation method for APP development according to claim 1, characterized in that: The form generation module generates a form according to the formatted form description information, including: Traversing the parameters in the formatted form description information, and generating a form item code matching the parameters in the formatted form description information; Receive the parameter value input by the user, and generate the form submission code by using the calling code template in the formatted form description information and the parameter value; Merge the form item code and the form submission code to obtain a form code; A form is generated according to the form code.
8. A form generation system for APP development, characterized in that: Used to implement the form generation method for APP development as described in any one of claims 1 to 7; The form generation system for APP development includes: A form information acquisition module, used to acquire form description information and transmit the form description information to a preset collection management module; A form information formatting module, which is in communication with the form information acquisition module and is used to format the form description information based on the collection management module to obtain formatted form description information; The form generation module is in communication with the form information formatting module and is used to input the formatted form description information into a preset form generation module so that the form generation module generates a form according to the formatted form description information.
9. An electronic device, characterized in that: include: a memory for storing computer program instructions; as well as, A processor is used to execute the computer program instructions to complete the operation of the form generation method for APP development as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program or instructions, characterized in that: When the computer program or the instruction is executed by a computer, the form generation method for APP development as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
JSON (JavaScript Object Notation) form generation method and device
CN119025112A
