CN113467775A - Method and device for generating page - Google Patents

Method and device for generating page Download PDF

Info

Publication number
CN113467775A
CN113467775A CN202010245452.1A CN202010245452A CN113467775A CN 113467775 A CN113467775 A CN 113467775A CN 202010245452 A CN202010245452 A CN 202010245452A CN 113467775 A CN113467775 A CN 113467775A
Authority
CN
China
Prior art keywords
service
page
parameter
configuration information
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010245452.1A
Other languages
Chinese (zh)
Inventor
陈文锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010245452.1A priority Critical patent/CN113467775A/en
Publication of CN113467775A publication Critical patent/CN113467775A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for generating a page, and relates to the technical field of computers. One embodiment of the method comprises: receiving and analyzing a service request to obtain service parameters; acquiring configuration information of a page template corresponding to the service request; the business parameters are entered into the calling request to call a service interface, so that a returned exit result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page. The implementation method can solve the technical problem of low page development efficiency.

Description

Method and device for generating page
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a page.
Background
The existing business system needs to realize page information display and interaction according to business processes and personalized requirements by hard coding, and comprises front-end display component elements and a back-end calling service interface. Therefore, page display generally realizes the calling of a service interface through coding, performs various logic conversions according to service logic, and performs page layout and style coding development by combining service personnel or product prototype diagrams, and finally realizes the page information display of various service systems.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) the back end calls a code which needs to be customized according to business requirements, calls an external service interface, and performs related judgment, processing and conversion according to business logic, and each business logic unit is developed in a customized manner, so that the development efficiency is low;
2) the customized front-end style design and coding are required to be carried out on the page display layer according to the page prototype, so that repeated development is caused, and the development efficiency is low;
3) the developed page cannot be embedded at multiple ends or called by multiple external systems due to problems of layout, interaction or style, and needs to be adjusted for different ends, so that reusability is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a page, so as to solve the technical problem of low page development efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of generating a page, including:
receiving and analyzing a service request to obtain service parameters;
acquiring configuration information of a page template corresponding to the service request;
the business parameters are entered into the calling request to call a service interface, so that a returned exit result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, before receiving and analyzing the service request and obtaining the service parameter, the method further includes:
registering a service interface and storing registration information of the service interface;
the registration information comprises a service type, a service name, a service description, an interface name, a method name, timeout time and configuration parameters.
Optionally, after registering the service interface, the method further includes:
storing the parameter entering information and parameter exiting information of the service interface in a configuration mode;
the parameter entering information comprises a service type, a service name, a parameter script and parameter conversion; the parameter information comprises service type, service name, parent attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
Optionally, before receiving and analyzing the service request and obtaining the service parameter, the method further includes:
storing the configuration information of each page template in a configuration mode;
the configuration information of the page template comprises a template type, a template name and configuration information of each component element in the page template; the template type comprises a native component, a basic component and a business component; the configuration information of the component element comprises an attribute classification, an attribute data type and an attribute value expression; the attribute data type includes a service type and a basic data type.
Optionally, the service parameter is entered into a calling request to call a service interface, so as to receive a returned exit result; mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page, including:
for each page template, judging the template type of the page template;
if the model type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template to generate a page;
if the template type of the page template is a service component, the service parameter is entered into a calling request to call a service interface, so that a returned participation result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the service parameter is entered into a calling request to call a service interface, so as to receive a returned exit result; mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page, including:
acquiring attribute data types of all component elements of the page template;
for each component element, judging the attribute data type of the component element;
if the attribute data type of the component element is a basic data type, performing attribute filling according to the configuration information of the component element to generate a page;
if the attribute data type of the component element is a service data type, the service parameter is entered into a calling request to call a service interface, so that a returned parameter-exiting result is received; mapping the parameter result to the configuration information of the component element; and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the service parameter is entered into a calling request to call a service interface, so as to receive a returned exit result; mapping the parameter result to the configuration information of the component element, including:
acquiring registration information, access information and access information of a service interface corresponding to the service request;
performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface;
receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value;
mapping the data value to an attribute value expression of the component element.
Optionally, performing attribute filling according to the mapped configuration information to generate a page, including:
and gradually adding the mapped configuration information of each component element of the page template into a hypertext markup language structure one by one, refreshing and displaying the page.
Optionally, after the generating the page, the method further includes:
and transferring the generated page to a parent page of the service system through calling of a parent page and a child page of the PostMessage function and parameter transfer.
In addition, according to another aspect of the embodiments of the present invention, there is provided an apparatus for generating a page, including:
the receiving module is used for receiving and analyzing the service request to obtain service parameters;
the acquisition module is used for acquiring the configuration information of the page template corresponding to the service request;
the generating module is used for participating the business parameters into a calling request to call a service interface so as to receive a returned participation result; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Further comprising a configuration module for:
receiving and analyzing a service request, registering a service interface before obtaining service parameters, and storing registration information of the service interface;
the registration information comprises a service type, a service name, a service description, an interface name, a method name, timeout time and configuration parameters.
Optionally, the configuration module is further configured to:
storing the parameter entering information and parameter exiting information of the service interface in a configuration mode;
the parameter entering information comprises a service type, a service name, a parameter script and parameter conversion; the parameter information comprises service type, service name, parent attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
Optionally, the configuration module is further configured to:
receiving and analyzing a service request, and storing configuration information of each page template in a configuration mode before obtaining service parameters;
the configuration information of the page template comprises a template type, a template name and configuration information of each component element in the page template; the template type comprises a native component, a basic component and a business component; the configuration information of the component element comprises an attribute classification, an attribute data type and an attribute value expression; the attribute data type includes a service type and a basic data type.
Optionally, the generating module is further configured to:
for each page template, judging the template type of the page template;
if the model type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template to generate a page;
if the template type of the page template is a service component, the service parameter is entered into a calling request to call a service interface, so that a returned participation result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the generating module is further configured to:
acquiring attribute data types of all component elements of the page template;
for each component element, judging the attribute data type of the component element;
if the attribute data type of the component element is a basic data type, performing attribute filling according to the configuration information of the component element to generate a page;
if the attribute data type of the component element is a service data type, the service parameter is entered into a calling request to call a service interface, so that a returned parameter-exiting result is received; mapping the parameter result to the configuration information of the component element; and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the generating module is further configured to:
acquiring registration information, access information and access information of a service interface corresponding to the service request;
performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface;
receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value;
mapping the data value to an attribute value expression of the component element.
Optionally, the generating module is further configured to:
and gradually adding the mapped configuration information of each component element of the page template into a hypertext markup language structure one by one, refreshing and displaying the page.
Optionally, the generating module is further configured to:
after the page is generated, the generated page is transmitted to a father page of a service system through calling of a father page and a son page of a PostMessage function and transmission of parameters.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because the technical means that the business parameters are entered into the calling request to call the service interface so as to receive the returned participation result, then the participation result is mapped to the configuration information of the page template, and the attribute is filled according to the mapped configuration information so as to generate the page is adopted, the technical problem of low page development efficiency in the prior art is solved. The embodiment of the invention realizes flexible calling of the service by configuring the service interface, realizes the personalized page by configuring the page template, does not need to carry out additional service calling logic coding and front-end page design and coding, improves the page development efficiency, and can configure different page styles, layouts, display attributes and the like according to the requirements of different ends and different external service systems, thereby realizing the maximum reusability of the page plug-in.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of generating a page according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a registration service interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of service interface registration information according to an embodiment of the present invention;
FIG. 4 is a schematic illustration of join management according to an embodiment of the invention;
FIG. 5 is a schematic diagram of configuring embedded reference information according to an embodiment of the invention;
FIG. 6 is a schematic illustration of an out-of-participation management in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of configuring parameter information according to an embodiment of the invention;
FIG. 8 is a schematic diagram of a configuration page template according to an embodiment of the invention;
FIG. 9 is a schematic diagram of configuration information of a page template according to an embodiment of the invention;
FIG. 10 is a diagram of various component elements on a page template, according to an embodiment of the invention;
FIG. 11 is a schematic diagram of configuration component elements according to an embodiment of the invention;
FIG. 12 is a schematic diagram of configuration information for component elements according to an embodiment of the invention;
FIG. 13 is a diagram showing a main flow of a method of generating a page according to a referential embodiment of the present invention;
FIG. 14 is a diagram showing the main flow of a method of generating a page according to another referential embodiment of the present invention;
FIG. 15 is a schematic diagram of the main modules of an apparatus for generating pages according to an embodiment of the present invention;
FIG. 16 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 17 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method of generating a page according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the method for generating a page may include:
step 101, receiving and analyzing a service request to obtain a service parameter.
And receiving a service request transmitted by the service system, and analyzing the service request to obtain service parameters. In order to participate in the call request, a service interface, which may be a third-party service provision, such as a JSF service, an HTTP rest service, or a local method service, needs to be registered before step 101. A JSF service is a remote call service (RPC) framework. HTTP rest service: based on a software architecture standard of http protocol, REST, Representational State Transfer (REST for short), is a software architecture style proposed by Roy Fielding doctor in his doctor paper in 2000. The method is a design and development mode aiming at network application, can reduce the development complexity and improve the scalability of a system. Local method service: refers to a tool or business logic function realized by java code in the service orchestration system.
Optionally, before step 101, further comprising: registering a service interface and storing registration information of the service interface; the registration information comprises a service type, a service name, a service description, an interface name, a method name, timeout time and configuration parameters. As shown in fig. 2, a plurality of service interfaces may be registered in advance. As shown in fig. 3, the registration information of the service interface may include a service type (such as a JSF service or a native service, etc.), a service chinese name, a service description, an interface name, a method name, an interface alias, a timeout time, and a configuration parameter (such as a token captcha). Optionally, the registration information of the service interface is stored in a database table.
Optionally, after registering the service interface, the method further includes: and storing the parameter entering information and parameter exiting information of the service interface in a configuration mode. The parameter entering information comprises a service type, a service name, a parameter script and parameter conversion; the parameter information comprises service type, service name, parent attribute, mapping expression, mapping name, mapping key value, data type and result conversion. As shown in fig. 4-7, the parameter information and parameter information of each service interface are stored in a database table by way of configuration. As shown in fig. 5, the parameter information may include a service type, a service chinese name, a parameter script (including a parameter type and a character string name of the substitute content), and a parameter conversion (including a parameter name, a parameter key, and the substitute content). As shown in fig. 7, the parameter information includes a service type, a service chinese name, a parent attribute, a mapping expression, a mapping name, a mapping key, a data type, and a result conversion (including an actual value and a converted value).
The embodiment of the invention can flexibly configure and analyze the access and the exit of the service, improve the development speed and the development efficiency of external service calling, and support various service calling, including JSF service, HTTP service, local method service and the like.
Optionally, configuration information of each page template on the configuration page is also needed before step 101. Specifically, before step 101, the method further includes: storing the configuration information of each page template in a configuration mode; the configuration information of the page template comprises a template type, a template name and configuration information of each component element in the page template; the template type comprises a native component, a basic component and a business component; the configuration information of the component element comprises an attribute classification, an attribute data type and an attribute value expression; the attribute data type includes a service type and a basic data type.
As shown in fig. 8-10, the configuration information for each page template includes the template type (such as native component, base component, and business component), the template name, the template remark, and the configuration information for the various component elements in the page template. As shown in fig. 11-12, the configuration information of each component element includes the attribute, the attribute name, the attribute classification (html attribute types such as tips, class, style, attrs, etc.), the attribute data type (Service data type such as Service, basic data type of JavaScript language such as Dynamic, String, Number, Boolean, Array, Object, etc.), whether it is necessary, and the attribute value expression.
And the research personnel stores various element types, element layouts, element styles and the like in the page in a database table in a data form according to business requirements, so that the page configuration is completed. The page template is also stored after attribute configuration of all component elements of the page is completed by research personnel in a page configuration function, data values of the component elements are expressed by keys defined in advance, and data values in a parameter result object returned by a service interface in an actual rendering process are matched and replaced. In the embodiment of the invention, the page development can be directly combined and configured based on the basic component library and the business components, the element display layout, the style and the interaction can be flexibly realized, and the whole page development efficiency and the page component reuse rate are improved.
And 102, acquiring the configuration information of the page template corresponding to the service request.
It should be noted that, before step 102, the corresponding relationship between each service request and the page in the service system also needs to be configured, and each page is composed of a plurality of page templates, so that the configuration information of each page template on the page corresponding to the service request is obtained by analyzing the service request.
103, participating the service parameter into a calling request to call a service interface so as to receive a returned participation result; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
In this step, the service parameters obtained by parsing in step 101 are entered into a call request to call the registered service interface, so as to receive an exit result returned by the service interface. And mapping the parameter output result to the configuration information of the page template, and finally performing attribute filling by the rendering component according to the mapped configuration information so as to generate the page.
Optionally, for each page template, judging the template type of the page template; if the model type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template to generate a page; if the template type of the page template is a service component, the service parameter is entered into a calling request to call a service interface, so that a returned participation result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page. In the embodiment of the invention, if the page template is a native component or a basic component, a service interface does not need to be called, so that the attribute filling can be directly carried out according to the configuration information of the configured page template, and the page is generated.
Optionally, the service parameter is entered into a calling request to call a service interface, so as to receive a returned exit result; mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page, including: acquiring attribute data types of all component elements of the page template; for each component element, judging the attribute data type of the component element; if the attribute data type of the component element is a basic data type, performing attribute filling according to the configuration information of the component element to generate a page; if the attribute data type of the component element is a service data type, the service parameter is entered into a calling request to call a service interface, so that a returned parameter-exiting result is received; mapping the parameter result to the configuration information of the component element; and performing attribute filling according to the mapped configuration information to generate a page. Each page template comprises a plurality of component elements, if the template type of the page template is a service component, the attribute data type of each component element in the page template needs to be further judged, and if the attribute data type of the component element is a basic data type such as Dynamic, String, Number, Boolean, Array or Object, a service interface does not need to be called, so that the attribute filling can be directly carried out according to the configuration information of the configured component elements, and the page is generated. If the attribute data type of the component element is a Service data type such as Service, a corresponding Service interface needs to be called, then the returned parameter output result is mapped into the configuration information of the component element, and attribute filling is carried out according to the mapped configuration information, so that a page is generated.
Optionally, the service parameter is entered into a calling request to call a service interface, so as to receive a returned exit result; mapping the parameter result to the configuration information of the component element, including: acquiring registration information, access information and access information of a service interface corresponding to the service request; performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface; receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value; mapping the data value to an attribute value expression of the component element. And if the attribute data type of the component element is a service data type such as service, acquiring the registration information, the participation information and the participation information of the service interface. For example, a service interface a, http:// _ jd.com/services/a and b service interface http:// _ jd.com/services/b are registered in advance, and the service request is http:// _ jd.com/services/b, then the registration information, the parameter entering information and the parameter leaving information of the service interface a corresponding to the service request are obtained, and the converted service parameters are entered and referred to the call request to call the service interface a. And obtaining a parameter result by calling a service interface, mapping and converting the parameter result to obtain a data value, and finally mapping the data value to the attribute value expression of the component element.
Optionally, performing attribute filling according to the mapped configuration information to generate a page, including: and gradually adding the mapped configuration information of each component element of the page template into a hypertext markup language structure one by one, refreshing and displaying the page. And after the configuration information of each component element of the page template is obtained, the configuration information is gradually added into a hypertext markup language (THML) structure one by one through a rendering component, and then the page is refreshed and displayed. Specifically, the configuration information of each component element can be added to the THML structure step by step through the VUE framework, and the browser analyzes and displays the configuration information according to the html protocol. VUE: js is a set of progressive frameworks that build user interfaces. Unlike other heavyweight frames, Vue employs a design developed in bottom-up increments.
Optionally, after the generating the page, the method further includes: and transferring the generated page to a parent page of the service system through calling of a parent page and a child page of the PostMessage function and parameter transfer. The embodiment of the invention realizes the reutilization of multiple terminals and different external service systems based on the parent-child page calling and parameter transmission of the PostMessage.
The embodiment of the invention realizes flexible configuration and arrangement of different service interface calls by using a configured service arrangement technology, and realizes service logic; the display layout, the interaction mode, the style and the like of the front-end page can realize flexible configuration of the page according to the configured page component elements, CSS style attributes, display field mapping and the like; different page styles, layouts, display attributes and the like can be configured by different terminals and different external service systems according to the requirements of the different terminals and the different external service systems, and the maximum reusability of the page plug-in is realized.
According to the various embodiments described above, it can be seen that the technical means of the embodiments of the present invention receiving the returned participating result by participating the service parameter in the call request to call the service interface, then mapping the participating result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate the page solves the technical problem of low page development efficiency in the prior art. The embodiment of the invention realizes flexible calling of the service by configuring the service interface, realizes the personalized page by configuring the page template, does not need to carry out additional service calling logic coding and front-end page design and coding, improves the page development efficiency, and can configure different page styles, layouts, display attributes and the like according to the requirements of different ends and different external service systems, thereby realizing the maximum reusability of the page plug-in.
Fig. 13 is a diagram illustrating a main flow of a method of generating a page according to a referential embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 13, the method for generating a page may include:
step 1, obtaining a rendering component.
Step 2, acquiring configuration information of each page template on the page; the configuration information of each page template includes template types (such as native components, basic components and business components), template names, template remarks and configuration information of each component element in the page template. The configuration information of each component element comprises the attribute, the attribute name, the attribute classification (html attribute types such as tips, class, style, attrs and the like), the attribute data type (Service data type such as Service and the like, basic data type of JavaScript language such as Dynamic, String, Number, Boolean, Array, Object and the like), the necessity or not and the attribute value expression of the component element.
Step 3, judging the template type of each page template;
if the template type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template;
if the template type of the page template is a business component, the attribute data type of each component element in the page template is continuously judged.
Step 4, judging the attribute data type of each component element;
if the attribute data type of the component element is a basic data type (such as Dynamic, String, Number, Boolean, Array, or Object), performing attribute filling according to the configuration information of the component element;
if the attribute data type of the component element is a Service data type (such as Service), step 5-step 8 are executed.
And step 5, acquiring the registration information, the participation information and the participation information of the service interface corresponding to the service request.
And 6, performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface.
And 7, receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value.
Step 8, mapping the data value to the attribute value expression of the component element (i.e. attribute filling).
And 9, calculating the configuration information of each component element of the page template by the rendering component, and gradually adding the configuration information into the hypertext markup language structure one by one.
And step 10, refreshing and displaying the page.
The embodiment of the invention is based on the service arrangement technology, namely, the service calling is flexibly realized by configuring JSF service, HTTP remote service, local method service and the like, and the personalized page is realized by combining the page configuration technology of customizable page elements, styles and layouts.
In addition, in a reference embodiment of the present invention, the detailed implementation of the method for generating a page is described in detail above, so that the repeated description is not repeated here.
Fig. 14 is a schematic diagram of a main flow of a method of generating a page according to another referenceable embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 14, the flow of the service call may include:
acquiring registration information, access information and access information of each service interface;
analyzing the access parameter carried by the service request based on the registration information and the access parameter information, and judging the service type (such as JSF service, HTTP remote service, local method service and the like);
calling a corresponding service interface according to the judgment result so as to receive a returned parameter output result;
and performing attribute mapping on the parameter output result based on the parameter output information so as to return a service calling result.
In addition, in a reference embodiment of the present invention, the detailed implementation of the method for generating a page is described in detail above, so that the repeated description is not repeated here.
Fig. 15 is a schematic diagram of main blocks of an apparatus for generating a page according to an embodiment of the present invention, and as shown in fig. 15, the apparatus 1500 for generating a page includes a receiving module 1501, an obtaining module 1502, and a generating module 1503; the receiving module 1501 is configured to receive and analyze a service request to obtain a service parameter; the obtaining module 1502 is configured to obtain configuration information of a page template corresponding to the service request; the generating module 1503 is configured to add the service parameter to the call request to call a service interface, so as to receive a returned parameter output result; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Further comprising a configuration module for:
receiving and analyzing a service request, registering a service interface before obtaining service parameters, and storing registration information of the service interface;
the registration information comprises a service type, a service name, a service description, an interface name, a method name, timeout time and configuration parameters.
Optionally, the configuration module is further configured to:
storing the parameter entering information and parameter exiting information of the service interface in a configuration mode;
the parameter entering information comprises a service type, a service name, a parameter script and parameter conversion; the parameter information comprises service type, service name, parent attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
Optionally, the configuration module is further configured to:
receiving and analyzing a service request, and storing configuration information of each page template in a configuration mode before obtaining service parameters;
the configuration information of the page template comprises a template type, a template name and configuration information of each component element in the page template; the template type comprises a native component, a basic component and a business component; the configuration information of the component element comprises an attribute classification, an attribute data type and an attribute value expression; the attribute data type includes a service type and a basic data type.
Optionally, the generating module 1503 is further configured to:
for each page template, judging the template type of the page template;
if the model type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template to generate a page;
if the template type of the page template is a service component, the service parameter is entered into a calling request to call a service interface, so that a returned participation result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the generating module 1503 is further configured to:
acquiring attribute data types of all component elements of the page template;
for each component element, judging the attribute data type of the component element;
if the attribute data type of the component element is a basic data type, performing attribute filling according to the configuration information of the component element to generate a page;
if the attribute data type of the component element is a service data type, the service parameter is entered into a calling request to call a service interface, so that a returned parameter-exiting result is received; mapping the parameter result to the configuration information of the component element; and performing attribute filling according to the mapped configuration information to generate a page.
Optionally, the generating module 1503 is further configured to:
acquiring registration information, access information and access information of a service interface corresponding to the service request;
performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface;
receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value;
mapping the data value to an attribute value expression of the component element.
Optionally, the generating module 1503 is further configured to:
and gradually adding the mapped configuration information of each component element of the page template into a hypertext markup language structure one by one, refreshing and displaying the page.
Optionally, the generating module 1503 is further configured to:
after the page is generated, the generated page is transmitted to a father page of a service system through calling of a father page and a son page of a PostMessage function and transmission of parameters.
According to the various embodiments described above, it can be seen that the technical means of the embodiments of the present invention receiving the returned participating result by participating the service parameter in the call request to call the service interface, then mapping the participating result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate the page solves the technical problem of low page development efficiency in the prior art. The embodiment of the invention realizes flexible calling of the service by configuring the service interface, realizes the personalized page by configuring the page template, does not need to carry out additional service calling logic coding and front-end page design and coding, improves the page development efficiency, and can configure different page styles, layouts, display attributes and the like according to the requirements of different ends and different external service systems, thereby realizing the maximum reusability of the page plug-in.
It should be noted that, in the implementation of the apparatus for generating a page according to the present invention, the method for generating a page has been described in detail above, and therefore, the repeated content is not described again.
Fig. 16 shows an exemplary system architecture 1600 to which the method of generating a page or the apparatus for generating a page of an embodiment of the invention may be applied.
As shown in fig. 16, the system architecture 1600 may include terminal devices 1601, 1602, 1603, a network 1604, and a server 1605. The network 1604 is the medium used to provide communications links between the terminal devices 1601, 1602, 1603 and the server 1605. The network 1604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables.
A user may interact with a server 1605 over a network 1604 using terminal devices 1601, 1602, 1603 to receive or send messages, etc. The terminal devices 1601, 1602, 1603 may have various messaging client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like (for example only).
The terminal devices 1601, 1602, 1603 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1605 may be a server that provides various services, such as a background management server (for example only) that supports shopping websites browsed by users using the terminal devices 1601, 1602, 1603. The background management server may analyze and otherwise process the received data such as the item information query request, and feed back a processing result (for example, target push information, item information — just an example) to the terminal device.
It should be noted that the method for generating a page provided by the embodiment of the present invention is generally executed by the server 1605, and accordingly, the apparatus for generating a page is generally disposed in the server 1605. The method for generating the page provided by the embodiment of the present invention may also be executed by the terminal devices 1601, 1602, 1603, and accordingly, the apparatus for generating the page may be disposed in the terminal devices 1601, 1602, 1603.
It should be understood that the number of terminal devices, networks, and servers in fig. 16 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 17, shown is a block diagram of a computer system 1700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 17 is only an example, and should not bring any limitation to the functions and the range of use of the embodiment of the present invention.
As shown in fig. 17, the computer system 1700 includes a Central Processing Unit (CPU)1701 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1702 or a program loaded from a storage portion 1708 into a Random Access Memory (RAM) 1703. In the RAM1703, various programs and data required for the operation of the system 1700 are also stored. The CPU 1701, ROM 1702, and RAM1703 are connected to each other through a bus 1704. An input/output (I/O) interface 1705 is also connected to bus 1704.
The following components are connected to the I/O interface 1705: an input section 1706 including a keyboard, a mouse, and the like; an output portion 1707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1708 including a hard disk and the like; and a communication section 1709 including a network interface card such as a LAN card, a modem, or the like. The communication section 1709 performs communication processing via a network such as the internet. A driver 1710 is also connected to the I/O interface 1705 as necessary. A removable medium 1711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1710 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1709, and/or installed from the removable media 1711. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an obtaining module, and a generating module, where the names of the modules do not in some cases constitute a limitation on the modules themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: receiving and analyzing a service request to obtain service parameters; acquiring configuration information of a page template corresponding to the service request; the business parameters are entered into the calling request to call a service interface, so that a returned exit result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
According to the technical scheme of the embodiment of the invention, because the technical means that the business parameters are entered into the calling request to call the service interface so as to receive the returned participation result, then the participation result is mapped into the configuration information of the page template, and the attribute filling is carried out according to the mapped configuration information so as to generate the page is adopted, the technical problem of low page development efficiency in the prior art is solved. The embodiment of the invention realizes flexible calling of the service by configuring the service interface, realizes the personalized page by configuring the page template, does not need to carry out additional service calling logic coding and front-end page design and coding, improves the page development efficiency, and can configure different page styles, layouts, display attributes and the like according to the requirements of different ends and different external service systems, thereby realizing the maximum reusability of the page plug-in.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of generating a page, comprising:
receiving and analyzing a service request to obtain service parameters;
acquiring configuration information of a page template corresponding to the service request;
the business parameters are entered into the calling request to call a service interface, so that a returned exit result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
2. The method of claim 1, wherein before receiving and parsing the service request to obtain the service parameters, further comprising:
registering a service interface and storing registration information of the service interface;
the registration information comprises a service type, a service name, a service description, an interface name, a method name, timeout time and configuration parameters.
3. The method of claim 2, wherein after registering the service interface, further comprising:
storing the parameter entering information and parameter exiting information of the service interface in a configuration mode;
the parameter entering information comprises a service type, a service name, a parameter script and parameter conversion; the parameter information comprises service type, service name, parent attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
4. The method of claim 1, wherein before receiving and parsing the service request to obtain the service parameters, further comprising:
storing the configuration information of each page template in a configuration mode;
the configuration information of the page template comprises a template type, a template name and configuration information of each component element in the page template; the template type comprises a native component, a basic component and a business component; the configuration information of the component element comprises an attribute classification, an attribute data type and an attribute value expression; the attribute data type includes a service type and a basic data type.
5. The method of claim 1, wherein the business parameter is enlisted in a call request to call a service interface to receive a returned enlisted result; mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page, including:
for each page template, judging the template type of the page template;
if the model type of the page template is a native component or a basic component, performing attribute filling according to the configuration information of the page template to generate a page;
if the template type of the page template is a service component, the service parameter is entered into a calling request to call a service interface, so that a returned participation result is received; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
6. The method of claim 5, wherein the business parameter is enlisted in a call request to call a service interface to receive a returned enlisted result; mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page, including:
acquiring attribute data types of all component elements of the page template;
for each component element, judging the attribute data type of the component element;
if the attribute data type of the component element is a basic data type, performing attribute filling according to the configuration information of the component element to generate a page;
if the attribute data type of the component element is a service data type, the service parameter is entered into a calling request to call a service interface, so that a returned parameter-exiting result is received; mapping the parameter result to the configuration information of the component element; and performing attribute filling according to the mapped configuration information to generate a page.
7. The method of claim 6, wherein the business parameter is enlisted in a call request to call a service interface to receive a returned enlisted result; mapping the parameter result to the configuration information of the component element, including:
acquiring registration information, access information and access information of a service interface corresponding to the service request;
performing parameter conversion on the service parameters according to the parameter entering information, and entering the converted service parameters into a calling request to call the service interface;
receiving a parameter output result returned by the service interface, and mapping and converting the parameter output result according to the parameter output information to obtain a data value;
mapping the data value to an attribute value expression of the component element.
8. The method of claim 1, wherein performing attribute population according to the mapped configuration information to generate a page comprises:
and gradually adding the mapped configuration information of each component element of the page template into a hypertext markup language structure one by one, refreshing and displaying the page.
9. The method of claim 1, after generating the page, further comprising:
and transferring the generated page to a parent page of the service system through calling of a parent page and a child page of the PostMessage function and parameter transfer.
10. An apparatus for generating a page, comprising:
the receiving module is used for receiving and analyzing the service request to obtain service parameters;
the acquisition module is used for acquiring the configuration information of the page template corresponding to the service request;
the generating module is used for participating the business parameters into a calling request to call a service interface so as to receive a returned participation result; and mapping the parameter result to the configuration information of the page template, and performing attribute filling according to the mapped configuration information to generate a page.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-9.
CN202010245452.1A 2020-03-31 2020-03-31 Method and device for generating page Pending CN113467775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010245452.1A CN113467775A (en) 2020-03-31 2020-03-31 Method and device for generating page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010245452.1A CN113467775A (en) 2020-03-31 2020-03-31 Method and device for generating page

