A page generation method and apparatus

By parsing the interface documentation and generating code blocks for page components during the development of back-end and middle-end pages, the problems of low development efficiency and difficult maintenance of back-end and middle-end pages are solved, and efficient and easy-to-maintain page generation is achieved.

CN122111426APending Publication Date: 2026-05-29BEIJING JINGDONG TUOXIAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JINGDONG TUOXIAN TECH CO LTD
Filing Date
2024-11-27
Publication Date
2026-05-29

Smart Images

  • Figure CN122111426A_ABST
    Figure CN122111426A_ABST
Patent Text Reader

Abstract

The application discloses a page generation method and device, and relates to the technical field of page development. The specific implementation of the method comprises the following steps: analyzing an interface document of a target interface to obtain input parameter fields and output parameter fields of the target interface; identifying page components corresponding to the input parameter fields and the output parameter fields respectively, and acquiring code blocks corresponding to the page components respectively according to the page components; associating field identifiers corresponding to the input parameter fields and the output parameter fields respectively with corresponding parameter identifiers in the code blocks, running the code blocks, and obtaining a page comprising the page components. The implementation reduces the difficulty of page development and improves the efficiency of page development, thereby overcoming the disadvantages of the prior art, such as low efficiency of page development by hand-written code, difficulty in maintaining pages developed by using a low-code mode, and high requirements for developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of page development technology, and in particular to a page generation method and apparatus. Background Technology

[0002] Currently, the development of back-end and middle-end pages relies either on hand-written code or on low-code platforms and configuration files. However, the former is inefficient, while the latter, although more efficient, generally employs a visual configuration and code-layer separation approach, making it difficult to identify which part of the user interface layer uses the code, thus hindering maintenance. Furthermore, it doesn't support source code development, making it time-consuming and labor-intensive to implement development requirements beyond its functional scope. Additionally, developers need a certain level of front-end coding knowledge to create back-end and middle-end pages. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a page generation method and apparatus. By pre-writing the input and output parameter fields of each target interface into the interface document and pre-compiling the code blocks for generating each page component, during back-end page development, the interface document can be directly obtained and parsed to determine the page components included in the page to be generated, and the code block corresponding to the page component can be called. Then, field association is performed, and the code block is run to generate the page including the page components. This reduces the difficulty of page development and increases the efficiency of page development, thereby overcoming the drawbacks of the prior art, such as low efficiency of page development by hand-writing code, difficulty in maintaining pages developed using low-code mode, and high requirements for developers.

[0004] To achieve the above objectives, according to one aspect of the present invention, a page generation method is provided.

[0005] An embodiment of the present invention provides a page generation method, comprising: parsing the interface document of a target interface to obtain the input parameter fields and output parameter fields of the target interface; identifying the page components corresponding to the input parameter fields and output parameter fields respectively, and obtaining the code blocks corresponding to the page components respectively; associating the field identifiers corresponding to the input parameter fields and output parameter fields with the corresponding parameter identifiers in the code blocks, running the code blocks, and obtaining a page including the page components.

[0006] Optionally, parsing the interface documentation also yields the display fields corresponding to the input and output parameter fields, respectively. The method further includes: in response to the display field value corresponding to the input and / or output parameter fields being true, modifying the display parameter value corresponding to the display field in the code block to true, so that the page component corresponding to the input and / or output parameter fields is displayed on the page; in response to the display field value corresponding to the input and / or output parameter fields being false, modifying the display parameter value corresponding to the display field in the code block to false, so that the page component corresponding to the input and / or output parameter fields is not displayed on the page.

[0007] Optionally, parsing the interface documentation also yields the first control type corresponding to the input parameter field and the second control type corresponding to the output parameter field; the first control type includes one or more of input boxes, drop-down selection boxes, cascading selection boxes, selection buttons, and date selection boxes; the second control type includes one or more of text, labels, dates, links, images, and phone numbers; after executing the step of obtaining the code blocks corresponding to the page components according to the page components, the method further includes: modifying the parameters in the code blocks corresponding to the first control type according to the first control type, so that the page includes one or more of input box components, drop-down selection components, cascading selection components, button components, and date selection components; modifying the parameters in the code blocks corresponding to the second control type according to the second control type, so that the page includes one or more of text display components, label display components, date display components, link display components, image display components, and phone number display components.

[0008] Optionally, based on the first control type, modify the parameters in the code block corresponding to the input parameter field that correspond to the first control type, including: responding to the first control type corresponding to the input parameter field including a drop-down selection box, receiving the user's selection operation for the first control type of the input parameter field, and popping up a dialog box including an input box for inputting the first sub-interface identifier in response to the selection operation; receiving the first sub-interface identifier input by the user through the input box on the dialog box; parsing the interface document corresponding to the first sub-interface to obtain the first sub-input parameter field and the first sub-output parameter field; and modifying the parameters in the code block corresponding to the input parameter field that correspond to the drop-down selection box based on the first sub-input parameter field and the first sub-output parameter field.

