CN113779483A - Page component generation method and device, storage medium and computer equipment - Google Patents

Page component generation method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN113779483A
CN113779483A CN202111339162.4A CN202111339162A CN113779483A CN 113779483 A CN113779483 A CN 113779483A CN 202111339162 A CN202111339162 A CN 202111339162A CN 113779483 A CN113779483 A CN 113779483A
Authority
CN
China
Prior art keywords
component
page
function
data
target
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.)
Granted
Application number
CN202111339162.4A
Other languages
Chinese (zh)
Other versions
CN113779483B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111339162.4A priority Critical patent/CN113779483B/en
Publication of CN113779483A publication Critical patent/CN113779483A/en
Application granted granted Critical
Publication of CN113779483B publication Critical patent/CN113779483B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Abstract

The application discloses a page component generation method, a page component generation device, a storage medium and computer equipment, wherein the method comprises the steps of determining a target level of a current component to be generated in a component layout structure and a component creation function corresponding to the target level by acquiring page parameters of a target page; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure. Therefore, the multilayer layout structure of the page components can be determined according to the input page parameters of the target page; when the page component is created, the creation of all the page components in the target page can be automatically realized by calling the creating function of the page component, and the creating efficiency of the page component can be effectively improved.

Description

Page component generation method and device, storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a page component, a storage medium, and a computer device.
Background
With the continuous development of internet technology and the continuous increase of internet users, internet products are also developed vigorously. Because the internet products can bring huge flow, numerous manufacturers strive for internet resources. For example, advertisement resources in internet products are important resources that are continuously strived by various large manufacturers.
Compared with a method for rendering an advertisement page by adopting a browser, the local rendering of the operating system has the advantages of high speed, rich display components and the like, and gradually becomes an optimal advertisement rendering mode in an internet product.
However, through research, the inventor of the present application finds that, when the operating system is adopted to render the page locally, the efficiency of generating the page component is low at present.
Disclosure of Invention
The embodiment of the application provides a page component generation method, a page component generation device, a storage medium and computer equipment.
A first aspect of the present application provides a method for generating a page component, where the method includes:
acquiring a page parameter of a target page, wherein the structure of the page parameter indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels;
determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level;
determining an input parameter corresponding to the component creation function according to the page parameter;
creating a page component corresponding to the target hierarchy based on the component creation function and the input parameters, and generating an associated component creation function associated with the component creation function;
and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with the component layout structure.
Accordingly, a second aspect of the present application provides a page component generating apparatus, including:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring page parameters of a target page, the structure of the page parameters indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels;
the first determining unit is used for determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level;
the second determining unit is used for determining the input parameters corresponding to the component creating function according to the page parameters;
a first generating unit, configured to create a page component corresponding to the target hierarchy based on the component creating function and the input parameter, and generate an associated component creating function associated with the component creating function;
and the second generating unit is used for creating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with the component layout structure.
In some embodiments, the second generating unit includes:
the execution subunit is configured to, when the target hierarchy is not the termination hierarchy, update the target hierarchy to an association hierarchy associated with the target hierarchy, update the component creation function to the association component creation function, and return to the step of determining an input parameter corresponding to the component creation function according to the page parameter;
and the output subunit is used for outputting the page component set with the component layout structure when the target hierarchy is a termination hierarchy.
In some embodiments, the first generating unit includes:
the first determining subunit is used for determining an associated page component associated with the page component according to the component layout structure;
and the generating subunit is used for generating an association component creating function corresponding to the association page component.
In some embodiments, the apparatus further comprises:
the content data acquisition unit is used for acquiring component content data corresponding to the page component according to the page parameter;
the content data checking unit is used for carrying out data checking on the component content data;
and the content data filling unit is used for filling the content of the page component according to the component content data when the data verification result is qualified.
In some embodiments, the content data verification unit includes:
the first obtaining subunit is used for obtaining a component data check function of the page component;
the checking subunit is used for performing data checking on the component content data by adopting the component data checking function;
the first generating unit is further configured to:
generating an associated component data check function associated with the component data check function;
the execution subunit is further configured to:
and calling the associated component data verification function to perform data verification on the component content data of the associated page component.
In some embodiments, the content data padding unit includes:
the second acquisition subunit is used for acquiring a component content filling function of the page component;
the filling subunit is used for filling the component content data into the page component by adopting the component content filling function;
the first generating unit is further configured to:
generating an associated component content fill function associated with the component content fill function;
the execution subunit is further configured to:
and filling the component content data corresponding to the associated page component into the associated page component by adopting the associated component content filling function.
In some embodiments, the content data acquisition unit includes:
the second determining subunit is used for determining a content storage address corresponding to the page component according to the page parameter;
and the third acquisition subunit is used for acquiring the component content data of the page component from the content storage address.
In some embodiments, the content data verification unit includes:
a fourth obtaining subunit, configured to obtain a data format of the component content data;
and the third determining subunit is configured to determine that the verification result of the component content data is qualified when the data format matches a preset data format corresponding to the component content data.
In some embodiments, the apparatus further comprises:
the output format acquisition unit is used for acquiring a preset page data output format;
and the data conversion unit is used for performing data conversion on the page component filled with the data according to the output format to obtain page data corresponding to the page component.
In some embodiments, the data conversion unit includes:
a fifth obtaining subunit, configured to obtain a component data conversion function corresponding to the page component;
the conversion module is used for performing data conversion on the page component filled with the data by adopting the component data conversion function to obtain page data corresponding to the page component;
the first generating unit is further configured to:
generating an associated component data transformation function associated with the component data transformation function;
the execution subunit is further configured to:
and performing data conversion on the associated page component filled with data by adopting the associated component data conversion function.
The third aspect of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, where the instructions are suitable for being loaded by a processor to execute the steps in the page component generating method provided in the first aspect of the present application.
A fourth aspect of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps in the page component generation method provided in the first aspect of the present application when executing the computer program.
A fifth aspect of the present application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps in the page component generation method provided by the first aspect.
According to the page component generation method provided by the embodiment of the application, the page parameter of the target page is obtained, the structure of the page parameter indicates the component layout structure of the target page, and the component layout structure comprises at least two component layout levels; determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
Therefore, the page component generation method provided by the application can determine the multilayer layout structure of the page components according to the input page parameters of the target page, and each layer of page components in the multilayer layout structure of the page components have an association relationship; when the creating function of any page component is called to create the page component, the creating functions of other layers of page components can be automatically generated according to the incidence relation among the layers of components, and the creating functions of other layers of page components can be automatically called to create other layers of page components, so that the layer-by-layer creation of all the page components in the target page can be automatically realized; compared with the method for creating the page component by traversing each component parameter, the component creating method provided by the application can effectively improve the creating efficiency of the page component.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a scenario generated by a page component in the present application;
FIG. 2 is a flowchart illustrating a method for generating a page component according to the present application;
FIG. 3 is a schematic diagram of page parameters provided herein;
FIG. 4 is another schematic flow chart diagram illustrating a page component generation method provided by the present application;
FIG. 5 is another illustration of the page parameters provided herein;
FIG. 6 is a schematic diagram of a layout structure of page components provided by the present application;
FIG. 7 is a schematic structural diagram of a page component generating apparatus provided in the present application;
fig. 8 is a schematic structural diagram of a computer device provided in the present application.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a page component generation method and device, a computer readable storage medium and a terminal. The page component generation method can be used in a page component generation device. The page component generating apparatus may be integrated in a computer device, and the computer device may be a terminal or a server. The terminal can be a mobile phone, a tablet Computer, a notebook Computer, a smart television, a wearable smart device, a Personal Computer (PC), a vehicle-mounted terminal, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), big data and an artificial intelligence platform. Wherein a server may be a node in a blockchain.
Please refer to fig. 1, which is a schematic view of a scenario of a page component generating method provided in the present application. As shown in the figure, the computer device a acquires a page parameter from the computer device B, wherein the structure of the page parameter indicates a component layout structure of a target page, and the component layout structure comprises at least two component layout levels; determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
It should be noted that the schematic diagram of the page component generation scenario shown in fig. 1 is only an example, and the page component generation scenario described in the embodiment of the present application is for more clearly illustrating the technical solution of the present application, and does not constitute a limitation on the technical solution provided by the present application. As can be appreciated by those skilled in the art, with the evolution of the page component generation scene and the appearance of new business scenes, the technical solution provided by the present application is also applicable to similar technical problems.
Based on the above-described implementation scenarios, detailed descriptions will be given below.
In the related art, when a page component is generated according to a page parameter input by a user, a waterfall type generation mode is generally adopted, a component parameter list input by the user is traversed to construct each component content so as to generate the page component, and the efficiency of generating the page component by adopting the generation mode is low. In order to solve the above problems, the present application provides a page component generating method, which can determine a multilayer layout structure of a page component according to an input page parameter of a target page; when the page components are created according to the page parameters, the creation of all the page components in the target page can be automatically realized only by calling the creation function of one page component; compared with the method for creating the page component by traversing each component parameter, the method can effectively improve the generation efficiency of the page component.
The embodiments of the present application will be described from the perspective of a page component generating apparatus, which may be integrated in a computer device. The computer device may be a terminal or a server. The terminal can be a mobile phone, a tablet Computer, a notebook Computer, a smart television, a wearable smart device, a Personal Computer (PC), a vehicle-mounted terminal, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), big data and an artificial intelligence platform. As shown in fig. 2, a schematic flow chart of a page component generation method provided by the present application is shown, where the method includes:
step 101, obtaining page parameters of a target page.
The target page may be a page displayed on a display Interface of the electronic device, and specifically may be a Graphical User Interface (GUI) of an application program, an application icon display Interface of an operating system, a display Interface of a browser, and the like. Each target page corresponds to display content which needs to be displayed, and the display content can be browser webpage content, newspaper and magazine content, poster content or advertisement landing page content and the like.
There are various ways of generating a target page with corresponding display content. For example, when the target page is an advertisement landing page and a user clicks a poster link of an advertisement in a display interface of the terminal, the terminal can call a browser and open the poster link in the browser, and page data of the corresponding advertisement landing page is obtained and rendered for display; the terminal can also acquire page parameters corresponding to the advertisement landing page according to the poster link, directly generate a page component through an operating system according to the page parameters, and render and display the page component. The method for directly generating the page component and rendering and displaying the page component through the operating system does not need to additionally call other application programs, has higher page generation speed and can provide better use experience. In a scenario of generating a page component by an operating system, the embodiment of the present application provides a faster page component generation method compared to the related art.
In the embodiment of the application, when the page component corresponding to the target page is generated, the page parameter of the target page may be obtained first. The page parameters may include component layout structure information, component attribute data, and component content data of each page component corresponding to the target page. Wherein, the component layout structure information of the target page can be determined by the structure of the page parameter. Specifically, the page parameter of the target page may be a parameter input according to a preset layout structure rule, or the page parameter of the target page may be a parameter obtained by performing data processing on the input page parameter according to the preset layout structure rule.
As shown in fig. 3, which is a schematic diagram of page parameters provided in the embodiment of the present application, as shown in the diagram, the page parameters have a multi-layer parameter structure, a first layer is parameters corresponding to the component a, a second layer is parameters corresponding to the component a1 and the component a2, and a third layer is parameters corresponding to the components a11, a12, and a 21. The structure of the page parameter indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels, namely a component A is a first-layer page component corresponding to the target page; the component A1 and the component A2 are the next page components of the component A, namely the second page components; component A11 and component A12 are the next level page components of component A1, component A21 is the next level page component of component A2, and components A11, A12, and A21 are the third level page components of the target page. That is, the page parameter shown in fig. 3 corresponds to the component layout structure of the tree structure of a target page.
The page parameter shown in fig. 3 may be obtained by setting a page parameter structure in advance, and then performing data filling on the page parameter structure by a user. The method can also be used for acquiring page data input by a user in any form, and then performing layer-by-layer data extraction and arrangement on the page data input by the user to obtain the page parameters of the diagram.
Step 102, determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level.
In the embodiment of the application, the component layout structure of the page components forming the target page can be determined according to the acquired page parameters of the target page. Further, the page components of the target page may be quickly generated based on the component layout structure of the page components of the target page.
Specifically, when generating a page component corresponding to a target page, a target level where the page component that needs to be generated currently is located may be determined. For example, please continue to refer to fig. 3, if the current page component that needs to be generated is component a, the target level of the current component to be generated may be determined to be the first level; and if the current component needing to be generated is the component A1 or the component A2, determining that the target level of the current component to be generated is the second level. That is, in the embodiment of the present application, the page components may be generated from the first hierarchy, or may be generated from other hierarchies.
Then, a component creation function corresponding to the target hierarchy may be further determined. The number of the component creating functions can be one or more; when only one component to be generated of the target level exists, the component creating function corresponding to the target level can be one; when there are multiple components to be generated in the target level, the function created by the component corresponding to the target level can be multiple. That is, in this step, it is necessary to determine a component creating function corresponding to each component to be generated in the target hierarchy, so as to further generate a corresponding page component according to the component creating function corresponding to each component to be generated.
The component creating function corresponding to the target hierarchy may be obtained from a preset storage location, or may be generated based on the component creating function corresponding to the component of the associated hierarchy. In some embodiments, when the target hierarchy is the first hierarchy, the component creating function corresponding to the component to be generated may be a preset component creating function, and the component creating function corresponding to the component to be generated may be acquired from a preset storage location. When the target level is not the first level, generating a component creating function corresponding to the target level by the component creating function of the level higher than the target level; for example, when the target hierarchy is the third hierarchy, the component creating function corresponding to the target hierarchy may be generated by the component creating function of the second hierarchy.
And 103, determining input parameters corresponding to the component creation function according to the page parameters.
The target level corresponding to the component to be generated and the component creating function corresponding to the target level are determined, and the component creating function corresponding to the target level needs to be further referred to, so that the page component corresponding to the target level is generated according to the component creating function. Specifically, the input parameters required by the component creation function may include component attribute data and component content data corresponding to the component to be generated, where the component attribute data and the component content data corresponding to the component to be generated may be extracted from the page parameters.
Because one or more page component creating functions corresponding to the target hierarchy may be provided, and each page component creating function needs to be referred to generate a corresponding page component thereof, the input parameters corresponding to the page components may also be one or more. Specifically, when one page component creating function is corresponding to the target level, the page parameter corresponding to the page component creating function may be determined according to the page parameter; when a plurality of page component creation functions corresponding to the target hierarchy are provided, the input parameter corresponding to each page component creation function needs to be determined according to the page parameter.
And 104, creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function.
Determining the component creating function corresponding to the target level and the input parameter corresponding to each component creating function, and then transmitting the component creating function according to the input parameter corresponding to each component creating function, thereby realizing the creation of the page component corresponding to the target level.
In the embodiment of the application, an associated component creating function associated with the component creating function corresponding to the target hierarchy may be further generated according to the component layout structure. Generating an association component creation function associated with the component creation function, wherein the association component creation function may be an association component creation function for respectively generating each component creation function in at least one component creation function; for example, continuing to refer to fig. 3, when the target level is the second level, the component creation functions are the component creation function corresponding to the component a1 and the component creation function corresponding to the component a2, and at this time, if the associated component creation functions associated with the component creation functions are the component creation functions corresponding to the component a11, the component a12, and the component a21, the associated component creation functions of the component a1 and the component a2 need to be generated respectively. Generating an associated component creation function associated with the component creation function, or generating a component creation function associated with at least one component creation function; for example, when the target hierarchy is the third hierarchy and the component creation function is a component creation function corresponding to the component a11, the component a12, and the component a21, if the associated component creation function is a component creation function corresponding to the component a1 and the component a2 at this time, the associated component creation function needs to be generated together from a plurality of component creation functions corresponding to the target hierarchy.
In the embodiment of the present application, the association relationship between the component creating function corresponding to the target hierarchy and the associated component creating function may be determined according to the component layout structure, or may be specifically set according to the requirement.
In some embodiments, generating an associated component creation function associated with the component creation function comprises:
1. determining an associated page component associated with the page component according to the component layout structure;
2. and generating an association component creating function corresponding to the association page component.
In the embodiment of the application, the associated page component associated with the page component corresponding to the target hierarchy can be determined according to the component layout structure. Specifically, one or more page components of a next level of each page component corresponding to the target level can be obtained from the component layout structure, the one or more page components of the next level of each page component are determined to be related page components, and then a related component creation function corresponding to the related page components is generated; or acquiring the page component of the previous level of each page component corresponding to the target level from the component layout structure, determining the page component of the previous level of each page component as an associated page component, and then generating an associated component creation function corresponding to the associated page component.
In some embodiments, generating an associated component creation function associated with the component creation function comprises:
A. determining an association level associated with a target level based on the component layout structure;
B. determining an associated page component corresponding to the associated hierarchy;
C. and generating an association component creation function of the association page component.
In the embodiment of the application, an association level associated with the target level can be determined according to the component layout structure, then the page component corresponding to the association level is determined to be the association page component, and an association component creation function of the association page component is further generated. Determining an association level associated with the target level according to the component layout structure, wherein the association level may be a next level of the target level, an upper level of the target level, a second level below the target level, and the like; that is, the above association relationship may be defined by itself based on the component layout structure, and is not limited herein. For example, taking the second level below the target level as the associated level for detailed description, please continue referring to fig. 3, assuming that the target level is the first level, i.e. the level where the component a is located, and the associated level is the third level, i.e. the levels where the components a11, a12 and a21 are located, it can be determined that the associated page components of the page component a are the components a11, a12 and a21, and then the component creation functions corresponding to the page components a11, a12 and a21 can be further generated.
And 105, generating a related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
As can be seen from the foregoing description, the page component generating apparatus may further generate an associated component creating function associated with the component creating function while creating the page component using the component creating function and its corresponding input parameters. After the association component creating function is generated, the association component associated with the page component can be further created according to the association component creating function and the input parameter corresponding to the association component creating function, and the component creating function associated with the association component creating function is further generated until the creation of each layer of components in the component layout structure is completed, so that the page component set with the component layout structure is obtained. It can be understood that the input parameters corresponding to each page component creation function can be obtained from the page parameters.
In some embodiments, the association component creating function associated with the component creating function may create functions for components corresponding to all components of the component layout structure except the target hierarchy, and all page components except the page component corresponding to the target hierarchy may be created by using the association component creating function and the page parameter, so as to obtain a page component set having the component layout structure.
In some embodiments, generating an associated page component of the page component based on the associated component creation function and the page parameter comprises:
1. when the target level is not the termination level, updating the target level to an association level associated with the target level, updating the component creation function to an association component creation function, and returning to execute the step of determining the input parameters corresponding to the component creation function according to the page parameters;
2. when the target level is a termination level, outputting a page component set with a component layout structure.
In the embodiment of the application, after the page component of the target level corresponding to the component to be generated is created each time, the target level is subjected to termination detection. When the target level is determined to be the termination level according to the detection result, determining that the creation of the page component of the target page is completed, and obtaining a page component set with the page component layout structure; and when the target hierarchy is determined not to be the termination hierarchy according to the detection result, generating a page component corresponding to the association layer according to the generated association component creating function.
Specifically, the page component corresponding to the association layer is generated according to the generated association component creation function, the target hierarchy may be updated to the association hierarchy associated with the target hierarchy, the component creation function may be updated to the association component creation function, then the step of determining the input parameter corresponding to the component creation function according to the page parameter is performed, the page component corresponding to the target hierarchy is created based on the component creation function and the input parameter, and the step of generating the association component creation function associated with the component creation function is performed sequentially.
And then, carrying out next termination detection again, and determining whether to continue to circularly generate the page components of the new level according to the new termination detection result until the termination detection result indicates that the target level is the termination level.
Wherein the setting of the termination hierarchy may correspond to an association relationship between hierarchies. For example, when the initial level is the first level, the associated level is the next level of the target level, and the device layout structure has five levels in total, then when the target level is the fifth level, the target level is determined to be the end level. Or, when the initial level is the fifth level and the association level is the level higher than the target level, determining that the target level is the termination level when the target level is the first level. Of course, when the relationship between the target hierarchy and the associated hierarchy is set in other manners, the corresponding termination hierarchy or the determination manner of the termination hierarchy may also be determined, and will not be described in detail here.
In some embodiments, after the step of creating the page component corresponding to the target hierarchy based on the component creation function and the input parameter, the method may further include:
A. acquiring component content data corresponding to the page component according to the page parameter;
B. performing data verification on the component content data;
C. and when the data verification result is qualified, filling the content of the page component according to the component content data.
In the embodiment of the present application, the page component created based on the component creation function and the input parameter is only a container of a display component for displaying content of the target page, and further content filling needs to be performed on the generated page component when the display component corresponding to the target page is completely generated. Specifically, component content data corresponding to the page component may be obtained from the page parameter, then data verification is performed on the obtained component content data, and when the data verification result is qualified, content filling is performed on the page component according to the component content data, so as to obtain each display component of the target page.
In the embodiment of the application, the steps of obtaining component content data corresponding to the page component, performing data verification on the component content data, and performing content filling on the page component when the data verification is qualified are executed after the page component is created. Because the creation of the page component is a cyclic process, after the creation of the page component of the target level is completed, when the target level is not the termination level, the page component corresponding to the association level of the target level needs to be cyclically created, and therefore, in the embodiment of the present application, the processes of obtaining and verifying the content data of the page component and filling the content into the page component may also be repeatedly executed along with the cyclic process of the creation of the page component.
In some embodiments, after all page components of the target page are created to obtain a page component set with a component layout structure, component content data corresponding to each page component is obtained from page parameters, then data verification is performed on each component content data, and after all data verification is qualified, data filling is performed on each page component one by one.
In some embodiments, obtaining component content data corresponding to a page component according to a page parameter includes:
a1, determining a content storage address corresponding to the page component according to the page parameter;
a2, obtaining the component content data of the page component from the content storage address.
In the embodiment of the present application, since the data amount of the component content data corresponding to the page component is large, for example, the component content data corresponding to some page components may include data such as video or audio, and if all of these data are stored in the page parameter, the data amount of the page parameter is very large. In the generation process of the page component, the page parameter needs to be called for many times, and if the data volume of the page parameter is too large, the generation efficiency of the page component is greatly influenced.
Therefore, in the embodiment of the present application, the content storage address corresponding to the page component may be recorded in the page parameter, and the component content data corresponding to the page component is stored in the content storage address corresponding to the page component. When the component content data of the page component needs to be acquired in the page component generating process, the content storage address corresponding to the page component can be determined from the page parameter, and then the component content data of the page component can be acquired from the content storage address. Therefore, the problem that the calling efficiency is reduced due to overlarge data quantity of the page parameters and the generation efficiency of the page components is influenced can be avoided; thereby, the generation efficiency of the page component can be improved.
In some embodiments, performing a data check on the component content data comprises:
b1, acquiring the data format of the component content data;
and B2, when the data format is matched with the preset data format corresponding to the component content data, determining that the verification result of the component content data is qualified.
In this embodiment of the present application, the page component generation apparatus acquires component content data corresponding to the page component from a content storage address corresponding to the page component, and may further acquire a data format of the acquired component content data. It is understood that different component content data should have their corresponding standard data format, which may be a preset data format. If the data format of the component content data is not matched with the corresponding preset data format, display abnormality occurs when the target page is rendered and displayed. Therefore, the data format of each component content data needs to be matched with the corresponding preset data format, and when the data format corresponding to the component content data is matched with the preset data format, the verification result of the component content data can be determined to be qualified.
In some embodiments, performing data check on the component content data may further include:
b3, acquiring a component data check function of the page component;
b4, performing data verification on the component content data by adopting a component data verification function;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component data check function associated with the component data check function;
the steps of updating the target hierarchy to an association hierarchy associated with the target hierarchy and updating the component creation function to an association component creation function further comprise:
and updating the component data check function into an associated component data check function.
In the embodiment of the application, the component content data corresponding to the page component is obtained from the page parameter, and a component data check function corresponding to the page component can be further obtained. Similar to the obtaining of the component creating function corresponding to the page component, the component data check function corresponding to the page component may also be obtained from a preset storage area, or may also be generated by the data check function corresponding to another component associated with the page component. And further carrying out data verification on the component content data corresponding to the page component by using a component data verification function corresponding to the page component. In the embodiment of the present application, the process of verifying the component content data by using the component data verification function may also be performed circularly along with the component creation process, that is, after the creation of a page component of a hierarchy is completed, the data verification function corresponding to each page component is obtained, and the component content data corresponding to each page component is determined from the page parameters, so as to perform data verification on the component content data of the page component of the hierarchy.
In some embodiments, content populating a page component according to component content data includes:
c1, acquiring a component content filling function of the page component;
c2, filling the component content data into the page component by adopting a component content filling function;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component content fill function associated with the component content fill function;
the steps of updating the target hierarchy to an association hierarchy associated with the target hierarchy and updating the component creation function to an association component creation function further comprise:
the component content fill function is updated to an associated component content fill function.
In the embodiment of the application, when the data verification is performed on the component content data of the page component and the data verification result is determined to be qualified, the component content filling function corresponding to the page component can be further obtained, and the component content data corresponding to the page component is filled into the page component by adopting the component content filling function. In this embodiment, the content filling of the page component may also be performed along with the creation process of the page component, and each time it is determined that the component content data corresponding to one page component is verified to be qualified, the component content data corresponding to the page component is filled into the page component by using the component content filling function corresponding to the page component.
In some embodiments, after the content filling of the page component according to the component content data, the method may further include:
a. acquiring a preset page data output format;
b. and performing data conversion on the page assembly filled with the data according to the page data output format to obtain page data corresponding to the page assembly.
The content filling is carried out on the page components to obtain display components corresponding to the target page, and the display components can be directly rendered and displayed to display the target page in a display interface; the display components can also be saved, so that the target page can be directly rendered and displayed by calling the display components when the target page needs to be displayed.
In this embodiment of the application, before storing the page component after data filling, a preset page data output format may be obtained, where the preset page data output format may be a data format convenient for a computer device to parse, and then data conversion is performed on the page component after data filling according to the preset page data output format, so as to obtain page data corresponding to the page component.
In some embodiments, the data transformation of the data-populated page component according to the page data output format includes:
b1, acquiring a component data conversion function corresponding to the page component;
b2, performing data conversion on the page assembly filled with the data by adopting an assembly data conversion function to obtain page data corresponding to the page assembly;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component data transformation function associated with the component data transformation function;
the steps of updating the target hierarchy to an association hierarchy associated with the target hierarchy and updating the component creation function to an association component creation function further comprise:
and updating the component data conversion function into the related component data conversion function.
In the embodiment of the application, after the created page component is subjected to data filling, a component data conversion function corresponding to the page component can be further obtained, and then the page component subjected to data filling is subjected to data conversion by using the component data conversion function, so that page data corresponding to the page component is obtained. In this embodiment, the data conversion of the page component after the data filling by using the component data conversion function may also be performed circularly along with the data filling process, and after a page component of a hierarchy is created, data verification, data filling, and data conversion may be performed on the page component of the hierarchy to obtain page data corresponding to the page component.
In some embodiments, after the page components are subjected to data filling, data conversion is performed on each page component subjected to data filling one by one, so as to obtain page data corresponding to the target page.
According to the above description, the page component generation method provided in the embodiment of the present application obtains the page parameter of the target page, where the structure of the page parameter indicates the component layout structure of the target page, and the component layout structure includes at least two component layout levels; determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
Therefore, the page component generating method provided by the application can determine the multilayer layout structure of the page components according to the input page parameters of the target page, and because of the space between each layer of page components in the multilayer layout structure of the page components; when the creating function of any component of the page is called to create the page component, the creating functions of other layers of page components can be automatically generated according to the incidence relation among the components of each layer, and the creating functions of other layers of page components can be automatically called to create other layers of page components, so that the layer-by-layer creation of all the page components in the target page can be automatically realized; compared with the method for creating the page component by traversing each component parameter, the component creating method provided by the application can effectively improve the creating efficiency of the page component.
Moreover, when the page component is created by adopting the method of creating the page component by traversing each component parameter waterfall type, some information is often required to be hard-coded to ensure the normal display of the page component. For example, when processing a paging structure, it is necessary to hard-code paging information into the traversal process; in some complex structured page components, some information also needs to be hard-coded to ensure the adaptation between the subcomponents of the page component. Therefore, the coupling degree between the page components is high, the reuse rate is low, and the efficiency is low when the components are added or adjusted and maintained. According to the page component generation method, the page component creation process is processed in a layering mode through the combination mode, so that the page components are decoupled, and subsequent new addition and maintenance of the page components are facilitated.
The application also provides a page component generation method, which can be used in computer equipment, wherein the computer equipment can be a terminal or a server. As shown in fig. 4, another schematic flow chart of the page component generation method provided by the present application is provided, where the method specifically includes:
step 201, a computer device obtains a page parameter of a target page.
The computer device may receive the page parameter of the target page from other computer devices, or may obtain the page parameter of the target page from a storage area preset in the computer device. In the embodiment of the present application, the page parameter also has a certain parameter structure, and the parameter structure may be a multi-layer structure shown in fig. 3. The multi-level structure indicates a multi-level component structure that constitutes a target page, the multi-level component structure including a top-level component and at least one lower-level component. In the embodiment of the present application, a top-level component is taken as an example for description. As shown in fig. 5, another schematic diagram of the page parameter provided by the present application is shown, and as shown in the diagram, the page parameter indicates that the component layout structure of the target page is a tree layout structure with the canvas component as the top-level component. The next level of the page list component comprises at least one display page component, and the next level of each display page component comprises at least one display element component. The display element components can be components corresponding to display elements such as texts, images, audio, videos or floating controls; the global component is a component independent from each display page, such as a functional component, a menu component, and the like.
The page parameters may be input in the format illustrated in fig. 5, or may be input in other data formats, for example, the page parameters may be input in a Json (JS Object Notation) format.
In step 202, the computer device invokes a component creation function in the canvas class to create a canvas component and generates a page list class based on the page parameters.
The computer device obtains the page parameters of the target page, and can generate the page components according to the obtained page parameters. In the embodiment of the application, the function class of the top page component, namely the canvas component, can be directly called, and then all levels of page components are generated step by step based on the canvas class and the page parameters. The class is a set representing a plurality of objects, the class in the application is a set of a plurality of functions, each class comprises four function functions, and the four function functions are respectively a component creation function (init), a parameter check function (CheckParam), a data filling function (Fill) and a data conversion function. Each component corresponds to a class containing the four functions, the class corresponding to the top-level canvas component is a canvas class, the canvas class can be preset, and the class of each other component can be generated based on the class of the component at the previous layer. The inside of each page component class can store a protobuf (Google Protocol Buffers) structure for storing the field structure of the page component, the protobuf is a set of method developed by Google for serializing a data structure, and can be used as a communication Protocol, a data storage format and the like.
The computer device first calls a component creating function in the canvas class to generate a top-level canvas component, and then obtains information of a next-level component of the canvas component from the page parameters, for example, a page list component and a global component are provided, and certainly, the global component is not provided. And then generating a corresponding class corresponding to the component according to the next-layer component information of the canvas component acquired from the page parameter. If the next layer of the canvas component only has one page list component, generating a page list class; and if the next layer of the canvas component has one page list component and one global component, generating a page list class and a global class.
In step 203, the computer device calls a component creating function in the page list class to create a page list component, and generates at least one display page class based on the page parameters.
Further, the computer device may invoke the component creation function in the previously generated page list class to create the page list component. Then, the computer device may determine that the next layer of the page list includes several display pages from the page parameters, and then generate display page classes corresponding to the several display pages one by one.
Of course, if the next layer of the canvas component includes the global component, after the global class is generated, a component creating function in the global class may be called to create the global component, and further, it is determined from the page parameters that the next layer of the global component includes several display element components, and then, a display element class corresponding to each display element component is generated according to the global class.
In step 204, the computer device calls a component creating function in each display page class to create each display page component, and generates a plurality of display element classes contained in each display page component based on the page parameters.
And generating at least one display page class according to the page list class and the page parameters, and further calling a component creating function in each display page class to create a display page component corresponding to the display page class. And further determining that the next layer of each display page comprises a plurality of display element components according to the page parameters, and then generating a display element class corresponding to each display element component according to the display page classes. The display element classes may include a video class, a text class, an image class, and the like.
In step 205, the computer device invokes a component creation function in each display element class to create a display element component.
The computer device can further call a component creating function in each display element class to create each display element component, thereby completing the creation of each component structure in the page component corresponding to the target page.
Step 206, the computer device calls the parameter checking function in the function class corresponding to each page component layer by layer to perform parameter checking on the page component.
The above steps only complete the creation of each page component structure in the target page, and the obtained page components are only containers without component contents. To complete the page components, further content population of these page components is required.
In order to avoid display abnormality when rendering and displaying the page assembly after data filling due to assembly content errors, parameter check needs to be performed on content parameters corresponding to each assembly before content filling is performed on the created page assembly.
In the embodiment of the application, the parameter check is performed on each page component, which may be to call a parameter check function in a class corresponding to each page component step by step, determine an input parameter corresponding to each page component, and then check the input parameter of the page component by using the parameter check function of each page component to obtain a parameter check result.
Specifically, the computer device can obtain the input parameters of the canvas assembly from the page parameters, and then call a parameter check function in the canvas class to perform parameter check on the input parameters of the canvas assembly to obtain a check result; the check function in the canvas class may then further call a parameter check function in a next level component class of canvas components, for example, a parameter check function in a page list class may be called. The parameter checking function in the page list class can acquire the input parameters corresponding to the page list component from the page parameters and perform parameter checking on the input parameters corresponding to the page list component.
And then, calling the parameter checking function in each component class layer by layer according to the mode, checking the input parameter corresponding to each page component, and obtaining a checking result of checking the input parameter of each page component. The input parameter of each page component is checked, which may be checking the format of the input parameter, for example, when the parameter to be input is size data, determining whether the input parameter is in a digital format; or when the parameter needing to be input is video data, judging whether the input parameter is in a video format or not.
Step 207, when the parameter is qualified, the computer device calls the data filling function corresponding to each page component layer by layer to perform data filling on the page components, so as to obtain the page components after data filling.
In the embodiment of the present application, when the result of the parameter check performed on each page component is qualified, it may be determined that the parameter check is qualified. The page components may then be further data-populated to populate the component content data of each page component into the page components. Specifically, the computer device may call a data stuffing function in a canvas class corresponding to the top canvas component, acquire an input parameter corresponding to the canvas component from the page parameter, and stuff component content data in the input parameter into the canvas component to obtain the canvas component after data stuffing. Further, the data filling function in the canvas class can further call the data filling function in the page list class, acquire the input parameters corresponding to the page list component from the page parameters, and fill the component content data in the input parameters corresponding to the page list component into the page list component.
And then, calling the data filling function in each component class layer by layer according to the mode, and filling data in each page component to obtain the page component after data filling, so as to finish the page component generating process of the target page.
Further, after the page components of the target page are generated, the page components may be rendered by the computer device to display the target page, or the page components may be stored in a preset data format, so that the data may be directly parsed and rendered to display the target page when the page components need to be displayed in the following. Thus, data conversion needs to be performed on each page component to generate page data corresponding to the target page.
Specifically, the computer device may call a data transformation function in a canvas class corresponding to the canvas component, and then transfer the data transformation function into a target object carrying page data, where the data transformation function in the canvas class writes the data of the canvas component into the target object, and further calls a data transformation function in a page list class corresponding to the page list component. And writing the data in the page list components into the target object by the data conversion function in the page list class, and continuously calling the data conversion function in the component class corresponding to the next layer of components until the data conversion of all the page components is completed.
The page component generation method provided by the present application is further described in detail below with a specific example. As shown in fig. 6, it is a schematic diagram of a layout structure of a page component corresponding to an input parameter. In the embodiment of the application, for any native advertisement landing page of the operating system, a corresponding display page of the canvas component for generating the advertisement landing page is corresponding. Therefore, a canvas class corresponding to a canvas component can be preset, and comprises four functions: the canvas class is stored in a protobuf structure by int functions, CheckParam functions, Fill functions and ToJson functions. Each component in the page component layout structure corresponds to a class, and each class comprises the four functions.
When the computer device receives the input parameters of the advertisement landing page in the Json format and the advertisement landing page component generation instruction, the canvas class of the canvas component can be called, and then the page component set of the component layout structure shown in fig. 6 is generated layer by layer. Specifically, after receiving the input parameters, the computer device calls an int function in the canvas class, and extracts the attribute data of the canvas component from the input parameters as the input parameters of the int function, thereby generating the canvas component 10 in the component layout structure shown in fig. 6. The computer device can further determine next-level sub-components, namely a page list component and a global component, contained in the canvas component according to the input parameters, and generate a page list class and a global class corresponding to the page list component. After the computer device calls the int function in the canvas class and generates the canvas component 10 by combining the attribute data of the canvas component included in the input parameter, the computer device automatically triggers and calls the int function in the page list class and the global class, and generates the page list component 11 and the global component 12 shown in fig. 6 by combining the attribute data of each component included in the input parameter. Then, by analogy, all page components in the page component layout structure shown in fig. 6 can be generated layer by layer.
So, after receiving the page component generation instruction and the input parameter of the advertisement landing page, the computer equipment only needs to call the canvas class corresponding to the top layer canvas component, so that the component layout structure with the structure shown in fig. 6 can be automatically generated layer by layer, and the generation efficiency of the page component is greatly improved.
The detailed steps of the page component layout structure generation process shown in fig. 6 are as follows:
when the computer device receives the input parameters of the advertisement landing page in the Json format and the advertisement landing page component generation instruction, the canvas class of the canvas component can be called, and then the page component set of the component layout structure shown in fig. 6 is generated layer by layer. The specific treatment steps are as follows:
a. a page parameter (in _ param) is received.
b. Invoking a canvas class and creating the canvas component 10 in FIG. 6 in combination with the page parameters; as the canvas component comprises 1 page list component and 1 global component according to the data in the page parameters, the page list class and the global class can be further generated. The page list class and the global class also comprise respective int functions, CheckParam functions, Fill functions and ToJson functions, and are stored in a protobuf structure.
c. And calling an int function in the canvas class, and transmitting a page parameter int (in _ param) to initialize the canvas component. Then, the int function of the canvas component may also call the int functions of the page list component and the global component, and the generated page list component 11 and the global component 12 are saved in the canvas component 10 as sub-components. While generating the page list component 11, determining a next-layer component of the page list component from the page parameters, and generating a class corresponding to the next-layer component; the next level component is also determined when the global component 12 is generated and its corresponding class is generated. Then, the int function in the page list class calls the int function in the class corresponding to the next-layer component to generate the next-layer component corresponding to the int function, that is, the first display page component 111 and the second display page component 112. The int function in the global class also calls the int function in the class corresponding to the component at the next layer to generate the component at the next layer, namely the floating button component 121 and the web view component 122.
And by analogy, generating a class corresponding to the next-layer component while generating a component, and then calling an int function in the class corresponding to the next-layer component to generate the next-layer component. That is, the int function in the class corresponding to the first display page component can also call the int function in the class corresponding to the next layer component to generate the first video component 1111, the image component 1112 and the application download component 1113. The int function in the class corresponding to the second display page component may also call the int function in the class corresponding to the next layer component to generate a second video component 1121 and a sliding component 1122.
d. And calling a CheckParam function in the canvas class, and checking the component parameters of the canvas component. And then calling a CheckParam function in a class corresponding to the next-layer component by the function, checking the component parameters of the next-layer component, and repeating the steps until the parameter checking of all the components is completed.
e. And calling a Fill function in the canvas class, and performing data filling on the canvas component. And then calling the Fill function in the class corresponding to the next-layer component, and performing data filling on the next-layer component by analogy until the data filling of all the components is completed.
f. And calling a ToJson function in the canvas class, and transmitting the data in the canvas component into an object out _ json for bearing the data. The object is automatically generated when the ToJson function is called, and the data in the canvas component is written into the object and stored in the canvas component. Then the ToJson function in the canvas class further calls the ToJson function in the class corresponding to the next-layer component, transmits the ToJson function into the corresponding object, writes the data of the next-layer component into the object, and stores the data in the next-layer component. And so on until the data for each component is written to the corresponding object.
Each component corresponds to a class, and therefore the class corresponding to each component can also form the structure shown in fig. 6. The top class can generate and call the lower class, and the lower component is generated when the lower class is called. Therefore, the generation of the whole advertisement landing page assembly can be completed only by calling the top layer type, namely the canvas type.
According to the above description, in the page component generation method provided by the application, the computer device obtains the page parameters of the target page; calling a component creating function in the canvas class to create a canvas component, and generating a page list class based on page parameters; calling a component creating function in the page list class to create a page list component, and generating at least one display page class based on page parameters; calling a component creating function in each display page class to create each display page component, and generating a plurality of display element classes contained in each display page component based on page parameters; calling a component creating function in each display element class to create a display element component; calling a parameter checking function in a function class corresponding to each page component layer by layer to perform parameter checking on the page components; and when the parameter is qualified, calling a data filling function corresponding to each page component layer by layer to fill data in the page components to obtain the page components after data filling.
Therefore, when the computer equipment needs to generate the page component corresponding to the target page according to the acquired page parameters, the function class of the top canvas component is only needed to be called, so that the function classes of other layers of page components can be generated layer by layer according to the incidence relation among the page components, and then all the page components corresponding to the target page can be generated layer by layer quickly, and the generation efficiency of the page components is greatly improved.
In order to better implement the method, the embodiment of the present application further provides a page component generating apparatus, which may be integrated in a terminal or a server.
For example, as shown in fig. 7, for a schematic structural diagram of a page component generating apparatus provided in an embodiment of the present application, the page component generating apparatus may include an obtaining unit 301, a first determining unit 302, a second determining unit 303, a first generating unit 304, and a second generating unit 305, as follows:
an obtaining unit 301, configured to obtain a page parameter of a target page, where a structure of the page parameter indicates a component layout structure of the target page, and the component layout structure includes at least two component layout levels;
a first determining unit 302, configured to determine a target level of a component to be currently generated in a component layout structure and a component creating function corresponding to the target level;
a second determining unit 303, configured to determine an input parameter corresponding to the component creation function according to the page parameter;
a first generating unit 304, configured to create a page component corresponding to the target hierarchy based on the component creating function and the input parameter, and generate an associated component creating function associated with the component creating function;
the second generating unit 305 is configured to create an associated page component of the page component according to the associated component creating function and the page parameter, and obtain a page component set having a component layout structure.
In some embodiments, the second generating unit comprises:
the execution subunit is used for updating the target hierarchy to an associated hierarchy associated with the target hierarchy and updating the component creation function to an associated component creation function when the target hierarchy is not the termination hierarchy, and returning to execute the step of determining the input parameters corresponding to the component creation function according to the page parameters;
and the output subunit is used for outputting the page component set with the component layout structure when the target hierarchy is the termination hierarchy.
In some embodiments, the first generating unit includes:
the first determining subunit is used for determining an associated page component associated with the page component according to the component layout structure;
and the generating subunit is used for generating an association component creating function corresponding to the association page component.
In some embodiments, the page component generating apparatus provided by the present application further includes:
the content data acquisition unit is used for acquiring component content data corresponding to the page component according to the page parameter;
the content data checking unit is used for carrying out data checking on the component content data;
and the content data filling unit is used for filling the content of the page component according to the component content data when the data verification result is qualified.
In some embodiments, the content data verification unit includes:
the first acquiring subunit is used for acquiring a component data check function of the page component;
the checking subunit is used for carrying out data checking on the component content data by adopting a component data checking function;
a first generating unit further configured to:
generating an associated component data check function associated with the component data check function;
an execution subunit further to:
and calling a related component data verification function, and performing data verification on the component content data of the related page component.
In some embodiments, a content data padding unit includes:
the second acquisition subunit is used for acquiring a component content filling function of the page component;
the filling subunit is used for filling the component content data into the page component by adopting a component content filling function;
a first generating unit further configured to:
generating an associated component content fill function associated with the component content fill function;
an execution subunit further to:
and filling the component content data corresponding to the associated page component into the associated page component by adopting an associated component content filling function.
In some embodiments, the content data acquisition unit includes:
the second determining subunit is used for determining a content storage address corresponding to the page component according to the page parameter;
and the third acquisition subunit is used for acquiring the component content data of the page component from the content storage address.
In some embodiments, the content data verification unit includes:
a fourth acquiring subunit, configured to acquire a data format of the component content data;
and the third determining subunit is used for determining that the verification result of the component content data is qualified when the data format is matched with the preset data format corresponding to the component content data.
In some embodiments, the page component generating apparatus provided by the present application further includes:
the output format acquisition unit is used for acquiring a preset page data output format;
and the data conversion unit is used for performing data conversion on the page assembly filled with the data according to the output format to obtain page data corresponding to the page assembly.
In some embodiments, a data translation unit, comprises:
the fifth acquiring subunit is used for acquiring a component data conversion function corresponding to the page component;
the conversion module is used for performing data conversion on the page component filled with the data by adopting a component data conversion function to obtain page data corresponding to the page component;
a first generating unit further configured to:
generating an associated component data transformation function associated with the component data transformation function;
an execution subunit further to:
and performing data conversion on the associated page component filled with the data by using an associated component data conversion function.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above description, in the page component generation apparatus provided in this embodiment of the application, the obtaining unit 301 obtains a page parameter of a target page, where a structure of the page parameter indicates a component layout structure of the target page, and the component layout structure includes at least two component layout levels; the first determining unit 302 determines a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; the second determining unit 303 determines an input parameter corresponding to the component creation function according to the page parameter; the first generation unit 304 creates a page component corresponding to the target hierarchy based on the component creation function and the input parameter, and generates an associated component creation function associated with the component creation function; the second generating unit 305 generates an associated page component of the page component according to the associated component creation function and the page parameter, resulting in a page component set having a component layout structure.
Therefore, the page component generation method provided by the application can determine the multilayer layout structure of the page components according to the input page parameters of the target page, and each layer of page components in the multilayer layout structure of the page components have an association relationship; when the creating function of the page component is called to create the page component, the creating functions of other layers of page components can be automatically generated according to the incidence relation among the layers of components, and the creating functions of other layers of page components can be automatically called to create other layers of page components, so that the layer-by-layer creation of all the page components in the target page can be automatically realized; compared with the method for creating the page component by traversing each component parameter, the component creating method provided by the application can effectively improve the creating efficiency of the page component.
An embodiment of the present application further provides a computer device, where the computer device may be a terminal or a server, and as shown in fig. 8, is a schematic structural diagram of the computer device provided in the present application. Specifically, the method comprises the following steps:
the computer device may include components such as a processing unit 401 of one or more processing cores, a storage unit 402 of one or more storage media, a power module 403, and an input module 404. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 8 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processing unit 401 is a control center of the computer device, connects various parts of the entire computer device by using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the storage unit 402 and calling data stored in the storage unit 402, thereby performing overall monitoring of the computer device. Optionally, the processing unit 401 may include one or more processing cores; preferably, the processing unit 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It is to be understood that the above-described modem processor may not be integrated into the processing unit 401.
The storage unit 402 may be used to store software programs and modules, and the processing unit 401 executes various functional applications and data processing by running the software programs and modules stored in the storage unit 402. The storage unit 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, web page access, and the like), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the storage unit 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory unit 402 may also include a memory controller to provide the processing unit 401 access to the memory unit 402.
The computer device further comprises a power module 403 for supplying power to each component, and preferably, the power module 403 is logically connected to the processing unit 401 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The power module 403 may also include one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and any other components.
The computer device may also include an input module 404, the input module 404 operable to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processing unit 401 in the computer device loads the executable file corresponding to the process of one or more application programs into the storage unit 402 according to the following instructions, and the processing unit 401 runs the application programs stored in the storage unit 402, so as to implement various functions as follows:
acquiring page parameters of a target page, wherein the structure of the page parameters indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels; determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
It should be noted that the computer device provided in the embodiment of the present application and the method in the foregoing embodiment belong to the same concept, and specific implementation of the above operations may refer to the foregoing embodiment, which is not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present invention provide a computer-readable storage medium having stored therein a plurality of instructions, which can be loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
acquiring page parameters of a target page, wherein the structure of the page parameters indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels; determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level; determining an input parameter corresponding to the component creation function according to the page parameter; creating page components corresponding to the target hierarchy based on the component creating function and the input parameters, and generating an associated component creating function associated with the component creating function; and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with a component layout structure.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any method provided by the embodiment of the present invention, the beneficial effects that can be achieved by any method provided by the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
According to an aspect of the application, there is provided, among other things, a computer program product or computer program comprising computer instructions stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementation modes of the page component generation method.
The page component generating method, device, storage medium and computer device provided by the embodiments of the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. A method for generating page components, the method comprising:
acquiring a page parameter of a target page, wherein the structure of the page parameter indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels;
determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level;
determining an input parameter corresponding to the component creation function according to the page parameter;
creating a page component corresponding to the target hierarchy based on the component creation function and the input parameters, and generating an associated component creation function associated with the component creation function;
and generating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with the component layout structure.
2. The method of claim 1, wherein generating the associated page component of the page components based on the associated component creation function and the page parameters comprises:
when the target level is not a termination level, updating the target level to an association level associated with the target level, updating the component creation function to the association component creation function, and returning to execute the step of determining the input parameter corresponding to the component creation function according to the page parameter;
outputting a set of page components having the component layout structure when the target level is a termination level.
3. The method of claim 2, wherein after creating the page component corresponding to the target level based on the component creation function and the input parameter, further comprising:
acquiring component content data corresponding to the page component according to the page parameter;
performing data verification on the component content data;
and when the data verification result is qualified, filling the content of the page component according to the component content data.
4. The method of claim 3, wherein the data verifying the component content data comprises:
acquiring a component data check function of the page component;
performing data verification on the component content data by adopting the component data verification function;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component data check function associated with the component data check function;
the step of updating the target hierarchy to an associated hierarchy associated with the target hierarchy and the component creation function to the associated component creation function further comprises:
and updating the component data check function to the associated component data check function.
5. The method of claim 4, wherein the content populating the page component according to the component content data comprises:
acquiring a component content filling function of the page component;
filling the component content data into the page component by adopting the component content filling function;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component content fill function associated with the component content fill function;
the step of updating the target hierarchy to an associated hierarchy associated with the target hierarchy and the component creation function to the associated component creation function further comprises:
updating the component content fill function to the associated component content fill function.
6. The method according to claim 3, wherein the obtaining component content data corresponding to the page component according to the page parameter comprises:
determining a content storage address corresponding to the page component according to the page parameter;
and acquiring the component content data of the page component from the content storage address.
7. The method of claim 6, wherein the data verifying the component content data comprises:
acquiring a data format of the component content data;
and when the data format is matched with a preset data format corresponding to the component content data, determining that the verification result of the component content data is qualified.
8. The method of claim 3, wherein after the content populating the page component according to the component content data, further comprising:
acquiring a preset page data output format;
and performing data conversion on the page assembly filled with the data according to the page data output format to obtain page data corresponding to the page assembly.
9. The method of claim 8, wherein the data translating the data-filled page component according to the output format comprises:
acquiring a component data conversion function corresponding to the page component;
performing data conversion on the page assembly filled with the data by adopting the assembly data conversion function to obtain page data corresponding to the page assembly;
the step of generating an associated component creation function associated with the component creation function further comprises:
generating an associated component data transformation function associated with the component data transformation function;
the step of updating the target hierarchy to an associated hierarchy associated with the target hierarchy and the component creation function to the associated component creation function further comprises:
and updating the component data conversion function to the related component data conversion function.
10. The method of claim 1, wherein generating an associated component creation function associated with the component creation function comprises:
determining an associated page component associated with the page component according to the component layout structure;
and generating an association component creating function corresponding to the association page component.
11. An apparatus for generating a page component, the apparatus comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring page parameters of a target page, the structure of the page parameters indicates a component layout structure of the target page, and the component layout structure comprises at least two component layout levels;
the first determining unit is used for determining a target level of a current component to be generated in the component layout structure and a component creating function corresponding to the target level;
the second determining unit is used for determining the input parameters corresponding to the component creating function according to the page parameters;
a first generating unit, configured to create a page component corresponding to the target hierarchy based on the component creating function and the input parameter, and generate an associated component creating function associated with the component creating function;
and the second generating unit is used for creating the related page component of the page component according to the related component creating function and the page parameter to obtain a page component set with the component layout structure.
12. A computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the page assembly generating method according to any one of claims 1 to 10.
13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the page component generation method of any one of claims 1 to 10 when executing the computer program.
14. A computer program product comprising computer programs/instructions, characterized in that said computer programs/instructions, when executed by a processor, implement the steps in the page component generation method of any of claims 1 to 10.
CN202111339162.4A 2021-11-12 2021-11-12 Page component generation method and device, storage medium and computer equipment Active CN113779483B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111339162.4A CN113779483B (en) 2021-11-12 2021-11-12 Page component generation method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111339162.4A CN113779483B (en) 2021-11-12 2021-11-12 Page component generation method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN113779483A true CN113779483A (en) 2021-12-10
CN113779483B CN113779483B (en) 2022-02-08

