A method and device for generating a page

By dividing the page into multiple independent page components and generating page templates according to business needs, the problems of high coupling and low modularity in front-end page development are solved, and development efficiency and scalability are improved.

CN113760279BActive Publication Date: 2025-03-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110048555.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-14
Publication Date
2025-03-18
Estimated Expiration
2041-01-14

AI Technical Summary

Technical Problem

In front-end page development in complex business scenarios, the page components have high coupling, strong dependence and low modularity, resulting in low development efficiency, poor scalability and insufficient configuration flexibility.

Method used

Divide the page into multiple independent page components, and select the corresponding page components to generate page templates according to different business needs. By receiving requests to generate business pages, page templates and page components are automatically obtained, page text is generated, and page rendering is rendered. Page components may be provided by third parties.

Benefits of technology

It improves the modularity and configurability of the page, enhances the flexibility and scalability of generating pages, and overcomes the problem of low development efficiency caused by centralized development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760279B_ABST
    Figure CN113760279B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating a page, and relates to the field of computer technology. A specific implementation of the method includes: being able to divide a page into multiple page components, and selecting corresponding page components to generate page templates according to different business requirements, and when receiving a request to generate a business page, automatically obtaining the page template and the corresponding page component, generating page text and then rendering the generated page; wherein the page component can be provided by a third party; it can be seen that according to multiple business configurations corresponding to multiple page templates, each page template is configured with multiple independent page components, which improves the modularity and configurability of the page, improves the flexibility and extensibility of the generated page, and overcomes the problem of low development efficiency caused by high page coupling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a page. Background Art

[0002] In the development of Internet applications, front-end page development is an important part of application development; Web front-end is an important computer application technology in the Internet era, and its main carriers are web browsers and mobile applications. Through this technology, people can browse page content conveniently and quickly, and can interact with it; as the scale and complexity of Internet applications increase, the difficulty of Web front-end page development is also increasing.

[0003] At present, in the front-end page development of complex business scenarios, the following problems exist: 1) The page components are highly coupled, strongly dependent, and have a low degree of modularity at the source code level, resulting in high centralization and dependence of the development team. 2) When there are page components for new businesses, code modifications and re-launch are required, resulting in low scalability. 3) When handling different businesses, the configuration flexibility is low due to the low degree of modularity. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a method and device for generating a page, which can divide a page into multiple page components, and select corresponding page components to generate a page template according to different business needs. When a request to generate a business page is received, the page template and the corresponding page component are automatically obtained, and the page text is generated and then the generated page is rendered; wherein the page component can be provided by a third party; it can be seen that according to multiple business configurations corresponding to multiple page templates, each page template is configured with multiple independent page components, which improves the modularity and configurability of the page, improves the flexibility and extensibility of the generated page, and overcomes the problem of low development efficiency caused by high page coupling.

[0005] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a method for generating a page is provided, characterized in that it includes: receiving a request for generating a page, the request at least including a business identifier; according to the business identifier, obtaining a page template corresponding to the business identifier, and a storage address of a page component included in the page template; the page component includes a common component and a business component; using a template engine, generating a page text according to the page template and the storage address of the page component; sending the page text to a client, and the client rendering the page according to the page text.

[0006] Optionally, the method for generating a page is characterized in that before obtaining, according to the business identifier, a page template corresponding to the business identifier and a storage address of a page component included in the page template:

[0007] According to the page layout corresponding to the business identifier, a corresponding page component is selected from a set of page components to generate the page template corresponding to the business identifier, and the storage address of the page component included in the page template is determined.

[0008] Optionally, the method for generating a page is characterized in that the page components include common components and business components, and also include: the common components belong to one or more businesses, and are set in the page template corresponding to the business identifiers of the one or more businesses; the business components belong to the page template corresponding to the business identifier.

[0009] Optionally, the method for generating a page is characterized in that the page components include public components and business components, and further includes: the business components are business components provided by a third party.

[0010] Optionally, the method for generating a page is characterized in that the page component is a JavaScript file.

[0011] Optionally, the method for generating a page is characterized in that a template engine is used to generate page text according to the storage addresses of the page template and the page components, including: obtaining the storage addresses of one or more page components associated with the page template, and using the template engine to write the storage addresses into a set tag range of the page template to generate the page text.