[0009] Optionally, based on the second control type, modify the parameters in the code block corresponding to the output parameter field that correspond to the second control type, including: in response to the second control type corresponding to the output parameter field including tags and the number of tags corresponding to the output parameter field being not unique, determine the target tag corresponding to the input parameter field from the multiple tags corresponding to the output parameter field, and modify the corresponding tag parameters in the code block corresponding to the output parameter field according to the target tag, so that the target tag is displayed on the page.

[0010] Optionally, after performing the step of identifying the page components corresponding to the input and output parameter fields, the method further includes: responding to the page component as a user operation component, receiving the second sub-interface identifier corresponding to the user operation input by the user; the user operation includes one or more of adding, deleting, querying, modifying, importing, and exporting; obtaining and parsing the interface document corresponding to the second sub-interface based on the second sub-interface identifier to obtain the second sub-input parameter field and the second sub-output parameter field; and generating a code block to implement the user operation based on the logical relationship between the second sub-interfaces corresponding to the user operation, using the second sub-input parameter field and the second sub-output parameter field.

[0011] Optionally, after executing the code block to obtain the page including the page components, the method further includes: in response to receiving form attribute values ​​input by the user based on the page component corresponding to the input parameter field, sending the form attribute values ​​to the corresponding target interface; and in response to receiving data returned by the target interface for the form attribute values, displaying the data returned by the target interface through the page component corresponding to the output parameter field.

[0012] Optionally, in response to receiving data returned by the target interface for form attribute values, the data returned by the target interface is displayed through the page component corresponding to the output parameter field, including: inputting the data returned by the target interface and pre-compiled prompt information into the AI ​​big data model; the prompt information indicates the display content items and display layout; receiving the display example generated by the AI ​​big data model based on the data returned by the target interface and the prompt information; and displaying the display example through the page component corresponding to the output parameter field.

[0013] To achieve the above objectives, according to another aspect of the present invention, a page generation apparatus is provided.

[0014] An embodiment of the present invention provides a page generation device, comprising: a document parsing module, used to parse the interface document of a target interface to obtain the input parameter fields and output parameter fields of the target interface; a page configuration module, used to identify the page components corresponding to the input parameter fields and output parameter fields respectively, and obtain the code blocks corresponding to the page components respectively; and a page generation module, used to associate the field identifiers corresponding to the input parameter fields and output parameter fields with the corresponding parameter identifiers in the code blocks, run the code blocks, and obtain a page including the page components.

[0015] To achieve the above objectives, according to another aspect of the present invention, an electronic device for page generation is provided.

[0016] An electronic device for page generation according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a page generation method according to an embodiment of the present invention.

[0017] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.

[0018] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a page generation method according to an embodiment of the present invention.

[0019] One embodiment of the above invention has the following advantages or beneficial effects: by pre-writing the input and output parameter fields of each target interface into the interface document and pre-compiling the code blocks for generating each page component, during the development of the back-end page, the interface document can be directly obtained and parsed to determine the page components included in the page to be generated, and the code block corresponding to the page component can be called. Then, the fields are associated, and the code block is run to generate the page including the page components. This reduces the difficulty of page development and increases the efficiency of page development, thereby overcoming the disadvantages of the prior art, such as the low efficiency of page development by hand-writing code, the difficulty in maintaining pages developed using low-code mode, and the high requirements for developers.

[0020] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0021] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0022] Figure 1 This is a flowchart illustrating a page generation method according to an embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of a back-end page according to an embodiment of the present invention;

[0024] Figure 3 This is a schematic diagram of an input parameter field in an interface document according to an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of a form component on a webpage according to an embodiment of the present invention;

[0026] Figure 5 This is a schematic diagram of an output parameter field in an interface document according to an embodiment of the present invention;

[0027] Figure 6This is a schematic diagram of a display component on a webpage according to an embodiment of the present invention;

[0028] Figure 7 This is a schematic diagram of input parameter fields in another interface document according to an embodiment of the present invention;

[0029] Figure 8 This is a schematic diagram of an input parameter field in another interface document according to an embodiment of the present invention;

[0030] Figure 9 This is a schematic diagram of an output parameter field in another interface document according to an embodiment of the present invention;

[0031] Figure 10 This is a schematic diagram illustrating the configuration of a drop-down selection box remote interface according to an embodiment of the present invention;

