CN111352682B - 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
CN111352682B
CN111352682B CN201811584129.6A CN201811584129A CN111352682B CN 111352682 B CN111352682 B CN 111352682B CN 201811584129 A CN201811584129 A CN 201811584129A CN 111352682 B CN111352682 B CN 111352682B
Authority
CN
China
Prior art keywords
page
target
file
code
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.)
Active
Application number
CN201811584129.6A
Other languages
Chinese (zh)
Other versions
CN111352682A (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

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 device, a server and a readable storage medium, which are used for acquiring page configuration data and service code files of a target page after receiving a page acquisition request for the target page sent by a service request side terminal, then detecting the page code type of the page code files included in the target page, respectively processing the page code files according to the page code type of the page code files, the service code files and the page configuration data to obtain target page code files including NodeJS code files and/or HTML files, and finally rendering the target page according to the target page code files. Therefore, the page rendered according to the target page code file is the modified page, so that usable services can be quickly generated according to various business requirements, secondary development of 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, a device, a server, and a readable storage medium.
Background
At present, the mainstream WEB page development mode is that an HTML file is stored on a server, corresponding JavaScript script codes are developed by front-end personnel, packaged and uploaded to the server, and then the server correlates the HTML file and the JavaScript script codes and stores the HTML file and the JavaScript script codes as a page code file. However, this approach has the disadvantage that the page code file is stored in the code repository entirely, and if it is to be modified, it needs to be developed again, so that any changes made to the WEB page (e.g., adding page services, modifying the service type, etc.) each time need the developer to modify the code to be on-line again, which greatly wastes development resources.
Disclosure of Invention
Accordingly, an object of an embodiment of the present application is to provide a page rendering method, apparatus, server and readable storage medium, which can quickly generate usable services according to various service requirements, without secondary development of pages, and save development resources.
According to an aspect of embodiments of the present application, an electronic device is provided 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 in operation, the processor and the storage medium communicate via a bus, and the processor executes the machine-readable instructions to perform the page rendering method.
According to another aspect of the embodiment of the present application, there is provided a page rendering method, applied to a server, the method including: after receiving a page acquisition request for 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, after 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 configured by a service provider terminal and aiming at the target page, wherein the data dictionary comprises JSON data of a basic form component and JSON data of an extended form component;
Generating a corresponding visual configuration page according to the data dictionary, and sending the visual configuration page to the service provider terminal for display, wherein the visual configuration page comprises configuration areas of the basic form component and the extended form component;
the data required to be displayed by the corresponding form components configured in each configuration area by the service provider terminal are obtained, the page configuration data of the target page are generated according to the data required to be displayed by each configured form component, and the page configuration data are stored.
In some embodiments of the present application, after 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 service provider terminal, and storing the service code file, wherein the service code file comprises NodeJS codes, HTML codes, javaScript codes 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 acquiring the page configuration data and the service code file of the target page after receiving the page acquisition 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 page configuration data and a page code file of the target page from page databases of all pre-stored pages 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 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 nodjs code file and/or an HTML file may include:
if the page code type of the page code file is NodeJS code type, acquiring NodeJS codes in the service code file;
acquiring corresponding first annotation content from the NodeJS codes according to a first preset regular expression;
Invoking 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 calling a pre-configured 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 a code editing area where a 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 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 nodjs 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 script file, a CSS file and an HTML file in the service code file;
acquiring a configuration file of a corresponding release environment according to the release 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 release environment, the dependency tree, the processed JavaScript script 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 present 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 file may include:
acquiring JavaScript codes in the service code file;
Acquiring corresponding second annotation content from the JavaScript code according to a second pre-configured regular expression;
invoking 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 script file to generate a processed JavaScript script file.
In some embodiments of the present application, the step of obtaining 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 may include:
acquiring a JavaScript component and a CSS style component which are depended on by the target page;
acquiring an HTML file and a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
And merging the JavaScript script component and the CSS style component which are depended on by the target page, and the HTML files of the page templates, the JavaScript dependent component and the CSS dependent component which are included by the target page, so as to generate a corresponding dependency tree.
In some embodiments of the present application, if the target page code file includes a NodeJS code file, the step of rendering the target page according to the target page code file may include:
and reading and executing the NodeJS codes 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 the 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 present application, after the step of rendering the target page from 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 an embodiment 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 service code files 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 the 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 the NodeJS code file and/or the 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 the embodiments of the present application, there is provided a readable storage medium having stored thereon a computer program 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 is required to be changed, the embodiment of the application only needs to pre-configure the page configuration data and the service code file, then processes the page code file 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, thereby quickly generating usable service according to various service requirements, needing no secondary development of the page and saving development resources.
In addition, in some embodiments, the method further includes obtaining a data dictionary configured by the service provider terminal and aiming at the target page, wherein the data dictionary includes JSON data of a basic form component and JSON data of an extended form component, then generating a corresponding visual configuration page according to the data dictionary, sending the visual configuration page to the service provider terminal for display, obtaining data required to be displayed by the corresponding form component configured by the service provider terminal in each configuration area, 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. Therefore, a set of visual configuration pages can be quickly generated by a developer without manual development, meanwhile, the communication and docking cost of a business party and the developer is reduced, and in addition, the configuration content of each form component is not required to be acquired from a server through a network request, so that server resources are saved.
The foregoing objects, features and advantages of embodiments of the application will be more readily apparent from the following detailed description of the embodiments taken in conjunction with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates an interactive schematic block diagram of a page rendering system provided by an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device that may implement the server, service requester terminal, service provider terminal of FIG. 1, provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of a page rendering method according to an embodiment of the present application;
FIG. 4 is a second schematic flow chart of a page rendering method according to an embodiment of the present application;
FIG. 5 shows one of the functional block diagrams of the page rendering apparatus provided by the embodiment of the present application;
FIG. 6 is a second functional block diagram of a page rendering device according to an embodiment of the present application;
Fig. 7 is a block diagram illustrating a third functional module of the page rendering apparatus according to the embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
In order to enable those skilled in the art to use the present disclosure, the following embodiments are presented in connection with a specific application scenario "net about driving scenario". It will be apparent to those having ordinary skill 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 primarily described in the context of a "net jockey drive scene," it should be understood that this is but 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 land, sea, or air, or the like, or any combination thereof. The transportation means of the transportation system may include taxis, private cars, windmills, buses, trains, bullet trains, high speed railways, subways, ships, airplanes, spacecraft, hot air balloons, or unmanned vehicles, etc., or any combination thereof. The application may also include any service system for network about a car, e.g. a system for sending and/or receiving express, a service system for a transaction between a buyer and a seller. Applications of the system or method of the present application may include web pages, plug-ins to a browser, client terminals, customization systems, internal analysis systems, or artificial intelligence robots, etc., or any combination thereof.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
The terms "passenger," "requestor," "attendant," "service requestor," and "customer" are used interchangeably herein to refer to a person, entity, or tool that may request or subscribe to a service. The terms "driver," "provider," "service provider," and "provider" are used interchangeably herein to refer to a person, entity, or tool that can provide a service. The term "user" in the present application may refer to a person, entity or tool requesting, subscribing to, providing or facilitating the provision of a service. For example, the user may be a passenger, driver, 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 art of the present application, embodiments of the present application provide a method, an apparatus, a server, and a readable storage medium for rendering a page, where when a service change is required to be performed on the page, only page configuration data and service code files are configured in advance, then the page code files are processed according to the configured service code files and 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 is not required to be performed on the page, and development resources are saved. The technical scheme of the application is explained below through possible implementation modes.
FIG. 1 is a schematic architecture diagram of a page rendering system 100 according to an alternative embodiment of the present application. For example, the page rendering system 100 may be an online transport service platform for a transport service such as a taxi, a ride service, a express service, a carpool service, a bus service, a driver rental service, or a airliner service, or a combination of any of the above services. 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 a processor executing instruction operations may be included in the server 110. 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 a portion of the components shown in fig. 1 or may include other components as well.
In some embodiments, the server 110 may be a single server or a group of servers. The server farm may be centralized or distributed (e.g., server 110 may 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, server 110 may be implemented on a cloud platform; for example only, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud (community cloud), distributed cloud, inter-cloud (inter-cloud), multi-cloud (multi-cloud), and the like, or any combination thereof. In some embodiments, server 110 may be implemented on an electronic device 200 having one or more of the components shown in FIG. 2 of the present application.
In some embodiments, 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 in the present application. 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. The processor may include one or more processing cores (e.g., a single core processor (S) or a multi-core processor (S)). By way of example only, the Processor may include a central processing unit (Central Processing Unit, CPU), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), special instruction set Processor (Application Specific Instruction-set Processor, ASIP), graphics processing unit (Graphics Processing Unit, GPU), physical processing unit (Physics Processing Unit, PPU), digital signal Processor (Digital Signal Processor, DSP), field programmable gate array (Field Programmable Gate Array, FPGA), programmable logic device (Programmable Logic Device, PLD), controller, microcontroller unit, reduced instruction set computer (Reduced Instruction Set Computing, RISC), 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, network 120 may be any type of wired or wireless network, or a combination thereof. By way of example only, the 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 (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), a wireless local area network (Wireless Local Area Networks, WLAN), a metropolitan area network (Metropolitan Area Network, MAN), a wide area network (Wide Area Network, WAN), a public switched telephone network (Public Switched Telephone Network, PSTN), a bluetooth network, a ZigBee network, a near field communication (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, 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 page rendering system 100 may connect to network 120 to exchange data and/or information.
In some embodiments, the user of the service requester terminal 130 may be a person other than the actual consumer of the service. For example, user a of service requester terminal 130 may use service requester terminal 130 to initiate a service request for service actual requester B (e.g., user a may call his own friend B), or receive service information or instructions from server 110, etc. In some embodiments, the user of the service provider terminal 140 may be the actual service provider or may be a person other than the actual service provider. For example, user C of service provider terminal 140 may use service provider terminal 140 to receive a service request for providing a service by service actual provider D (e.g., user C may pick up for driver D employed by himself), and/or information or instructions from 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 include a mobile device, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, or the like, 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, or an augmented reality device, or the like, or any combination thereof. In some embodiments, the smart home device may include a smart lighting device, a control device for a smart appliance device, a smart monitoring device, a smart television, a smart video camera, or an intercom, or the like, or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart lace, a smart glass, a smart helmet, a smart watch, a smart garment, a smart backpack, a smart accessory, etc., or any combination thereof. In some embodiments, the smart mobile device may include a smart phone, a personal digital assistant (PersonalDigital 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, a virtual reality glass, a virtual reality patch, an augmented reality helmet, an augmented reality glass, an augmented reality patch, or the like, or any combination thereof. For example, the virtual reality device and/or the 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, database 150 may store data obtained from service requester terminal 130 and/or service provider terminal 140. In some embodiments, database 150 may store data and/or instructions for the exemplary methods described in the present disclosure. In some embodiments, database 150 may include mass storage, removable storage, volatile Read-write Memory, or Read-Only Memory (ROM), or the like, 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, magnetic tape, and the like; the volatile read-write memory may include random access memory (Random Access Memory, RAM); the RAM may include dynamic RAM (Dynamic Random Access Memory, DRAM), double data Rate Synchronous dynamic RAM (DDR SDRAM); static Random-Access Memory (SRAM), thyristor RAM (T-RAM) and Zero-capacitor RAM (Zero-RAM), etc. By way of example, ROM may include Mask Read-Only Memory (MROM), programmable ROM (Programmable Read-Only Memory, PROM), erasable programmable ROM (Programmable Erasable Read-Only Memory, PEROM), electrically erasable programmable ROM (Electrically Erasable Programmable Read Only Memory, EEPROM), compact disk ROM (CD-ROM), digital versatile disk ROM, and the like. In some embodiments, database 150 may be implemented on a cloud platform. For example only, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, cross-cloud, multi-cloud, or other similar, or the like, or any combination thereof.
In some embodiments, database 150 may be connected to network 120 to communicate with one or more components in page rendering system 100 (e.g., server 110, service requester terminal 130, 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, database 150 may be directly connected to one or more components in page rendering system 100 (e.g., server 110, service requester terminal 130, 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., server 110, service requester terminal 130, service provider terminal 140, etc.) may have access to the database 150. In some embodiments, one or more components in page rendering system 100 may read and/or modify information related to a service requester, 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 of one or more users after receiving a service request.
In some embodiments, the exchange of information of one or more components in the page rendering system 100 may be accomplished through 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. The tangible product may include a food, a pharmaceutical, a merchandise, a chemical product, an appliance, a garment, an automobile, a house, a luxury item, or the like, or any combination thereof. The non-substance 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 host product alone, a web 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, a program, a system, etc. of the mobile terminal, or any combination thereof. The mobile terminal may include a tablet computer, a notebook computer, a mobile phone, a personal digital assistant (Personal Digital Assistant, PDA), a smart watch, a Point of sale (POS) device, a car computer, a car television, or a wearable device, or the like, or any combination thereof. For example, the internet product may be any software and/or application used in a computer or mobile phone. The software and/or applications may involve social, shopping, shipping, 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 scheduling software and/or applications, drawing software and/or applications, and the like. In the vehicle scheduling software and/or applications, the vehicle may include horses, dollies, rickshaw (e.g., wheelbarrows, bicycles, tricycles, etc.), automobiles (e.g., taxis, buses, private cars, etc.), trains, subways, watercraft, aircraft (e.g., aircraft, helicopters, space shuttles, rockets, hot air balloons, etc.), and the like, or any combination thereof.
Fig. 2 shows 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 inventive concepts, according to some embodiments of the application. For example, the processor 220 may be used on the electronic device 200 and to perform functions in the present application.
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 one computer is shown, the functionality described herein may be implemented in a distributed fashion across multiple similar platforms for convenience 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 various forms of storage media 240, such as magnetic disk, ROM, or RAM, or any combination thereof. By way of example, 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. It should be noted, however, that the electronic device 200 of the present application may also include multiple processors, and thus, steps performed by one processor described in the present application may also be performed jointly by multiple processors or separately. For example, if the processor of the electronic device 200 performs steps a and B, it should be understood that steps a and B may also be performed by two different processors together or performed separately in one processor. For example, the first processor performs step a, the second processor performs step B, or the first processor and the second processor together perform steps a and B.
Fig. 3 illustrates a flow diagram of a page rendering method performed by the server 110 shown in fig. 1, according to some embodiments of the application. It should be understood that, in other embodiments, the order of some steps in the page rendering method described in 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 below.
Step S110, after receiving the page acquisition request for the target page sent by the service requester terminal 130, acquires the page configuration data and the service code file of the target page.
In this embodiment, the user may use various services provided by the server 110 on the service requester terminal 130, and select a desired service to enter a target page corresponding to the service, and in this process, send a page acquisition request for the target page to the server 110. Taking the network taxi taking service as an example, the user can select related taxi taking services, such as a taxi taking service, a bicycle taking 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, the service requester terminal 130, upon receiving a user selection of the express service, transmits a page acquisition request of a target page where the express service is located to the server 110.
In the prior art, the configuration scheme of the pages of the services is configured through a set of configuration systems, and an interface is provided 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 dock the configuration system, which results in increased communication cost. For example, for a page of a 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 need to interface 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, additional Http requests need to be sent to the server 110 to obtain the configuration content, so that resources of the server 110 are occupied, and additional development cost and docking cost are also required.
In order to solve the above-described problems, the present inventors have studied carefully, and before this step S110, first proposed the following.
As one embodiment, first, a data dictionary for a target page configured by the service provider terminal 140 is acquired, and the data dictionary includes JSON (JavaScript Object Notation, JS object profile) data of a basic form component and JSON data of an extended form component.
Wherein a developer may develop JSON data for some basic form components, such as input boxes, drop-down boxes, dates, etc., on the service provider terminal 140 in advance. On this basis, JSON data of other extended form components can be developed, for example, JSON data of a one-key alarm component is added in a express service page. And then generates a data dictionary from the JSON data of the base form component and the JSON data of the extended form component, and transmits the data dictionary to the server 110.
The server 110 may then generate a corresponding visual configuration page from the data dictionary and send the visual configuration page to the service provider terminal 140 for display. The visual configuration page comprises a configuration area of the basic form component and the extended form component, and a developer can configure data required to be displayed by the basic form component and the extended form component in the configuration area.
Then, the server 110 acquires data to be displayed by the corresponding form components (the base form component and the extension form component) configured in each configuration area by the service provider terminal 140, generates page configuration data of the target page according to the configured data to be displayed by each form component, and stores the page configuration data. For example, if the data that the form component needs to display is the a data, the configuration area of the form component may be configured to modify the a data that needs to be displayed into the B data.
In this way, a set of visual configuration pages can be quickly generated by the developer without manual development, meanwhile, the communication and docking cost of the service party and the developer is reduced, and in addition, the configuration content of each form component is not required to be acquired from the server 110 through a network request, so that the resources of the server 110 are saved.
On this basis, the server 110 also needs to acquire 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 nodeb code, an HTML code, a JavaScript code, and comment content, where the comment content is used to characterize that this code portion needs to acquire the foregoing stored configuration data.
In this way, when the target page changes on the basis of the above, the server 110 first acquires the page configuration data and the service code file of the target page after receiving the page acquisition request for the target page. As an embodiment, after receiving the page acquisition request for the target page sent by the service requester terminal 130, the server 110 may acquire the page ID of the target page from the page acquisition request, and acquire the page configuration data and the page code file of the target page from the page databases of the pre-stored pages according to the page ID, 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 in 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 one possible implementation manner, if the page code type of the page code file is a node js code type, the node js code in the service code file is obtained, and the corresponding first annotation content is obtained from the node js code according to a first preset regular expression. And then invoking a pre-configured character string template engine to acquire the first target field and the first code processing policy from the annotation content, for example, the pre-configured character string template engine may be invoked to match the first target field and the code editing area where the first code processing policy is located from the first annotation content, and acquire the first target field and the first code processing policy from the code editing area. Next, first target data corresponding to the first target field is acquired from the page configuration data. And then, carrying out data processing on the first target data according to a 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 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 a first code processing strategy is located in the first annotation content, and obtain a first target field tagsInfo and a first code processing strategy stringify from the code editing area $ ${ }. Next, first target data corresponding to the first target field tagsInfo is acquired from the page configuration data. And then, carrying out data processing on the first target data according to a first code processing strategy stringing 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.
Furthermore, in another possible implementation, if the page code type of the page code file is a front end page code type:
first, a JavaScript script file, CSS (Cascading Style Sheets) file, and HTML (HyperText Markup Language) file in a service code file are acquired.
The JavaScript script file is an executable file written according to a certain format by using a specific descriptive language, and is also called a macro or batch file. Scripts may typically be invoked and executed temporarily by an application. Therefore, the JavaScript script file can be applied to WEB page design, because the JavaScript file not only can reduce the size of the WEB page and improve the WEB page browsing speed, but also can enrich the expression of the WEB page, such as animation, sound, and the like. For example, when the user clicks the mobile phone number on the speed car service page, dialing software such as a telephone can be automatically called, which is realized through the function of a JavaScript script file.
The CSS file is used for storing CSS codes, and is a computer language for representing styles of HTML files, in particular, a language defining style structures such as fonts, colors, positions, etc., and is used for describing the format and reality of information on pages. The CSS style may be stored directly in the HTML web page or in a separate style sheet file. Either way, the style sheet contains rules that apply the style to the specified type of element. When externally used, the 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 the web page, the external style sheet is stored in a separate document, and the web page links the external style sheet through a special tag. The "stacking" in the name CSS indicates a manner in which style sheets are regularly applied to HTML file elements. Specifically, the styles in the CSS style sheet form a hierarchy, with more specific styles overlaying the generic style. The priority of the style rules is determined by the CSS according to this hierarchy, thereby achieving a cascading effect.
And simultaneously, acquiring a configuration file of the corresponding release environment according to the release environment of the target page. For example, corresponding configuration files are acquired for the release environment a and the release environment B, respectively, and the configuration files may be used to represent paths connecting servers providing the test environment, for example, the configuration files may be addresses (IP addresses, MAC addresses, etc.) of server interfaces of the release environment a and the release environment B.
And then, processing the JavaScript file according to the service code file and the page configuration data. As one implementation, first, a JavaScript code in a business code file is obtained, and corresponding second annotation content is obtained from the JavaScript code according to a second pre-configured regular expression. 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, carrying out data processing on the second target data according to a second code processing strategy to generate a corresponding second data character string. And finally, the generated second data character string is injected into the JavaScript file, and the processed JavaScript file is generated.
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 component of each page template. As one implementation, the JavaScript script component and the CSS style component which are depended on by the target page can be obtained first, then the HTML files and the JavaScript dependent components and the CSS dependent components of all page templates included by the target page are obtained, and finally the HTML files and the JavaScript dependent components and the CSS dependent components of all page templates included by the target page and the JavaScript script component and the CSS style component which are depended on by the target page are combined to generate corresponding dependency trees.
And finally, injecting the configuration file, the dependency tree, the processed JavaScript file and the CSS file of the release environment into the HTML file to obtain the target page code file comprising the HTML file.
And step S130, rendering the target page according to the target page code file.
In one possible implementation, if the target page code file includes a NodeJS code file, at this time, since the front-end page is not involved, the NodeJS code in the NodeJS code file is read and executed, and the target page is rendered according to the execution result.
In another possible implementation manner, if the target page code file further includes an HTML file, in a process of reading and executing the NodeJS code in the NodeJS code file, and rendering the target page according to the execution result, the execution result is further required to be injected into the HTML file, so as to obtain a target HTML file, and rendering the target page 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 the CDN (Content Delivery Network ) to relieve the pressure of the server 110. Meanwhile, the subsequent service requester terminal 130 directly accesses the pure static page on the CDN and does not access the server 110 because it does not involve interaction with the server 110.
Therefore, when the page needs to be subjected to service change, the embodiment of the application only needs to pre-configure the page configuration data and the service code file, then processes the page code file 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, thereby being capable of quickly generating usable service according to various service requirements, needing no secondary development on the page and saving development resources.
In addition, the embodiment of the application further obtains the data dictionary configured by the service provider terminal 140 and aiming at the target page, wherein the data dictionary comprises the JSON data of the basic form component and the JSON data of the extended form component, then generates a corresponding visual configuration page according to the data dictionary and sends the visual configuration page to the service provider terminal 140 for displaying, obtains the data required to be displayed by the corresponding form component configured by the service provider terminal 140 in each configuration area, generates the page configuration data of the target page according to the data required to be displayed by each configured form component, and stores the page configuration data. In this way, a set of visual configuration pages can be quickly generated by the developer without manual development, meanwhile, the communication and docking cost of the business party and the developer is reduced, and in addition, the configuration content of each form component is not required to be acquired from the server 110 through a network request, so that server resources are saved.
In a further implementation manner, referring to fig. 4, the page rendering method provided by the embodiment of the present application may further include the following steps:
and 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 device 300 according to some embodiments of the application, the functions performed by the page rendering device 300 corresponding to the steps performed by the method described above. The apparatus may be understood as the above-mentioned server 110, or a processor of the server 110, or may be understood as a component which is independent from the above-mentioned server 110 or 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 acquisition 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, after receiving a page obtaining request for a target page sent by the service requester terminal 130, page configuration data and a service code file of the target page. It will be appreciated that the data acquisition module 310 may be configured to perform step S110 described above, and reference may be made to the details of the implementation of the data acquisition module 310 as described above with respect to 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, 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. It will be appreciated that the page code file processing module 320 may be configured to perform step S120 described above, and reference may be made to the details of the implementation of the page code file processing module 320 as described above with respect to step S120.
The page rendering module 330 may be used to render a target page from a target page code file. It is understood that the page rendering module 330 may be used to perform the step S130 described above, and reference may be made to the details of the implementation of the page rendering module 330 regarding the step S130 described above.
In a possible implementation, 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.
The data dictionary obtaining module 301 is configured to obtain a data dictionary configured by the service provider terminal 140 for a target page, where the data dictionary includes JSON data of a basic form component and JSON data of an 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 a base form component and an extended form component,
The page configuration data storage module 303 is configured to obtain data required 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 configured data required to be displayed by each 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, where the service code file obtaining module 304 may be configured 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 includes a nodeb code, an HTML code, a JavaScript code, and comment content, and the comment content is used to characterize that configuration data needs to be obtained.
In one possible implementation, the data acquisition module 304 may be specifically 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 page databases of all pre-stored pages according to the page IDs, wherein the page database of each page corresponds to the page ID of the page.
In one possible implementation, if the page code type of the page code file is a nodjs code type, the page code file processing module 320 may specifically be configured to:
obtaining NodeJS codes in service code files;
Acquiring corresponding first annotation content from NodeJS codes according to a first preset regular expression;
invoking 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 a 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 one possible implementation, the method for calling the preconfigured 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 from the annotation content, and acquiring the first target field and the first code processing strategy from the code editing area.
In one possible implementation, if the page code type of the page code file is the front-end page code type, the page code file processing module 320 may specifically be configured to:
Acquiring a JavaScript file, a CSS file and an HTML file in a service code file;
acquiring a configuration file of a corresponding release environment according to the release 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 release environment into the HTML file to obtain a target page code file comprising the HTML file.
In one possible implementation, the page code file processing module 320 may specifically obtain the processed JavaScript script file by:
acquiring JavaScript codes in a service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second preset regular expression;
invoking 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 the JavaScript script file to generate a processed JavaScript script file.
In one possible implementation, page code file processing module 320 may specifically generate the corresponding dependency tree by:
acquiring a JavaScript component and a CSS style component which are depended on by a target page;
acquiring an HTML file and a JavaScript dependent component and a CSS dependent component of each page template included in a target page;
and merging the JavaScript script component and the CSS style component which are depended on by the target page, and the HTML files of the page templates, the JavaScript dependent component and the CSS dependent component which are included by the target page, so as to generate a corresponding dependency tree.
In one possible implementation, if the target page code file includes a NodeJS code file, the page rendering module 330 may be specifically configured to: and reading and executing the NodeJS codes in the NodeJS code file, and rendering the target page according to the execution result.
In one possible implementation, 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, obtain a target HTML file, and render the target page according to the target HTML file.
In a possible implementation, referring to fig. 7, the page rendering apparatus 300 may further include a target page returning module 340, where 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 communicate with each other via wired or wireless connections. The wired connection may include a metal cable, optical cable, hybrid cable, or the like, or any combination thereof. The wireless connection may include a connection through a LAN, WAN, bluetooth, zigBee, or NFC, 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.
The embodiment of the application also provides a readable storage medium, which stores computer executable instructions, and the computer executable instructions can execute the page rendering method in any of the above method embodiments.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the method embodiments, and are not repeated in the present disclosure. In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, and for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in 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 this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily appreciate variations or alternatives within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (22)

1. A method of page rendering, characterized by being applied to a server, the method comprising:
after receiving a page acquisition request for 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;
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 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 NodeJS code type, acquiring NodeJS codes in the service code file; acquiring corresponding first annotation content from the NodeJS codes according to a first preset regular expression; invoking 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; injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file;
if the page code type of the page code file is the front end page code type, acquiring a JavaScript script file, a CSS file and an HTML file in the service code file; acquiring a configuration file of a corresponding release environment according to the release 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; injecting the configuration file of the release 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;
And rendering the target page according to the target page code file.
2. The page rendering method according to claim 1, wherein, after receiving a page acquisition request for a target page sent by a service requester terminal, before the step of acquiring page configuration data and a service code file of the target page, the method further comprises:
acquiring a data dictionary configured by a service provider terminal and aiming at the target page, wherein the data dictionary comprises JSON data of a basic form component and JSON data of an extended form component;
generating a corresponding visual configuration page according to the data dictionary, and sending the visual configuration page to the service provider terminal for display, wherein the visual configuration page comprises configuration areas of the basic form component and the extended form component;
the data required to be displayed by the corresponding form components configured in each configuration area by the service provider terminal are obtained, the page configuration data of the target page are generated according to the data required to be displayed by each configured form component, and the page configuration data are stored.
3. The page rendering method according to claim 1, wherein, after receiving a page acquisition request for a target page sent by a service requester terminal, before the step of acquiring page configuration data and a service code file of the target page, the method further comprises:
and acquiring a service code file of the target page configured by the service provider terminal, and storing the service code file, wherein the service code file comprises NodeJS codes, HTML codes, javaScript codes 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 acquiring the page configuration data and the service code file of the target page after receiving the page acquisition request for the target page sent by the service requester terminal includes:
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 page configuration data and a page code file of the target page from page databases of all pre-stored pages 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 of claim 1, wherein the step of invoking a pre-configured string template engine to obtain a first target field and a 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 a code editing area where a 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.
6. The page rendering method according to claim 1, 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 includes:
acquiring JavaScript codes in the service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second pre-configured regular expression;
invoking 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 script file to generate a processed JavaScript script file.
7. The page rendering method according to claim 1, wherein the step of acquiring 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 on by the target page;
acquiring an HTML file and a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
and merging the JavaScript script component and the CSS style component which are depended on by the target page, and the HTML files of the page templates, the JavaScript dependent component and the CSS dependent component which are included by the target page, so as to generate a corresponding dependency tree.
8. The page rendering method of claim 1, wherein if the target page code file includes a nodjs code file, the step of rendering the target page from the target page code file includes:
And reading and executing the NodeJS codes in the NodeJS code file, and rendering the target page according to an execution result.
9. The page rendering method as claimed in claim 8, 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 the execution result into the HTML file to obtain a target HTML file;
and rendering the target page according to the target HTML file.
10. The page rendering method of claim 1, wherein after the step of rendering the target page from the target page code file, the method further comprises:
and returning the rendered target page to the service requester terminal for display.
11. A page rendering apparatus, for application to a server, the apparatus comprising:
the data acquisition module is used for acquiring page configuration data and service code files 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 the 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 the NodeJS code file and/or the HTML file;
If the page code type of the page code file is the NodeJS code type, the page code file processing module is specifically configured to: acquiring NodeJS codes in the service code file; acquiring corresponding first annotation content from the NodeJS codes according to a first preset regular expression; invoking 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; injecting the generated first data character string into the NodeJS code file to obtain a target page code file comprising the NodeJS code file;
if the page code type of the page code file is the 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 release environment according to the release 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; injecting the configuration file of the release 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;
And the page rendering module is used for rendering the target page according to the target page code file.
12. The page rendering apparatus of claim 11, wherein the apparatus further comprises:
the data dictionary acquisition module is used for acquiring a data dictionary aiming at the target page and configured by the service provider terminal, wherein the data dictionary comprises JSON data of a basic form component and JSON data of an extended form component;
the configuration page sending module is used for generating a corresponding visual configuration page according to the data dictionary and sending the visual configuration page to the service provider terminal for display, wherein the visual configuration page comprises configuration areas of the basic form component and the extension form component;
and the page configuration data storage module is used for acquiring the data required 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 required to be displayed by each form component, and storing the page configuration data.
13. The page rendering apparatus of claim 11, wherein the apparatus further comprises:
The service code file acquisition module is used for acquiring a service code file of the target page configured by the service provider terminal and storing the service code file, wherein the service code file comprises NodeJS codes, HTML codes, javaScript codes and annotation content, and the annotation content is used for representing that the configuration data need to be acquired.
14. The page rendering device of claim 11, wherein the data acquisition 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 page configuration data and a page code file of the target page from page databases of all pre-stored pages according to the page ID, wherein the page database of each page corresponds to the page ID of the page.
15. The page rendering device of claim 11, wherein the page code 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 a code editing area where a 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.
16. The page rendering device of claim 11, wherein the page code file processing module obtains the processed JavaScript script file by:
acquiring JavaScript codes in the service code file;
acquiring corresponding second annotation content from the JavaScript code according to a second pre-configured regular expression;
invoking 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 script file to generate a processed JavaScript script file.
17. The page rendering device of claim 11, wherein the page code file processing module generates the corresponding dependency tree by:
acquiring a JavaScript component and a CSS style component which are depended on by the target page;
Acquiring an HTML file and a JavaScript dependent component and a CSS dependent component of each page template included in the target page;
and merging the JavaScript script component and the CSS style component which are depended on by the target page, and the HTML files of the page templates, the JavaScript dependent component and the CSS dependent component which are included by the target page, so as to generate a corresponding dependency tree.
18. The page rendering device of claim 11, wherein if the target page code file includes a nodjs code file, the page rendering module is specifically configured to:
and reading and executing the NodeJS codes in the NodeJS code file, and rendering the target page according to an execution result.
19. The page rendering device of claim 18, wherein if the target page code file further comprises an HTML file, the page rendering module is specifically configured to:
injecting the execution result into the HTML file to obtain a target HTML file;
and rendering the target page according to the target HTML file.
20. The page rendering apparatus of claim 12, 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 display.
21. 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 run by a server, the processor executing the machine-readable instructions to perform the steps of the page rendering method of any of claims 1-10 when executed.
22. A readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, performs the steps of the page rendering method according to any of claims 1-10.
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 CN111352682A (en) 2020-06-30
CN111352682B true 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)

Families Citing this family (26)

* 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
CN112115399A (en) * 2020-09-02 2020-12-22 北京一亩田新农网络科技有限公司 Method and device for changing page theme based on cs, electronic equipment and computer readable medium
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
CN112732254B (en) * 2020-12-29 2023-08-08 车巴达(苏州)网络科技有限公司 Webpage development method, webpage development device, computer equipment and storage medium
CN112642157B (en) * 2020-12-31 2023-04-28 广州华多网络科技有限公司 Agent development control method and corresponding device, equipment and medium thereof
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
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
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
CN113468460B (en) * 2021-09-02 2022-02-25 北京优锘科技有限公司 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
CN113821749B (en) * 2021-09-30 2023-09-01 上海柯林布瑞信息技术有限公司 Page generation method and computer based on JS real-time analysis
CN113821751B (en) * 2021-11-24 2022-11-08 中国电力科学研究院有限公司 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
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
CN115098213A (en) * 2022-07-15 2022-09-23 北京有竹居网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN116009863B (en) * 2022-12-30 2024-01-19 中电金信软件有限公司 Front-end page rendering method, device and storage medium
CN116541120B (en) * 2023-07-05 2023-11-14 北京华顺信安信息技术有限公司 Webpage rendering mode identification method, system and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8990289B2 (en) * 2009-02-27 2015-03-24 Oracle America, Inc. Server based framework for improving Ajax performance
US20110249003A1 (en) * 2010-04-13 2011-10-13 Microsoft Corporation Configurable framework for rich data visualization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN111352682A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
CN111352682B (en) Page rendering method, device, server and readable storage medium
CN111352649B (en) Code processing method, device, server and readable storage medium
AU2019236737B2 (en) Systems and methods for displaying vehicle information for on-demand services
CN111367575B (en) User behavior prediction method and device, electronic equipment and storage medium
CN106610785B (en) commodity object list information processing method and device
CN113924152A (en) 3D avatar plug-in for third party games
WO2014100582A2 (en) Supporting color fonts
CN110400201A (en) Information displaying method, device, electronic equipment and medium
CN111274348B (en) Service feature data extraction method and device and electronic equipment
EP4173258A1 (en) Third-party modifications for a camera user interface
CN111435936B (en) Cloud host creation method, cloud host creation device, server and computer readable storage medium
EP4173266A1 (en) Camera user interface to generate content
CN114417064A (en) Data processing method and device, computer equipment and storage medium
CN111326147B (en) Speech recognition method, device, electronic equipment and storage medium
US20130304747A1 (en) Characteristic-based selection in a networked computing environment
CN109271160A (en) Active rule construction method, device and computer system, medium
CN107247785A (en) A kind of static readonly map file generation method and device
CN111274471B (en) Information pushing method, device, server and readable storage medium
CN116263659A (en) Data processing method, apparatus, computer program product, device and storage medium
CN106416127A (en) Methods and systems for legacy compatible software
US9424243B1 (en) Mechanism to support composite data models in HTML form
CN112035581A (en) Model-based task processing method, device, equipment and medium
CN111274106B (en) Order data analysis method and device and electronic equipment
KR102588706B1 (en) System for providing virtual star trading service for social media
CN112015421B (en) Article information display method and device, electronic equipment and computer readable medium

Legal Events

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