Page layout file generation method and device, equipment and storage medium

Through the page description information input in natural language, the target page controls and layout information are automatically determined, and the page layout files are generated, which solves the problems of low generation efficiency and high requirements for developers in the existing technology, and realizes efficient and accurate page layout file generation.

CN119902762APending Publication Date: 2025-04-29BEIJING 58 INFORMATION TTECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411976196.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, the generation efficiency of page layout files is low and has high requirements for developers, making it difficult to avoid code writing errors.

Method used

By obtaining the page description information of the target page entered by the user in natural language, the target controls and layout information contained in the target page are automatically determined, and the page layout file is generated based on the mapping relationship between the preset control and the control code expression.

Benefits of technology

It improves the efficiency of page layout files generation, reduces professional requirements for developers, and ensures the accuracy of generated page layout files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902762A_ABST
    Figure CN119902762A_ABST
Patent Text Reader

Abstract

Embodiments of the invention provide a page layout file generation method and apparatus, a device and a storage medium. The method comprises the steps of obtaining page description information of a target page input by a user in a natural language; determining a target control contained in the target page according to the page description information; determining layout information of the target control in the target page according to the control number and / or the control type of the target control; determining a target control code corresponding to the target control according to a preset mapping relationship between various controls and control code expressions; according to the layout information and the target control code, a page layout file of the target page is generated, and the page layout file is used for constructing the target page. In the scheme, based on the page description information of the target page input by the user in the natural language, the page layout file used for constructing the target page can be automatically generated, excessive participation of developers is not needed, and the generation efficiency of the page layout file can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a page layout file generation method, device, equipment and storage medium. Background Art

[0002] The construction of an application (APP) is inseparable from the construction of a user interface (UI). In actual applications, developers manually write page layout codes, encapsulate the page layout codes into page layout files, and build user interfaces based on the page layout files. However, this page layout file generation method has high requirements on developers and low generation efficiency. Summary of the invention

[0003] Embodiments of the present invention provide a page layout file generation method, apparatus, device and storage medium, so as to improve the generation efficiency of the page layout file.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a page layout file, the method comprising:

[0005] Obtain page description information of the target page input by the user in natural language;

[0006] Determining a target control included in the target page according to the page description information;

[0007] Determining layout information of the target control in the target page according to the control quantity and / or control type of the target control;

[0008] Determine the target control code corresponding to the target control according to the mapping relationship between the preset multiple controls and the control code expression;

[0009] A page layout file of the target page is generated according to the layout information and the target control code, and the page layout file is used to construct the target page.

[0010] In a second aspect, an embodiment of the present invention provides a device for generating a page layout file, the device comprising:

[0011] An acquisition module, used to acquire page description information of a target page input by a user in natural language;

[0012] A determination module, configured to determine a target control included in the target page according to the page description information; determine layout information of the target control in the target page according to the number and / or type of controls of the target control; and determine a target control code corresponding to the target control according to a mapping relationship between a plurality of preset controls and control code expressions;

[0013] A generation module is used to generate a page layout file of the target page according to the layout information and the target control code, and the page layout file is used to construct the target page.

[0014] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the page layout file generation method described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the page layout file generation method described in the first aspect.

[0016] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, when the computer program is executed by a processor of an electronic device, the processor can at least implement the page layout file generation method as described in the first aspect.

[0017] In the page layout file generation method of the embodiment of the present invention, when it is necessary to generate a page layout file for constructing a target page, first, obtain the page description information of the target page input by the user in natural language; then, determine the target control included in the target page according to the page description information; then, determine the layout information of the target control in the target page according to the number of controls and / or control type of the target control, and determine the target control code corresponding to the target control according to the mapping relationship between the preset multiple controls and the control code expression; finally, generate the page layout file of the target page according to the layout information and the target control code.

[0018] In this solution, in the process of generating a page layout file for building a target page, after the user inputs the page description information of the target page in natural language, the target control contained in the target page, the layout information of the target control in the target page, and the target control code corresponding to the target control can be automatically obtained based on the page description information. After that, the layout information is combined with the target control code to automatically generate a page layout file for building the target page. In this process, the generation of the page layout file can be completed efficiently without too much involvement of the developer. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A flow chart of a method for generating a page layout file provided by an embodiment of the present invention;

