CN118132885A - Webpage generating method and device, electronic equipment, storage medium and computer program product - Google Patents

Webpage generating method and device, electronic equipment, storage medium and computer program product Download PDF

Info

Publication number
CN118132885A
CN118132885A CN202410246563.2A CN202410246563A CN118132885A CN 118132885 A CN118132885 A CN 118132885A CN 202410246563 A CN202410246563 A CN 202410246563A CN 118132885 A CN118132885 A CN 118132885A
Authority
CN
China
Prior art keywords
webpage
elements
generating
generation
position information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410246563.2A
Other languages
Chinese (zh)
Inventor
杨凯
樊亦洲
高浩程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202410246563.2A priority Critical patent/CN118132885A/en
Publication of CN118132885A publication Critical patent/CN118132885A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a web page generation method and apparatus, an electronic device, a storage medium, and a computer program product, which can be applied to the fields of big data and financial science and technology. The method comprises the following steps: acquiring a webpage design file, wherein the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer; determining N webpage controls for generating M elements, wherein the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M; and generating a target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage for animation design.

Description

Webpage generating method and device, electronic equipment, storage medium and computer program product
Technical Field
The present disclosure relates to the field of big data and financial science and technology, and more particularly, to a web page generation method and apparatus, an electronic device, a storage medium, and a computer program product.
Background
The business intelligence (Business Intelligence, BI) report may help the user make accurate decisions. Currently, in the early stage of BI report making, a developer performs overall layout setting according to a User Interface (UI) design drawing, then selects a proper control, and uses BI setting to perform style adjustment on the control.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: in the early stage of BI report making, operations such as layout setting, control selection, style adjustment and the like are performed manually, so that a great deal of effort is consumed, and the webpage generating efficiency is low.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a web page generation method and apparatus, an electronic device, a storage medium, and a computer program product.
According to a first aspect of the present disclosure, there is provided a web page generation method, including:
Acquiring a webpage design file, wherein the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer;
determining N webpage controls for generating M elements, wherein the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M; and
Generating a target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage of animation design.
According to an embodiment of the present disclosure, generating a target web page from a web page design file and N web page controls includes:
Determining element style information, element position information and element size information of each element from a webpage design file;
Generating M control attribute groups based on the first association relation of the element style information and the control attributes, wherein each webpage control comprises at least one control attribute group; and
And generating a target webpage according to the element position information, the element size information and the control attribute group.
According to an embodiment of the present disclosure, generating a target web page according to element position information, element size information, and a control attribute group includes:
Acquiring a blank webpage template;
Determining the generation sequence of M elements based on the element position information; and
And generating M elements on the blank template according to the element position information, the element size information and the control attribute group based on the generation sequence to form the target webpage.
According to an embodiment of the present disclosure, the element position information includes row coordinate values and column coordinate values; determining a generation order of the M elements based on the element position information, including:
Distributing M elements to a plurality of first sub-generation sequences based on the row coordinate values, wherein the row coordinate values of the elements in each first sub-generation sequence are the same, and the first sub-generation sequences are arranged according to the sequence from small to large of the row coordinate values;
Aiming at each first sub-generation sequence, arranging a plurality of elements based on column coordinate values of the elements in the sub-generation sequence to obtain an arranged second sub-generation sequence; and
And determining the generation sequence of M elements according to the second sub-generation sequences.
According to an embodiment of the present disclosure, determining the generation order of the M elements based on the element position information further includes:
determining the position information of R areas in the blank webpage template according to the template parameters of the blank webpage template, wherein R is a positive integer;
assigning M elements to R regions based on the element position information and the position information of the R regions; and
For each of the R regions, a generation order of a plurality of elements in the region is determined based on the element position information.
According to an embodiment of the present disclosure, generating M elements on a blank template based on a generation order according to element position information, element size information, and a control attribute group, to form a target web page, includes:
And using the generation sequence, the element position information, the element size information and the control attribute group as parameters of an element selector, and generating M elements on the blank template based on the generation sequence by using the element selector.
According to an embodiment of the present disclosure, determining N web page controls for generating M elements includes:
Identifying the element names of the M elements from the webpage design file;
determining the element types of each of M elements according to the element names; and
N webpage controls for generating M elements are determined according to the element types based on the element types and the second association relation of the webpage controls.
A second aspect of the present disclosure provides a web page generating apparatus, including:
The system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring a webpage design file, the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer;
The system comprises a determining module, a processing module and a processing module, wherein the determining module is used for determining N webpage controls for generating M elements, the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M;
The generating module is used for generating a target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage for animation design.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the webpage generating method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described web page generation method.
The fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described web page generation method.
According to the webpage generating method and device, the electronic device, the computer readable storage medium and the computer program product, N webpage controls for generating M elements can be determined through the webpage design file, so that a target webpage can be generated. Because the BI platform can automatically select the webpage controls corresponding to the elements according to M elements in the webpage design file and generate the target webpage by utilizing the webpage controls based on the webpage design file, layout setting, control selection and style adjustment are not needed to be manually performed, the style adjustment process in the early stage of report making is optimized, the webpage generation efficiency is improved, and the design cost is reduced.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of a web page generation method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a web page generation method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow diagram for generating a target web page in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates an example schematic diagram of generating a target web page according to an embodiment of the disclosure;
FIG. 5 schematically shows a block diagram of a web page generating apparatus according to an embodiment of the present disclosure; and
Fig. 6 schematically illustrates a block diagram of an electronic device adapted to implement a web page generation method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a convention should be interpreted in accordance with the meaning of one of skill in the art having generally understood the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
BI produces reports that alleviate the need for front-end development, saving group and personal costs. However, at the early stage of BI report making, a developer needs to perform overall layout setting according to a user interface design diagram and then drag operation to select controls and styles, and the low-value repeated labor consumes a great deal of effort of the developer aiming at different page design requirements, so that the efficiency is low.
In view of this, embodiments of the present disclosure provide a web page generating method. The method comprises the following steps: acquiring a webpage design file, wherein the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer; determining N webpage controls for generating M elements, wherein the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M; and generating a target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage for animation design.
It should be noted that, the web page generating method and the web page generating device provided in the present disclosure may be used in a financial field, for example, a financial institution such as a bank, and may also be used in any field other than the financial field, and therefore, an application field of the web page generating method and the web page generating device provided in the present disclosure is not limited.
In the technical scheme of the invention, the related user information (including but not limited to user personal information, user image information, user equipment information, such as position information and the like) and data (including but not limited to data for analysis, stored data, displayed data and the like) are information and data authorized by a user or fully authorized by all parties, and the related data are collected, stored, used, processed, transmitted, provided, disclosed, applied and the like, all comply with related laws and regulations and standards, necessary security measures are adopted, no prejudice to the public order is provided, and corresponding operation entries are provided for the user to select authorization or rejection.
Fig. 1 schematically illustrates an application scenario of a web page generation method according to an embodiment of the present disclosure.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the webpage generating method provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, the webpage generating apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The web page generation method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the web page generating apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
Alternatively, the web page generating method provided by the embodiment of the present disclosure may also be performed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be performed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the web page generating apparatus provided by the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely representative of the operations for the purpose of description, and should not be construed as representing the order of execution of the respective operations. The method need not be performed in the exact order shown unless explicitly stated.
The webpage generating method of the disclosed embodiment will be described in detail with reference to fig. 2 to 4 based on the scenario described in fig. 1.
Fig. 2 schematically illustrates a flowchart of a web page generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the method 200 includes operations S210 to S230.
In operation S210, a web page design file is acquired.
According to an embodiment of the present disclosure, a web page design file is used to generate a target web page, the web page design file includes M elements in the target web page, and M is a positive integer.
According to an embodiment of the present disclosure, the target web page may be a user interface, and the web page design file is a design drawing created from the target web page, for example, a hypertext markup language (HyperText Markup Language, html) file generated by plug-in software production.
According to an embodiment of the present disclosure, the web page design file includes M elements in the target web page, for example, the elements may be text box elements, content elements, title elements, etc. in the representation.
According to an embodiment of the present disclosure, a web page design file includes M elements, and a process for generating a target web page by using the web page design file may include: and generating M elements of the target webpage by using descriptions or code definitions of the M elements in the webpage design file, and rendering the M elements in the target webpage.
In operation S220, N web page controls for generating M elements are determined.
According to an embodiment of the disclosure, the web page control is configured to generate at least one element, where N is a positive integer less than or equal to M. The webpage control refers to an encapsulation control for data and a method, and can be a single-selection control, a multi-selection control, a drop-down control and the like. According to the embodiment of the disclosure, the server may acquire a web page design file from the terminal device, upload the web page design file to the BI platform, traverse each element of the web page design file by the BI platform, determine a web page control corresponding to each element, and generate a target web page based on the web page control corresponding to each element.
According to the embodiment of the disclosure, the webpage control of the BI platform can be reused, that is, a plurality of elements can correspond to the same webpage control, and the relationship between the elements and the webpage control is many-to-one. And the BI platform identifies the corresponding relation between the elements and the webpage controls by traversing each element, so that N webpage controls of M elements are determined.
In operation S230, a target web page is generated according to the web page design file and the N web page controls.
According to an embodiment of the present disclosure, the target web page is a static web page for use as an initial web page for an animation design.
And carrying out style adjustment according to the elements in the webpage design file and the webpage controls corresponding to the elements, and automatically generating a static target webpage.
According to the embodiment of the disclosure, based on the target webpage, animation design is performed according to an animation design technology, and a display interface required by a user is obtained.
According to the embodiment of the disclosure, the BI platform can automatically select the webpage control corresponding to the element according to M elements in the webpage design file and generate the target webpage by using the webpage control based on the webpage design file, so that layout setting, control selection and style adjustment are not required to be manually performed, the style adjustment process in the early stage of report making is optimized, the webpage generation efficiency is improved, and the design cost is reduced.
According to an embodiment of the present disclosure, generating a target web page from a web page design file and N web page controls includes: determining element style information, element position information and element size information of each element from a webpage design file; generating M control attribute groups based on the first association relation of the element style information and the control attributes, wherein each webpage control comprises at least one control attribute group; and generating the target webpage according to the element position information, the element size information and the control attribute group.
According to the embodiment of the disclosure, each element contains an element style attribute, an element position attribute and an element size attribute, and each element can be determined from a webpage design file, and element style information, element position information and element size information are acquired from the attributes. For example, the attribute value 500 is acquired from the width attribute, that is, the width information included in the element size information is 500.
According to an embodiment of the present disclosure, the element style information may include an inline style, an internal style, and an external style, a text style, a decoration style, etc., for example, the text style may set a text size, a color, a font, etc., the external style may set an external link address, and the decoration style may set a window size.
According to an embodiment of the present disclosure, the element position information may be information of a horizontal position, a vertical position, or the like of the element.
According to embodiments of the present disclosure, the element size information may be width, height, etc. information of the element.
For example, for a certain text box element, the element style information may be a "selectable" text box, the element position information may be row 3, column 4, or a specific coordinate position in the page coordinate system. The element size information is 1cm wide and 0.5cm high.
According to the embodiment of the disclosure, the control attribute corresponds to a function of the control, for example, acquiring an attribute of a size of the control, acquiring an attribute of a position of the control, acquiring an attribute of a Chinese color in the control, acquiring an attribute of a frame of the control, and the like, and a plurality of control attributes of the control are combined to obtain a control attribute group.
According to an embodiment of the present disclosure, the first association relationship refers to a relationship between element style information and a control attribute, for example, element style information of a certain element in a web page design file is a text color, and the text color is red. And according to the first association relation, the element style information is corresponding to the control attribute for acquiring the color of the control text. Similarly, based on the above manner, the element style information of each element can be corresponding to the control attribute, so as to obtain all the control attributes of the element. All the control attributes are combined to obtain the control attribute group of the element.
For example, the element position information is set to the landscape direction 614px, the portrait direction 438px, the element size information is set to the wide 66px, and the high 66px, and the target web page is generated from the element position information, the element size information, and the control attribute group.
According to the embodiment of the disclosure, the position of the element in the target webpage is generated according to the element position information of the element, the size of the element in the target webpage is generated according to the element size information of the element, and the control attribute of the element in the target webpage is generated according to the control attribute group of the element.
FIG. 3 schematically illustrates a flow chart of generating a target web page according to an embodiment of the disclosure.
As shown in fig. 3, generating the target web page according to the element position information, the element size information, and the control attribute group includes steps S310 to S330.
In operation S310, a blank web page template is acquired.
According to an embodiment of the present disclosure, a blank web page template characterizes a blank user interface for forming a target web page.
In operation S320, a generation order of M elements is determined based on the element position information.
According to the embodiment of the disclosure, the positions of M elements in the blank webpage template are determined according to the element position information, and then the generation sequence is obtained according to the positions of the M elements.
In operation S330, M elements are generated on the blank template based on the generation order according to the element position information, the element size information, and the control attribute group, forming a target web page.
For example, taking the element 1 and the element 2 as examples, when the generation sequence of the elements is determined to be that the element 1 is generated first and the element 2 is regenerated, the element 1 may be generated on the blank web page template according to the element position information, the element size information and the control attribute group of the element 1, and then the element 2 may be generated according to the element position information, the element size information and the control attribute group of the element 2.
According to the embodiment of the disclosure, M elements are sequentially generated on a blank webpage template according to the element position information, the element size information and the control attribute group of the M elements, so that a target webpage is obtained.
According to an embodiment of the present disclosure, the element position information includes row coordinate values and column coordinate values; determining a generation order of the M elements based on the element position information, including: distributing M elements to a plurality of first sub-generation sequences based on the row coordinate values, wherein the row coordinate values of the elements in each first sub-generation sequence are the same, and the first sub-generation sequences are arranged according to the sequence from small to large of the row coordinate values; aiming at each first sub-generation sequence, arranging a plurality of elements based on column coordinate values of the elements in the sub-generation sequence to obtain an arranged second sub-generation sequence; and determining the generation sequence of the M elements according to the plurality of second sub-generation sequences.
According to an embodiment of the present disclosure, the element position information includes a row coordinate value representing the lateral direction information and a column coordinate value representing the longitudinal direction information.
For example, the row coordinate value 1px and the column coordinate value 1px of the element 1, the row coordinate value 2px and the column coordinate value 2px of the element 2, the row coordinate value 1px and the column coordinate value 2px of the element 3, the row coordinate value 2px and the column coordinate value 1px of the element 4, and the row coordinate value 2px and the column coordinate value 3px of the element 5. According to the same row coordinate values, element 1 and element 3 are assigned to one first sub-generation sequence, and element 2, element 4, and element 5 are assigned to one first sub-generation sequence.
According to the embodiment of the disclosure, the first sub-generation sequences are ordered in the order of the small row coordinate values, namely, elements in the first sub-generation sequences with small row coordinate values are traversed first, and elements in the first sub-generation sequences with large row coordinate values are traversed first.
According to an embodiment of the present disclosure, according to column coordinate values of a plurality of elements in a sub-generation sequence, arranging the plurality of elements to obtain a second sub-generation sequence after arrangement includes: and arranging according to the sequence from small to large of the column coordinate values to obtain a second sub-generation sequence.
For example, still taking the above-described first sub-generation sequence including element 2, element 4, and element 5 as an example, the second sub-generation sequence is element 4, element 2, and element 5 based on column coordinate value 2px of element 2, column coordinate value 1px of element 4, and column coordinate value 3px of element 5.
According to an embodiment of the present disclosure, determining the generation order of the M elements based on the element position information further includes: determining the position information of R areas in the blank webpage template according to the template parameters of the blank webpage template, wherein R is a positive integer; assigning M elements to R regions based on the element position information and the position information of the R regions; and determining, for each of the R regions, a generation order of the plurality of elements in the region based on the element position information.
According to an embodiment of the present disclosure, the template parameters of the blank web page template may include a position parameter, and the blank template is divided into R regions according to the position parameter values.
According to an embodiment of the present disclosure, element position information is matched with position information of R areas, and M elements are sequentially allocated to the R areas.
According to the embodiment of the disclosure, for a first region of the R regions, determining an element corresponding to the matched element position information as a first generated element according to the position information of the first region; for a second region of the R regions, determining that the element corresponding to the matched element position information is a second generation element according to the position information of the second region. And determining the generation sequence of M elements in turn according to each region of the R regions and the element position information.
For example, the position information of the first area is 400×400, matching is performed according to the element position information and the position information of the first area, and an element corresponding to the element position information of 400×400 is allocated to the first area.
According to the embodiment of the disclosure, the generation sequence of M elements is determined by dividing the blank webpage template into the areas, the controls are generated in parallel, and the element generation efficiency of the target page is improved.
According to an embodiment of the present disclosure, generating M elements on a blank template based on a generation order according to element position information, element size information, and a control attribute group, to form a target web page, includes: and using the generation sequence, the element position information, the element size information and the control attribute group as parameters of an element selector, and generating M elements on the blank template based on the generation sequence by using the element selector.
According to an embodiment of the present disclosure, a plurality of parameters are provided on the element selector, including a generation order, element position information, element size information, and control parameters.
According to the embodiment of the disclosure, the element selector in the BI platform can select the designated element from the webpage design file according to the element name, acquire the element position information, the element size information and the control attribute group of the element based on the parameter corresponding relation, and finally generate M elements on the blank template based on the generation sequence.
According to the embodiment of the disclosure, when different page design requirements of users are met, the user does not need to custom repeat code generation, and the target webpage is automatically formed on the blank template by matching the related parameters of the element selector with the modified style information, the modified position information and the like, so that the efficiency of the construction process is improved.
According to an embodiment of the present disclosure, determining N web page controls for generating M elements includes: identifying the element names of the M elements from the webpage design file; determining the element types of each of M elements according to the element names; and determining N webpage controls for generating M elements according to the element types based on the second association relation of the element types and the webpage controls.
According to the embodiment of the present disclosure, the element names of the M elements may be sequentially identified from the web page design file, the element types of the M elements may be determined, for example, the value of the element name of the element 1 is identified as name1, and the value of the element type is determined as radio.
According to an embodiment of the disclosure, the second association relationship of the element type and the web page control is a preset association relationship. And associating the labels in the webpage design file with the element types, namely binding the element types to the controls according to the second association relation.
For example, the element type of the identification element can be set as a radio and the element type can be set in a tag label in the web page design file. At this time, the element type may be corresponding to the single-selection control according to the second association relationship. Similarly, based on the above manner, the element type of each element can be corresponding to the web page control, the control of the element is obtained, and the control is associated with the control attribute group.
According to the embodiment of the disclosure, automatic and rapid selection of the webpage control is realized based on the predefined element types and the second association relation in the webpage design file.
FIG. 4 schematically illustrates an example schematic diagram of generating a target web page according to an embodiment of the disclosure.
As shown in FIG. 4, element names 401 of each of M elements are identified from the web page design file, and element types 402 of each of M elements are determined. According to the second association relation 403 between the element type and the web page control, that is, the element type is set in the label in the web page design file, the web page control 404 to which the element type is bound can be determined. 406 refers to element style information, element position information and element size information, and according to a first association relation 405 between the element style information and the control attributes, all the control attributes of the elements are determined according to the element style information in 406, a control attribute group is obtained by combining, and M control attribute lives 407 of M elements are sequentially obtained. The M elements of web page control 404 and M control properties 407 are associated.
The generating order 408 of the M elements in the blank web page template can be determined from the element position information in 406 by a rank coordinate value size method or a method of dividing the blank web page template into R areas and matching the position information. The element selector may select a specified element from the web page design file according to the element name 401, obtain element position information, element size information and a control attribute group 407 in 406 based on the parameter correspondence, and finally sequentially generate M elements on a blank template based on the generation sequence 408 to form a target web page 409.
Based on the webpage generating method, the invention further provides a webpage generating device. The device will be described in detail below in connection with fig. 5.
Fig. 5 schematically shows a block diagram of a web page generating apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the web page generating apparatus 500 of this embodiment includes an acquisition module 510, a determination module 520, and a generation module 530.
The obtaining module 510 is configured to obtain a web page design file, where the web page design file is used to generate a target web page, the web page design file includes M elements in the target web page, and M is a positive integer. In an embodiment, the obtaining module 510 may be configured to perform the operation S210 described above, which is not described herein.
The determining module 520 is configured to determine N web page controls for generating M elements, where N is a positive integer less than or equal to M, and the web page controls are used for generating at least one element. In an embodiment, the determining module 520 may be configured to perform the operation S220 described above, which is not described herein.
The generating module 530 is configured to generate a target webpage according to the webpage design file and the N webpage controls, where the target webpage is a static webpage and is used as an initial webpage for animation design. In an embodiment, the generating module 530 may be configured to perform the operation S230 described above, which is not described herein.
According to an embodiment of the present disclosure, the generation module 530 includes a first generation sub-module, a second generation sub-module, and a third generation sub-module.
The first generation sub-module is used for determining element style information, element position information and element size information of each element from the webpage design file.
And the second generation sub-module is used for generating M control attribute groups based on the first association relation of the element style information and the control attributes, wherein each webpage control comprises at least one control attribute group.
And the third generation sub-module is used for generating a target webpage according to the element position information, the element size information and the control attribute group.
According to an embodiment of the present disclosure, the third generation sub-module includes an acquisition unit, a first generation unit, and a second generation unit.
And the acquisition unit is used for acquiring the blank webpage template.
And a first generation unit configured to determine a generation order of the M elements based on the element position information.
And the second generating unit is used for generating M elements on the blank template according to the element position information, the element size information and the control attribute group based on the generating sequence to form a target webpage.
According to an embodiment of the present disclosure, the first generation unit includes an allocation subunit, a first generation subunit, and a second generation subunit.
And the allocation subunit is used for allocating the M elements to a plurality of first sub-generation sequences based on the row coordinate values, wherein the row coordinate values of the elements in each first sub-generation sequence are the same, and the plurality of first sub-generation sequences are arranged according to the order of the row coordinate values from small to large.
The first generating subunit is configured to, for each first sub-generating sequence, arrange a plurality of elements in the sub-generating sequence based on column coordinate values of the plurality of elements, and obtain an arranged second sub-generating sequence.
And the second generation subunit is used for determining the generation sequence of the M elements according to the plurality of second sub generation sequences.
According to an embodiment of the present disclosure, the first generation unit further comprises a third generation subunit, a fourth generation subunit and a fifth generation subunit.
The third generation subunit is used for determining the position information of R areas in the blank webpage template according to the template parameters of the blank webpage template, wherein R is a positive integer.
And a fourth generation subunit configured to allocate the M elements to the R regions based on the element position information and the position information of the R regions.
And a fifth generation subunit for determining, for each of the R regions, a generation order of the plurality of elements in the region based on the element position information.
According to an embodiment of the present disclosure, the second generation unit comprises a sixth generation subunit.
And a sixth generation subunit, configured to generate M elements on the blank template based on the generation order using the element selector, with the generation order, the element position information, the element size information, and the control attribute group as parameters of the element selector.
According to an embodiment of the present disclosure, the determination module 520 includes a first determination sub-module, a second determination sub-module, and a third determination sub-module.
And the first determination submodule is used for identifying the element names of the M elements from the webpage design file.
And the second determination submodule is used for determining the element types of the M elements according to the element names.
And the third determining submodule is used for determining N webpage controls for generating M elements according to the element types based on the second association relation between the element types and the webpage controls.
Any of the plurality of modules of the acquisition module 510, the determination module 520, and the generation module 530 may be combined in one module to be implemented, or any of the plurality of modules may be split into a plurality of modules, according to embodiments of the present disclosure. Or at least some of the functionality of one or more of the modules may be combined with, and implemented in, at least some of the functionality of other modules.
According to embodiments of the present disclosure, at least one of the acquisition module 510, the determination module 520, and the generation module 530 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of any of three implementations of software, hardware, and firmware. Or at least one of the acquisition module 510, the determination module 520 and the generation module 530 may be at least partially implemented as a computer program module which, when executed, may perform the corresponding functions.
Fig. 6 schematically illustrates a block diagram of an electronic device adapted to implement a web page generation method according to an embodiment of the disclosure.
The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, a computer electronic device 600 according to an embodiment of the present disclosure includes a processor 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 609 into a Random Access Memory (RAM) 603. The processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 601 may also include on-board memory for caching purposes. The processor 601 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or the RAM 603. Note that the program may be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
According to an embodiment of the present disclosure, the electronic device 600 may also include an input/output (I/O) interface 605, the input/output (I/O) interface 605 also being connected to the bus 604. The electronic device 600 may also include one or more of the following components connected to an input/output (I/O) interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to an input/output (I/O) interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 602 and/or RAM 603 and/or one or more memories other than ROM 602 and RAM 603 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the web page generation methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and/or installed from the removable medium 611. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
While the foregoing is directed to embodiments of the present disclosure, other and further details of the invention may be had by the present application, it is to be understood that the foregoing description is merely exemplary of the present disclosure and that no limitations are intended to the scope of the disclosure, except insofar as modifications, equivalents, improvements or modifications may be made without departing from the spirit and principles of the present disclosure.