[0032] Figure 11 This is a schematic diagram of a page configuration form according to an embodiment of the present invention;

[0033] Figure 12 This is a schematic diagram illustrating the specific process of another page generation method according to an embodiment of the present invention;

[0034] Figure 13 This is a flowchart illustrating a method for generating a page according to an embodiment of the present invention;

[0035] Figure 14 This is a schematic diagram of the main modules of a page generation device according to an embodiment of the present invention;

[0036] Figure 15 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0037] Figure 16 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0038] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0039] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0040] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.

[0041] Figure 1 This is a schematic diagram of the main steps of a page generation method according to an embodiment of the present invention.

[0042] like Figure 1 As shown, the page generation method of this embodiment mainly includes steps S101-S103:

[0043] Step S101: Parse the interface documentation of the target interface to obtain the input and output parameter fields of the target interface. This embodiment of the invention uses the generation of a backend page as an example to illustrate the page generation method in detail. The backend page mainly includes a search area, a table area (display area), a function area, an operation area, and a pagination area, such as... Figure 2 As shown in the diagram. The API documentation is pre-configured by the backend and can include the target API name, its input and output parameter fields, etc. After generating a page based on the API documentation, this page includes multiple page components. Based on the input parameter fields, form components for searching are generated, such as input boxes for doctor names and doctor titles. Based on the output parameter fields, display components showcasing the search results are generated, such as tables displaying doctor information. After the user enters the doctor's name and title in the input boxes and clicks search, the searched doctor information is displayed in the information display area.

