CN111352682A - Page rendering method, device, server and readable storage medium - Google Patents

Page rendering method, device, server and readable storage medium Download PDF

Info

Publication number
CN111352682A
CN111352682A CN201811584129.6A CN201811584129A CN111352682A CN 111352682 A CN111352682 A CN 111352682A CN 201811584129 A CN201811584129 A CN 201811584129A CN 111352682 A CN111352682 A CN 111352682A
Authority
CN
China
Prior art keywords
page
file
code
target
code file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811584129.6A
Other languages
Chinese (zh)
Other versions
CN111352682B (en
Inventor
张哲�
傅铮
陈成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN201811584129.6A priority Critical patent/CN111352682B/en
Publication of CN111352682A publication Critical patent/CN111352682A/en
Application granted granted Critical
Publication of CN111352682B publication Critical patent/CN111352682B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the application provides a page rendering method, a page rendering device, a server and a readable storage medium, wherein page configuration data and a service code file of a target page are acquired after a page acquisition request aiming at the target page sent by a service requester terminal is received, then the page code type of the page code file included by the target page is detected, the page code file is respectively processed according to the page code type, the service code file and the page configuration data of the page code file, the target page code file including a NodeJS code file and/or an HTML file is obtained, and finally the target page is rendered according to the target page code file. Therefore, the page rendered according to the target page code file is the modified page, so that the usable service can be quickly generated according to various business requirements, secondary development on the page is not needed, and development resources are saved.

Description

Page rendering method, device, server and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page rendering method, an apparatus, a server, and a readable storage medium.
Background
Currently, the mainstream WEB page development mode is to store an HTML file on a server, develop a corresponding JavaScript script code by front-end personnel, package and upload the JavaScript script code to the server, and then associate the HTML file and the JavaScript script code by the server and store the HTML file and the JavaScript script code as a page code file. However, the disadvantage of this method is that the page code file is stored in the code repository, and if the page code file is modified, secondary development is required, so that any change (for example, adding page service, modifying service type, etc.) made to the WEB page every time requires a developer to modify the code and go online again, which wastes development resources greatly.
Disclosure of Invention
In view of this, an object of the embodiments of the present application is to provide a page rendering method, an apparatus, a server and a readable storage medium, which can quickly generate a usable service according to various business requirements, and save development resources without performing secondary development on a page.
According to an aspect of embodiments of the present application, there is provided an electronic device that may include one or more storage media and one or more processors in communication with the storage media. One or more storage media store machine-readable instructions executable by a processor. When the electronic device is operated, the processor is communicated with the storage medium through the bus, and the processor executes the machine readable instructions to execute the page rendering method.
According to another aspect of the embodiments of the present application, there is provided a page rendering method applied to a server, the method including: after receiving a page acquisition request aiming at a target page sent by a service requester terminal, acquiring page configuration data and a service code file of the target page; detecting the page code type of a page code file included in the target page, and respectively processing the page code file according to the page code type of the page code file, the service code file and the page configuration data to obtain a target page code file including a NodeJS code file and/or an HTML file; and rendering the target page according to the target page code file.
In some embodiments of the present application, before the step of obtaining the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal, the method may further include:
acquiring a data dictionary which is configured by a service provider terminal and aims at the target page, wherein the data dictionary comprises JSON data of a basic form assembly and JSON data of an extended form assembly;
generating a corresponding visual configuration page according to the data dictionary and sending the visual configuration page to the service provider terminal for displaying, wherein the visual configuration page comprises configuration areas of the basic form component and the extended form component;
and acquiring data required to be displayed by the corresponding form component configured in each configuration area by the service provider terminal, generating page configuration data of the target page according to the configured data required to be displayed by each form component, and storing the page configuration data.
In some embodiments of the present application, before the step of obtaining the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal, the method may further include:
and acquiring a service code file of the target page configured by the terminal of the service provider, and storing the service code file, wherein the service code file comprises a NodeJS code, an HTML code, a JavaScript code and annotation content, and the annotation content is used for representing that the configuration data needs to be acquired.
In some embodiments of the present application, the step of obtaining the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal may include:
after receiving a page acquisition request aiming at a target page sent by a service requester terminal, acquiring a page ID of the target page from the page acquisition request;
and acquiring the page configuration data and the page code file of the target page from a pre-stored page database of each page according to the page ID, wherein the page database of each page corresponds to the page ID of the page.
In some embodiments of the present application, the step of respectively processing the page code file according to the page code type of the page code file, the service code file, and the page configuration data to obtain a target page code file including a nodess code file and/or an HTML file may include:
if the page code type of the page code file is the NodeJS code type, acquiring a NodeJS code in the service code file;
acquiring corresponding first annotation content from the NodeJS code according to a first regular expression configured in advance;
calling a pre-configured character string template engine to acquire a first target field and a first code processing strategy from the annotation content, and acquiring first target data corresponding to the first target field from the page configuration data;
performing data processing on the first target data according to the first code processing strategy to generate a corresponding first data character string;
and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
In some embodiments of the present application, the step of invoking a preconfigured string template engine to obtain a first target field and a first code processing policy from the annotation content may include:
and calling a pre-configured character string template engine to match the first target field and the code editing area where the first code processing strategy is located from the first annotation content, and acquiring the first target field and the first code processing strategy from the code editing area.
In some embodiments of the present application, the step of respectively processing the page code file according to the page code type of the page code file, the service code file, and the page configuration data to obtain a target page code file including a nodess code file and/or an HTML file may include:
if the page code type of the page code file is the front-end page code type, acquiring a JavaScript file, a CSS file and an HTML file in the service code file;
acquiring a configuration file of a corresponding publishing environment according to the publishing environment of the target page;
processing the JavaScript file according to the service code file and the page configuration data;
acquiring a specific dependency component of the target page and a template dependency component of each page template included in the target page, and generating a corresponding dependency tree according to the specific dependency component and the template dependency component of each page template;
and injecting the configuration file of the publishing environment, the dependency tree, the processed JavaScript file and the CSS file into the HTML file to obtain a target page code file comprising the HTML file.
In some embodiments of the application, the step of processing the JavaScript script file according to the service code file and the page configuration data to obtain a processed JavaScript script file may include:
obtaining a JavaScript code in the service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second regular expression configured in advance;
calling a pre-configured character string template engine to acquire a second target field and a second code processing strategy from the second annotation content, and acquiring second target data corresponding to the second target field from the page configuration data;
performing data processing on the second target data according to the second code processing strategy to generate a corresponding second data character string;
and injecting the generated second data character string into the JavaScript file to generate a processed JavaScript file.
In some embodiments of the present application, the step of obtaining the specific dependency component of the target page and the template dependency component of each page template included in the target page, and generating the corresponding dependency tree according to the specific dependency component and the template dependency component of each page template may include:
acquiring a JavaScript component and a CSS style component which are depended by the target page;
acquiring an HTML file, a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
and combining the JavaScript component and the CSS style component which are depended by the target page and the HTML file, the JavaScript dependency component and the CSS dependency component of each page template included by the target page to generate a corresponding dependency tree.
In some embodiments of the present application, if the target page code file includes a nodess code file, the step of rendering the target page according to the target page code file may include:
and reading and executing the NodeJS code in the NodeJS code file, and rendering the target page according to an execution result.
In some embodiments of the present application, if the target page code file further includes an HTML file, the step of rendering the target page according to the execution result includes:
injecting an execution result into the HTML file to obtain a target HTML file;
and rendering the target page according to the target HTML file.
In some embodiments of the application, after the step of rendering the target page according to the target page code file, the method may further include:
and returning the rendered target page to the service requester terminal for display.
According to another aspect of the embodiments of the present application, there is provided a page rendering apparatus applied to a server, the apparatus including:
the data acquisition module is used for acquiring page configuration data and a service code file of a target page after receiving a page acquisition request aiming at the target page and sent by a service requester terminal;
the page code file processing module is used for detecting the page code type of a page code file included in the target page, and respectively processing the page code file according to the page code type of the page code file, the service code file and the page configuration data to obtain the target page code file including a NodeJS code file and/or an HTML file;
and the page rendering module is used for rendering the target page according to the target page code file.
According to another aspect of embodiments of the present application, there is provided a readable storage medium, on which a computer program is stored, which, when executed by a processor, can perform the steps of the page rendering method described above.
Based on any aspect, when the service of the page needs to be changed, the page configuration data and the service code file only need to be configured in advance, then the page code file is processed according to the configured service code file and the page configuration data to form a new target page code file, and then the page rendered according to the target page code file is the modified page, so that the usable service can be quickly generated according to various service requirements, secondary development of the page is not needed, and development resources are saved.
In addition, in some embodiments, the data dictionary configured by the service provider terminal and for the target page is further acquired, where the data dictionary includes JSON data of basic form components and JSON data of extended form components, then a corresponding visual configuration page is generated according to the data dictionary and sent to the service provider terminal for display, data required to be displayed by the corresponding form components configured in each configuration area by the service provider terminal is acquired, page configuration data of the target page is generated according to the data required to be displayed by each configured form component, and the page configuration data is stored. Therefore, a set of visual configuration pages can be quickly generated by developers without manual development, communication and docking costs of business parties and the developers are reduced, and in addition, configuration contents of various form components are not required to be acquired from a server through a network request, so that server resources are saved.
In order to make the aforementioned objects, features and advantages of the embodiments of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 shows an interaction schematic block diagram of a page rendering system provided by an embodiment of the application;
FIG. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device that may implement the server, the service requester terminal, and the service provider terminal of FIG. 1 provided by an embodiment of the present application;
FIG. 3 is a flowchart illustrating one of page rendering methods provided by embodiments of the present application;
fig. 4 shows a second flowchart of the page rendering method provided in the embodiment of the present application;
FIG. 5 is a block diagram of functional modules of a page rendering apparatus according to an embodiment of the present disclosure;
FIG. 6 is a second block diagram illustrating functional blocks of a page rendering apparatus according to an embodiment of the present disclosure;
fig. 7 shows a third functional block diagram of a page rendering apparatus according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some of the embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
To enable those skilled in the art to utilize the present disclosure, the following embodiments are presented in conjunction with a specific application scenario, "net appointment taxi taking scenario". It will be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the application. Although the present application is described primarily in the context of a "net appointment taxi taking scenario," it should be understood that this is only one exemplary embodiment. The application can be applied to any other traffic type. For example, the present application may be applied to different transportation system environments, including terrestrial, marine, or airborne, among others, or any combination thereof. The vehicle of the transportation system may include a taxi, a private car, a windmill, a bus, a train, a bullet train, a high speed rail, a subway, a ship, an airplane, a spacecraft, a hot air balloon, or an unmanned vehicle, etc., or any combination thereof. The application can also comprise any service system for online taxi taking, for example, a system for sending and/or receiving express delivery, and a service system for business transaction of buyers and sellers. Applications of the system or method of the present application may include web pages, plug-ins for browsers, client terminals, customization systems, internal analysis systems, or artificial intelligence robots, among others, or any combination thereof.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
The terms "passenger," "requestor," "service person," "service requestor," and "customer" are used interchangeably in this application to refer to an individual, entity, or tool that can request or order a service. The terms "driver," "provider," "service provider," and "provider" are used interchangeably in this application to refer to an individual, entity, or tool that can provide a service. The term "user" in this application may refer to an individual, entity or tool that requests a service, subscribes to a service, provides a service, or facilitates the provision of a service. For example, the user may be a passenger, a driver, an operator, etc., or any combination thereof. In the present application, "passenger" and "passenger terminal" may be used interchangeably, and "driver" and "driver terminal" may be used interchangeably.
In order to solve at least one technical problem described in the background of the present application, embodiments of the present application provide a page rendering method, an apparatus, a server, and a readable storage medium, when a page needs to be modified for service, only page configuration data and a service code file need to be configured in advance, then the page code file is processed according to the configured service code file and the page configuration data to form a new target page code file, and then a page rendered according to the target page code file is a modified page, so that a usable service can be quickly generated according to various service requirements, secondary development of the page is not needed, and development resources are saved. The technical solution of the present application is explained below by means of possible implementations.
FIG. 1 is an architecture diagram of a page rendering system 100 provided by an alternative embodiment of the present application. For example, the page rendering system 100 may be an online transportation service platform relied upon for transportation services such as taxi, designated drive service, express service, carpool service, bus service, driver rental service, or regular service, or a combination of any of the above. The page rendering system 100 may include a server 110, a network 120, a service requester terminal 130, a service provider terminal 140, and a database 150, and the server 110 may include a processor therein to perform an instruction operation. The page rendering system 100 shown in fig. 1 is only one possible example, and in other possible embodiments, the page rendering system 100 may include only one of the components shown in fig. 1 or may also include other components.
In some embodiments, the server 110 may be a single server or a group of servers. The set of servers can be centralized or distributed (e.g., the servers 110 can be a distributed system). In some embodiments, the server 110 may be local or remote to the terminal. For example, the server 110 may access information stored in the service requester terminal 130, the service provider terminal 140, and the database 150, or any combination thereof, via the network 120. As another example, the server 110 may be directly connected to at least one of the service requester terminal 130, the service provider terminal 140, and the database 150 to access information and/or data stored therein. In some embodiments, the server 110 may be implemented on a cloud platform; by way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud (community cloud), a distributed cloud, an inter-cloud, a multi-cloud, and the like, or any combination thereof. In some embodiments, the server 110 may be implemented on an electronic device 200 having one or more of the components shown in FIG. 2 in the present application.
In some embodiments, the server 110 may include a processor. The processor may process information and/or data related to the service request to perform one or more of the functions described herein. For example, in a express service, the processor may determine the target vehicle based on a service request obtained from the service requester terminal 130. A processor may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (S)). Merely by way of example, a Processor may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction Set Processor (ASIP), a Graphics Processing Unit (GPU), a Physical Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller Unit, a reduced Instruction Set computer (reduced Instruction Set computer), a microprocessor, or the like, or any combination thereof.
Network 120 may be used for the exchange of information and/or data. In some embodiments, one or more components in the page rendering system 100 (e.g., the server 110, the service requester terminal 130, the service provider terminal 140, and the database 150) may send information and/or data to other components. For example, the server 110 may obtain a service request from the service requester terminal 130 via the network 120. In some embodiments, the network 120 may be any type of wired or wireless network, or combination thereof. Merely by way of example, Network 130 may include a wired Network, a Wireless Network, a fiber optic Network, a telecommunications Network, an intranet, the internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a WLAN, a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a bluetooth Network, a ZigBee Network, a Near Field Communication (NFC) Network, or the like, or any combination thereof. In some embodiments, network 120 may include one or more network access points. For example, the network 120 may include wired or wireless network access points, such as base stations and/or network switching nodes, through which one or more components of the page rendering system 100 may connect to the network 120 to exchange data and/or information.
In some embodiments, the user of the service requestor terminal 130 may be someone other than the actual demander of the service. For example, the user a of the service requester terminal 130 may use the service requester terminal 130 to initiate a service request for the service actual demander B (for example, the user a may call a car for his friend B), or receive service information or instructions from the server 110. In some embodiments, the user of the service provider terminal 140 may be the actual provider of the service or may be another person than the actual provider of the service. For example, user C of the service provider terminal 140 may use the service provider terminal 140 to receive a service request serviced by the service provider entity D (e.g., user C may pick up an order for driver D employed by user C), and/or information or instructions from the server 110. In some embodiments, "service requester" and "service requester terminal" may be used interchangeably, and "service provider" and "service provider terminal" may be used interchangeably.
In some embodiments, the service requester terminal 130 may comprise a mobile device, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, etc., or any combination thereof. In some embodiments, the mobile device may include a smart home device, a wearable device, a smart mobile device, a virtual reality device, an augmented reality device, or the like, or any combination thereof. In some embodiments, the smart home devices may include smart lighting devices, control devices for smart electrical devices, smart monitoring devices, smart televisions, smart cameras, or walkie-talkies, or the like, or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart lace, smart glass, a smart helmet, a smart watch, a smart garment, a smart backpack, a smart accessory, and the like, or any combination thereof. In some embodiments, the smart mobile device may include a smartphone, a Personal Digital Assistant (PDA), a gaming device, a navigation device, or a point of sale (POS) device, or the like, or any combination thereof. In some embodiments, the virtual reality device and/or the augmented reality device may include a virtual reality helmet, virtual reality glass, a virtual reality patch, an augmented reality helmet, augmented reality glass, an augmented reality patch, or the like, or any combination thereof. For example, the virtual reality device and/or augmented reality device may include various virtual reality products and the like. In some embodiments, the built-in devices in the motor vehicle may include an on-board computer, an on-board television, and the like.
Database 150 may store data and/or instructions. In some embodiments, the database 150 may store data obtained from the service requester terminal 130 and/or the service provider terminal 140. In some embodiments, database 150 may store data and/or instructions for the exemplary methods described herein. In some embodiments, database 150 may include mass storage, removable storage, volatile Read-write Memory, or Read-Only Memory (ROM), among others, or any combination thereof. By way of example, mass storage may include magnetic disks, optical disks, solid state drives, and the like; removable memory may include flash drives, floppy disks, optical disks, memory cards, zip disks, tapes, and the like; volatile read-write Memory may include Random Access Memory (RAM); the RAM may include Dynamic RAM (DRAM), Double data Rate Synchronous Dynamic RAM (DDR SDRAM); static RAM (SRAM), Thyristor-Based Random Access Memory (T-RAM), Zero-capacitor RAM (Zero-RAM), and the like. By way of example, ROMs may include Mask Read-Only memories (MROMs), Programmable ROMs (PROMs), Erasable Programmable ROMs (PERROMs), Electrically Erasable Programmable ROMs (EEPROMs), compact disk ROMs (CD-ROMs), digital versatile disks (ROMs), and the like. In some embodiments, database 150 may be implemented on a cloud platform. By way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, across clouds, multiple clouds, or the like, or any combination thereof.
In some embodiments, a database 150 may be connected to the network 120 to communicate with one or more components in the page rendering system 100 (e.g., the server 110, the service requestor terminal 130, the service provider terminal 140, etc.). One or more components in the page rendering system 100 may access data or instructions stored in the database 150 via the network 120. In some embodiments, the database 150 may be directly connected to one or more components in the page rendering system 100 (e.g., the server 110, the service requestor terminal 130, the service provider terminal 140, etc.); alternatively, in some embodiments, database 150 may also be part of server 110.
In some embodiments, one or more components in the page rendering system 100 (e.g., the server 110, the service requestor terminal 130, the service provider terminal 140, etc.) may have access to the database 150. In some embodiments, one or more components in the page rendering system 100 may read and/or modify information related to a service requestor, a service provider, or the public, or any combination thereof, when certain conditions are met. For example, server 110 may read and/or modify information for one or more users after receiving a service request.
In some embodiments, the exchange of information by one or more components in the page rendering system 100 may be accomplished by a request service. The object of the service request may be any product. In some embodiments, the product may be a tangible product or a non-physical product. Tangible products may include food, pharmaceuticals, commodities, chemical products, appliances, clothing, automobiles, homes, or luxury goods, and the like, or any combination thereof. The non-material product may include a service product, a financial product, a knowledge product, an internet product, or the like, or any combination thereof. The internet product may include a stand-alone host product, a network product, a mobile internet product, a commercial host product, an embedded product, or the like, or any combination thereof. The internet product may be used in software, programs, or systems of the mobile terminal, etc., or any combination thereof. The mobile terminal may include a tablet, a laptop, a mobile phone, a Personal Digital Assistant (PDA), a smart watch, a Point of sale (POS) device, a vehicle-mounted computer, a vehicle-mounted television, a wearable device, or the like, or any combination thereof. The internet product may be, for example, any software and/or application used in a computer or mobile phone. The software and/or applications may relate to social interaction, shopping, transportation, entertainment time, learning, or investment, or the like, or any combination thereof. In some embodiments, the transportation-related software and/or applications may include travel software and/or applications, vehicle dispatch software and/or applications, mapping software and/or applications, and the like. In the vehicle scheduling software and/or application, the vehicle may include a horse, a carriage, a human powered vehicle (e.g., unicycle, bicycle, tricycle, etc.), an automobile (e.g., taxi, bus, privatege, etc.), a train, a subway, a ship, an airplane (e.g., airplane, helicopter, space shuttle, rocket, hot air balloon, etc.), etc., or any combination thereof.
Fig. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device 200 of a server 110, a service requester terminal 130, a service provider terminal 140, which may implement the concepts of the present application, according to some embodiments of the present application. For example, the processor 220 may be used on the electronic device 200 and to perform the functions herein.
The electronic device 200 may be a general purpose computer or a special purpose computer, both of which may be used to implement the page rendering method of the present application. Although only a single computer is shown, for convenience, the functions described herein may be implemented in a distributed fashion across multiple similar platforms to balance processing loads.
For example, the electronic device 200 may include a network port 210 connected to a network, one or more processors 220 for executing program instructions, a communication bus 230, and a different form of storage medium 240, such as a disk, ROM, or RAM, or any combination thereof. Illustratively, the computer platform may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application may be implemented in accordance with these program instructions. The electronic device 200 also includes an Input/Output (I/O) interface 250 between the computer and other Input/Output devices (e.g., keyboard, display screen).
For ease of illustration, only one processor is depicted in the electronic device 200. However, it should be noted that the electronic device 200 in the present application may also comprise a plurality of processors, and thus the steps performed by one processor described in the present application may also be performed by a plurality of processors in combination or individually. For example, if the processor of the electronic device 200 executes steps a and B, it should be understood that steps a and B may also be executed by two different processors together or separately in one processor. For example, a first processor performs step a and a second processor performs step B, or the first processor and the second processor perform steps a and B together.
Fig. 3 illustrates a flowchart of a page rendering method of some embodiments of the present application, which is performed by the server 110 illustrated in fig. 1. It should be understood that, in other embodiments, the order of some steps in the page rendering method according to this embodiment may be interchanged according to actual needs, or some steps may be omitted or deleted. The detailed steps of the page rendering method are described as follows.
In step S110, after receiving the page obtaining request for the target page sent by the service requester terminal 130, the page configuration data and the service code file of the target page are obtained.
In this embodiment, the user may use various services provided by the server 110 on the service requester terminal 130, and select a required service to enter a target page corresponding to the service, in which process a page acquisition request for the target page is sent to the server 110. Taking the car booking service as an example, the user may select a related car taking service, such as a express service, a taxi service, a single car service, and the like, through contents, pictures, and the like displayed in each display area in the WEB page displayed on the service requester terminal 130, and then select a target service. For example, after receiving the express delivery service selected by the user, the service requester terminal 130 sends a page acquisition request of a target page where the express delivery service is located to the server 110.
In the prior art, the configuration scheme for the pages of these services is configured by a set of configuration systems, and provides an interface for external personnel to access. However, the inventor finds that the current configuration system is separated from the actual page, the business side needs to communicate with the configuration system, and the developer needs to interface with the configuration system, thereby increasing the communication cost. For example, for a page of the express service, the configuration system is separated from the page of the express service, and if the page service provided by the page of the express service needs to be updated, after a business party and a developer are in butt joint with the configuration system, how to configure the page service is determined, so that the communication cost in the whole process is increased. In addition, in the configuration process, an additional Http request needs to be sent to the server 110 to obtain the configuration content, thereby occupying the resources of the server 110 and requiring additional development cost and docking cost.
In order to solve the above problem, the inventors of the present application have made intensive studies and first proposed the following solutions before this step S110.
As an embodiment, first, a data dictionary configured by the service provider terminal 140 for the target page is obtained, where the data dictionary includes JSON (JSON Object Notation) data of the basic form component and JSON data of the extended form component.
Wherein the developer may develop some basic form components, such as JSON data for input boxes, drop-down boxes, dates, etc., on the service provider terminal 140 in advance. On the basis, JSON data of other extension form components can be developed, for example, JSON data of a one-key alarm component is added in a express bus service page. And then generating a data dictionary according to the JSON data of the basic form component and the JSON data of the extended form component, and sending the data dictionary to the server 110.
Next, the server 110 may generate a corresponding visualization configuration page according to the data dictionary and transmit the visualization configuration page to the service provider terminal 140 for display. The visualization configuration page comprises configuration areas of the basic form component and the extended form component, and developers can configure data required to be displayed by the basic form component and the extended form component in the configuration areas.
Then, the server 110 obtains data that needs to be displayed by the corresponding form component (the basic form component and the extended form component) configured in each configuration area by the service provider terminal 140, generates page configuration data of a target page according to the data that needs to be displayed by each configured form component, and stores the page configuration data. For example, if the data that the a form component originally needs to display is the a data, then the configuration area of the a form component may be configured to modify the a data that needs to be displayed into the B data.
Therefore, a set of visual configuration pages can be quickly generated by developers without manual development, communication and docking costs of business parties and the developers are reduced, and configuration contents of various form components are not required to be acquired from the server 110 through a network request, so that resources of the server 110 are saved.
On this basis, the server 110 further needs to obtain a service code file of the target page configured by the service provider terminal 140, and store the service code file, where the service code file may include a nodjs code, an HTML code, a JavaScript code, and a comment content, and the comment content is used to represent that this code portion needs to obtain the aforementioned stored configuration data.
In this way, when the target page is changed, the server 110 first obtains the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page. As an embodiment, the server 110 may obtain, after receiving a page obtaining request for a target page sent by the service requester terminal 130, a page ID of the target page from the page obtaining request, and obtain, according to the page ID, page configuration data and a page code file of the target page from a pre-stored page database of each page, where the page database of each page corresponds to the page ID of the page.
Step S120, detecting the page code type of the page code file included by the target page, and respectively processing the page code file according to the page code type, the service code file and the page configuration data of the page code file to obtain the target page code file including the NodeJS code file and/or the HTML file.
In a possible implementation manner, if the page code type of the page code file is the nodess code type, the nodess code in the service code file is obtained, and the corresponding first annotation content is obtained from the nodess code according to a first regular expression configured in advance. And then, invoking a pre-configured character string template engine to acquire the first target field and the first code processing strategy from the annotation content, for example, invoking the pre-configured character string template engine to acquire the first target field and the first code processing strategy from a code editing area in the first annotation content, where the first target field and the first code processing strategy are matched, and acquiring the first target field and the first code processing strategy from the code editing area. Then, first target data corresponding to the first target field is obtained from the page configuration data. And then, performing data processing on the first target data according to the first code processing strategy to generate a corresponding first data character string, and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
For example, if the first annotation content obtained is:
/**----CMS Fields Begin----**/
var tagsInfo={};
try{
tagsInfo=JSON.parse('$$[tagsInfo|stringify]');
}catch(e){}
/**----CMS Fields End----**/
on the basis of obtaining the first annotation content, a pre-configured character string template engine can be called to match a first target field and a code editing area $ { } where the first code processing strategy is located in the first annotation content, and obtain a first target field tagsInfo and a first code processing strategy stripingity from the code editing area $ { }. Then, first target data corresponding to the first target field tagsInfo is obtained from the page configuration data. And then, performing data processing on the first target data according to the first code processing strategy string to generate a corresponding first data character string, and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
In another possible implementation, if the page code type of the page code file is a front-end page code type, then:
firstly, a JavaScript script file, a css (cascading styles files) file, and an html (hypertext Markup language) file in the service code file are obtained.
The JavaScript script file is an executable file written according to a certain format using a specific descriptive language, and is also called a macro or batch file. Scripts can typically be temporarily called and executed by an application. Therefore, the JavaScript file can be applied to WEB page design, because the JavaScript file not only can reduce the scale of the webpage and improve the browsing speed of the webpage, but also can enrich the expression of the webpage, such as animation, sound and the like. For example, when a user clicks a mobile phone number on a express service page, dialing software such as a telephone can be automatically called through the function of a JavaScript script file.
The CSS file is used to store CSS code and is a computer language used to render HTML file styles, and in particular, a language that defines style structures such as fonts, colors, locations, etc., and is used to describe the way information on a page is formatted and rendered. CSS styles may be stored directly on the HTML web page or in a separate style sheet file. Either way, the style sheet contains rules that apply the style to elements of the specified type. For external use, style sheet rules are placed in an external style sheet document with file extension _ css. Style rules are formatting instructions that may be applied to elements in a web page, such as text paragraphs or links. A style rule consists of one or more style attributes and their values. The internal style sheet is directly placed in a webpage, the external style sheet is stored in an independent document, and the webpage is linked with the external style sheet through a special label. The "cascading" in the name CSS indicates the manner in which style sheet rules are applied to HTML file elements. Specifically, styles in the CSS style sheet form a hierarchy, with more specific styles overlaying common styles. The priority of the style rules is determined by the CSS according to this hierarchy, thereby achieving a cascading effect.
And meanwhile, acquiring a configuration file of the corresponding publishing environment according to the publishing environment of the target page. For example, a corresponding configuration file is acquired for each of the distribution environment a and the distribution environment B, and the configuration file may be used to indicate a path for connecting a server providing the test environment, and for example, the configuration file may be an address (IP address, MAC address, etc.) of a server interface of the distribution environment a and the distribution environment B.
And then, processing the JavaScript file according to the service code file and the page configuration data. As an implementation manner, first, a JavaScript code in a service code file is obtained, and corresponding second annotation content is obtained from the JavaScript code according to a second regular expression configured in advance. And then, calling a pre-configured character string template engine to acquire a second target field and a second code processing strategy from the second annotation content, and acquiring second target data corresponding to the second target field from the page configuration data. And then, performing data processing on the second target data according to the second code processing strategy to generate a corresponding second data character string. And finally, injecting the generated second data character string into a JavaScript script file, and generating a processed JavaScript script file.
Meanwhile, a specific dependency component of the target page and a template dependency component of each page template included in the target page are obtained, and a corresponding dependency tree is generated according to the specific dependency component and the template dependency components of each page template. As an implementation manner, firstly, a JavaScript script component and a CSS style component that a target page depends on may be obtained, then, an HTML file, a JavaScript dependent component, and a CSS dependent component of each page template included in the target page are obtained, and finally, the JavaScript script component and the CSS style component that the target page depends on and the HTML file, the JavaScript dependent component, and the CSS dependent component of each page template included in the target page are merged to generate a corresponding dependency tree.
On the basis, finally, the configuration file, the dependency tree, the processed JavaScript script file and the CSS file of the publishing environment are injected into the HTML file to obtain a target page code file comprising the HTML file.
And step S130, rendering the target page according to the target page code file.
In a possible implementation manner, if the target page code file comprises a nodess code file, since the front-end page is not involved at this time, the nodess code in the nodess code file is read and executed, and the target page is rendered according to the execution result.
In another possible implementation, if the target page code file further includes an HTML file, in the process of reading and executing the nodess code in the nodess code file and rendering the target page according to the execution result, the execution result needs to be injected into the HTML file to obtain the target HTML file, and the target page is rendered according to the target HTML file.
In addition, if the rendered target page is a pure static page, the pure static page is uploaded to a CDN (content delivery Network) to relieve the pressure of the server 110. Meanwhile, the subsequent service requester terminal 130 directly accesses a pure static page on the CDN without accessing the server 110 because it does not involve interaction with the server 110.
Therefore, when the page needs to be changed in service, the page configuration data and the service code file only need to be configured in advance, then the page code file is processed according to the configured service code file and the page configuration data to form a new target page code file, and then the page rendered according to the target page code file is the changed page, so that the usable service can be quickly generated according to various service requirements, secondary development of the page is not needed, and development resources are saved.
In addition, in the embodiment of the present application, a data dictionary configured by the service provider terminal 140 and for a target page is obtained, where the data dictionary includes JSON data of basic form components and JSON data of extended form components, then a corresponding visual configuration page is generated according to the data dictionary and sent to the service provider terminal 140 for display, data that needs to be displayed by the corresponding form components configured in each configuration area by the service provider terminal 140 is obtained, page configuration data of the target page is generated according to the data that needs to be displayed by each configured form component, and the page configuration data is stored. Therefore, a set of visual configuration pages can be quickly generated by developers without manual development, communication and docking costs of business parties and the developers are reduced, and in addition, configuration contents of various form components are not required to be acquired from the server 110 through a network request, so that server resources are saved.
In a further embodiment, referring to fig. 4, the page rendering method provided in the embodiment of the present application may further include the following steps:
step S140, returning the rendered target page to the service requester terminal 130 for display.
In this embodiment, since the rendered target page is the modified page, the user can experience various service services provided by the target page at the first time.
Fig. 5 shows a block diagram of a page rendering apparatus 300 according to some embodiments of the present application, where the functions implemented by the page rendering apparatus 300 correspond to the steps executed by the method described above. The apparatus may be understood as the server 110 or a processor of the server 110, or may be understood as a component that is independent from the server 110 or the processor and implements the functions of the present application under the control of the server 110, as shown in fig. 5, the page rendering apparatus 300 may include a data obtaining module 310, a page code file processing module 320, and a page rendering module 330.
The data obtaining module 310 may be configured to obtain the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal 130. It is understood that the data obtaining module 310 may be configured to perform the step S110, and for a detailed implementation of the data obtaining module 310, reference may be made to the content related to the step S110.
The page code file processing module 320 may be configured to detect a page code type of a page code file included in the target page, and process the page code file according to the page code type of the page code file, the service code file, and the page configuration data, respectively, to obtain the target page code file including the nodess code file and/or the HTML file. It is understood that the pagecode file processing module 320 can be used to execute the above step S120, and for the detailed implementation of the pagecode file processing module 320, reference can be made to the above contents related to step S120.
Page rendering module 330 may be configured to render the target page according to the target page code file. It is understood that the page rendering module 330 can be used to perform the step S130, and the detailed implementation of the page rendering module 330 can refer to the content related to the step S130.
In one possible implementation manner, referring to fig. 6, the page rendering apparatus 300 may further include a data dictionary obtaining module 301, a configuration page sending module 302, and a configuration page sending module 303.
A data dictionary obtaining module 301, configured to obtain a data dictionary configured by the service provider terminal 140 and for the target page, where the data dictionary includes JSON data of the basic form component and JSON data of the extended form component.
A configuration page sending module 302, configured to generate a corresponding visual configuration page according to the data dictionary and send the visual configuration page to the service provider terminal 140 for display, where the visual configuration page includes configuration areas of the basic form component and the extended form component,
The page configuration data storage module 303 is configured to obtain data that needs to be displayed by the corresponding form component configured in each configuration area by the service provider terminal 140, generate page configuration data of the target page according to the data that needs to be displayed by each configured form component, and store the page configuration data.
In a possible implementation manner, still referring to fig. 6, the page rendering apparatus 300 may further include a service code file obtaining module 304, and the service code file obtaining module 304 may be configured to obtain a service code file of a target page configured by the service provider terminal 140, and store the service code file, where the service code file includes a nodjs code, an HTML code, a JavaScript code, and a comment content, and the comment content is used to represent that configuration data needs to be obtained.
In a possible implementation manner, the data obtaining module 304 may specifically be configured to:
after receiving a page acquisition request for a target page sent by the service requester terminal 130, acquiring a page ID of the target page from the page acquisition request;
and acquiring page configuration data and a page code file of the target page from a pre-stored page database of each page according to the page ID, wherein the page database of each page corresponds to the page ID of the page.
In a possible implementation manner, if the page code type of the page code file is the nodess code type, the page code file processing module 320 may be specifically configured to:
acquiring a NodeJS code in the service code file;
acquiring corresponding first annotation content from the NodeJS code according to a first regular expression configured in advance;
calling a pre-configured character string template engine to acquire a first target field and a first code processing strategy from the annotation content, and acquiring first target data corresponding to the first target field from page configuration data;
performing data processing on the first target data according to the first code processing strategy to generate a corresponding first data character string;
and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
In a possible implementation manner, the manner of calling the pre-configured string template engine to obtain the first target field and the first code processing policy from the annotation content may include:
and calling a pre-configured character string template engine to match the first target field and the code editing area where the first code processing strategy is located in the annotation content, and acquiring the first target field and the first code processing strategy from the code editing area.
In a possible implementation manner, if the page code type of the page code file is a front end page code type, the page code file processing module 320 may be specifically configured to:
acquiring a JavaScript file, a CSS file and an HTML file in the service code file;
acquiring a configuration file of a corresponding publishing environment according to the publishing environment of the target page;
processing the JavaScript file according to the service code file and the page configuration data;
acquiring a specific dependency component of a target page and a template dependency component of each page template included in the target page, and generating a corresponding dependency tree according to the specific dependency component and the template dependency component of each page template;
and injecting the configuration file, the dependency tree, the processed JavaScript file and the CSS file of the publishing environment into the HTML file to obtain a target page code file comprising the HTML file.
In a possible implementation manner, the pagecode file processing module 320 may specifically obtain the processed JavaScript script file by:
obtaining a JavaScript code in a service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second regular expression configured in advance;
calling a pre-configured character string template engine to acquire a second target field and a second code processing strategy from second annotation content, and acquiring second target data corresponding to the second target field from page configuration data;
performing data processing on the second target data according to a second code processing strategy to generate a corresponding second data character string;
and injecting the generated second data character string into a JavaScript script file to generate a processed JavaScript script file.
In a possible implementation, the pagecode file processing module 320 may specifically generate the corresponding dependency tree by:
acquiring a JavaScript component and a CSS style component which are depended by the target page;
acquiring HTML files, JavaScript dependent components and CSS dependent components of all page templates included in a target page;
and combining the JavaScript component and the CSS style component which are depended by the target page and the HTML file, the JavaScript dependent component and the CSS dependent component of each page template included by the target page to generate a corresponding dependency tree.
In a possible implementation manner, if the target page code file includes a nodess code file, the page rendering module 330 may be specifically configured to: and reading and executing the NodeJS code in the NodeJS code file, and rendering a target page according to an execution result.
In a possible implementation manner, if the target page code file further includes an HTML file, the page rendering module 330 may be specifically configured to inject the execution result into the HTML file to obtain a target HTML file, and render the target page according to the target HTML file.
In a possible implementation manner, referring to fig. 7, the page rendering apparatus 300 may further include a target page returning module 340, and the target page returning module 340 may be configured to return the rendered target page to the service requester terminal 130 for display.
The modules may be connected or in communication with each other via a wired or wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may comprise a connection over a LAN, WAN, bluetooth, ZigBee, NFC, or the like, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units.
An embodiment of the present application further provides a readable storage medium, where the readable storage medium stores computer-executable instructions, and the computer-executable instructions may execute the page rendering method in any method embodiment described above.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (26)