[0012] To achieve the above object, according to a second aspect of an embodiment of the present invention, a device for generating a page is provided, characterized in that it includes: a request receiving module, a template obtaining module and a page generating module; wherein,

[0013] The request receiving module is used to receive a request for generating a page, wherein the request at least includes a service identifier;

[0014] The template acquisition module is used to acquire the page template corresponding to the business identifier and the storage address of the page component included in the page template according to the business identifier; the page component includes a common component and a business component.

[0015] The page generation module is used to generate page text using a template engine according to the page template and the storage address of the page component; and send the page text to the client so that the client renders the page according to the page text.

[0016] Optionally, the device for generating pages is characterized in that the template acquisition module is also used to: before obtaining the page template corresponding to the business identifier and the storage address of the page component contained in the page template according to the business identifier: according to the page layout corresponding to the business identifier, select the corresponding page component from a set page component set to generate the page template corresponding to the business identifier, and determine the storage address of the page component contained in the page template.

[0017] To achieve the above-mentioned purpose, according to the third aspect of an embodiment of the present invention, there is provided an electronic device for generating a page, characterized in that it includes: 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 any of the methods described in the above-mentioned methods for generating a page.

[0018] To achieve the above-mentioned purpose, according to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, any method as described in the above-mentioned method for generating a page is implemented.

[0019] An embodiment of the above invention has the following advantages or beneficial effects: it can divide a page into multiple page components, and select corresponding page components to generate page templates according to different business needs. When a request to generate a business page is received, the page template and the corresponding page component are automatically obtained, and the page text is generated and then the generated page is rendered; the page component can be provided by a third party; it can be seen that multiple page templates correspond to multiple business configurations, and each page template is configured with multiple independent page components, which improves the modularity and configurability of the page, improves the flexibility and extensibility of the generated page, and overcomes the problem of low development efficiency caused by centralized development.

[0020] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0022] Figure 1 It is a flowchart of a method for generating a page provided by an embodiment of the present invention;

[0023] Figure 2 It is a schematic diagram of a process of generating a page template and page text provided by an embodiment of the present invention;

[0024] Figure 3It is a structural schematic diagram of a device for generating a page provided by an embodiment of the present invention;

[0025] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0026] Figure 5 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

[0027] 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.

[0028] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a page, which may include the following steps:

[0029] Step S101: receiving a request for generating a page, wherein the request at least includes a service identifier.

[0030] Specifically, the business identifier indicates different businesses, and the business is to display business-related information through a page and interact with users. For example, in the page of an electronic shopping mall application, there are sales business, rental business, group purchase business, second-hand business, etc. for the same item; the business identifier of the sales business (for example: service_sale_111), the business identifier of the rental business (for example: service_lease_123), the business identifier of the group purchase business (for example: service_share_666), and the business identifier of the second-hand business (for example: service_used_999) are set respectively; the present invention does not limit the specific form and content of the business identifier. Further, a request for generating a page is received, for example: an item sales page is generated according to the sales business identifier contained in the received request, an item rental page is generated according to the rental business identifier contained in the received request, a group purchase page is generated according to the group purchase business identifier contained in the received request, and a second-hand item sales page is generated according to the second-hand business identifier contained in the received request.

[0031] The present invention does not limit the specific form and content of the business identifier; further, the request for generating a page may also include an item identifier or a user identifier displayed on the page, etc. The present invention does not limit the specific form and content of the request for generating a page.

[0032] Step S102: According to the business identifier, a page template corresponding to the business identifier and a storage address of a page component included in the page template are obtained; the page component includes a common component and a business component.