[0044] Step S102: Identify the page components corresponding to the input and output parameter fields, and obtain the corresponding code blocks for each page component. The input parameter fields in the API documentation are as follows: Figure 3 As shown, the field name includes (e.g., doctorname, professorname), the corresponding field type (e.g., string), Chinese description (e.g., doctor's name, doctor's title), remarks, and whether it is required (e.g., yes, no). Based on this input field, the page component generated on the page can be identified as a form component, and the code block that generates the form component can be called. Figure 3 The form component generated from the input parameter fields is as follows: Figure 4 As shown. Similarly, the output parameter fields in the interface documentation are as follows: Figure 5 As shown, this includes field names (e.g., ID, doctorname, sex, age, phonenumber, address, etc.), the corresponding field types (e.g., string, number, etc.), Chinese descriptions (e.g., ID, doctor's name, gender, age, phone number, address, etc.), and remarks. Based on this output parameter field, the page component generated based on this input parameter field can be identified as a table, and the code block for generating the table can be called. Figure 5 The form component generated from the input parameter fields is as follows: Figure 6 As shown.

[0045] After obtaining the code block, the field identifiers of the input and output parameter fields are associated with the parameter identifiers in the code block, thereby modifying the relevant parameters in the code block according to the contents of the input and output parameter fields.

[0046] In addition to basic information such as input and output parameter fields, the API documentation also includes extended fields corresponding to these fields, such as "Display," which indicates whether the page component corresponding to the input parameter should be displayed on the generated page. For example, the input parameter fields `pagesize` and `pageNo` are described in Chinese as "number per page" and "current page number," respectively. While it's unnecessary to display these values ​​in the search area, the doctor's name and title need to be displayed on the page. Therefore, the API documentation includes an option to display these values. Figure 7 As shown, for input parameter fields where the "show or not show" option is checked, the corresponding page component will be displayed on the page; conversely, for input parameter fields where the "show or not show" option is not checked, the corresponding page component will not be displayed on the page. Similarly, whether the page component corresponding to the output parameter field is displayed on the page is also determined by checking its corresponding "show or not show" option, as mentioned above.

[0047] Therefore, in order to correctly generate the page according to the content defined in the interface document, in an optional embodiment of the present invention, parsing the interface document further obtains the display fields corresponding to the input parameter fields and output parameter fields respectively; the method further includes: in response to the display field value corresponding to the input parameter field and / or output parameter field being true, modifying the display parameter value corresponding to the display field in the code block to true, so that the page component corresponding to the input parameter field and / or output parameter field is displayed on the page; in response to the display field value corresponding to the input parameter field and output parameter field being false, modifying the display parameter value corresponding to the display field in the code block to false, so that the page component corresponding to the input parameter field and / or output parameter field is not displayed on the page. After parsing the display field, the relevant parameter values ​​in the code block are modified according to the display field, so that the page components corresponding to the input parameter field and / or output parameter field whose "whether to display" option is checked are displayed on the page, while the page components corresponding to the input parameter field and / or output parameter field whose "whether to display" option is not checked are not displayed on the page.

[0048] In addition to the "whether to display" field, the API documentation also includes a control type field, such as... Figure 8 and 9 As shown. The control type field indicates how a page component is displayed on the page. For example, a form component can be a simple input box, a dropdown selection box, a cascading selection box, a selection button, a date picker, etc.; another example is that a display component can be displayed through text, images, links, etc. To meet the diverse needs of page input and display, in an optional embodiment of the present invention, parsing the interface document further obtains a first control type corresponding to the input parameter field and a second control type corresponding to the output parameter field; the first control type includes one or more of an input box, a drop-down selection box, a cascading selection box, a selection button, and a date selection box; the second control type includes one or more of text, labels, dates, links, images, and mobile phone numbers; after performing the step of obtaining the code block corresponding to each page component according to the page component, the method further includes: modifying the parameters in the code block corresponding to the first control type according to the first control type, so that the page includes one or more of an input box component, a drop-down selection component, a cascading selection component, a button component, and a date selection component; modifying the parameters in the code block corresponding to the second control type according to the second control type, so that the page includes one or more of a text display component, a label display component, a date display component, a link display component, an image display component, and a mobile phone number display component. By parsing the interface documentation, the control types corresponding to each page component are obtained. Based on the control types, the relevant parameters in the code block are modified accordingly, so that the form of the page components on the page is consistent with the control types defined in the interface documentation, which meets the diverse needs of page input and display and facilitates users to input and obtain information.

[0049] A certain input parameter field corresponds to a dropdown selection box. The content of the dropdown options may be static data or may need to be obtained through another interface, which could be a remote interface. In this case, you need to select the data type and enter the interface identifier, such as the interface ID, through the editing options corresponding to the dropdown selection box in the interface documentation. Figure 10 As shown.

[0050] In an optional embodiment of the present invention, modifying the parameters corresponding to the first control type in the code block corresponding to the input parameter field according to the first control type includes: responding to the first control type corresponding to the input parameter field including a drop-down selection box, receiving the user's selection operation for the first control type of the input parameter field, and popping up a dialog box including an input box for inputting a first sub-interface identifier in response to the selection operation; receiving the first sub-interface identifier input by the user through the input box on the dialog box; parsing the interface document corresponding to the first sub-interface to obtain the first sub-input parameter field and the first sub-output parameter field; and modifying the parameters corresponding to the drop-down selection box in the code block corresponding to the input parameter field according to the first sub-input parameter field and the first sub-output parameter field. Specifically, clicking on the control type corresponding to the input parameter field, such as a drop-down selection box, pops up an edit dialog box about the drop-down selection box, through which the user can configure the data type, interface ID, and other content corresponding to the drop-down option. The interface document corresponding to the interface ID is called based on the user input interface ID; the interface document corresponding to the interface ID is parsed to obtain the first input parameter field and the first output parameter field; based on the first input parameter field and the first output parameter field, the parameters in the corresponding code block are modified so that when the code block runs, it first calls the data of the target interface and then calls the data of the first sub-interface, thereby generating a drop-down selection box through interface integration.

[0051] A certain output parameter field corresponds to a control type of label, and the number of labels can be multiple. Labels can be used to indicate the domain or type of the content corresponding to the output parameter field. Multiple labels correspond to multiple domains or types. For example, some doctors named Zhang AA specialize in internal medicine while others specialize in surgery. To make user searches more precise, a label indicating the area of ​​expertise of each doctor is added to the interface documentation. This ensures that when a user searches for "Zhang AA" or "surgeon," the information for "surgeon Zhang AA" is accurately displayed on the page. In an optional embodiment of the invention, modifying the parameters corresponding to the second control type in the code block corresponding to the output parameter field, based on the second control type, includes: responding to the second control type corresponding to the output parameter field including labels and the number of labels corresponding to the output parameter field being not unique, determining the target label corresponding to the input parameter field from the multiple labels corresponding to the output parameter field, and modifying the corresponding label parameters in the code block corresponding to the output parameter field based on the target label, so that the target label is displayed on the page. When a certain output parameter field corresponds to multiple tags, such as internal medicine and surgery, the tag to be displayed is determined to be surgery based on the fact that surgery is included in the input parameter field. This achieves the purpose of filtering out the target tag from multiple tags, and by modifying the tag parameters in the corresponding code block, the target tag and its corresponding content are displayed on the page.

[0052] The following embodiment implements the configuration of CRUD operations on a webpage. A configuration form input box is designed, where the user inputs the identifier of one or more of the second sub-interfaces involved in the CRUD, SELECT, SELECT, UPDATE, and ROID operations, such as an interface ID. An AI model is used to call the corresponding interface document for each second sub-interface, parse the interface document to obtain input and output parameter data, and analyze this data to determine the interaction logic between multiple second sub-interfaces. In an optional embodiment of the invention, after the step of identifying the page components corresponding to the input and output parameter fields, the method further includes: responding to the page component being a user operation component, receiving the second sub-interface identifier corresponding to the user operation; the user operation includes one or more of CRUD, SELECT, SELECT, UPDATE, ROID, and ROID; obtaining and parsing the interface document corresponding to the second sub-interface based on the second sub-interface identifier to obtain the second sub-input parameter field and the second sub-output parameter field; and generating a code block to implement the user operation based on the logical relationship between the second sub-interfaces corresponding to the user operation, using the second sub-input parameter field and the second sub-output parameter field. Running the code block generated in this embodiment generates one or more user interaction buttons on the page, such as CRUD, SELECT, UPDATE, ROID, ROID, and ROID buttons.

[0053] Step S103: Associate the field identifiers corresponding to the input and output parameter fields with the corresponding parameter identifiers in the code block, run the code block, and obtain the page including page components.

[0054] In an optional embodiment of the present invention, after executing the code block to obtain a page including page components, the method further includes: in response to receiving form attribute values ​​input by the user based on the page component corresponding to the input parameter field, sending the form attribute values ​​to the corresponding target interface; and in response to receiving data returned by the target interface for the form attribute values, displaying the data returned by the target interface through the page component corresponding to the output parameter field. After the code block generates the page, the user inputs form attribute values, such as Zhang AA, through the input box, and sends the form attribute values, such as Zhang AA, to the target interface. The target interface returns data to be displayed, such as detailed information about Zhang AA, and the data to be displayed, such as the detailed information about Zhang AA, is displayed through the display component on the page.

[0055] When displaying data, an artificial intelligence (AI) big data model can be used to analyze the data to make the content of the display page more reasonable, the layout more aesthetically pleasing, and the display effect better. In an optional embodiment of the present invention, in response to receiving data returned by the target interface for form attribute values, the data returned by the target interface is displayed through the page component corresponding to the output parameter field. This includes: inputting the data returned by the target interface and pre-compiled prompt information into the AI ​​big data model; the prompt information indicates the display content items and display layout; receiving a display example generated by the AI ​​big data model based on the data returned by the target interface and the prompt information; and displaying the display example through the page component corresponding to the output parameter field. The display of a details page usually involves unfolding the fields of a table row, but there are special cases, such as a doctor's details page that needs to highlight the user's avatar. Therefore, the page configuration form design includes an input box for prompt information. The page configuration form is as follows: Figure 11 As shown, this is designed to meet user-defined needs. Users can input a prompt message into the large model, for example, a doctor's details page that needs to display the doctor's avatar in a left-right layout. The data to be displayed and the prompt message are input into the large model together. After receiving the data and prompt message, the large model outputs a display sample, which is then displayed through the display components on the page.

[0056] The page generation method of this embodiment will be further illustrated below. The page generation method of this embodiment mainly includes the following steps, such as... Figure 12 As shown:

[0057] Step S1201: Parse the interface documentation of the target interface to obtain the input and output parameter fields of the target interface.

[0058] Step S1202: Identify the page components corresponding to the input and output parameter fields, and obtain the code blocks corresponding to the page components according to the page components.

[0059] Step S1203: Associate the field identifiers corresponding to the input and output parameter fields with the corresponding parameter identifiers in the code block.

[0060] Step S1204: In response to the display field value corresponding to the input parameter field and / or output parameter field being true, modify the display parameter value corresponding to the display field in the code block to true.

[0061] Step S1205: In response to the display field value corresponding to the input parameter field and the output parameter field being false, modify the display parameter value corresponding to the display field in the code block to be false.

[0062] Step S1206: Based on the first control type corresponding to each input parameter field, modify the parameters in the code block corresponding to the first control type.

[0063] Step S1207: Based on the second control type corresponding to the output parameter field, modify the parameters in the code block corresponding to the output parameter field that correspond to the second control type.

[0064] Step S1208: Run the code block to obtain the page including page components.

[0065] The following is an exemplary description of how to use the generated page using another embodiment. The page generation method in this embodiment mainly includes the following steps: Figure 13 As shown:

[0066] Step S1301: In response to receiving the form attribute value input by the user based on the page component corresponding to the input parameter field, send the form attribute value to the corresponding target interface.

[0067] Step S1302: Receive the data returned by the target interface for the form attribute values.

[0068] Step S1303: Input the data returned by the target interface and the pre-compiled prompt information into the artificial intelligence big model; the prompt information indicates the content items to be displayed and the display layout.

[0069] Step S1304: Receive the data and prompts returned by the AI ​​big data model based on the data returned by the target interface, and generate a display example of the data returned by the target interface.

[0070] Step S1305: Display the example through the page component corresponding to the output parameter field.

[0071] The page generation method of this invention pre-writes the input and output parameter fields of each target interface into the interface document and pre-compiles the code blocks for generating each page component. During back-end page development, the interface document can be directly obtained and parsed to determine the page components included in the page to be generated, and the code block corresponding to the page component can be called. Then, the fields are associated, and the code block is run to generate the page including the page components. This reduces the difficulty of page development and increases the efficiency of page development, thereby overcoming the drawbacks of the prior art, such as the low efficiency of page development by hand-writing code, the difficulty in maintaining pages developed using low-code mode, and the high requirements for developers.

[0072] Figure 14 This is a schematic diagram of the main modules of a page generation apparatus according to an embodiment of the present invention.

[0073] like Figure 14 As shown, the page generation apparatus 1400 of this embodiment includes:

[0074] The document parsing module 1401 is used to parse the interface document of the target interface to obtain the input parameter fields and output parameter fields of the target interface;

[0075] The page configuration module 1402 is used to identify the page components corresponding to the input and output parameter fields, and to obtain the code blocks corresponding to the page components according to the page components.

[0076] The page generation module 1403 is used to associate the field identifiers corresponding to the input and output parameter fields with the corresponding parameter identifiers in the code block, run the code block, and obtain a page including page components.

[0077] In an optional embodiment of the present invention, parsing the interface document further obtains the display fields corresponding to the input parameter fields and output parameter fields, respectively; the page configuration module 1402 is further configured to, in response to the display field value corresponding to the input parameter field and / or output parameter field being true, modify the display parameter value corresponding to the display field in the code block to true, so that the page component corresponding to the input parameter field and / or output parameter field is displayed on the page; in response to the display field value corresponding to the input parameter field and output parameter field being false, modify the display parameter value corresponding to the display field in the code block to false, so that the page component corresponding to the input parameter field and / or output parameter field is not displayed on the page.

[0078] In an optional embodiment of the present invention, parsing the interface document further obtains a first control type corresponding to the input parameter field and a second control type corresponding to the output parameter field; the first control type includes one or more of an input box, a drop-down selection box, a cascading selection box, a selection button, and a date selection box; the second control type includes one or more of text, labels, dates, links, images, and mobile phone numbers; after performing the step of obtaining the code block corresponding to the page component according to the page component, the page configuration module 1402 is further used to modify the parameters in the code block corresponding to the first control type according to the first control type, so that the page includes one or more of an input box component, a drop-down selection component, a cascading selection component, a button component, and a date selection component; and modify the parameters in the code block corresponding to the second control type according to the second control type, so that the page includes one or more of a text display component, a label display component, a date display component, a link display component, an image display component, and a mobile phone number display component.

[0079] In an optional embodiment of the present invention, the page configuration module 1402 is further configured to, in response to the first control type corresponding to the input parameter field including a drop-down selection box, receive a user's selection operation for the first control type of the input parameter field, and pop up a dialog box including an input box for inputting a first sub-interface identifier in response to the selection operation; receive the first sub-interface identifier input by the user through the input box on the dialog box; parse the interface document corresponding to the first sub-interface to obtain the first sub-input parameter field and the first sub-output parameter field; and modify the parameters corresponding to the drop-down selection box in the code block corresponding to the input parameter field according to the first sub-input parameter field and the first sub-output parameter field.

[0080] In an optional embodiment of the present invention, the page configuration module 1402 is further configured to, in response to the fact that the second control type corresponding to the output parameter field includes a label and the number of labels corresponding to the output parameter field is not unique, determine the target label corresponding to the input parameter field from the multiple labels corresponding to the output parameter field, and modify the corresponding label parameter in the code block corresponding to the output parameter field according to the target label, so that the target label is displayed on the page.

[0081] In an optional embodiment of the present invention, the page configuration module 1402 is further configured to, after performing the step of identifying the page components corresponding to the input parameter fields and output parameter fields respectively, receive the second sub-interface identifier corresponding to the user operation input by the user in response to the page component being a user operation component; the user operation includes one or more of adding, deleting, querying, modifying, importing, and exporting; according to the second sub-interface identifier, obtain and parse the interface document corresponding to the second sub-interface to obtain the second sub-input parameter field and the second sub-output parameter field; and generate a code block that implements the user operation based on the second sub-input parameter field and the second sub-output parameter field, according to the logical relationship between the second sub-interfaces corresponding to the user operation.

[0082] In an optional embodiment of the present invention, the page generation module 1403 is further configured to, after executing the running code block to obtain a page including page components, send the form attribute values ​​to the corresponding target interface in response to receiving form attribute values ​​input by the user based on the page component corresponding to the input parameter field; and display the data returned by the target interface through the page component corresponding to the output parameter field in response to receiving the data returned by the target interface for the form attribute values.

[0083] In an optional embodiment of the present invention, the page generation module 1403 is further configured to input the data returned by the target interface and the pre-compiled prompt information into the artificial intelligence big model; the prompt information indicates the display content items and display layout; receive the display example generated by the artificial intelligence big model based on the data returned by the target interface and the prompt information; and display the display example through the page component corresponding to the output parameter field.

[0084] The page generation device of this invention, by pre-writing the input and output parameter fields of each target interface into the interface document and pre-compiling the code blocks for generating each page component, can directly obtain and parse the interface document to determine the page components included in the page to be generated during mid-to-back-end page development, call the code block corresponding to the page component, then associate the fields, and run the code block to generate the page including the page component. This reduces the difficulty of page development and increases the efficiency of page development, thereby overcoming the drawbacks of the prior art, such as the low efficiency of page development by hand-writing code, the difficulty in maintaining pages developed using low-code mode, and the high requirements for developers.

[0085] Figure 15 An exemplary system architecture 1500 is shown that can be applied to the page generation method or page generation apparatus of the present invention.

[0086] like Figure 15 As shown, the system architecture 1500 may include a front-end server 1501, a network 1502, and back-end servers 1503, 1504, and 1505. The network 1502 serves as the medium for providing communication links between the front-end server 1501 and the back-end servers 1503, 1504, and 1505. The network 1502 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0087] Front-end server 1501 interacts with back-end servers 1503, 1504, and 1505 via network 1502 to receive or send data. Front-end server 1501 serves as a platform for page development, obtaining data from back-end servers 1503, 1504, and 1505, and generating pages based on the obtained data.