[0021] Figure 2 A flow chart of a method for determining layout information provided by an embodiment of the present invention;

[0022] Figure 3 A flowchart of another method for generating a page layout file provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of a device for generating a page layout file provided by an embodiment of the present invention;

[0024] Figure 5 For Figure 4 A schematic diagram of the structure of an electronic device corresponding to the page layout file generating device provided in the illustrated embodiment. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0028] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0029] The page layout file generation method provided in the embodiment of the present invention can be executed by an electronic device, which can be a terminal device such as a PC, a laptop, a smart phone, etc., or a server. The server can be a physical server including an independent host, or a virtual server, or a cloud server or a server cluster.

[0030] Figure 1 A flow chart of a method for generating a page layout file provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps may be included:

[0031] 101. Obtain page description information of a target page input by a user in natural language.

[0032] 102. Determine the target control included in the target page according to the page description information.

[0033] 103. Determine layout information of the target control in the target page according to the control quantity and / or control type of the target control.

[0034] 104. Determine a target control code corresponding to a target control according to a mapping relationship between a plurality of preset controls and control code expressions.

[0035] 105. Generate a page layout file of the target page according to the layout information and the target control code; wherein the page layout file is used to construct the target page.

[0036] In the related art, when it is necessary to generate a page layout file for building a target page, the designer will usually first create a page design file based on the page effect or function that the target page wants to achieve. Among them, the page design file contains page design information corresponding to the target page, and the page design information includes control design information, such as the number of controls, control types, control styles, etc. Among them, controls, also known as components or elements, refer to each independent part or element on the page, which can perform specific functions or display information, such as: text box controls are used to enter text, button controls are used to trigger specific operations, and picture controls are used to display image content. Afterwards, the developer writes code based on the page design file to generate a page layout file that can implement the page design in the page design file, that is, to generate a page layout file for building the target page.

[0037] In the above process, on the one hand, the method of first making a page design file and then generating a page layout file is complicated and requires high professional skills of relevant personnel; on the other hand, in the process of manually writing a page layout file, it is difficult to avoid code writing errors caused by negligence of developers, thereby failing to obtain an accurate page layout file.

[0038] In order to solve at least one of the above technical problems, an embodiment of the present invention provides a method that has low professional requirements for relevant personnel and can efficiently, accurately and automatically generate a page layout file for building a target page. In summary, when a target page needs to be built, the page information of the target page is directly described in natural language, that is, the page information that originally needs to be expressed by the page design file is expressed in natural language, thereby simplifying the expression method of the page information of the target page; then, the control information required to generate the page layout file of the target page is obtained from the page information of the target page described in natural language, and based on the obtained control information and the code expression of multiple preset controls, the page layout file corresponding to the target page is automatically generated, thereby eliminating the need to manually write the page layout file, which can not only improve the generation efficiency of the page layout file, but also obtain an accurate page layout file.

[0039] The following is a detailed description of the page layout file generation method provided by the embodiment of the present invention.

[0040] In the embodiment of the present application, the page information of the target page described by the user in natural language is referred to as page description information. Optionally, the user can input the page description information by text or voice. When the user inputs the page description information by voice, the voice content can be converted into text content by a voice recognition model (such as a whatsper model, etc.), so that the page description information can be further processed by natural language to obtain information for generating a page layout file.

[0041] It is understandable that a page is composed of several controls arranged in a specific manner, so accurately obtaining the control information corresponding to the target control contained in the target page is the key to generating the page layout file of the target page. The control information of the target control includes but is not limited to: the number of controls, the type of control, the layout information of the control in the target page, etc.

[0042] In actual applications, it is necessary to obtain the control information corresponding to the target control from the page description information of the target page input by the user. On the one hand, the page description information input by the user needs to include description information related to the target control contained in the target page. On the other hand, it is necessary to be able to identify the description information related to the target control from the page description information.

[0043] Whether the page description information input by the user contains description information related to the target control included in the target page is affected by the user's subjective factors. Therefore, in this embodiment, it is assumed that the page description information input by the user contains description information related to the target control included in the target page. Since the user's natural language expression is diverse, how to accurately obtain the description information related to the target control from the page description information input by the user is to be solved in the embodiment of the present invention.