1. A page rendering method is applied to a server, and comprises the following steps:
after receiving a page acquisition request aiming at a target page sent by a service requester terminal, acquiring page configuration data and a service code file of the target page;
detecting the page code type of a page code file included in the target page, and respectively processing the page code file according to the page code type of the page code file, the service code file and the page configuration data to obtain a target page code file including a NodeJS code file and/or an HTML file;
and rendering the target page according to the target page code file.
2. The page rendering method according to claim 1, wherein before the step of obtaining the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal, the method further comprises:
acquiring a data dictionary which is configured by a service provider terminal and aims at the target page, wherein the data dictionary comprises JSON data of a basic form assembly and JSON data of an extended form assembly;
generating a corresponding visual configuration page according to the data dictionary and sending the visual configuration page to the service provider terminal for displaying, wherein the visual configuration page comprises configuration areas of the basic form component and the extended form component;
and acquiring data required to be displayed by the corresponding form component configured in each configuration area by the service provider terminal, generating page configuration data of the target page according to the configured data required to be displayed by each form component, and storing the page configuration data.
3. The page rendering method according to claim 1, wherein before the step of obtaining the page configuration data and the service code file of the target page after receiving the page obtaining request for the target page sent by the service requester terminal, the method further comprises:
and acquiring a service code file of the target page configured by the terminal of the service provider, and storing the service code file, wherein the service code file comprises a NodeJS code, an HTML code, a JavaScript code and annotation content, and the annotation content is used for representing that the configuration data needs to be acquired.
4. The page rendering method according to claim 1, wherein the step of obtaining the page configuration data and the service code file of the target page after receiving a page obtaining request for the target page sent by a service requester terminal comprises:
after receiving a page acquisition request aiming at a target page sent by a service requester terminal, acquiring a page ID of the target page from the page acquisition request;
and acquiring the page configuration data and the page code file of the target page from a pre-stored page database of each page according to the page ID, wherein the page database of each page corresponds to the page ID of the page.
5. The page rendering method according to any one of claims 1 to 4, wherein the step of processing the page code file according to the page code type of the page code file, the service code file, and the page configuration data, respectively, to obtain a target page code file including a NodeJS code file and/or an HTML file, includes:
if the page code type of the page code file is the NodeJS code type, acquiring a NodeJS code in the service code file;
acquiring corresponding first annotation content from the NodeJS code according to a first regular expression configured in advance;
calling a pre-configured character string template engine to acquire a first target field and a first code processing strategy from the annotation content, and acquiring first target data corresponding to the first target field from the page configuration data;
performing data processing on the first target data according to the first code processing strategy to generate a corresponding first data character string;
and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
6. The page rendering method of claim 5, wherein the step of invoking a pre-configured string template engine to obtain the first target field and the first code processing policy from the annotation content comprises:
and calling a pre-configured character string template engine to match the first target field and the code editing area where the first code processing strategy is located from the first annotation content, and acquiring the first target field and the first code processing strategy from the code editing area.
7. The page rendering method according to any one of claims 1 to 4, wherein the step of processing the page code file according to the page code type of the page code file, the service code file, and the page configuration data, respectively, to obtain a target page code file including a NodeJS code file and/or an HTML file, includes:
if the page code type of the page code file is the front-end page code type, acquiring a JavaScript file, a CSS file and an HTML file in the service code file;
acquiring a configuration file of a corresponding publishing environment according to the publishing environment of the target page;
processing the JavaScript file according to the service code file and the page configuration data;
acquiring a specific dependency component of the target page and a template dependency component of each page template included in the target page, and generating a corresponding dependency tree according to the specific dependency component and the template dependency component of each page template;
and injecting the configuration file of the publishing environment, the dependency tree, the processed JavaScript file and the CSS file into the HTML file to obtain a target page code file comprising the HTML file.
8. The page rendering method according to claim 7, wherein the step of processing the JavaScript script file according to the service code file and the page configuration data to obtain a processed JavaScript script file comprises:
obtaining a JavaScript code in the service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second regular expression configured in advance;
calling a pre-configured character string template engine to acquire a second target field and a second code processing strategy from the second annotation content, and acquiring second target data corresponding to the second target field from the page configuration data;
performing data processing on the second target data according to the second code processing strategy to generate a corresponding second data character string;
and injecting the generated second data character string into the JavaScript file to generate a processed JavaScript file.
9. The page rendering method according to claim 7, wherein the step of obtaining the specific dependency component of the target page and the template dependency component of each page template included in the target page, and generating the corresponding dependency tree according to the specific dependency component and the template dependency component of each page template includes:
acquiring a JavaScript component and a CSS style component which are depended by the target page;
acquiring an HTML file, a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
and combining the JavaScript component and the CSS style component which are depended by the target page and the HTML file, the JavaScript dependency component and the CSS dependency component of each page template included by the target page to generate a corresponding dependency tree.
10. The page rendering method of claim 1, wherein if the target page code file comprises a nodess code file, the step of rendering the target page according to the target page code file comprises:
and reading and executing the NodeJS code in the NodeJS code file, and rendering the target page according to an execution result.
11. The page rendering method according to claim 10, wherein if the target page code file further includes an HTML file, the step of rendering the target page according to the execution result includes:
injecting an execution result into the HTML file to obtain a target HTML file;
and rendering the target page according to the target HTML file.
12. The page rendering method of claim 1, wherein after the step of rendering the target page according to the target page code file, the method further comprises:
and returning the rendered target page to the service requester terminal for display.
13. A page rendering device applied to a server, the device comprising:
the data acquisition module is used for acquiring page configuration data and a service code file of a target page after receiving a page acquisition request aiming at the target page and sent by a service requester terminal;
the page code file processing module is used for detecting the page code type of a page code file included in the target page, and respectively processing the page code file according to the page code type of the page code file, the service code file and the page configuration data to obtain the target page code file including a NodeJS code file and/or an HTML file;
and the page rendering module is used for rendering the target page according to the target page code file.
14. The page rendering apparatus of claim 13, wherein the apparatus further comprises:
the data dictionary acquisition module is used for acquiring a data dictionary which is configured by a service provider terminal and aims at the target page, wherein the data dictionary comprises JSON data of a basic form component and JSON data of an extended form component;
a configuration page sending module, configured to generate a corresponding visual configuration page according to the data dictionary and send the visual configuration page to the service provider terminal for display, where the visual configuration page includes configuration areas of the basic form component and the extended form component;
and the page configuration data storage module is used for acquiring the data which needs to be displayed by the corresponding form component configured in each configuration area by the service provider terminal, generating the page configuration data of the target page according to the configured data which needs to be displayed by each form component, and storing the page configuration data.
15. The page rendering apparatus of claim 13, wherein the apparatus further comprises:
and the service code file acquisition module is used for acquiring a service code file of the target page configured by the terminal of the service provider and storing the service code file, wherein the service code file comprises a NodeJS code, an HTML code, a JavaScript code and annotation content, and the annotation content is used for representing the configuration data which needs to be acquired.
16. The page rendering device according to claim 13, wherein the data obtaining module is specifically configured to:
after receiving a page acquisition request aiming at a target page sent by a service requester terminal, acquiring a page ID of the target page from the page acquisition request;
and acquiring the page configuration data and the page code file of the target page from a pre-stored page database of each page according to the page ID, wherein the page database of each page corresponds to the page ID of the page.
17. The page rendering device according to any one of claims 13 to 16, wherein if the page code type of the page code file is the nodjs code type, the page code file processing module is specifically configured to:
acquiring a NodeJS code in the service code file;
acquiring corresponding first annotation content from the NodeJS code according to a first regular expression configured in advance;
calling a pre-configured character string template engine to acquire a first target field and a first code processing strategy from the annotation content, and acquiring first target data corresponding to the first target field from the page configuration data;
performing data processing on the first target data according to the first code processing strategy to generate a corresponding first data character string;
and injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file.
18. The page rendering apparatus of claim 17, wherein the pagecode file processing module obtains the first target field and the first code processing policy by:
and calling a pre-configured character string template engine to match the first target field and the code editing area where the first code processing strategy is located from the first annotation content, and acquiring the first target field and the first code processing strategy from the code editing area.
19. The page rendering device according to any one of claims 13 to 16, wherein if the page code type of the page code file is a front-end page code type, the page code file processing module is specifically configured to:
acquiring a JavaScript file, a CSS file and an HTML file in the service code file;
acquiring a configuration file of a corresponding publishing environment according to the publishing environment of the target page;
processing the JavaScript file according to the service code file and the page configuration data;
acquiring a specific dependency component of the target page and a template dependency component of each page template included in the target page, and generating a corresponding dependency tree according to the specific dependency component and the template dependency component of each page template;
and injecting the configuration file of the publishing environment, the dependency tree, the processed JavaScript file and the CSS file into the HTML file to obtain a target page code file comprising the HTML file.
20. The page rendering device of claim 19, wherein the pagecode file processing module obtains the processed JavaScript script file by:
obtaining a JavaScript code in the service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second regular expression configured in advance;
calling a pre-configured character string template engine to acquire a second target field and a second code processing strategy from the second annotation content, and acquiring second target data corresponding to the second target field from the page configuration data;
performing data processing on the second target data according to the second code processing strategy to generate a corresponding second data character string;
and injecting the generated second data character string into the JavaScript file to generate a processed JavaScript file.
21. The page rendering apparatus of claim 19, wherein the pagecode file processing module generates the corresponding dependency tree by:
acquiring a JavaScript component and a CSS style component which are depended by the target page;
acquiring an HTML file, a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
and combining the JavaScript component and the CSS style component which are depended by the target page and the HTML file, the JavaScript dependency component and the CSS dependency component of each page template included by the target page to generate a corresponding dependency tree.
22. The page rendering apparatus of claim 13, wherein if the target page code file comprises a nodess code file, the page rendering module is specifically configured to:
and reading and executing the NodeJS code in the NodeJS code file, and rendering the target page according to an execution result.
23. The page rendering device of claim 22, wherein if the target page code file further comprises an HTML file, the page rendering module is specifically configured to:
injecting an execution result into the HTML file to obtain a target HTML file;
and rendering the target page according to the target HTML file.
24. The page rendering apparatus of claim 14, wherein the apparatus further comprises:
and the target page returning module is used for returning the rendered target page to the service requester terminal for displaying.
25. A server, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the server is running, the processor executing the machine-readable instructions to perform the steps of the page rendering method of any of claims 1-12 when executed.
26. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, performs the steps of the page rendering method according to any one of claims 1-12.
CN201811584129.6A 2018-12-24 2018-12-24 Page rendering method, device, server and readable storage medium Active CN111352682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811584129.6A CN111352682B (en) 2018-12-24 2018-12-24 Page rendering method, device, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811584129.6A CN111352682B (en) 2018-12-24 2018-12-24 Page rendering method, device, server and readable storage medium