[0088] It should be noted that the page generation method provided in this embodiment of the invention is generally executed by the front-end server 1501, and correspondingly, the page generation device is generally set in the front-end server 1501.

[0089] It should be understood that Figure 15 The number of front-end servers, network servers, and back-end servers shown is merely illustrative. Depending on implementation needs, any number of front-end servers, network servers, and back-end servers can be used.

[0090] The following is for reference. Figure 16 It shows a schematic diagram of the structure of a computer system 1600 suitable for implementing an electronic device according to embodiments of the present invention. Figure 16 The front-end server shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0091] like Figure 16 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1602 or programs loaded from storage portion 1608 into random access memory (RAM) 1603. The RAM 1603 also stores various programs and data required for the operation of the computer system 1600. The CPU 1601, ROM 1602, and RAM 1603 are interconnected via a bus 1604. An input / output (I / O) interface 1605 is also connected to the bus 1604.

[0092] The following components are connected to I / O interface 1605: an input section 1606 including a keyboard, mouse, etc.; an output section 1607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN card, modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to I / O interface 1605 as needed. Removable media 1611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1610 as needed so that computer programs read from them can be installed into storage section 1608 as needed.

[0093] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a 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 communication section 1609, and / or installed from removable medium 1611. When the computer program is executed by central processing unit (CPU) 1601, it performs the functions defined above in the system of this invention.