[0033] Specifically, before obtaining the page template corresponding to the business identifier and the storage address of the page component contained in the page template according to the business identifier: according to the page layout corresponding to the business identifier, select the corresponding page component from the set page component set to generate the page template corresponding to the business identifier, and determine the storage address of the page component contained in the page template. Among them, the set page component set includes page components related to the page, and the page components are extracted and formed into independent data and business modules based on the constituent elements of the page. For example, in an e-commerce mall application, the relevant page components may include: item title component, item picture component, item detail component, item logistics component, item rental business component, item group purchase component, etc.; further, according to the business identifier, the corresponding component is selected, for example, if the business identifier indicates a group purchase business, then the item title component, item picture component, item detail component, item logistics component, item group purchase business component, etc. may be selected, and according to the page layout of the group purchase business, a group purchase business page template is generated; for another example, if the business identifier indicates a rental business, then the item title component, item picture component, item detail component, item rental business component may be selected, and according to the page layout of the group purchase business, a rental business page template is generated; wherein, the format of the page template may be a format based on HTML (HyperText Markup Language, HTML), that is, the page template may be a fragment in HTML format; the following is an example of page components contained in the page template (the page component is an "item sales label"): <li class="w-mod-t a-con"draggable="false"style=""> <h4 class="w-tit-b j-drag"> <span class="a-model-name"> Item sales tags < / h4> <div class="clearfix pl10 pt10 pr10 pb10"> … , where the label or It is a tag defined by the HTML standard, and the present invention does not limit the specific content included in the page template.

[0034] Furthermore, the page component includes the controls required for the page and the data source information corresponding to the controls, and is packaged to generate a file based on the controls and the corresponding data source. Preferably, the generated JavaScript file is uploaded to a CDN server (CDN, Content Delivery Network), that is, the page component is a JavaScript file; wherein, one page component can be generated into one JavaScript file, and multiple page components can also be generated into one JavaScript file (for example: multiple common components are packaged into one JavaScript file).

[0035] Further, the generated JavaScript file path (i.e., the storage address of the JavaScript file) is stored, that is, according to the business identifier, the page template corresponding to the business identifier and the storage address of the page component contained in the page template are obtained; the storage address is, for example, " / / cdn-shop.abcd.com / test / couponPaid.js"; further, the storage address is represented in the page template in HTML format, as shown in the following example:

[0036] <scriptsrc=“ / / cdn-shop.abcd.com / test / couponPaid.js”>

[0037] Furthermore, the page components include common components and business components. Among them, common components can become components of page templates of multiple businesses, for example: item title components and item picture components can be included in the page template of item group purchase business, and can also be included in the page template of item rental business. It can be understood that, preferably, common components are different services of objects of the same category, or different specifications of the same object. The same parts are extracted from multiple page design layouts and divided into various components. Preferably, the granularity of the component is based on the control. It can be understood that the smaller the granularity of the component, the more flexible it is when composing the page. That is, the common component belongs to one or more businesses and is set in the page template corresponding to the business identifier of the one or more businesses. Furthermore, each component can be developed based on Vue (Vue is a progressive JavaScript framework for building user interfaces); the data source corresponding to each component is a database that has stored the data required by the page component.

[0038] Among them, the business component is the different part in each page template. For example, the item group purchasing business component and the item rental business component of the same item are examples of business components. The item group purchasing business component belongs to the group purchasing business page template, and the item rental business component belongs to the rental business page template, that is, the business component belongs to the page template corresponding to the business identifier. Furthermore, the business components can also be developed and provided by a third party, for example: Company B develops business component C according to the page component development specifications formulated by Company A and provides the JavaScript file of the page component (for example: c.js) to Company A; Company A uploads c.js to CDN, and Company B is a third party of Company A; wherein the third party obtains the specification text of the page component, for example: including page interface specifications, development framework specifications, interface parameter specifications, etc.; the page components developed by the third party operate on the data objects associated with the page (for example: value acquisition and assignment operations) using the two-way binding and message mechanism of the Vue framework itself to associate and operate with local components; it can be understood that the process of uploading to CDN is the same for public components and business components; by modularizing the page and dividing it into business components, the business components can be developed by the internal development team of the enterprise, or developed and provided by a third party, which improves the flexibility and efficiency of page development; that is, the business components are business components provided by a third party.

[0039] Furthermore, the method for selecting the corresponding page component from the set page component set to generate the page template corresponding to the business identifier can use a tool for visually configuring page templates, the tool includes a list of page component sets, and the page template corresponding to the business identifier is generated by selecting business-related page components from the list; when a new page component is added to the page component set, or a page component is deleted from the page component set, the tool for visually configuring page templates can also be used to perform operations, reducing the complexity of adding or reducing page components from individual page templates; it can be understood that when the page components included in the page template are changed (increased or decreased), the data corresponding to the page template is updated in the database accordingly to ensure that when the page is rendered according to the data of the page template, the generated page is an updated page; the data of each page component contained in the page template is stored.