[0044] Specifically, the target controls included in the target page can be determined based on the page description information, and then, based on the determined target controls, the control information corresponding to the target controls for generating the page layout file can be determined, such as: the number of controls, the type of controls, the layout information of the controls in the target page, etc.

[0045] In an optional embodiment, determining the target control included in the target page according to the page description information includes:

[0046] In response to extracting a first keyword related to the control type from the page description information, a target control included in the target page is determined according to the extracted first keyword related to the control type.

[0047] The control type refers to the type of control. Common control types include but are not limited to pictures, text boxes, buttons, etc.

[0048] During the specific implementation process, the first keywords corresponding to various control types can be pre-defined, such as: control type 1 {first keyword 1-1, first keyword 1-2, first keyword 1-3...}, control type 2 {first keyword 2-1, first keyword 2-2, first keyword 2-3...}, etc.

[0049] Therefore, if any first keyword corresponding to a certain control type is extracted from the page description information, it is determined that the target page contains a target control belonging to this control type. For example, if the keyword corresponding to the picture control type is extracted from the page description information, it is determined that the target page contains a picture control belonging to the image control type.

[0050] In this solution, by presetting first keywords corresponding to various control types and extracting keywords from page description information of the target page input by the user, the target control included in the target page can be determined more accurately.

[0051] In actual applications, users may not describe the target page from the dimension of the target page's control composition, that is, the page description information does not describe what types of controls the target page contains; instead, the target page is described from the dimension of the functions that the target page is to achieve, such as "I want to generate a user login page".

[0052] In view of the situation where the page description information is described from the dimension of the functions implemented by the target page, an embodiment of the present invention provides another method for determining the target control included in the target page according to the page description information:

[0053] In response to extracting a second keyword related to a preset page template from the page description information, a target page template corresponding to the target page is determined according to the second keyword; and a control included in the target page template is determined to be a target control included in the target page.

[0054] During the specific implementation process, you can first pre-configure a variety of page templates for realizing different functions, for example, a list template for displaying data sets such as product catalogs, news lists, search results, etc., an interactive template for realizing interactive functions such as user selection, submitting feedback, filling out forms, etc., a navigation template for helping users move between different parts of the application, etc.; then, define the second keyword corresponding to each page template, such as: page template 1 {second keyword 1-1, second keyword 1-2, second keyword 1-3...}, page template 2 {second keyword 2-1, second keyword 2-2, second keyword 2-3...}, etc.

[0055] Thus, if any second keyword corresponding to a certain page template is extracted from the page description information, it is determined that the target page matches the page template, that is, the page template can realize the function to be realized by the target page; further, the control included in the page template can be the target control included in the target page. For example, if a keyword corresponding to a navigation template such as a navigation bar is extracted from the page description information, at least one control pre-configured in the navigation template is determined to be the target control included in the target page.

[0056] In this solution, by pre-configuring multiple page templates for implementing different functions, defining the second keyword corresponding to each page template, and extracting keywords from the page description information of the target page input by the user, the target controls contained in the target page can be determined more accurately.

[0057] To further improve the accuracy of determining the target controls included in the target page based on the page description information, in another optional embodiment, it is also possible to: determine the first target control included in the target page based on the first keyword related to the control type extracted from the page description information; determine the target page template corresponding to the target page based on the second keyword related to the preset page template extracted from the page description information, and determine that the control included in the target page template is the second target control included in the target page; determine the target control included in the target page based on the first target control and the second target control, for example, use the combination of the first target control and the second target control as the target control included in the target page, etc.

[0058] After determining the target control included in the target page by any of the above methods, further, based on the determined target control, determine the control information corresponding to the target control for generating the page layout file, such as: the number of controls, control type, layout information of the control in the target page, etc.

[0059] The control type belongs to the property information of the target control. When the target control is determined, the control type is also determined. The number of the target control can be determined by counting the number of the target controls included in the target page.

[0060] Optionally, the layout information of the target control in the target page can be determined by the number of target controls and / or control types. The layout information of the target control in the target page includes: the layout form corresponding to the target page, and the position information of the target control in the target page under the corresponding layout form.

[0061] Among them, the layout forms corresponding to the target page include: linear layout and relative layout. In linear layout, controls are placed in the horizontal or vertical direction in the defined order. Linear layout is usually used to create pages with simple structures. In relative layout, controls can be placed relative to other controls, that is, controls are allowed to be laid out relative to other controls, which can achieve more sophisticated control positioning options. Relative layout is suitable for creating complex structured pages.