[0094] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0096] The modules described in the embodiments of this invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a document parsing module, a page configuration module, and a page generation module. The names of these modules do not necessarily limit the module itself; for example, the page generation module can also be a module that executes code blocks to obtain a page including page components.

[0097] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: parsing an interface document of a target interface to obtain input parameter fields and output parameter fields of the target interface; identifying page components corresponding to the input parameter fields and output parameter fields respectively, and obtaining code blocks corresponding to the page components respectively; associating the field identifiers corresponding to the input parameter fields and output parameter fields with the corresponding parameter identifiers in the code blocks, running the code blocks, and obtaining a page including the page components.

[0098] According to the technical solution of the present invention, by pre-writing the input and output parameter fields of each target interface into the interface document and pre-compiling the code blocks for generating each page component, during the development of the back-end page, the interface document can be directly obtained and parsed to determine the page components included in the page to be generated, and the code block corresponding to the page component can be called. Then, the fields are associated, and the code block is run to generate the page including the page components. This reduces the difficulty of page development and increases the efficiency of page development, thereby overcoming the disadvantages of the prior art, such as the low efficiency of page development by hand-writing code, the difficulty in maintaining pages developed using low-code mode, and the high requirements for developers.

[0099] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A page generation method, characterized in that, include: Parse the interface documentation of the target interface to obtain the input and output parameter fields of the target interface; Identify the page components corresponding to the input parameter fields and the output parameter fields respectively, and obtain the code blocks corresponding to the page components according to the page components; Associate the field identifiers corresponding to the input parameter field and the output parameter field with the corresponding parameter identifiers in the code block, run the code block, and obtain a page including the page component.

2. The method according to claim 1, characterized in that, Parsing the interface documentation also yields the display fields corresponding to the input parameter fields and the output parameter fields, respectively; the method further includes: In response to the display field value corresponding to the input parameter field and / or the output parameter field being true, the display parameter value corresponding to the display field in the code block is modified to true, so that the page component corresponding to the input parameter field and / or the output parameter field is displayed on the page; In response to the display field value corresponding to the input parameter field and the output parameter field being false, the display parameter value corresponding to the display field in the code block is modified to false, so that the page component corresponding to the input parameter field and / or the output parameter field is not displayed on the page.

3. The method according to claim 1, characterized in that, Parsing the interface documentation also yields a first control type corresponding to the input parameter field and a second control type corresponding to the output parameter field; the first control type includes one or more of an input box, a drop-down selection box, a cascading selection box, a selection button, and a date selection box; the second control type includes one or more of text, a label, a date, a link, an image, and a mobile phone number; After performing the step of obtaining the code block corresponding to the page component based on the page component, the method further includes: Based on the first control type, modify the parameters in the code block corresponding to the first control type in the input parameter field so that the page includes one or more of the following components: input box component, drop-down selection component, cascading selection component, button component, and date selection component; Based on the second control type, modify the parameters in the code block corresponding to the second control type in the output parameter field so that the page includes one or more of the following components: text display component, label display component, date display component, link display component, image display component, and mobile phone number display component.