Family

ID=78873884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111339162.4A Active CN113779483B (en) 2021-11-12 2021-11-12 Page component generation method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN113779483B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013246A1 (en) * 2007-04-27 2009-01-08 Bea Systems, Inc. Web based application constructor using extensibility points for page components, page layouts/templates, security roles, shells, and associating data spaces with templates
CN107844299A (en) * 2017-12-01 2018-03-27 浪潮软件股份有限公司 A kind of implementation method of Web application development tools
CN108228188A (en) * 2018-01-08 2018-06-29 武汉斗鱼网络科技有限公司 A kind of view component processing method, electronic equipment and readable storage medium storing program for executing
CN112416418A (en) * 2020-08-13 2021-02-26 上海哔哩哔哩科技有限公司 Application component generation method and device, computer equipment and readable storage medium
CN113126990A (en) * 2021-04-22 2021-07-16 北京京东振世信息技术有限公司 Page development method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013246A1 (en) * 2007-04-27 2009-01-08 Bea Systems, Inc. Web based application constructor using extensibility points for page components, page layouts/templates, security roles, shells, and associating data spaces with templates
CN107844299A (en) * 2017-12-01 2018-03-27 浪潮软件股份有限公司 A kind of implementation method of Web application development tools
CN108228188A (en) * 2018-01-08 2018-06-29 武汉斗鱼网络科技有限公司 A kind of view component processing method, electronic equipment and readable storage medium storing program for executing
CN112416418A (en) * 2020-08-13 2021-02-26 上海哔哩哔哩科技有限公司 Application component generation method and device, computer equipment and readable storage medium
CN113126990A (en) * 2021-04-22 2021-07-16 北京京东振世信息技术有限公司 Page development method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113779483B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN110795195B (en) Webpage rendering method and device, electronic equipment and storage medium
CN109445784B (en) Method and device for processing structure data, storage medium and electronic equipment
CN111240777B (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
CN111459610B (en) Model deployment method and device
CN113791765B (en) Resource arrangement method, device and equipment of cloud service and storage medium
CN107479873A (en) A kind of APP page modules melt forwarding method, electronic equipment and storage medium
CN111506300A (en) Applet generation method, device, equipment and storage medium
CN115510347A (en) Presentation file conversion method and device, electronic equipment and storage medium
CN113742014A (en) Interface rendering method and device, electronic equipment and storage medium
CN112860247B (en) Custom generation method, device, equipment and medium of model component
CN112650804B (en) Big data access method, device, system and storage medium
CN113900650A (en) Data processing method and device, electronic equipment and readable storage medium
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN106844763B (en) A kind of method showed to the Internet media file formula of modifying and its device
CN113535541A (en) Test method, test device, storage medium and computer equipment
CN113779483B (en) Page component generation method and device, storage medium and computer equipment
CN117234582A (en) Project code processing method and device, electronic equipment and storage medium
CN107506597A (en) Medical files acquisition methods, terminal and server
CN115811481A (en) Interactive service testing method and device, computer equipment and storage medium
CN113419806B (en) Image processing method, device, computer equipment and storage medium
CN117376660A (en) Subtitle element rendering method, device, equipment, medium and program product
CN112764802A (en) Business logic customization method and device, electronic equipment and storage medium
CN114499759B (en) Message generation method and device, electronic equipment and storage medium
US11487931B1 (en) Replaying a webpage based on virtual document object model
CN115729655A (en) Data rendering method and device, electronic equipment and medium

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
GR01 Patent grant
GR01 Patent grant