Claims (11)

1.A web page generation method, comprising:
Acquiring a webpage design file, wherein the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer;
Determining N webpage controls for generating the M elements, wherein the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M; and
And generating the target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage of animation design.
2. The method of claim 1, wherein the generating the target web page from the web page design file and N web page controls comprises:
Determining element style information, element position information and element size information of each element from the webpage design file;
Generating M control attribute groups based on the first association relation of the element style information and the control attributes, wherein each webpage control comprises at least one control attribute group; and
And generating the target webpage according to the element position information, the element size information and the control attribute group.
3. The method of claim 2, wherein the generating the target web page from the element position information, the element size information, and the control property group comprises:
Acquiring a blank webpage template;
Determining the generation sequence of the M elements based on the element position information; and
And generating M elements on the blank template according to the element position information, the element size information and the control attribute group based on the generation sequence to form the target webpage.
4. A method according to claim 3, wherein the element position information comprises row and column coordinate values; the determining, based on the element position information, a generation order of the M elements includes:
distributing the M elements to a plurality of first sub-generation sequences based on the row coordinate values, wherein the row coordinate values of the elements in each first sub-generation sequence are the same, and the plurality of first sub-generation sequences are arranged according to the order of the row coordinate values from small to large;
aiming at each first sub-generation sequence, arranging a plurality of elements in the sub-generation sequence based on column coordinate values of the elements to obtain an arranged second sub-generation sequence; and
And determining the generation sequence of the M elements according to the second sub-generation sequences.
5. The method according to claim 3 or 4, wherein the determining the generation order of the M elements based on the element position information further comprises:
Determining the position information of R areas in the blank webpage template according to the template parameters of the blank webpage template, wherein R is a positive integer;
Assigning the M elements to the R regions based on the element position information and the position information of the R regions; and
For each of the R regions, determining a generation order of a plurality of elements in the region based on the element position information.
6. The method of claim 3, wherein the generating the M elements on the blank template to form the target web page based on the generating order from the element position information, the element size information, and the control property group comprises:
And using the generating sequence, the element position information, the element size information and the control attribute group as parameters of an element selector, and generating the M elements on the blank template based on the generating sequence by using the element selector.
7. The method of claim 1, wherein the determining N web page controls for generating the M elements comprises:
Identifying the element names of the M elements from the webpage design file;
Determining the element types of the M elements according to the element names; and
And determining N webpage controls for generating the M elements according to the element types based on the second association relation of the element types and the webpage controls.
8. A web page generation apparatus comprising:
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring a webpage design file, the webpage design file is used for generating a target webpage, the webpage design file comprises M elements in the target webpage, and M is a positive integer;
the determining module is used for determining N webpage controls for generating the M elements, wherein the webpage controls are used for generating at least one element, and N is a positive integer less than or equal to M; and
The generation module is used for generating the target webpage according to the webpage design file and the N webpage controls, wherein the target webpage is a static webpage and is used as an initial webpage of animation design.
9. An electronic device, comprising:
One or more processors;
A memory for storing one or more computer programs,
Characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, realizes the steps of the method according to any one of claims 1-7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps of the method according to any one of claims 1-7.
CN202410246563.2A 2024-03-05 2024-03-05 Webpage generating method and device, electronic equipment, storage medium and computer program product Pending CN118132885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410246563.2A CN118132885A (en) 2024-03-05 2024-03-05 Webpage generating method and device, electronic equipment, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410246563.2A CN118132885A (en) 2024-03-05 2024-03-05 Webpage generating method and device, electronic equipment, storage medium and computer program product