4. The method according to claim 3, characterized in that, The step of modifying the parameters in the code block corresponding to the first control type in accordance with the first control type includes: In response to the first control type corresponding to the input parameter field including a drop-down selection box, the system receives the user's selection operation for the first control type of the input parameter field, and pops up a dialog box including an input box for inputting the first sub-interface identifier in response to the selection operation. Receive the first sub-interface identifier input by the user through the input box on the dialog box; Parse the interface document corresponding to the first sub-interface to obtain the first sub-input parameter field and the first sub-output parameter field; Based on the first sub-input parameter field and the first sub-output parameter field, modify the parameters in the code block corresponding to the input parameter field that correspond to the drop-down selection box.

5. The method according to claim 3, characterized in that, The step of modifying the parameters in the code block corresponding to the second control type in accordance with the second control type includes: In response to the fact that the second control type corresponding to the output parameter field includes a label and the number of labels corresponding to the output parameter field is not unique, the target label corresponding to the input parameter field is determined from the multiple labels corresponding to the output parameter field, and the corresponding label parameters in the code block corresponding to the output parameter field are modified according to the target label so that the target label is displayed on the page.

6. The method according to claim 1, characterized in that, After performing the step of identifying the page components corresponding to the input parameter field and the output parameter field respectively, the method further includes: In response to the fact that the page component is a user operation component, the second sub-interface identifier corresponding to the user operation input by the user is received; the user operation includes one or more of the following: add, delete, query, modify, import, and export; Based on the second sub-interface identifier, obtain and parse the interface document corresponding to the second sub-interface to get the second sub-input parameter field and the second sub-output parameter field; Based on the logical relationship between the second sub-interfaces corresponding to the user operation, a code block for implementing the user operation is generated based on the second sub-input parameter field and the second sub-output parameter field.

7. The method according to claim 1, characterized in that, After executing the step of running the code block to obtain a page including the page components, the method further includes: In response to receiving form attribute values ​​input by the user based on the page component corresponding to the input parameter field, the form attribute values ​​are sent to the corresponding target interface; In response to receiving data returned by the target interface for the form attribute value, the data returned by the target interface is displayed through the page component corresponding to the output parameter field.

8. The method according to claim 7, characterized in that, The step of responding to receiving data returned by the target interface for the form attribute value and displaying the data returned by the target interface through the page component corresponding to the output parameter field includes: The data returned by the target interface and the pre-compiled prompts are input into the large-scale artificial intelligence model; the prompts indicate the content items to be displayed and the display layout. Receive the data returned by the AI ​​big data model based on the target interface and the prompt information, and generate a display example for the data returned by the target interface; The example is displayed through the page component corresponding to the output parameter field.

9. A page generation device, characterized in that, include: The document parsing module is used to parse the interface document of the target interface to obtain the input parameter fields and output parameter fields of the target interface; The page configuration module is used to identify the page components corresponding to the input parameter fields and the output parameter fields, and to obtain the code blocks corresponding to the page components according to the page components. The page generation module is used to associate the field identifiers corresponding to the input parameter field and the output parameter field with the corresponding parameter identifiers in the code block, run the code block, and obtain a page including the page component.

10. An electronic device for page generation, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.