[0040] Step S103: using a template engine to generate page text according to the page template and the storage address of the page component; sending the page text to the client, and the client renders the page according to the page text.

[0041] Specifically, the template engine can adopt Velocity. The Velocity template engine is created to separate the user interface from the business data content. It can generate text in a specific format. For example, the template engine can generate HTML format text. Further, the page template and the storage address of the JavaScript files of each page component contained in the page template are obtained to generate page text, wherein the page text is HTML format text. Further, the page text is sent to the client, and the client uses the browser to render the page according to the HTML text to display the page to the user.

[0042] Furthermore, the storage address of one or more of the page components associated with the page template is obtained, and the storage address is written into the set tag range of the page template using the template engine to generate the page text. For example: the storage address of the page component (JavaScript file) is written into the set tag range of the page template (HTML format), for example: the tag is set to be the start identifier of the tag range, and to be the end identifier of the tag range, that is, the tag range is set for acquisition by the browser that executes the rendering page. Preferably, the generated page text is stored in the server, and when a request to generate a page is received, the page template corresponding to the business identifier contained in the request is sent, so that the client can render it into a page through the client's browser and display it to the user.

[0043] like Figure 2 As shown, an embodiment of the present invention provides a method for generating a page, which may include the following steps:

[0044] Step S201: According to the page layout corresponding to the business identifier, a corresponding page component is selected from a set of page components to generate a page template corresponding to the business identifier, and the storage address of the page component included in the page template is determined.

[0045] Specifically, the description of generating a page template according to the page component is consistent with the description of step S102, and will not be repeated here; that is, the page component includes a common component and a business component. The common component belongs to one or more businesses and is set in the page template corresponding to the business identifier of the one or more businesses; the business component belongs to the page template corresponding to the business identifier. The business component is a business component provided by a third party. The page component is a JavaScript file.

[0046] Step S202: According to the business identifier, obtain a page template corresponding to the business identifier and the storage address of the page component contained in the page template; the page component includes a common component and a business component; use a template engine to generate a page text according to the storage address of the page template and the page component; send the page text to the client, and the client renders the page according to the page text.

[0047] Specifically, the specific description of obtaining the page template corresponding to the business identifier and the storage address of the page component is consistent with the description of step S102, and will not be repeated here.

[0048] The specific description of using the template engine to generate page text is consistent with the description of step S103 and will not be repeated here; that is, obtain the storage address of one or more page components associated with the page template, use the template engine to write the storage address into the set tag range of the page template, and generate the page text.

[0049] like Figure 3 As shown, the embodiment of the present invention provides a device 300 for generating a page, including: a request receiving module 301, a template obtaining module 302 and a page generating module 303; wherein,

[0050] The request receiving module 301 is used to receive a request for generating a page, wherein the request at least includes a service identifier;

[0051] The template acquisition module 302 is used to acquire, according to the business identifier, a page template corresponding to the business identifier and a storage address of a page component included in the page template; the page component includes a common component and a business component.

[0052] The page generation module 303 is used to generate page text using a template engine according to the page template and the storage address of the page component; and render the page according to the page text.

[0053] Optionally, the template acquisition module 302 is also used to: before obtaining the page template corresponding to the business identifier and the storage address of the page component contained in the page template according to the business identifier: according to the page layout corresponding to the business identifier, select the corresponding page component from the set page component set to generate the page template corresponding to the business identifier, and determine the storage address of the page component contained in the page template.

[0054] An embodiment of the present invention also provides an electronic device for generating a page, comprising: 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 provided in any of the above embodiments.

[0055] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in any of the above embodiments is implemented.

[0056] Figure 4 An exemplary system architecture 400 is shown to which the method for generating a page or the apparatus for generating a page according to the embodiment of the present invention can be applied.

[0057] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0058] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Terminal devices 401, 402, 403 can be installed with various client applications, such as e-commerce client applications, web browser applications, search applications, etc.

[0059] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting various client applications, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0060] The server 405 may be a server providing various services, such as a background management server providing support for client applications used by users using the terminal devices 401, 402, 403. The background management server may process the received request for generating a page and feed back the generated page to the terminal device.

[0061] 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 405 , and accordingly, the device for generating a page is generally disposed in the server 405 .

[0062] It should be understood that Figure 4 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.

[0063] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 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.