Publications (1)

Publication Number Publication Date
CN118132885A true CN118132885A (en) 2024-06-04

Family

ID=91245267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410246563.2A Pending CN118132885A (en) 2024-03-05 2024-03-05 Webpage generating method and device, electronic equipment, storage medium and computer program product

Country Status (1)

Country Link
CN (1) CN118132885A (en)

Similar Documents

Publication Publication Date Title
CA2892664C (en) System and method for displaying multiple applications
US20130326337A1 (en) Web application compositon and modification editor
US20190339820A1 (en) Displaying a subset of menu items based on a prediction of the next user-actions
US20190179519A1 (en) Graphically organizing content in a user interface to a software application
CN105488125A (en) Page access method and apparatus
US10951486B2 (en) Terminal device, UI expansion method, and UI expansion program
CN112395027A (en) Widget interface generation method and device, storage medium and electronic equipment
CN114048329A (en) Knowledge graph construction and display method and device, electronic equipment and medium
CN113553123A (en) Data processing method and device, electronic equipment and storage medium
CN112965916A (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN112085160A (en) Image sample expansion method and device and storage medium
US10824595B1 (en) Personalized user interface systems and methods
CN118132885A (en) Webpage generating method and device, electronic equipment, storage medium and computer program product
CN105373310A (en) Method and device for updating pages in real time based on user operations
CN115756461A (en) Annotation template generation method, image identification method and device and electronic equipment
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN115033634A (en) Data acquisition method, data acquisition device, electronic equipment and medium
CN113326079A (en) Service version switching method, switching device, electronic equipment and storage medium
CN112860344A (en) Component processing method and device, electronic equipment and storage medium
CN110888583A (en) Page display method, system and device and electronic equipment
CN114510309B (en) Animation effect setting method, device, equipment and medium
CN114741064B (en) Page generation method, device and system and storage medium
CN112965699B (en) Front-end page generation method, device, computer system and readable storage medium
CN114417091A (en) Data screening method and device, electronic equipment and storage medium
CN115760087A (en) Method, device, equipment and storage medium for generating multi-format electronic certificate

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination