A method and device for generating a page
By receiving business requests and mapping service interface results to page templates, the problem of low page development efficiency is solved, flexible service invocation and page configuration are realized, and page reusability is improved.
Patent Information
- Application Number
- CN202010245452.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-03-31
AI Technical Summary
The page development efficiency in the existing technology is low, requiring customized coding to call external service interfaces and front-end style design, resulting in low development efficiency and non-reusable pages.
By receiving and parsing business requests, the page template configuration information is obtained, the business parameters are input into the service interface, the parameter results are received and mapped into the page template, and attributes are filled to generate the page to achieve flexible service invocation and page configuration.
It improves page development efficiency, realizes page reuse on different ends and external systems, and reduces additional service call logic coding and front-end design requirements.
Smart Images

Figure CN113467775B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a page. Background Art
[0002] Existing business systems need to be hard-coded to implement page information display and interaction according to business processes and personalized needs, including front-end display component elements and back-end call service interfaces. Therefore, page display is generally achieved by calling service interfaces through coding, performing various logic conversions according to business logic, and developing page layout and style coding in combination with business personnel or product prototypes, ultimately achieving page information display for various business systems.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] 1) Backend calls require customized coding based on business needs, calling external service interfaces, and performing relevant judgments, processing, and conversions based on business logic. Each business logic unit is customized for development, resulting in low development efficiency;
[0005] 2) Customized front-end style design and coding are required based on the page prototype at the page display layer, resulting in repeated development and low development efficiency;
[0006] 3) The developed pages cannot be embedded in multiple terminals or called by multiple external systems due to layout, interaction or style issues. They need to be adjusted for different terminals, resulting in low reusability. Summary of the invention
[0007] In view of this, an embodiment of the present invention provides a method and device for generating a page to solve the technical problem of low efficiency in page development.
[0008] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for generating a page is provided, comprising:
[0009] Receive and parse business requests to obtain business parameters;
[0010] Obtaining configuration information of a page template corresponding to the business request;
[0011] The business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page.
[0012] Optionally, before receiving and parsing the service request and obtaining the service parameters, the following steps are further included:
[0013] Registering a service interface and storing registration information of the service interface;
[0014] The registration information includes service type, service name, service description, interface name, method name, timeout period and configuration parameters.
[0015] Optionally, after registering the service interface, it also includes:
[0016] Storing input parameter information and output parameter information of the service interface by configuration;
[0017] Among them, the input parameter information includes service type, service name, parameter script and parameter conversion; the output parameter information includes service type, service name, parent class attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
[0018] Optionally, before receiving and parsing the service request and obtaining the service parameters, the following steps are further included:
[0019] The configuration information of each page template is stored by configuration;
[0020] Among them, the configuration information of the page template includes template type, template name, and configuration information of each component element in the page template; the template type includes native components, basic components, and business components; the configuration information of the component elements includes attribute classification, attribute data type, and attribute value expression; the attribute data type includes service type and basic data type.
[0021] Optionally, the business parameter is input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attribute is filled according to the mapped configuration information to generate the page, including:
[0022] For each page template, determining the template type of the page template;
[0023] If the model type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template to generate a page;
[0024] If the template type of the page template is a business component, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page.
[0025] Optionally, the business parameter is input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attribute is filled according to the mapped configuration information to generate the page, including:
[0026] Obtaining the attribute data type of each component element of the page template;
[0027] For each component element, determine the attribute data type of the component element;
[0028] If the attribute data type of the component element is a basic data type, the attribute is filled according to the configuration information of the component element to generate a page;
[0029] If the attribute data type of the component element is a service data type, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the component element; and the attributes are filled in according to the mapped configuration information to generate a page.
[0030] Optionally, the business parameter is input into a call request to call a service interface, thereby receiving a returned output result; and the output result is mapped to the configuration information of the component element, including:
[0031] Obtain registration information, input parameter information, and output parameter information of the service interface corresponding to the business request;
[0032] Perform parameter conversion on the business parameters according to the input parameter information, and input the converted business parameters into the call request to call the service interface;
[0033] Receive the output parameter result returned by the service interface, and map and convert the output parameter result according to the output parameter information to obtain a data value;
[0034] The data value is mapped to the attribute value expression of the component element.
[0035] Optionally, fill in attributes according to the mapped configuration information to generate a page, including:
[0036] The mapped configuration information of each component element of the page template is added to the hypertext markup language structure one by one and level by level, and the page is refreshed and displayed.
[0037] Optionally, after the page is generated, it also includes:
[0038] The generated page is passed to the parent page of the business system through the parent-child page call and parameter passing of the PostMessage function.
[0039] In addition, according to another aspect of an embodiment of the present invention, there is provided an apparatus for generating a page, comprising:
[0040] The receiving module is used to receive and analyze the service request and obtain the service parameters;
[0041] An acquisition module, used to acquire configuration information of a page template corresponding to the business request;
[0042] The generation module is used to input the business parameters into the call request to call the service interface, thereby receiving the returned output result; mapping the output result to the configuration information of the page template, and filling in the attributes according to the mapped configuration information to generate the page.
[0043] Also includes configuration modules for:
[0044] Receive and parse the service request, register the service interface before obtaining the service parameters, and store the registration information of the service interface;
[0045] The registration information includes service type, service name, service description, interface name, method name, timeout period and configuration parameters.
[0046] Optionally, the configuration module is further used to:
[0047] Storing input parameter information and output parameter information of the service interface by configuration;
[0048] Among them, the input parameter information includes service type, service name, parameter script and parameter conversion; the output parameter information includes service type, service name, parent class attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
[0049] Optionally, the configuration module is further used to:
[0050] Receive and parse the business request, and before obtaining the business parameters, store the configuration information of each page template through configuration;
[0051] Among them, the configuration information of the page template includes template type, template name, and configuration information of each component element in the page template; the template type includes native components, basic components, and business components; the configuration information of the component elements includes attribute classification, attribute data type, and attribute value expression; the attribute data type includes service type and basic data type.
[0052] Optionally, the generating module is further used for:
[0053] For each page template, determining the template type of the page template;
[0054] If the model type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template to generate a page;
[0055] If the template type of the page template is a business component, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page.
[0056] Optionally, the generating module is further used for:
[0057] Obtaining the attribute data type of each component element of the page template;
[0058] For each component element, determine the attribute data type of the component element;
[0059] If the attribute data type of the component element is a basic data type, the attribute is filled according to the configuration information of the component element to generate a page;
[0060] If the attribute data type of the component element is a service data type, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the component element; and the attributes are filled in according to the mapped configuration information to generate a page.
[0061] Optionally, the generating module is further used for:
[0062] Obtain registration information, input parameter information, and output parameter information of the service interface corresponding to the business request;
[0063] Perform parameter conversion on the business parameters according to the input parameter information, and input the converted business parameters into the call request to call the service interface;
[0064] Receive the output parameter result returned by the service interface, and map and convert the output parameter result according to the output parameter information to obtain a data value;
[0065] The data value is mapped to the attribute value expression of the component element.
[0066] Optionally, the generating module is further used for:
[0067] The mapped configuration information of each component element of the page template is added to the hypertext markup language structure one by one and level by level, and the page is refreshed and displayed.
[0068] Optionally, the generating module is further used for:
[0069] After the page is generated, the generated page is transferred to the parent page of the business system through the parent-child page call and parameter transfer of the PostMessage function.
[0070] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including:
[0071] one or more processors;
[0072] a storage device for storing one or more programs,
[0073] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.
[0074] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0075] An embodiment of the above invention has the following advantages or beneficial effects: because the business parameters are input into the call request to call the service interface, thereby receiving the returned output result, and then mapping the output result to the configuration information of the page template, and filling the attributes according to the mapped configuration information to generate the page, the technical problem of low efficiency of page development in the prior art is overcome. The embodiment of the present invention realizes flexible calling of services by configuring the service interface, and realizes personalized pages by configuring the page template, so there is no need for additional service call logic coding and front-end page design and coding, which improves the efficiency of page development, and different terminals and different external business systems can configure different page styles, layouts, display attributes, etc. according to their own needs, realizing the maximum reuse of page plug-ins.
[0076] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0078] Figure 1 is a schematic diagram of the main process of the method for generating a page according to an embodiment of the present invention;
[0079] Figure 2 is a schematic diagram of a registration service interface according to an embodiment of the present invention;
[0080] Figure 3 is a schematic diagram of service interface registration information according to an embodiment of the present invention;
[0081] Figure 4 is a schematic diagram of parameter management according to an embodiment of the present invention;
[0082] Figure 5 is a schematic diagram of configuring input parameter information according to an embodiment of the present invention;
[0083] Figure 6 is a schematic diagram of parameter output management according to an embodiment of the present invention;
[0084] Figure 7 is a schematic diagram of configuring parameter information according to an embodiment of the present invention;
[0085] Figure 8 is a schematic diagram of a configuration page template according to an embodiment of the present invention;
[0086] Fig. 9 is a schematic diagram of configuration information of a page template according to an embodiment of the present invention;
[0087] Fig.10 is a schematic diagram of various component elements on a page template according to an embodiment of the present invention;
[0088] Fig.11 is a schematic diagram of configuration component elements according to an embodiment of the present invention;
[0089] Fig.12 is a schematic diagram of configuration information of component elements according to an embodiment of the present invention;
[0090] Fig.13 is a schematic diagram of the main process of a method for generating a page according to a reference embodiment of the present invention;
[0091] Fig.14 is a schematic diagram of the main process of a method for generating a page according to another reference embodiment of the present invention;
[0092] Fig.15 is a schematic diagram of main modules of an apparatus for generating a page according to an embodiment of the present invention;
[0093] Fig.16 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0094] Fig.17 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0095] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0096] Figure 1 Schematic diagram of the main process of the method for generating a page according to an embodiment of the present invention. As an embodiment of the present invention, Figure 1 As shown, the method for generating a page may include:
[0097] Step 101: Receive and parse a service request to obtain service parameters.
[0098] Receive the business request passed in by the business system, parse it and obtain the business parameters. In order to input the business parameters into the call request, it is also necessary to register the service interface before step 101. The service interface can be provided by a third-party service, such as JSF service, HTTP rest service or local method service. JSF service is a remote call service (RPC) framework. HTTP rest service: a software architecture standard based on the http protocol. REST, or Representational State Transfer (REST for short), is a software architecture style proposed by Dr. Roy Fielding in his doctoral thesis in 2000. It is a design and development method for network applications that can reduce the complexity of development and improve the scalability of the system. Local method service: refers to tools or business logic functions implemented by java code in the service orchestration system.
[0099] Optionally, before step 101, the method further includes: registering a service interface and storing registration information of the service interface; wherein the registration information includes service type, service name, service description, interface name, method name, timeout time and configuration parameters. Figure 2 As shown in , multiple service interfaces can be pre-registered. Figure 3 As shown, the registration information of the service interface may include the service type (such as JSF service or local service, etc.), the Chinese name of the service, the service name, the service description, the interface name, the method name, the interface alias, the timeout period, and the configuration parameters (such as the token verification code). Optionally, the registration information of the service interface is stored in a database table.
[0100] Optionally, after registering the service interface, it also includes: storing the input parameter information and output parameter information of the service interface by configuration. The input parameter information includes the service type, service name, parameter script and parameter conversion; the output parameter information includes the service type, service name, parent class attribute, mapping expression, mapping name, mapping key value, data type and result conversion. Figure 4-7 As shown in the figure, the input and output parameter information of each service interface is stored in the database table through configuration. Figure 5 As shown, the input parameter information may include the service type, the Chinese name of the service, the parameter script (including the parameter type and the string name of the replacement content), and the parameter conversion (including the parameter name, parameter key, and replacement content). Figure 7 As shown, the output parameter information includes service type, service Chinese name, parent class attribute, mapping expression, mapping name, mapping key value, data type, and result conversion (including actual value and conversion value).
[0101] The embodiment of the present invention can flexibly configure and parse the input and output parameters of the service, improve the development speed and efficiency of external service calls, and support multiple service calls, including JSF services, HTTP services, local method services, etc.
[0102] Optionally, it is also necessary to configure the configuration information of each page template on the page before step 101. Specifically, before step 101, it also includes: storing the configuration information of each page template by configuration; wherein the configuration information of the page template includes the template type, the template name, and the configuration information of each component element in the page template; the template type includes native components, basic components, and business components; the configuration information of the component element includes attribute classification, attribute data type, and attribute value expression; the attribute data type includes service type and basic data type.
[0103] like Figure 8-10 As shown, the configuration information of each page template includes the template type (such as native components, basic components and business components), template name, template notes and configuration information of each component element in the page template. Figure 11-12 As shown, the configuration information of each component element includes the attributes of the component element, attribute name, attribute classification (such as html attribute types such as props, class, style, attrs, etc.), attribute data type (such as service data types such as Service, such as basic data types of JavaScript language such as Dynamic, String, Number, Boolean, Array, Object, etc.), whether it is required, and attribute value expression.
[0104] According to business needs, R&D personnel store various element types, element layouts, element styles, etc. in the page in the form of data in a database table to complete the page configuration. The page template is also stored after the R&D personnel complete the attribute configuration of all component elements of the page in the page configuration function. The data value of the component element is represented by a pre-defined key. During the actual rendering process, the data value in the output result object returned by the service interface is matched and replaced. In an embodiment of the present invention, page development can be directly combined and configured based on the basic component library and business components, and the element display layout, style, and interaction can be flexibly implemented, thereby improving the overall page development efficiency and the page component reuse rate.
[0105] Step 102: Obtain configuration information of a page template corresponding to the business request.
[0106] It should be noted that before step 102, the correspondence between each business request and page in the business system also needs to be configured. Each page consists of multiple page templates. Therefore, the configuration information of each page template on the page corresponding to the business request is obtained by parsing the business request.
[0107] Step 103, input the business parameters into the call request to call the service interface, thereby receiving the returned output result; map the output result to the configuration information of the page template, and fill in the attributes according to the mapped configuration information to generate the page.
[0108] In this step, the business parameters obtained by parsing in step 101 are input into the call request to call the registered service interface, thereby receiving the output result returned by the service interface. The output result is then mapped to the configuration information of the page template, and finally the rendering component fills in the attributes according to the mapped configuration information to generate the page.
[0109] Optionally, for each page template, determine the template type of the page template; if the model type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template to generate a page; if the template type of the page template is a business component, input the business parameters into the call request to call the service interface, thereby receiving the returned output result; map the output result to the configuration information of the page template, and fill in the attributes according to the mapped configuration information to generate a page. In an embodiment of the present invention, if the page template is a native component or a basic component, there is no need to call the service interface, so the attributes can be directly filled according to the configuration information of the configured page template to generate a page.
[0110] Optionally, the business parameters are input into the call request to call the service interface, thereby receiving the returned output results; the output results are mapped to the configuration information of the page template, and attributes are filled in according to the mapped configuration information to generate a page, including: obtaining the attribute data type of each component element of the page template; for each component element, determining the attribute data type of the component element; if the attribute data type of the component element is the basic data type, attributes are filled in according to the configuration information of the component element to generate a page; if the attribute data type of the component element is the service data type, the business parameters are input into the call request to call the service interface, thereby receiving the returned output results; the output results are mapped to the configuration information of the component element; attributes are filled in according to the mapped configuration information to generate a page. Each page template includes multiple component elements. If the template type of the page template is a business component, it is necessary to further determine the attribute data type of each component element in the page template. If the attribute data type of the component element is a basic data type such as Dynamic, String, Number, Boolean, Array or Object, there is no need to call the service interface, so the attributes can be directly filled according to the configuration information of the configured component element to generate the page. If the attribute data type of the component element is a service data type such as Service, it is necessary to call the corresponding service interface, and then map the returned output result to the configuration information of the component element, and fill the attributes according to the mapped configuration information to generate the page.
[0111] Optionally, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the component element, including: obtaining the registration information, input parameter information and output parameter information of the service interface corresponding to the business request; performing parameter conversion on the business parameters according to the input parameter information, and inputting the converted business parameters into the call request to call the service interface; receiving the output result returned by the service interface, mapping and converting the output result according to the output parameter information to obtain the data value; mapping the data value to the attribute value expression of the component element. If the attribute data type of the component element is a service data type such as service, the registration information, input parameter information and output parameter information of the service interface are obtained. For example, service interface a, http: / / ***.jd.com / services / a and service interface b, http: / / ***.jd.com / services / b, are pre-registered, and the business request is http: / / ***.jd.com / services / a? param={}, then the registration information, input parameter information and output parameter information of the service interface a corresponding to the business request are obtained, and the converted business parameters are input into the call request to call the service interface a. The output parameter result is obtained by calling the service interface, and then the output parameter result is mapped and converted to obtain the data value, and finally the data value is mapped to the attribute value expression of the component element.
[0112] Optionally, attributes are filled according to the mapped configuration information to generate a page, including: adding the mapped configuration information of each component element of the page template to the Hypertext Markup Language structure one by one and step by step, refreshing and displaying the page. After obtaining the configuration information of each component element of the page template, the configuration information is added to the Hypertext Markup Language (THML) structure one by one and step by step through the 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 one by one and step by step through the VUE framework, and the browser parses and displays it according to the html protocol. VUE: Vue.js is a progressive framework for building user interfaces. Unlike other heavyweight frameworks, Vue adopts a bottom-up incremental development design.
[0113] Optionally, after the page is generated, the method further includes: passing the generated page to the parent page of the business system through the parent-child page call and parameter transfer of the PostMessage function. The embodiment of the present invention realizes the reuse of multiple terminals and different external business systems based on the parent-child page call and parameter transfer of PostMessage.
[0114] The embodiment of the present invention utilizes configurable service orchestration technology to realize flexible configuration and orchestration of different service interface calls and realize business logic; the front-end page display layout, interaction mode, style, etc. can realize flexible configuration of the page according to the configured page component elements, CSS style attributes, attribute and display field mapping, etc.; different terminals and different external business systems can configure different page styles, layouts, display attributes, etc. according to their own needs to realize maximum reuse of page plug-ins.
[0115] According to the various embodiments described above, it can be seen that the embodiment of the present invention receives the returned output result by invoking the service interface by inputting the business parameters into the call request, and then maps the output result to the configuration information of the page template, and fills the attributes according to the mapped configuration information to generate the page, thereby solving the technical problem of low efficiency of page development in the prior art. The embodiment of the present invention realizes flexible calling of services by configuring the service interface, and realizes personalized pages by configuring the page template, so there is no need for additional service call logic coding and front-end page design and coding, which improves the efficiency of page development, and different terminals and different external business systems can configure different page styles, layouts, display attributes, etc. according to their own needs, realizing the maximum reuse of page plug-ins.
[0116] Fig.13 Schematic diagram of the main process of a method for generating a page according to a reference embodiment of the present invention. As another embodiment of the present invention, Fig.13 As shown, the method for generating a page may include:
[0117] Step 1: Get the rendering component.
[0118] Step 2, obtain the configuration information of each page template on the page; wherein, the configuration information of each page template includes the template type (such as native components, basic components and business components), template name, template notes and configuration information of each component element in the page template. The configuration information of each component element includes the attributes of the component element, attribute name, attribute classification (such as props, class, style, attrs and other html attribute types), attribute data type (such as Service and other service data types, such as Dynamic, String, Number, Boolean, Array, Object and other basic data types of JavaScript language), whether it is required, and attribute value expression.
[0119] Step 3: for each page template, determine the template type of the page template;
[0120] If the template type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template;
[0121] If the template type of the page template is a business component, then continue to determine the attribute data type of each component element in the page template.
[0122] Step 4: for each component element, determine the attribute data type of the component element;
[0123] If the attribute data type of the component element is a basic data type (such as Dynamic, String, Number, Boolean, Array, or Object, etc.), the attribute is filled according to the configuration information of the component element;
[0124] If the attribute data type of the component element is a service data type (such as Service, etc.), execute steps 5 to 8.
[0125] Step 5: Get the registration information, input parameter information, and output parameter information of the service interface corresponding to the business request.
[0126] Step 6: convert the business parameters according to the input parameter information, and input the converted business parameters into the call request to call the service interface.
[0127] Step 7, receiving the output parameter result returned by the service interface, mapping and converting the output parameter result according to the output parameter information to obtain a data value.
[0128] Step 8: Map the data value to the attribute value expression of the component element (ie, attribute filling).
[0129] Step 9: The rendering component calculates the configuration information of each component element of the page template, and adds it to the hypertext markup language structure one by one and level by level.
[0130] Step 10, refresh the page and display it.
[0131] The embodiment of the present invention is based on service orchestration technology, that is, service calls are flexibly implemented by configuring JSF services, HTTP remote services, local method services, etc., and personalized pages are implemented in combination with page configuration technology that can customize page elements, styles, and layouts. During the entire implementation process, there is no need for additional service call logic coding and front-end page design and coding, and all are achieved through integrated configuration.
[0132] In addition, the specific implementation content of the method for generating a page in a reference embodiment of the present invention has been described in detail in the above-mentioned method for generating a page, so the repeated content will not be described again here.
[0133] Fig.14 Schematic diagram of the main process of a method for generating a page according to another reference embodiment of the present invention. As another embodiment of the present invention, Fig.14 As shown, the process of service call may include:
[0134] Get the registration information, input parameter information, and output parameter information of each service interface;
[0135] Based on the registration information and input parameter information, parse the input parameters carried by the business request to determine the service type (such as JSF service, HTTP remote service, local method service, etc.);
[0136] Call the corresponding service interface according to the judgment result to receive the returned output result;
[0137] Based on the output parameter information, the output parameter result is attribute mapped to return the service call result.
[0138] In addition, the specific implementation content of the method for generating a page in a reference embodiment of the present invention has been described in detail in the above-mentioned method for generating a page, so the repeated content will not be described again here.
[0139] Fig.15 is a schematic diagram of the main modules of the apparatus for generating a page according to an embodiment of the present invention, such as Fig.15 As shown, the device 1500 for generating a page includes a receiving module 1501, an acquisition module 1502 and a generating module 1503; wherein the receiving module 1501 is used to receive and parse a business request to obtain business parameters; the acquisition module 1502 is used to obtain configuration information of a page template corresponding to the business request; the generating module 1503 is used to input the business parameters into a call request to call a service interface, thereby receiving a returned output result; mapping the output result to the configuration information of the page template, and filling in attributes according to the mapped configuration information to generate a page.
[0140] Also includes configuration modules for:
[0141] Receive and parse the service request, register the service interface before obtaining the service parameters, and store the registration information of the service interface;
[0142] The registration information includes service type, service name, service description, interface name, method name, timeout period and configuration parameters.
[0143] Optionally, the configuration module is further used to:
[0144] Storing input parameter information and output parameter information of the service interface by configuration;
[0145] Among them, the input parameter information includes service type, service name, parameter script and parameter conversion; the output parameter information includes service type, service name, parent class attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
[0146] Optionally, the configuration module is further used to:
[0147] Receive and parse the business request, and before obtaining the business parameters, store the configuration information of each page template through configuration;
[0148] Among them, the configuration information of the page template includes template type, template name, and configuration information of each component element in the page template; the template type includes native components, basic components, and business components; the configuration information of the component elements includes attribute classification, attribute data type, and attribute value expression; the attribute data type includes service type and basic data type.
[0149] Optionally, the generating module 1503 is further used for:
[0150] For each page template, determining the template type of the page template;
[0151] If the model type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template to generate a page;
[0152] If the template type of the page template is a business component, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page.
[0153] Optionally, the generating module 1503 is further used for:
[0154] Obtaining the attribute data type of each component element of the page template;
[0155] For each component element, determine the attribute data type of the component element;
[0156] If the attribute data type of the component element is a basic data type, the attribute is filled according to the configuration information of the component element to generate a page;
[0157] If the attribute data type of the component element is a service data type, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the component element; and the attributes are filled in according to the mapped configuration information to generate a page.
[0158] Optionally, the generating module 1503 is further used for:
[0159] Obtain registration information, input parameter information, and output parameter information of the service interface corresponding to the business request;
[0160] Perform parameter conversion on the business parameters according to the input parameter information, and input the converted business parameters into the call request to call the service interface;
[0161] Receive the output parameter result returned by the service interface, and map and convert the output parameter result according to the output parameter information to obtain a data value;
[0162] The data value is mapped to the attribute value expression of the component element.
[0163] Optionally, the generating module 1503 is further used for:
[0164] The mapped configuration information of each component element of the page template is added to the hypertext markup language structure one by one and level by level, and the page is refreshed and displayed.
[0165] Optionally, the generating module 1503 is further used for:
[0166] After the page is generated, the generated page is transferred to the parent page of the business system through the parent-child page call and parameter transfer of the PostMessage function.
[0167] According to the various embodiments described above, it can be seen that the embodiment of the present invention receives the returned output result by invoking the service interface by inputting the business parameters into the call request, and then maps the output result to the configuration information of the page template, and fills the attributes according to the mapped configuration information to generate the page, thereby solving the technical problem of low efficiency of page development in the prior art. The embodiment of the present invention realizes flexible calling of services by configuring the service interface, and realizes personalized pages by configuring the page template, so there is no need for additional service call logic coding and front-end page design and coding, which improves the efficiency of page development, and different terminals and different external business systems can configure different page styles, layouts, display attributes, etc. according to their own needs, realizing the maximum reuse of page plug-ins.
[0168] It should be noted that the specific implementation content of the device for generating a page in the present invention has been described in detail in the method for generating a page described above, so the repeated content will not be described again here.
[0169] Fig.16 An exemplary system architecture 1600 is shown to which the method for generating a page or the apparatus for generating a page according to the embodiments of the present invention can be applied.
[0170] like Fig.16 As shown, system architecture 1600 may include terminal devices 1601, 1602, 1603, network 1604 and server 1605. Network 1604 is used to provide a medium for communication links between terminal devices 1601, 1602, 1603 and server 1605. Network 1604 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0171] Users can use terminal devices 1601, 1602, 1603 to interact with server 1605 through network 1604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 1601, 1602, 1603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0172] The terminal devices 1601 , 1602 , and 1603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0173] The server 1605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 1601, 1602, and 1603. The backend management server may analyze and process the received data such as the item information query request, and feed back the processing results (such as target push information, item information - only an example) to the terminal device.
[0174] It should be noted that the method for generating a page provided in the embodiment of the present invention is generally executed by the server 1605, and accordingly, the apparatus for generating a page is generally set in the server 1605. The method for generating a page provided in the embodiment of the present invention can also be executed by the terminal devices 1601, 1602, and 1603, and accordingly, the apparatus for generating a page can be set in the terminal devices 1601, 1602, and 1603.
[0175] It should be understood that Fig.16 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0176] Reference below Fig.17 , which shows a schematic diagram of the structure of a computer system 1700 of a terminal device suitable for implementing an embodiment of the present invention. Fig.17 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0177] like Fig.17 As shown, the computer system 1700 includes a central processing unit (CPU) 1701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1702 or a program loaded from a storage part 1708 into a random access memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the system 1700 are also stored. The CPU 1701, the ROM 1702, and the RAM 1703 are connected to each other via a bus 1704. An input / output (I / O) interface 1705 is also connected to the bus 1704.
[0178] The following components are connected to the I / O interface 1705: an input section 1706 including a keyboard, a mouse, etc.; an output section 1707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1708 including a hard disk, etc.; and a communication section 1709 including a network interface card such as a LAN card, a modem, etc. The communication section 1709 performs communication processing via a network such as the Internet. A drive 1710 is also connected to the I / O interface 1705 as needed. A removable medium 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as needed, so that a computer program read therefrom is installed into the storage section 1708 as needed.
[0179] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1709, and / or installed from the removable medium 1711. When the computer program is executed by the central processing unit (CPU) 1701, the above-mentioned functions defined in the system of the present invention are executed.
[0180] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0181] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0182] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a receiving module, an acquisition module and a generating module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.
[0183] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device implements the following method: receiving and parsing a business request to obtain business parameters; obtaining configuration information of a page template corresponding to the business request; inputting the business parameters into a call request to call a service interface, thereby receiving a returned output result; mapping the output result to the configuration information of the page template, and filling in attributes according to the mapped configuration information to generate a page.
[0184] According to the technical solution of the embodiment of the present invention, the technical problem of low efficiency of page development in the prior art is overcome because the business parameters are input into the call request to call the service interface, thereby receiving the returned output result, and then mapping the output result to the configuration information of the page template, and filling the attributes according to the mapped configuration information to generate the page. The embodiment of the present invention realizes flexible calling of services by configuring the service interface, and realizes personalized pages by configuring the page template, so there is no need for additional service call logic coding and front-end page design and coding, which improves the efficiency of page development, and different terminals and different external business systems can configure different page styles, layouts, display attributes, etc. according to their own needs, realizing the maximum reuse of page plug-ins.
[0185] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating a page, characterized in that: include: Receive and parse business requests to obtain business parameters; Obtaining configuration information of a page template corresponding to the business request; The business parameters are input into the call request to call the service interface, thereby receiving the returned output result; Mapping the output parameter result to the configuration information of the page template, and filling in attributes according to the mapped configuration information to generate a page; The business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page, including: Obtaining the attribute data type of each component element of the page template; For each component element, determine the attribute data type of the component element; If the attribute data type of the component element is a basic data type, the attribute is filled 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 business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the component element; and the attributes are filled in according to the mapped configuration information to generate a page.
2. The method according to claim 1, characterized in that Before receiving and parsing the business request and obtaining the business parameters, it also includes: Registering a service interface and storing registration information of the service interface; The registration information includes service type, service name, service description, interface name, method name, timeout period and configuration parameters.
3. The method according to claim 2, characterized in that After registering the service interface, it also includes: Storing input parameter information and output parameter information of the service interface by configuration; Among them, the input parameter information includes service type, service name, parameter script and parameter conversion; the output parameter information includes service type, service name, parent class attribute, mapping expression, mapping name, mapping key value, data type and result conversion.
4. The method according to claim 1, characterized in that: Before receiving and parsing the business request and obtaining the business parameters, it also includes: The configuration information of each page template is stored by configuration; Among them, the configuration information of the page template includes template type, template name, and configuration information of each component element in the page template; the template type includes native components, basic components, and business components; the configuration information of the component elements includes attribute classification, attribute data type, and attribute value expression; the attribute data type includes service type and basic data type.
5. The method according to claim 1, characterized in that: The business parameters are input into the call request to call the service interface, thereby receiving the returned output result; Mapping the output parameter result to the configuration information of the page template, and filling in attributes according to the mapped configuration information to generate a page, including: For each page template, determining the template type of the page template; If the model type of the page template is a native component or a basic component, fill in the attributes according to the configuration information of the page template to generate a page; If the template type of the page template is a business component, the business parameters are input into the call request to call the service interface, thereby receiving the returned output result; the output result is mapped to the configuration information of the page template, and the attributes are filled according to the mapped configuration information to generate the page.
6. The method according to claim 1, characterized in that The business parameters are input into the call request to call the service interface, thereby receiving the returned output result; Mapping the output parameter result to the configuration information of the component element includes: Obtain registration information, input parameter information, and output parameter information of the service interface corresponding to the business request; Perform parameter conversion on the business parameters according to the input parameter information, and input the converted business parameters into the call request to call the service interface; Receive the output parameter result returned by the service interface, and map and convert the output parameter result according to the output parameter information to obtain a data value; The data value is mapped to the attribute value expression of the component element.
7. The method according to claim 1, characterized in that Fill in attributes according to the mapped configuration information to generate pages, including: The mapped configuration information of each component element of the page template is added to the hypertext markup language structure one by one and level by level, and the page is refreshed and displayed.
8. The method according to claim 1, characterized in that After the page is generated, it also includes: The generated page is passed to the parent page of the business system through the parent-child page call and parameter passing of the PostMessage function.
9. A device for generating a page, characterized in that: include: The receiving module is used to receive and analyze the service request and obtain the service parameters; An acquisition module, used to acquire configuration information of a page template corresponding to the business request; A generation module is used to input the business parameters into the call request to call the service interface, thereby receiving the returned output result; Mapping the output parameter result to the configuration information of the page template, and filling in attributes according to the mapped configuration information to generate a page; The generation module is also used for: Obtaining the attribute data type of each component element of the page template; For each component element, determine the attribute data type of the component element; If the attribute data type of the component element is a basic data type, the attribute is filled 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 business parameter is input into the call request to call the service interface, thereby receiving the returned output result; Mapping the output parameter result to the configuration information of the component element; Fill in the attributes according to the mapped configuration information to generate the page.
10. An electronic device, characterized in that: include: 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 according to any one of claims 1 to 8.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Page generation method and apparatus
CN108255847A
Front-end development method and device for cross-platform desktop application
CN110347383A