[0062] Figure 2 A flow chart of a method for determining layout information provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the following steps may be included:

[0063] 201. In response to determining that the number of controls of the target control is greater than a set threshold, and / or the control type of the target control includes controls with interactive properties, determine that the layout form of the target control in the target page is a relative layout.

[0064] 202. Determine the relative position relationship of the target control in the target page when using relative layout.

[0065] In this solution, the page complexity of the target page is characterized by the number and type of controls of the target control, and the layout form of the target page is determined.

[0066] Specifically, when the number of controls of the target control is greater than the set threshold, and / or the control type of the target control includes controls with interactive properties, it is determined that the page complexity of the target page is high, and a relative layout is adopted; when the number of controls of the target control is less than or equal to the set threshold and the control type of the target control does not include controls with interactive properties, it is determined that the page complexity of the target page is low, and a linear layout is adopted. Among them, controls with interactive properties refer to controls that allow users to interact with them and can respond to user operations to trigger specific behaviors or state changes, such as buttons, etc.

[0067] When it is determined that the layout form of the target control in the target page is a relative layout, further, the relative position relationship of the target control in the target page when using the relative layout can be determined based on the control height and / or control width of the target control and the screen height and / or screen width of the terminal device used to display the target page.

[0068] Specifically, after obtaining the screen size of the terminal device (i.e., screen height and / or screen width) and the control size of the target control (i.e., control height and / or control width), the control can be guided to be positioned relative to other controls based on the control layout rules predefined in the relative layout, that is, the relative position relationship between the target controls in the target page is determined. The predefined control layout rules include, but are not limited to, alignment (e.g., top alignment, bottom alignment, left alignment, or right alignment), centering (e.g., horizontal centering, vertical centering, or simultaneous centering), spacing control (e.g., setting the distance between controls through margins, etc.), etc.

[0069] In addition, the size and position of the target control can be adjusted proportionally according to the aspect ratio between the screen height and screen width of the terminal device to ensure that the proportional relationship is consistent on different terminal devices. Alternatively, the arrangement and spacing of the target controls can be adjusted according to the proportional relationship between the screen size and the control size. For example, when the screen width is large, the horizontal spacing between controls is increased; when the screen height is small, the vertical spacing between controls is reduced, etc.

[0070] When it is determined that the layout form of the target control in the target page is a linear layout, first, the display order of the target controls in the target page is determined, and the display order can be determined based on the user's sorting operation on the target controls; then, according to the layout direction of the linear layout (for example: horizontal layout or vertical layout), the target controls are arranged in the display order, for example: when the layout direction is a vertical layout, the target controls are arranged from top to bottom, and when the layout direction is a horizontal layout, the target controls are arranged from left to right; according to the arrangement result of the target controls, the position information of the target controls in the target page is determined.

[0071] The above describes the process of determining one element of the page layout file for generating the target page, “layout information of the target control in the target page”. The following describes the process of determining another element of the page layout file for generating the target page, “target control code corresponding to the target control”.

[0072] In order to reduce the impact of manually written code on the accuracy of the page layout file of the target page, an embodiment of the present invention provides a method for automatically generating a target control code corresponding to a target control. Specifically, a mapping relationship between multiple controls and control code expressions can be preset, that is, a mapping relationship between the natural language expression and the code expression of each control can be preconfigured, so that after determining the target control included in the target page according to the page description information input by the user, the target control code corresponding to the target control can be determined from the mapping relationship.

[0073] Optionally, in the mapping relationship between multiple controls and control code expressions, each control may correspond to a control code expression in at least one programming language, wherein a programming language refers to a language used by programmers to express algorithms, data structures, and interact with computer hardware, including but not limited to Java, C++, Python, etc.

[0074] Accordingly, according to the mapping relationship between the preset multiple controls and the control code expressions, the target control code corresponding to the target control is determined, including: according to the mapping relationship between the preset multiple controls and the control code expressions, and the target programming language used by the page layout file to be generated, the target control code corresponding to the target control is determined, wherein the target control code is expressed in the target programming language.

[0075] After determining the layout information of the target control in the target page and the target control code corresponding to the target control, a page layout file for constructing the target page is generated according to the layout information and the target control code.