[0064] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0065] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0066] 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 product, 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 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0067] 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. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, 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.

[0068] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product 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.

[0069] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be provided in a processor, for example, may be described as: a processor including a request receiving module, a template obtaining module, and a page generating module. The names of these modules do not, in some cases, constitute limitations on the modules themselves, for example, the template obtaining module may also be described as "a module for obtaining a business page template corresponding to a business identifier according to a business identifier".

[0070] 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 may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a request to generate a page, the request at least including a business identifier; according to the business identifier, obtaining a page template corresponding to the business identifier and a storage address of a page component included in the page template; the page component includes a common component and a business component; using a template engine, generating a page text according to the page template and the storage address of the page component; sending the page text to a client so that the client renders the page according to the page text.

[0071] It can be seen that the embodiments of the present invention can divide a page into multiple page components, and according to different business needs, select corresponding page components to generate page templates. When a request to generate a business page is received, the page template and the corresponding page component are automatically obtained, and the page text is generated and then the generated page is rendered; wherein the page component can be provided by a third party; it can be seen that according to multiple business configurations corresponding to multiple page templates, each page template is configured with multiple independent page components, which improves the modularity and configurability of the page, improves the flexibility and extensibility of the generated page, and overcomes the problem of low development efficiency caused by centralized development.

[0072] 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: receiving a request for generating a page, wherein the request at least includes a business identifier; According to the business identifier, a page template corresponding to the business identifier and a storage address of a page component included in the page template are obtained; the page component includes a common component and a business component; wherein the common component is a component divided by extracting the same parts from a plurality of existing page design layouts for different businesses of the same category of objects or different specifications of the same object; the business component is a part with differences in different page templates; The page component is a JavaScript file; Using a template engine, according to the page template and the storage address of the page component, a page text is generated; wherein the template engine adopts a Velocity template engine, which is used to separate the user interface from the business data content and generate a page text in HTML format; Wherein, the step of using a template engine to generate a page text according to the page template and the storage address of the page component comprises: obtaining the storage address of one or more page components associated with the page template, and using a template engine to write the storage address into a set tag range of the page template to generate the page text; The page text is sent to the client so that the client renders the page according to the page text.

2. The method according to claim 1, characterized in that Before obtaining, according to the business identifier, a page template corresponding to the business identifier and a storage address of a page component included in the page template: According to the page layout corresponding to the business identifier, a corresponding page component is selected from a set of page components to generate the page template corresponding to the business identifier, and the storage address of the page component included in the page template is determined.

3. The method according to claim 1, characterized in that The page components include common components and business components, and also include: The common component belongs to one or more businesses and is set in the page template corresponding to the business identifier of the one or more businesses; The business component belongs to the page template corresponding to the business identifier.

4. The method according to claim 3, characterized in that: The page components include common components and business components, and also include: The business component is a business component provided by a third party.

5. A device for generating a page, characterized in that: include: Request receiving module, template obtaining module and page generating module; wherein, The request receiving module is used to receive a request for generating a page, wherein the request at least includes a service identifier; The template acquisition module is used to acquire, according to the business identifier, a page template corresponding to the business identifier and a storage address of a page component contained in the page template; the page component includes a common component and a business component; wherein the common component is a component divided by extracting the same parts from a plurality of existing page design layouts for different businesses of the same category of objects or different specifications of the same object; the business component is a part with differences in different page templates; the page component is a JavaScript file; The page generation module is used to generate page text by using a template engine according to the page template and the storage address of the page component; send the page text to the client so that the client renders the page according to the page text; wherein the template engine adopts a Velocity template engine, which is used to separate the user interface from the business data content and generate page text in HTML format; wherein, using the template engine to generate page text according to the page template and the storage address of the page component includes: obtaining the storage address of one or more page components associated with the page template, using the template engine to write the storage address into the set tag range of the page template, and generating the page text.

6. The device according to claim 5, characterized in that The template acquisition module is used to: before obtaining the page template corresponding to the business identifier and the storage address of the page component contained in the page template according to the business identifier: according to the page layout corresponding to the business identifier, select the corresponding page component from the set page component set to generate the page template corresponding to the business identifier, and determine the storage address of the page component contained in the page template.

7. 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 4.

8. 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 4 is implemented.

Citation Information

Patent Citations

  • Page configuration method and device

    CN111767499A