Publications (1)

Publication Number Publication Date
CN113467775A true CN113467775A (en) 2021-10-01

Family

ID=77865484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010245452.1A Pending CN113467775A (en) 2020-03-31 2020-03-31 Method and device for generating page

Country Status (1)

Country Link
CN (1) CN113467775A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113849103A (en) * 2021-10-13 2021-12-28 京东科技信息技术有限公司 Object model mapping method and device
CN114296789A (en) * 2022-03-09 2022-04-08 太平金融科技服务(上海)有限公司深圳分公司 Business processing method, device, equipment and storage medium based on full-flow configuration
CN114629703A (en) * 2022-03-14 2022-06-14 平安普惠企业管理有限公司 Dynamic service configuration method, device, equipment and storage medium
CN115470770A (en) * 2022-10-31 2022-12-13 思创数码科技股份有限公司 Electronic form template filling method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040153627A1 (en) * 2002-02-26 2004-08-05 Mark Alcazar Page function architectural framework
WO2005038620A2 (en) * 2003-10-14 2005-04-28 Seebeyond Technology Corporation Web browser as web service server
CN108255847A (en) * 2016-12-28 2018-07-06 腾讯科技(深圳)有限公司 Page generation method and device
CN108446116A (en) * 2018-02-26 2018-08-24 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of the application program page
CN108958736A (en) * 2018-07-20 2018-12-07 北京三快在线科技有限公司 Page generation method, device, electronic equipment and computer-readable medium
CN109788031A (en) * 2018-12-17 2019-05-21 平安普惠企业管理有限公司 Business datum acquisition methods, device, computer equipment and storage medium
CN110020307A (en) * 2017-11-30 2019-07-16 阿里巴巴集团控股有限公司 A kind of method for drafting and device of client's end-view
CN110347383A (en) * 2019-06-28 2019-10-18 深圳市中农易讯信息技术有限公司 The front end development approach and device of cross-platform desktop application
CN110825374A (en) * 2019-11-04 2020-02-21 泰康保险集团股份有限公司 Page generation method and device based on component, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040153627A1 (en) * 2002-02-26 2004-08-05 Mark Alcazar Page function architectural framework
WO2005038620A2 (en) * 2003-10-14 2005-04-28 Seebeyond Technology Corporation Web browser as web service server
CN108255847A (en) * 2016-12-28 2018-07-06 腾讯科技(深圳)有限公司 Page generation method and device
CN110020307A (en) * 2017-11-30 2019-07-16 阿里巴巴集团控股有限公司 A kind of method for drafting and device of client's end-view
CN108446116A (en) * 2018-02-26 2018-08-24 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of the application program page
CN108958736A (en) * 2018-07-20 2018-12-07 北京三快在线科技有限公司 Page generation method, device, electronic equipment and computer-readable medium
CN109788031A (en) * 2018-12-17 2019-05-21 平安普惠企业管理有限公司 Business datum acquisition methods, device, computer equipment and storage medium
CN110347383A (en) * 2019-06-28 2019-10-18 深圳市中农易讯信息技术有限公司 The front end development approach and device of cross-platform desktop application
CN110825374A (en) * 2019-11-04 2020-02-21 泰康保险集团股份有限公司 Page generation method and device based on component, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王琰洁;陈刚;石超;: "基于页面模型的引擎式快速页面构造服务", 计算机系统应用, no. 10, 15 October 2016 (2016-10-15) *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113849103A (en) * 2021-10-13 2021-12-28 京东科技信息技术有限公司 Object model mapping method and device
CN114296789A (en) * 2022-03-09 2022-04-08 太平金融科技服务(上海)有限公司深圳分公司 Business processing method, device, equipment and storage medium based on full-flow configuration
CN114296789B (en) * 2022-03-09 2022-07-22 太平金融科技服务(上海)有限公司深圳分公司 Business processing method, device, equipment and storage medium based on full-process configuration
CN114629703A (en) * 2022-03-14 2022-06-14 平安普惠企业管理有限公司 Dynamic service configuration method, device, equipment and storage medium
CN115470770A (en) * 2022-10-31 2022-12-13 思创数码科技股份有限公司 Electronic form template filling method and system
CN115470770B (en) * 2022-10-31 2023-02-21 思创数码科技股份有限公司 Electronic form template filling method and system