[0076] Optionally, page layout file templates of different layout forms can be pre-configured. After the above layout information and target control code are obtained, according to the layout form contained in the layout information, a target page layout template matching the layout form contained in the layout information is determined from the pre-configured page layout file template; according to the position information corresponding to the target control contained in the layout information in the target page, the target positions corresponding to the target control codes in the target page layout template are determined; the target control code is written into the target page layout template to generate a page layout file of the target page.

[0077] In summary, in the page layout file generation method provided by the embodiment of the present invention, when it is necessary to generate a page layout file for constructing a target page, first, obtain the page description information of the target page input by the user in natural language; then, determine the target control contained in the target page according to the page description information; then, determine the layout information of the target control in the target page according to the number of controls and / or control type of the target control, and determine the target control code corresponding to the target control according to the mapping relationship between the preset multiple controls and the control code expression; finally, generate the page layout file of the target page according to the layout information and the target control code. In this scheme, the page information of the target page is described by natural language, that is, the page information that originally needs to be expressed by the page design file is expressed by natural language, thereby simplifying the expression method of the page information of the target page; then, from the page information of the target page described by natural language, obtain the control information required to generate the page layout file of the target page, and based on the obtained control information and the preset multiple control code expressions, automatically generate the page layout file corresponding to the target page, so that there is no need to manually write the page layout file, which can not only improve the generation efficiency of the page layout file, but also obtain an accurate page layout file.

[0078] It is understandable that in the mapping relationship between preset controls and control code expressions, the control style information in the control code corresponding to each control is often the default. In order to facilitate the generation of personalized target pages for users, an embodiment of the present invention provides another page layout file generation method.

[0079] Figure 3 A flowchart of another method for generating a page layout file provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the following steps may be included:

[0080] 301. Obtain page description information of a target page input by a user in natural language.

[0081] 302. Determine a target control included in the target page according to the page description information.

[0082] 303. Determine layout information of the target control in the target page according to the control quantity and / or control type of the target control.

[0083] 304. Determine a target control code corresponding to the target control according to a preset mapping relationship between multiple controls and control code expressions.

[0084] 305. Obtain target control style information of the target control from the page description information; and set the default control style information in the target control code as the target control style information.

[0085] 306. Generate a page layout file of the target page according to the layout information and the target control code including the target control style information; wherein the page layout file is used to construct the target page.

[0086] The specific implementation process of step 301 to step 304 may refer to the aforementioned embodiment, and will not be described in detail in this embodiment.

[0087] In this embodiment, the control style information is the visual feature information of the control, including but not limited to the size, color, shape, etc. of the control.

[0088] In an optional embodiment, the target control and the target control style information of the target control can be extracted from the page description information input by the user through a machine learning model capable of natural language processing, such as a large language model (LLM).

[0089] In actual applications, if the target control style information of the target control is extracted from the page description information, the default control style information in the target control code is set as the target control style information in the process of determining the target control code corresponding to the target control; if the target control style information of the target control is not extracted from the page description information, the default control style information in the target control code is used in the process of determining the target control code corresponding to the target control.

[0090] In this solution, by obtaining the target control style information of the target control from the page description information input by the user and setting the default control style information in the target control code as the target control style information, it can ensure that the target page constructed by the page layout file generated based on the target control code meets the user's control personalization requirements and improves user satisfaction.

[0091] The following will describe in detail the page layout file generation device of one or more embodiments of the present invention. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.

[0092] Figure 4 A schematic diagram of a page layout file generating device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device includes: an acquisition module 11, a determination module 12, and a generation module 13.

[0093] The acquisition module 11 is used to acquire the page description information of the target page input by the user in natural language.

[0094] The determination module 12 is used to determine the target control contained in the target page according to the page description information; determine the layout information of the target control in the target page according to the control quantity and / or control type of the target control; and determine the target control code corresponding to the target control according to the mapping relationship between the preset multiple controls and the control code expression.

[0095] The generating module 13 is used to generate a page layout file of the target page according to the layout information and the target control code, and the page layout file is used to construct the target page.

[0096] Optionally, the determination module 12 is specifically configured to, in response to extracting a first keyword related to a control type from the page description information, determine a target control included in the target page according to the first keyword.

[0097] Optionally, the determination module 12 is further specifically used to determine the target page template corresponding to the target page in response to extracting a second keyword related to a preset page template from the page description information, based on the second keyword; and determine that the control contained in the target page template is the target control contained in the target page.

[0098] Optionally, the determination module 12 is further specifically used to determine that the layout form of the target control in the target page is a relative layout in response to determining that the number of controls of the target control is greater than a set threshold, and / or that the control type of the target control includes controls with interactive properties; and determine the relative position relationship of the target control in the target page when using the relative layout.

[0099] Optionally, the determination module 12 is also specifically used to determine the relative position relationship of the target control in the target page when using the relative layout based on the control height and / or control width of the target control and the screen height and / or screen width of the terminal device used to display the target page.

[0100] Optionally, the acquisition module 11 is further configured to acquire target control style information of the target control from the page description information.

[0101] Correspondingly, the determining module 12 is further configured to set the default control style information in the target control code as the target control style information.

[0102] Figure 4 The device shown can execute the steps introduced in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments, which will not be repeated here.

[0103] In one possible design, the above Figure 4 The structure of the page layout file generating device shown can be implemented as an electronic device, such as Figure 5 As shown, the electronic device may include: a memory 21, a processor 22, and a communication interface 23. The memory 21 stores executable codes, and when the executable codes are executed by the processor 22, the processor 22 can at least implement the page layout file generation method provided in the above embodiments.

[0104] In addition, an embodiment of the present invention provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the page layout file generation method provided in the aforementioned embodiment.

[0105] An embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, the processor is caused to execute the page layout file generation method provided in the above embodiment.

[0106] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0107] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0108] 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 it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 method for generating a page layout file, characterized in that: include: Obtain page description information of the target page input by the user in natural language; Determining a target control included in the target page according to the page description information; Determining layout information of the target control in the target page according to the control quantity and / or control type of the target control; Determine the target control code corresponding to the target control according to the mapping relationship between the preset multiple controls and the control code expression; A page layout file of the target page is generated according to the layout information and the target control code, and the page layout file is used to construct the target page.

2. The method according to claim 1, characterized in that The step of determining the target control included in the target page according to the page description information includes: In response to extracting a first keyword related to a control type from the page description information, a target control included in the target page is determined according to the first keyword.

3. The method according to claim 1, characterized in that The step of determining the target control included in the target page according to the page description information includes: In response to extracting a second keyword related to a preset page template from the page description information, determining a target page template corresponding to the target page according to the second keyword; It is determined that the control included in the target page template is a target control included in the target page.

4. The method according to claim 1, characterized in that The determining, according to the number of controls and / or control type of the target control, layout information of the target control in the target page includes: In response to determining that the number of controls of the target control is greater than a set threshold, and / or that the control type of the target control includes controls with interactive properties, determining that the layout form of the target control in the target page is a relative layout; Determine the relative position relationship of the target control in the target page when the relative layout is used.

5. The method according to claim 4, characterized in that The determining the relative position relationship of the target control in the target page when the relative layout is used includes: The relative position relationship of the target control in the target page when using the relative layout is determined according to the control height and / or control width of the target control and the screen height and / or screen width of the terminal device used to display the target page.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Acquire target control style information of the target control from the page description information; The default control style information in the target control code is set as the target control style information.

7. A page layout file generating device, characterized in that: include: An acquisition module, used to acquire page description information of a target page input by a user in natural language; A determination module, configured to determine a target control included in the target page according to the page description information; determine layout information of the target control in the target page according to the number and / or type of controls of the target control; and determine a target control code corresponding to the target control according to a mapping relationship between a plurality of preset controls and control code expressions; A generation module is used to generate a page layout file of the target page according to the layout information and the target control code, and the page layout file is used to construct the target page.

8. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the page layout file generation method as described in any one of claims 1 to 6.

9. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the page layout file generation method according to any one of claims 1 to 6.

10. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to execute the page layout file generation method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target page generation method and device

    CN117389559A

  • Management page generation method and device, electronic equipment and storage medium

    CN118605873A

  • Small program front-end page website building design method and system

    CN119045790A

  • Page layout file generation method and device, equipment and storage medium

    CN119105758A

  • Building software applications using natural language and machine-learning models

    WO2024249921A2