Publications (2)

Publication Number Publication Date
CN111352682A true CN111352682A (en) 2020-06-30
CN111352682B CN111352682B (en) 2023-11-10

Family

ID=71192025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811584129.6A Active CN111352682B (en) 2018-12-24 2018-12-24 Page rendering method, device, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN111352682B (en)

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN112035197A (en) * 2020-08-11 2020-12-04 深圳前海微众银行股份有限公司 Configuration method and device of front-end page
CN112115399A (en) * 2020-09-02 2020-12-22 北京一亩田新农网络科技有限公司 Method and device for changing page theme based on cs, electronic equipment and computer readable medium
CN112363794A (en) * 2020-11-30 2021-02-12 华云数据控股集团有限公司 Rendering method of front-end list type component and electronic equipment
CN112631565A (en) * 2020-12-25 2021-04-09 深圳云之家网络有限公司 Service fusion method and device, computer equipment and storage medium
CN112642157A (en) * 2020-12-31 2021-04-13 广州华多网络科技有限公司 Agent development control method and corresponding device, equipment and medium
CN112684968A (en) * 2020-12-28 2021-04-20 北京五八信息技术有限公司 Page display method and device, electronic equipment and computer readable medium
CN112685667A (en) * 2020-12-29 2021-04-20 浪潮软件科技有限公司 Data interaction method and device, computer readable medium and interaction server
CN112732254A (en) * 2020-12-29 2021-04-30 车巴达(苏州)网络科技有限公司 Webpage development method and device, computer equipment and storage medium
CN112965699A (en) * 2021-04-12 2021-06-15 中国工商银行股份有限公司 Front-end page generation method, device, computer system and readable storage medium
CN113138763A (en) * 2021-04-14 2021-07-20 招商银行股份有限公司 Page construction method, device, equipment and computer readable storage medium
CN113158115A (en) * 2021-04-09 2021-07-23 北京房江湖科技有限公司 Configuration page display method and device, electronic equipment and storage medium
CN113157274A (en) * 2021-05-20 2021-07-23 北京字节跳动网络技术有限公司 Software development method and device based on micro front end, electronic equipment and storage medium
CN113468460A (en) * 2021-09-02 2021-10-01 北京优锘科技有限公司 Method, device and equipment for rendering Web page based on YAML (Yaml language)
CN113487420A (en) * 2021-07-27 2021-10-08 中国银行股份有限公司 Page configuration method and device for transaction request, electronic equipment and storage medium
CN113486282A (en) * 2021-07-23 2021-10-08 北京乐学帮网络技术有限公司 Page generation method and device
CN113656717A (en) * 2021-08-06 2021-11-16 上海硬通网络科技有限公司 Webpage control rendering method, device, equipment and storage medium
CN113821751A (en) * 2021-11-24 2021-12-21 中国电力科学研究院有限公司 Browser optimization method and system, computer equipment and readable storage medium
CN113821749A (en) * 2021-09-30 2021-12-21 上海柯林布瑞信息技术有限公司 Page generation method based on JS real-time analysis and computer
CN113918252A (en) * 2021-09-22 2022-01-11 北京三快在线科技有限公司 Interface display method and device, computer equipment and storage medium
CN114090105A (en) * 2021-02-02 2022-02-25 京东科技信息技术有限公司 System building method and device
CN114153547A (en) * 2021-12-06 2022-03-08 珠海金山数字网络科技有限公司 Management page display method and device
CN114217874A (en) * 2021-12-16 2022-03-22 中国建设银行股份有限公司 Applet generation method, device, equipment, readable storage medium and product
CN114443169A (en) * 2022-01-28 2022-05-06 中国民生银行股份有限公司 Method and device for realizing technical component platformization
CN114780196A (en) * 2022-04-29 2022-07-22 北京百度网讯科技有限公司 User interface form rendering method and device, electronic equipment and storage medium
CN115098213A (en) * 2022-07-15 2022-09-23 北京有竹居网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN116009863A (en) * 2022-12-30 2023-04-25 中电金信软件有限公司 Front-end page rendering method, device and storage medium
CN116541120A (en) * 2023-07-05 2023-08-04 北京华顺信安信息技术有限公司 Webpage rendering mode identification method, system and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100223322A1 (en) * 2009-02-27 2010-09-02 Sun Microsystems, Inc. Server based framework for improving ajax performance
US20110249003A1 (en) * 2010-04-13 2011-10-13 Microsoft Corporation Configurable framework for rich data visualization
CN106843901A (en) * 2017-02-10 2017-06-13 广州优视网络科技有限公司 A kind of page rendering and the method and apparatus of checking
CN108446116A (en) * 2018-02-26 2018-08-24 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of the application program page
CN108614693A (en) * 2018-03-21 2018-10-02 阿里巴巴集团控股有限公司 It is a kind of for the processing method of page assembly, device and equipment
CN108846087A (en) * 2018-06-12 2018-11-20 恒生电子股份有限公司 A kind of page rendering method, apparatus, terminal and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100223322A1 (en) * 2009-02-27 2010-09-02 Sun Microsystems, Inc. Server based framework for improving ajax performance
US20110249003A1 (en) * 2010-04-13 2011-10-13 Microsoft Corporation Configurable framework for rich data visualization
CN106843901A (en) * 2017-02-10 2017-06-13 广州优视网络科技有限公司 A kind of page rendering and the method and apparatus of checking
CN108446116A (en) * 2018-02-26 2018-08-24 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of the application program page
CN108614693A (en) * 2018-03-21 2018-10-02 阿里巴巴集团控股有限公司 It is a kind of for the processing method of page assembly, device and equipment
CN108846087A (en) * 2018-06-12 2018-11-20 恒生电子股份有限公司 A kind of page rendering method, apparatus, terminal and server

Cited By (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN112035197B (en) * 2020-08-11 2021-07-13 深圳前海微众银行股份有限公司 Configuration method and device of front-end page
CN112035197A (en) * 2020-08-11 2020-12-04 深圳前海微众银行股份有限公司 Configuration method and device of front-end page
CN112115399A (en) * 2020-09-02 2020-12-22 北京一亩田新农网络科技有限公司 Method and device for changing page theme based on cs, electronic equipment and computer readable medium
CN112363794A (en) * 2020-11-30 2021-02-12 华云数据控股集团有限公司 Rendering method of front-end list type component and electronic equipment
CN112363794B (en) * 2020-11-30 2024-02-06 华云数据控股集团有限公司 Rendering method of front-end list component and electronic equipment
CN112631565A (en) * 2020-12-25 2021-04-09 深圳云之家网络有限公司 Service fusion method and device, computer equipment and storage medium
CN112684968A (en) * 2020-12-28 2021-04-20 北京五八信息技术有限公司 Page display method and device, electronic equipment and computer readable medium
CN112685667A (en) * 2020-12-29 2021-04-20 浪潮软件科技有限公司 Data interaction method and device, computer readable medium and interaction server
CN112732254A (en) * 2020-12-29 2021-04-30 车巴达(苏州)网络科技有限公司 Webpage development method and device, computer equipment and storage medium
CN112732254B (en) * 2020-12-29 2023-08-08 车巴达(苏州)网络科技有限公司 Webpage development method, webpage development device, computer equipment and storage medium
CN112642157A (en) * 2020-12-31 2021-04-13 广州华多网络科技有限公司 Agent development control method and corresponding device, equipment and medium
CN114090105A (en) * 2021-02-02 2022-02-25 京东科技信息技术有限公司 System building method and device
CN113158115A (en) * 2021-04-09 2021-07-23 北京房江湖科技有限公司 Configuration page display method and device, electronic equipment and storage medium
CN112965699A (en) * 2021-04-12 2021-06-15 中国工商银行股份有限公司 Front-end page generation method, device, computer system and readable storage medium
CN112965699B (en) * 2021-04-12 2024-04-30 中国工商银行股份有限公司 Front-end page generation method, device, computer system and readable storage medium
CN113138763A (en) * 2021-04-14 2021-07-20 招商银行股份有限公司 Page construction method, device, equipment and computer readable storage medium
CN113157274A (en) * 2021-05-20 2021-07-23 北京字节跳动网络技术有限公司 Software development method and device based on micro front end, electronic equipment and storage medium
CN113157274B (en) * 2021-05-20 2023-11-24 抖音视界有限公司 Software development method and device based on micro front end, electronic equipment and storage medium
CN113486282A (en) * 2021-07-23 2021-10-08 北京乐学帮网络技术有限公司 Page generation method and device
CN113487420A (en) * 2021-07-27 2021-10-08 中国银行股份有限公司 Page configuration method and device for transaction request, electronic equipment and storage medium
CN113656717B (en) * 2021-08-06 2024-05-28 上海硬通网络科技有限公司 Webpage control rendering method, device, equipment and storage medium
CN113656717A (en) * 2021-08-06 2021-11-16 上海硬通网络科技有限公司 Webpage control rendering method, device, equipment and storage medium
CN113468460A (en) * 2021-09-02 2021-10-01 北京优锘科技有限公司 Method, device and equipment for rendering Web page based on YAML (Yaml language)
CN113918252A (en) * 2021-09-22 2022-01-11 北京三快在线科技有限公司 Interface display method and device, computer equipment and storage medium
CN113821749A (en) * 2021-09-30 2021-12-21 上海柯林布瑞信息技术有限公司 Page generation method based on JS real-time analysis and computer
CN113821749B (en) * 2021-09-30 2023-09-01 上海柯林布瑞信息技术有限公司 Page generation method and computer based on JS real-time analysis
CN113821751A (en) * 2021-11-24 2021-12-21 中国电力科学研究院有限公司 Browser optimization method and system, computer equipment and readable storage medium
CN114153547B (en) * 2021-12-06 2023-11-17 珠海金山数字网络科技有限公司 Management page display method and device
CN114153547A (en) * 2021-12-06 2022-03-08 珠海金山数字网络科技有限公司 Management page display method and device
CN114217874A (en) * 2021-12-16 2022-03-22 中国建设银行股份有限公司 Applet generation method, device, equipment, readable storage medium and product
CN114443169A (en) * 2022-01-28 2022-05-06 中国民生银行股份有限公司 Method and device for realizing technical component platformization
CN114780196B (en) * 2022-04-29 2023-07-28 北京百度网讯科技有限公司 User interface form rendering method and device, electronic equipment and storage medium
CN114780196A (en) * 2022-04-29 2022-07-22 北京百度网讯科技有限公司 User interface form rendering method and device, electronic equipment and storage medium
CN115098213A (en) * 2022-07-15 2022-09-23 北京有竹居网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN116009863A (en) * 2022-12-30 2023-04-25 中电金信软件有限公司 Front-end page rendering method, device and storage medium
CN116009863B (en) * 2022-12-30 2024-01-19 中电金信软件有限公司 Front-end page rendering method, device and storage medium
CN116541120A (en) * 2023-07-05 2023-08-04 北京华顺信安信息技术有限公司 Webpage rendering mode identification method, system and computer equipment
CN116541120B (en) * 2023-07-05 2023-11-14 北京华顺信安信息技术有限公司 Webpage rendering mode identification method, system and computer equipment

Also Published As

Publication number Publication date
CN111352682B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
CN111352682B (en) Page rendering method, device, server and readable storage medium
US11537607B2 (en) Automated sequential site navigation
CN111352649A (en) Code processing method, device, server and readable storage medium
US9569865B2 (en) Supporting color fonts
CN104809209A (en) Display method, display device and server of social network information flow
US12120074B2 (en) Generating and accessing video content for products
AU2019236737A1 (en) Systems and methods for displaying vehicle information for on-demand services
US10326858B2 (en) System and method for dynamically generating personalized websites
CN111401388A (en) Data mining method, device, server and readable storage medium
US9262550B2 (en) Processing semi-structured data
CN112070587A (en) Information sharing method and device for virtual article, electronic equipment and storage medium
CN111435936B (en) Cloud host creation method, cloud host creation device, server and computer readable storage medium
CN111507116A (en) Code scanning method and device, code scanning equipment and computer readable storage medium
CN109271160A (en) Active rule construction method, device and computer system, medium
CN102929877B (en) List data on webpage is generated method and the device of form document
US20130304747A1 (en) Characteristic-based selection in a networked computing environment
US20230247102A1 (en) Addressing previous client device technology in online platforms
CN107247785A (en) A kind of static readonly map file generation method and device
CN111274471B (en) Information pushing method, device, server and readable storage medium
US20160162977A1 (en) Account creation overlay
CN113419806B (en) Image processing method, device, computer equipment and storage medium
CN111222932A (en) Order period calculation method and device and electronic equipment
CN112748924B (en) Inventory display method and system
CN115033233A (en) Interface calling method and device, electronic equipment and storage medium
US9424243B1 (en) Mechanism to support composite data models in HTML form

Legal Events

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