Similar Documents

Publication Publication Date Title
CN107832045B (en) Method and apparatus for cross programming language interface conversion
CN113467775A (en) Method and device for generating page
CN107491382B (en) Log output method and device
CN110471848B (en) Method and device for dynamically returning message
US11687715B2 (en) Summary generation method and apparatus
CN109062560B (en) Method and apparatus for generating information
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
CN113626223A (en) Interface calling method and device
CN113076294A (en) Information sharing method and device
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN107729394A (en) Data Mart management system and its application method based on Hadoop clusters
CN113536748A (en) Method and device for generating chart data
CN110830427A (en) Method and device for message encoding and message decoding in netty environment
CN114816382A (en) Method and device for processing page
CN109033447B (en) Face recognition data visualization system
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN115705465A (en) Data analysis result presentation method, device, equipment and storage medium
CN113094561A (en) Webpage generation method, webpage generation device, electronic equipment and storage medium
CN112507017A (en) Data table conversion method and device
CN113542335A (en) Information sharing method and device, electronic equipment and storage medium
CN111753228A (en) Data request method and device, computer readable medium and electronic equipment
CN113760343A (en) Method and device for processing service request
CN113448652A (en) Request processing method and device
CN113986850B (en) Storage method, device, equipment and computer readable storage medium of electronic volume
CN111090485B (en) Multi-cluster-oriented help data processing method and device, medium and equipment

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