CN117234502A - Page rendering method, device, equipment and storage medium - Google Patents

Page rendering method, device, equipment and storage medium Download PDF

Info

Publication number
CN117234502A
CN117234502A CN202210635731.8A CN202210635731A CN117234502A CN 117234502 A CN117234502 A CN 117234502A CN 202210635731 A CN202210635731 A CN 202210635731A CN 117234502 A CN117234502 A CN 117234502A
Authority
CN
China
Prior art keywords
page
page rendering
request
call
rendering request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210635731.8A
Other languages
Chinese (zh)
Inventor
章天野
金康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210635731.8A priority Critical patent/CN117234502A/en
Publication of CN117234502A publication Critical patent/CN117234502A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure provides a page rendering method, a device, equipment and a storage medium, wherein the method is used for terminal equipment, and the terminal equipment is deployed with an application program, a JS engine and a Hybrid environment, and comprises the following steps: responding to a page rendering instruction initiated based on an application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render the target page, the pre-reading file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page; generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated; and rendering the target page according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment. Therefore, the method reduces development cost and improves page rendering efficiency.

Description

Page rendering method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computer and network communication, in particular to a page rendering method, device, equipment and storage medium.
Background
With the improvement of the performance of terminal devices and the continuous progress of artificial intelligence technology, more and more APP (Application program) is running on the terminal devices. When the user uses the APP, the user needs to click on a control on the APP page to jump and render the page. For example, first screen performance refers to the time elapsed from the user clicking on a page to showing a valid frame. The rendering efficiency of a page is a very important factor affecting the user's use of APP.
Currently, applications and Hybrid environments may be deployed in terminal devices. The local configuration of the application program is provided with a configuration file in a JSON format, and a local on-terminal SDK (Software Development Kit ) is matched with the JSON configuration file preset locally. And prefetching the page rendered data if any configuration file is hit. Initializing the Hybrid environment while prefetching, and sending the prefetched data to the initialized Hybrid environment for rendering.
However, the logical file for page rendering in the Hybrid environment is JS format, which is different from the format of JSON profile. During prefetching, staff is required to translate the JS logical file into the JSON configuration file, development cost is high, the translation process is complex along with continuous change of business logic iteration, consistency between the JS logical file and the JSON configuration file cannot be ensured, and page rendering efficiency and accuracy are affected.
Disclosure of Invention
The embodiment of the disclosure provides a page rendering method, device, equipment and storage medium, so as to improve the efficiency and precision of page rendering.
In a first aspect, an embodiment of the present disclosure provides a page rendering method, where the method is applied to a terminal device, and the terminal device is deployed with an application program, a JS engine, and a Hybrid environment, and includes:
responding to a page rendering instruction initiated based on the application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
In a second aspect, an embodiment of the present disclosure provides a page rendering apparatus, where the apparatus is applied to a terminal device, and the terminal device is deployed with an application program, a JS engine, and a Hybrid environment, and includes:
The pre-reading file determining module is used for responding to a page rendering instruction initiated by the application program and determining a pre-reading file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
the call credential generation module is used for generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and the page rendering module is used for rendering the target page according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to cause the at least one processor to perform the page rendering method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the page rendering method according to the first aspect and the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the page rendering method according to the first aspect and the various possible designs of the first aspect.
The method, the device, the equipment and the storage medium for rendering the page are provided, and an application program, a JS engine and a Hybrid environment are deployed in terminal equipment of the method. The Hybrid environment comprises a JS environment, namely, the JS engine and files in the Hybrid environment are both in a JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The JS engine generates call credentials for the page render request in the pre-read file, indicating that a call to the page render request has been initiated. And running a preset JS logical file in a Hybrid environment according to the call certificate and the page rendering request, and rendering the target page. Through the arrangement of the JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in the pre-reading and page rendering processes, the development cost is reduced, the inconformity of the pre-reading file and the logical file in the Hybrid environment in the rendering process is avoided, and the page rendering efficiency and accuracy are improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present disclosure, and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a schematic diagram of a prior art thread of page rendering;
fig. 2 is a schematic flow chart of a page rendering method according to an embodiment of the disclosure;
fig. 3 is a schematic flow chart of a page rendering method according to an embodiment of the disclosure;
fig. 4 is a schematic flow chart of a page rendering method according to an embodiment of the disclosure;
fig. 5 is a schematic flow chart of a page rendering method according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram of a thread of page rendering provided by an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a page rendering device according to an embodiment of the disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
Referring to fig. 1, fig. 1 is a schematic diagram of a thread for rendering a page in the prior art. In the prior art, the node one and the node two occur on the local end of the application program, the Worker refers to a non-main thread, namely a working thread, and the UI (User Interface) refers to a main thread. Node three occurs in the Hybrid environment, which runs JS codes, running on JS threads. prefatch. JSON is a configuration file written using JSON, index. JS is a rendering logic file written in JS format. Prefatch is denoted as pre-read, and json is the translation of the JS-format rendering logic file by the staff. Node one is represented as responding to a page rendering instruction, e.g., a user clicking on a Hybrid portal. The workbench on the Native terminal matches with preset configuration files, and if any configuration file is hit, a corresponding prefetch request is initiated, and the Hybrid environment synchronously starts to initialize. The prefetch request is the originating prefetch request. And the second node returns the prefetch request from the non-main thread to the main thread, and processes the prefetch request locally to obtain a processing result. The processing result may be data such as elements and positions that need to appear on the page at the time of page rendering. The Hybrid view init initializes the Hybrid environment. And thirdly, after initialization of the Hybrid environment is completed, synchronizing a processing result to the Hybrid environment, and performing rendering processing on the page in the Hybrid environment.
However, the use and maintenance costs in the prior art are high, the configuration file is written in the JSON format, the understanding cost is high, and the writing process is split and tedious along with the continuous change of business logic iteration. Original rendering logic files need to be manually rewritten into a JSON format, front-back logic consistency cannot be guaranteed, a split feeling exists between the function type and command type JS and the purely declarative JSONs, development experience is poor, and page rendering accuracy and efficiency are low. The embodiment of the disclosure provides a page rendering method to solve the above problems.
Fig. 2 is a flow chart of a page rendering method according to an embodiment of the disclosure. The method of the embodiment can be applied to terminal equipment, and the terminal equipment is deployed with an application program, a JS engine and a Hybrid environment. As shown in fig. 2, the page rendering method includes:
s201, responding to a page rendering instruction initiated based on an application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-reading file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page.
The user can manually send out the page rendering instruction of the APP, or set the page rendering instruction with timing to automatically send out the page rendering instruction. Whether the user sends out manually or automatically, the page of the APP is rendered based on the application program. For example, the user may open the home page of the APP by clicking a login button of the APP, and the instruction to open the home page is a page rendering instruction, that is, the page rendering instruction may be an instruction based on the APP to display a valid frame of the page.
The page rendering instruction is used for indicating to render the target page, and page identification information can be included in the page rendering instruction and used for representing the target page to be rendered. And acquiring page identification information from the page rendering instruction, and determining a target page according to the page identification information. For example, the target page may be determined from the URL (Uniform Resource Locator ) of the page.
Pre-reading files corresponding to different pages are pre-configured, and each pre-reading file is associated with the page for storage. After the target page is determined, a pre-read file corresponding to the target page is determined according to the pre-stored association relation. The pre-read file is pre. The pre-fetch file may include at least one JS-formatted page rendering request, each of which is used to indicate rendering of each element in the target page. An element may be content of a control, picture, text, table, etc. in a page for display. For example, the target page is an APP home page, the top left corner of the home page displays a picture, the bottom right corner of the home page displays a text, and all the contents displayed on the home page are elements, i.e., the picture in the top left corner is an element, and the text in the bottom right corner is an element. The picture rendering the upper left corner is a page rendering request in the pre-read file, and the text rendering the lower right corner is also a page rendering request in the pre-read file.
The pre-reading file is used for pre-acquiring a page rendering request in the target page in the process of rendering the target page, so that an application program can conveniently process the page rendering request, and data of elements required to be rendered in the page are obtained. The rendering logic file in JS format is set in the Hybrid environment, and the rendering logic file can be index. If the pre-read file is not set, the rendering logic file in the Hybrid environment is required to be executed for page rendering after the initialization of the Hybrid environment is waited. According to the embodiment of the disclosure, the page rendering request in the rendering logic file does not need to be processed after the initialization of the Hybrid environment, and the page rendering request in the pre-read file can be synchronously processed when the Hybrid environment is initialized, so that the page rendering efficiency is improved. That is, after responding to the page rendering request, the Hybrid environment is initialized, and the determination and execution of the pre-read file are performed synchronously.
S202, generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated.
The terminal device is deployed with a JS engine, wherein the JS engine can be a lightweight JS engine, and can directly operate the pre-read file in the JS format. The lighter the JS engine, the better the effect of this embodiment. The rendering logic file in the Hybrid environment is not required to be converted into a JSON format, and then the application program locally runs the pre-read file in the JSON format, so that errors of the pre-read file are avoided.
After the pre-read file of the target page is obtained, the lightweight JS engine executes the pre-read file and calls each page rendering request in the pre-read file. Each time a page rendering request is invoked, a corresponding invocation credential may be generated. That is, the call credential may indicate that a call to the page rendering request has been initiated. A call credential may also be generated after determining that all page rendering requests have been invoked. For example, a call to a page rendering request may be initiated through JSB (JsBridge). The lightweight JS engine calls the JSB, initiates a page rendering request to the application program, generates a call certificate every time one JSB call is initiated, and the call certificate can also be sent to the application program. The application program can send the call certificate to the Hybrid environment, and the call certificate can be used as an operation parameter of a rendering configuration file in the Hybrid environment, so that the rendering processing of pages in the Hybrid environment is facilitated.
In this embodiment, generating call credentials for a page rendering request based on a JS engine includes: starting the JS engine, and generating a call certificate of each page rendering request in the pre-read file based on the JS engine running the pre-read file.
Specifically, the user can send out a page rendering instruction through the terminal device, and the application program finds out a corresponding pre-read file according to the page URL. And starting a lightweight JS engine, and executing pre-reading files by the lightweight JS engine. The lightweight JS engine can run a pre-read file in JS format, determine each page rendering request in the pre-read file, and initiate the page rendering request to the application program, and generate a call certificate every time a page rendering request is initiated. In the embodiment of the disclosure, the lightweight JS engine does not process the page rendering request, but initiates the page rendering request to the application program, and the application program processes the page rendering request.
The method has the advantages that the application program executes the pre-read file in the JSON format in the prior art, the process of processing the page rendering request in the pre-read file is improved to the process of executing the pre-read file in the JS format by the lightweight JS engine, and the application program processes the page rendering request in the pre-read file. By deploying the lightweight JS engine, the process of converting the original logic of the JS format into the JSON format can be reduced, the development language is unified, the conversion errors of pre-read files are avoided, the development difficulty is reduced, the manpower and time are saved, and the accuracy and the efficiency of page rendering are improved.
In this embodiment, generating call credentials for a page rendering request based on a JS engine includes: and calling bridging between the JS engine and the application program according to the page rendering request in the pre-read file, and generating a calling certificate corresponding to the page rendering request.
Specifically, the pre-reading process is accompanied by JSB call, the lightweight JS engine calls JSB to initiate a page rendering request to an application program, and the call credential is an identifier of the call JSB, and one call credential is generated every time the JSB is called, that is, one call credential is generated every time a page rendering request is initiated. The call ticket does not need to wait for the page rendering request to be completely initiated, and then all call tickets are sent to the application program together, but can be sent once every time a page rendering request is initiated.
The method has the advantages that cross-language calling is achieved through JSB bridging, so that an application program can process a received page rendering request, and page rendering efficiency is improved.
S203, based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
The terminal equipment is deployed with a Hybrid environment, wherein the Hybrid environment comprises a JS environment, and a rendering configuration file in the Hybrid environment is in a JS format.
The application program receives the page rendering request, processes the page rendering request, determines the elements to be displayed on the page and the positions of the elements and other data, and takes the data as a processing result. And sending the processing result to a Hybrid environment, executing a rendering configuration file in the Hybrid environment, wherein the processing result of the call certificate and the page rendering request can be used as parameters in the rendering configuration file, so that the rendering processing of the target page according to the call certificate of the page rendering request, the page rendering request and other data is realized, and the elements in the target page are displayed on the target page. The data such as the processing result, the call certificate and the like can be synchronized into the Hybrid environment through the SDK on the application program end, and the rendering process of the page is completed.
In the embodiment of the disclosure, the Hybrid environment can be initialized before receiving the application-synchronous data, and after the initialization is completed, the pre-read data is directly obtained for rendering. If the Hybrid environment is not initialized, the application program can wait for the initialization to be completed and then perform data synchronization.
The embodiment of the disclosure provides a page rendering method, wherein an application program, a lightweight JS engine and a Hybrid environment are deployed in terminal equipment of the method. The Hybrid environment includes a JS environment, that is, the lightweight JS engine and the files in the Hybrid environment may be in JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The JS engine generates call credentials for the page render request in the pre-read file, indicating that a call to the page render request has been initiated. And the application program processes the page rendering request according to the call of the lightweight JS engine. And sending the processing result to a Hybrid environment, running a preset JS logical file in the Hybrid environment according to the processing result, and rendering the target page. Through the arrangement of the JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in the pre-reading and page rendering processes, the development cost is reduced, the inconformity of the pre-reading file and the logical file in the Hybrid environment in the rendering process is avoided, and the page rendering efficiency and accuracy are improved.
Fig. 3 is a flow chart of a page rendering method according to an embodiment of the disclosure, where the embodiment is an alternative embodiment of the foregoing embodiment.
In this embodiment, before rendering a target page according to a call ticket of a page rendering request and the page rendering request based on a Hybrid environment, the method may further include: transmitting the page rendering request and the call evidence of the page rendering request to an application program based on the JS engine; and processing the page rendering request based on the application program to obtain a processing result, wherein the processing result is used for indicating the processing mode of the elements of the target page.
As shown in fig. 3, the method includes:
s301, responding to a page rendering instruction initiated based on an application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-reading file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page.
S302, generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated.
S303, transmitting the page rendering request and the call evidence of the page rendering request to an application program based on the JS engine.
After the lightweight JS engine initiates the call of the page rendering request, the page rendering request and the corresponding call certificate are both sent to the application program, which indicates that the page rendering request is initiated. The application may cache the call credentials and send the call credentials into the Hybrid environment each time a call credential is received.
S304, processing the page rendering request based on the application program to obtain a processing result, wherein the processing result is used for indicating a processing mode of the elements of the target page.
After receiving the call certificate and the page rendering request, the application program can process the page rendering request. The processing result obtained may be the rendered element and the element display position in the target page, etc. For example, if the page rendering request is a request for rendering an element in the upper left corner of the target page, the application program processes the page rendering request, and may obtain the element and the specific position of the element required to be displayed in the upper left corner of the target page as a processing result. The elements and the element positions required to be rendered in each page can be stored in advance, and the elements and the element positions in the target page are searched according to the elements and the element positions in each page stored in advance and are used as processing results.
The application program may send the call ticket to the Hybrid environment, and after obtaining the processing results, may send the processing results to the Hybrid environment. Each time a processing result is obtained, the processing result may be sent to the Hybrid environment.
In this embodiment, processing a page rendering request based on an application program to obtain a processing result includes: the method comprises the steps that a page rendering request is sent to a server, the server receives the page rendering request, processes the page rendering request, and sends a processing result of the page rendering request to an application program; or, carrying out local processing on the page rendering request based on the application program to obtain a processing result of the page rendering request.
Specifically, the application program may perform processing of the page rendering request locally, or may send the page rendering request to the server, and perform processing by the server.
For example, the application program sends the page rendering request to the server, and the server processes the page rendering request after receiving the page rendering request to obtain a processing result. And then sending the processing result of the page rendering request to the application program. The application program may also perform local processing on the page rendering request, for example, store processing results of various page rendering requests locally, and find corresponding processing results.
And the page rendering request can be processed locally preferentially, and if the local processing result cannot be obtained, the page rendering request is sent to a server for processing.
The method has the advantages that the page rendering request is processed through the server and the local area, so that the processing result of all page rendering requests can be obtained, the target page is comprehensively displayed, and the page rendering precision is effectively improved.
S305, based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
The method comprises the steps that a preset rendering logic file can be operated in a Hybrid environment, and rendering processing is conducted on a target page according to a call evidence of a page rendering request and the page rendering request. And the processing result sent by the application program can be received, the processing result is directly rendered, and the rendering efficiency is improved.
In this embodiment, based on the Hybrid environment, rendering the target page according to the call ticket of the page rendering request and the page rendering request includes: and rendering the target page according to the call certificate of the page rendering request and the processing result based on the Hybrid environment.
Specifically, the application program sends the call certificate to the Hybrid environment, and after the processing result of each page rendering request is obtained, the processing result is sent to the Hybrid environment. In this embodiment, the call ticket and the processing result do not need to be sent at the same time, and the call ticket may be sent first and then the processing result may be sent. The JS format rendering configuration file is preconfigured in the Hybrid environment, and the rendering configuration file can be expressed as index. The rendering profile may be used to display elements in the page on the page in corresponding locations. Executing the rendering configuration file in the Hybrid environment, and rendering the elements related to each page rendering request according to the call certificate and the processing result to complete the processing process of page rendering.
It should be noted that in this embodiment, the initialization of the Hybrid environment may be started after the page rendering instruction is responded. After initialization of the Hybrid environment is completed, the call certificate and the processing result are sent, and if the initialization is not completed, the call certificate and the processing result are sent after the initialization is completed.
The method has the advantages that the target page can be directly rendered based on the Hybrid environment, the processing of the page rendering request is not needed, the preprocessing of the page rendering request is realized, and the page rendering efficiency is improved.
And initiating a page rendering request to the application program by calling the JSB. In the prior art, the processing result of the request is returned to the original caller, namely to the workbench of the lightweight JS engine. At this time, if the Hybrid environment is initialized, the Worker of the lightweight JS engine initiates data synchronization, and the processing result is finally transferred to the Hybrid environment through the application program. This process involves a large number of serialization and deserialization operations, which severely slows efficiency when the amount of data is large. In this embodiment, considering that the Worker of the lightweight JS engine does not accept JSB callback, the processing result is not returned to the Worker, but directly and synchronously goes through after the Hybrid environment is ready, so that multiple data transfer across environments is omitted.
The embodiment of the disclosure provides a page rendering method, wherein an application program, a JS engine and a Hybrid environment are deployed in terminal equipment of the method. Among them, the Hybrid environment includes a JS environment, that is, the JS engine and the files in the Hybrid environment may be in JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The JS engine generates call credentials for the page render request in the pre-read file, indicating that a call to the page render request has been initiated. And the application program processes the page rendering request according to the call of the JS engine. And sending the processing result to a Hybrid environment, running a preset JS logical file in the Hybrid environment according to the processing result, and rendering the target page. Through the arrangement of the JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in the pre-reading and page rendering processes, the development cost is reduced, the inconformity of the pre-reading file and the logical file in the Hybrid environment in the rendering process is avoided, and the page rendering efficiency and accuracy are improved.
Fig. 4 is a flow chart of a page rendering method according to an embodiment of the disclosure, where the embodiment is an alternative embodiment of the foregoing embodiment.
In this embodiment, in response to a page rendering instruction initiated by an application program, determining a pre-read file corresponding to a target page indicated by the page rendering instruction may be refined as: determining a target page indicated by the page rendering instruction in response to the page rendering instruction initiated based on the application program; and determining the pre-read file corresponding to the target page according to the uniform resource locator of the target page.
As shown in fig. 4, the method includes:
s401, responding to a page rendering instruction initiated by an application program, and determining a target page indicated by the page rendering instruction.
And responding to a page rendering instruction sent by a user or sent by the terminal equipment at fixed time, and determining a target page from the page rendering instruction. For example, page identification information may be included in the page rendering instruction, and the page identification information may be a unique identification of the page. According to the page identification information, a target page to be rendered can be determined.
S402, determining a pre-read file corresponding to the target page according to the uniform resource locator of the target page.
The method comprises the steps of configuring a pre-reading file for each page in advance, wherein the pre-reading file comprises a page rendering request which needs to be rendered in the corresponding page, and the page rendering request indicates that elements in the page need to be rendered and displayed according to a preset position. After determining the target page, the URLs of the target page are determined, and each URL may correspond to a pre-read file. And determining the pre-read file of the target page according to the URL of the target page.
In this embodiment, determining, according to the uniform resource locator of the target page, the pre-read file corresponding to the target page includes: searching the pre-read file corresponding to the uniform resource locator of the target page according to the uniform resource locator of the target page and the association relation between the preset uniform resource locator and the candidate pre-read file.
Specifically, a plurality of candidate pre-read files are pre-configured, and the association relationship between each URL and the candidate pre-read files is set and stored. After the URL of the target page is determined, searching candidate pre-reading files corresponding to the URL of the target page from the pre-stored association relation to serve as the pre-reading files of the target page. If the corresponding candidate pre-read file does not exist, a prompt can be sent to the user to remind the user to check and report.
The method has the advantages that the pre-reading file of the target page can be rapidly determined by searching the URL, the URL can be uniquely determined, the error in searching the pre-reading file is avoided, and the accuracy and the efficiency of page rendering are improved.
S403, generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated.
S404, based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
The embodiment of the disclosure provides a page rendering method, wherein an application program, a JS engine and a Hybrid environment are deployed in terminal equipment of the method. Among them, the Hybrid environment includes a JS environment, that is, the JS engine and the files in the Hybrid environment may be in JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The JS engine generates call credentials for the page render request in the pre-read file, indicating that a call to the page render request has been initiated. And the application program processes the page rendering request according to the call of the JS engine. And sending the processing result to a Hybrid environment, running a preset JS logical file in the Hybrid environment according to the processing result, and rendering the target page. Through the arrangement of the JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in the pre-reading and page rendering processes, the development cost is reduced, the inconformity of the pre-reading file and the logical file in the Hybrid environment in the rendering process is avoided, and the page rendering efficiency and accuracy are improved.
Fig. 5 is a flow chart of a page rendering method according to an embodiment of the present disclosure, where the embodiment is an alternative embodiment of the foregoing embodiment.
In this embodiment, after responding to the page rendering instruction initiated based on the application program, it is possible to append: and initializing the JS environment where the JS engine is located according to the environment parameters preset in the application program.
As shown in fig. 5, the method includes:
s501, responding to a page rendering instruction initiated by an application program, determining a pre-read file corresponding to a target page indicated by the page rendering instruction, and initializing the JS environment where the JS engine is located according to environment parameters preset in the application program.
And responding to the page rendering instruction, and determining a target page and a pre-read file corresponding to the target page. When the pre-read file is determined, the JS environment where the lightweight JS engine is located can be initialized synchronously. In this embodiment, the order between the steps of determining the pre-read file and initializing the JS environment in which the lightweight JS engine is located may not be limited. For example, the operations may be performed synchronously, or the JS initialization may be performed first, and then the pre-read file may be determined. The JS environment where the lightweight JS engine is located is initialized, so that the JS environment where the lightweight JS engine is located is kept consistent with the JS environment of the Hybrid as much as possible, and the page rendering precision is improved. The environment parameters of the JS environment can be preset in the terminal device, and initialization can be performed according to the preset environment parameters.
In this embodiment, after responding to the page rendering instruction initiated based on the application program, the method further includes: and initializing the Hybrid environment based on initialization parameters preset by the Hybrid environment.
Specifically, after responding to the page rendering instruction, besides initializing the JS environment where the lightweight JS engine is located, the Hybrid environment may be initialized. Initialization parameters of the Hybrid environment are preset, and initialization is carried out according to the initialization parameters.
In this embodiment, the order of initializing the JS environment where the lightweight JS engine is located and initializing the Hybrid environment is not limited either. Notably, the application program sends the call certificate and the processing result to the Hybrid environment, and needs to be performed after the initialization of the Hybrid environment is completed.
The method has the beneficial effects that the Hybrid environment is initialized, so that the Hybrid environment and the JS environment where the JS engine is located are kept consistent as much as possible, the influence of irrelevant parameters in the environment on page rendering is avoided, and the page rendering precision is improved.
S502, generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated.
S503, based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
The embodiment of the disclosure provides a page rendering method, wherein an application program, a lightweight JS engine and a Hybrid environment are deployed in terminal equipment of the method. The Hybrid environment includes a JS environment, that is, the lightweight JS engine and the files in the Hybrid environment may be in JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The lightweight JS engine generates call credentials for a page rendering request in a pre-read file, indicating that a call to the page rendering request has been initiated. And the application program processes the page rendering request according to the call of the lightweight JS engine. And sending the processing result to a Hybrid environment, running a preset JS logical file in the Hybrid environment according to the processing result, and rendering the target page. Through deployment of the lightweight JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in pre-reading and page rendering, the development cost is reduced, inconsistency between the pre-reading file and the logical file in the Hybrid environment in rendering is avoided, and the page rendering efficiency and accuracy are improved.
Fig. 6 is a schematic thread diagram of page rendering according to an embodiment of the present disclosure. As shown in fig. 6, the threads of page rendering include a main thread and two JS threads that are local to the application.
Node 1.1 to node 2 are processes for initializing the JS environment of the lightweight JS engine, node 1.2 to node 3 are processes for determining the pre-read file, and node 1.3 to node 4 are processes for initializing the Hybrid environment. The execution sequence of the three steps from node 1.1 to node 2, node 1.2 to node 3 and node 1.3 to node 4 is not limited, and can be synchronously executed. Nodes 3 through 5 are invoking JSB to initiate a page rendering request to an application. Nodes 5 through 6 send call credentials to the Hybrid environment. And the nodes 5 to 7 are used for processing the page rendering request to obtain a processing result. The nodes 7 to 8 send the processing results to the Hybrid environment, so that the rendering of the pages in the Hybrid environment is facilitated.
In the embodiment of the disclosure, the service logic is split into two parts by the developer, one part can be executed in advance in a JS environment of a lightweight JS engine, and the other part is executed after the initialization of the Hybrid environment is completed, and the data synchronization technology is utilized to efficiently synchronize data between the two JS engines, so that the page rendering efficiency is improved.
Fig. 7 is a schematic structural diagram of a page rendering device according to an embodiment of the present disclosure. The device is applied to terminal equipment, and the terminal equipment is deployed with an application program, a JS engine and a Hybrid environment. The apparatus may be implemented in software, hardware or a combination of both. As shown in fig. 7, the apparatus includes: a pre-fetch file determination module 701, a call credential generation module 702, and a page rendering module 703.
A pre-read file determining module 701, configured to determine, in response to a page rendering instruction initiated based on the application program, a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
a call credential generating module 702, configured to generate a call credential of the page rendering request based on the JS engine, where the call credential indicates that a call to the page rendering request is initiated;
and the page rendering module 703 is configured to perform rendering processing on the target page according to the call credential of the page rendering request and the page rendering request based on the Hybrid environment.
Optionally, the apparatus further comprises:
the call evidence conveying module is used for conveying the page rendering request and the call evidence of the page rendering request to the application program based on the JS engine before the target page is rendered according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment;
the processing result obtaining module is used for processing the page rendering request based on the application program to obtain a processing result, and the processing result is used for indicating a processing mode of the element of the target page.
Optionally, the page rendering module 703 is specifically configured to:
and rendering the target page according to the call certificate of the page rendering request and the processing result based on the Hybrid environment.
Optionally, the processing result obtaining module is specifically configured to:
the page rendering request is sent to a server, the server receives the page rendering request, processes the page rendering request, and sends a processing result of the page rendering request to an application program; or,
and carrying out local processing on the page rendering request based on an application program to obtain a processing result of the page rendering request.
Optionally, the pre-read file determination module 701 includes:
a target page determining unit, configured to determine, in response to a page rendering instruction initiated based on the application program, a target page indicated by the page rendering instruction;
and the pre-read file obtaining unit is used for determining the pre-read file corresponding to the target page according to the uniform resource locator of the target page.
Optionally, the pre-reading file obtaining unit is specifically configured to:
searching the pre-read file corresponding to the uniform resource locator of the target page according to the uniform resource locator of the target page and the association relation between the preset uniform resource locator and the candidate pre-read file.
Optionally, the credential generation module 702 is invoked, specifically for:
and starting the JS engine, and generating a call certificate of each page rendering request in the pre-read file based on the JS engine running the pre-read file.
Optionally, the apparatus further comprises:
and the JS environment initializing module is used for initializing the JS environment where the JS engine is located according to preset environment parameters in the application program after responding to the page rendering instruction initiated based on the application program.
Optionally, the apparatus further comprises:
and the Hybrid environment initializing module is used for initializing the Hybrid environment based on initialization parameters preset by the Hybrid environment after responding to the page rendering instruction initiated by the application program.
Optionally, the credential generation module 702 is invoked, specifically for:
and calling bridging between the JS engine and an application program according to the page rendering request in the pre-read file, and generating a calling certificate corresponding to the page rendering request.
The embodiment provides a page rendering method device, and an application program, a JS engine and a Hybrid environment are deployed in terminal equipment of the device. Among them, the Hybrid environment includes a JS environment, that is, the JS engine and the files in the Hybrid environment may be in JS format. After responding to the page rendering instruction, the JS-format pre-reading file corresponding to the target page indicated by the page rendering instruction can be determined. The JS engine generates call credentials for the page render request in the pre-read file, indicating that a call to the page render request has been initiated. And the application program processes the page rendering request according to the call of the JS engine. And sending the processing result to a Hybrid environment, running a preset JS logical file in the Hybrid environment according to the processing result, and rendering the target page. Through the arrangement of the JS engine, the process of translating the JS logical file into the JSON format can be reduced, namely, the JS format file is used in the pre-reading and page rendering processes, the development cost is reduced, the inconformity of the pre-reading file and the logical file in the Hybrid environment in the rendering process is avoided, and the page rendering efficiency and accuracy are improved.
In order to achieve the above embodiments, the embodiments of the present disclosure further provide an electronic device.
Referring to fig. 8, there is shown a schematic structural diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure, which electronic device 800 may be a terminal device or a server. The terminal device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (Personal Digital Assistant, PDA for short), a tablet (Portable Android Device, PAD for short), a portable multimedia player (Portable Media Player, PMP for short), an in-vehicle terminal (e.g., an in-vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage 808 into a random access Memory (Random Access Memory, RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a liquid crystal display (Liquid Crystal Display, LCD for short), a speaker, a vibrator, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above-described embodiments.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (Local Area Network, LAN for short) or a wide area network (Wide Area Network, WAN for short), or it may be connected to an external computer (e.g., connected via the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a page rendering method applied to a terminal device, where an application program, a JS engine, and a Hybrid environment are deployed, the method including:
responding to a page rendering instruction initiated based on the application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
According to one or more embodiments of the present disclosure, before performing a rendering process on the target page according to the call ticket of the page rendering request and the page rendering request based on the Hybrid environment, the method further includes:
Transmitting the page rendering request and a call credential of the page rendering request to the application program based on the JS engine;
and processing the page rendering request based on the application program to obtain a processing result, wherein the processing result is used for indicating a processing mode of the element of the target page.
According to one or more embodiments of the present disclosure, based on the Hybrid environment, performing rendering processing on the target page according to the call ticket of the page rendering request and the page rendering request, includes:
and rendering the target page according to the call certificate of the page rendering request and the processing result based on the Hybrid environment.
According to one or more embodiments of the present disclosure, processing the page rendering request based on the application program, to obtain a processing result includes:
the page rendering request is sent to a server, the server receives the page rendering request, processes the page rendering request, and sends a processing result of the page rendering request to an application program; or,
and carrying out local processing on the page rendering request based on an application program to obtain a processing result of the page rendering request.
According to one or more embodiments of the present disclosure, in response to a page rendering instruction initiated based on the application program, determining a pre-read file corresponding to a target page indicated by the page rendering instruction includes:
responsive to a page rendering instruction initiated based on the application, determining a target page indicated by the page rendering instruction;
and determining the pre-read file corresponding to the target page according to the uniform resource locator of the target page.
According to one or more embodiments of the present disclosure, determining, according to a uniform resource locator of the target page, a pre-read file corresponding to the target page includes:
searching the pre-read file corresponding to the uniform resource locator of the target page according to the uniform resource locator of the target page and the association relation between the preset uniform resource locator and the candidate pre-read file.
In accordance with one or more embodiments of the present disclosure, generating call credentials for the page rendering request based on the JS engine includes:
and starting the JS engine, and generating a call certificate of each page rendering request in the pre-read file based on the JS engine running the pre-read file.
According to one or more embodiments of the present disclosure, after responding to the page rendering instruction initiated based on the application program, further comprising:
and initializing the JS environment where the JS engine is located according to environmental parameters preset in the application program.
According to one or more embodiments of the present disclosure, after responding to the page rendering instruction initiated based on the application program, further comprising:
and initializing the Hybrid environment based on initialization parameters preset by the Hybrid environment.
In accordance with one or more embodiments of the present disclosure, generating call credentials for the page rendering request based on the JS engine includes:
and calling bridging between the JS engine and an application program according to the page rendering request in the pre-read file, and generating a calling certificate corresponding to the page rendering request.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a page rendering apparatus applied to a terminal device, the terminal device being deployed with an application program, a JS engine, and a Hybrid environment, the apparatus including:
the pre-reading file determining module is used for responding to a page rendering instruction initiated by the application program and determining a pre-reading file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
The call credential generation module is used for generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and the page rendering module is used for rendering the target page according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment.
According to one or more embodiments of the present disclosure, the apparatus further comprises:
the call evidence conveying module is used for conveying the page rendering request and the call evidence of the page rendering request to the application program based on the JS engine before the target page is rendered according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment;
the processing result obtaining module is used for processing the page rendering request based on the application program to obtain a processing result, and the processing result is used for indicating a processing mode of the element of the target page.
According to one or more embodiments of the present disclosure, the page rendering module is specifically configured to:
and rendering the target page according to the call certificate of the page rendering request and the processing result based on the Hybrid environment.
According to one or more embodiments of the present disclosure, the processing result obtaining module is specifically configured to:
the page rendering request is sent to a server, the server receives the page rendering request, processes the page rendering request, and sends a processing result of the page rendering request to an application program; or,
and carrying out local processing on the page rendering request based on an application program to obtain a processing result of the page rendering request.
According to one or more embodiments of the present disclosure, a pre-read file determination module includes:
a target page determining unit, configured to determine, in response to a page rendering instruction initiated based on the application program, a target page indicated by the page rendering instruction;
and the pre-read file obtaining unit is used for determining the pre-read file corresponding to the target page according to the uniform resource locator of the target page.
According to one or more embodiments of the present disclosure, the pre-reading file obtaining unit is specifically configured to:
searching the pre-read file corresponding to the uniform resource locator of the target page according to the uniform resource locator of the target page and the association relation between the preset uniform resource locator and the candidate pre-read file.
According to one or more embodiments of the present disclosure, a credential generation module is invoked, specifically for:
and starting the JS engine, and generating a call certificate of each page rendering request in the pre-read file based on the JS engine running the pre-read file.
According to one or more embodiments of the present disclosure, the apparatus further comprises:
and the JS environment initializing module is used for initializing the JS environment where the JS engine is located according to preset environment parameters in the application program after responding to the page rendering instruction initiated based on the application program.
According to one or more embodiments of the present disclosure, the apparatus further comprises:
and the Hybrid environment initializing module is used for initializing the Hybrid environment based on initialization parameters preset by the Hybrid environment after responding to the page rendering instruction initiated by the application program.
According to one or more embodiments of the present disclosure, a credential generation module is invoked, specifically for:
and calling bridging between the JS engine and an application program according to the page rendering request in the pre-read file, and generating a calling certificate corresponding to the page rendering request.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device comprising: at least one processor and memory;
The memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory, causing the at least one processor to perform the page rendering method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the page rendering method as described above in the first aspect and the various possible designs of the first aspect.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the page rendering method as described above in the first aspect and the various possible designs of the first aspect.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (14)

1. The page rendering method is characterized in that the method is applied to terminal equipment, the terminal equipment is deployed with an application program, a JS engine and a Hybrid environment, and the method comprises the following steps:
Responding to a page rendering instruction initiated based on the application program, and determining a pre-read file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and based on the Hybrid environment, rendering the target page according to the call evidence of the page rendering request and the page rendering request.
2. The method of claim 1, further comprising, prior to rendering the target page based on the Hybrid environment, based on the call credentials of the page rendering request, and the page rendering request:
transmitting the page rendering request and a call credential of the page rendering request to the application program based on the JS engine;
And processing the page rendering request based on the application program to obtain a processing result, wherein the processing result is used for indicating a processing mode of the element of the target page.
3. The method of claim 2, wherein rendering the target page according to the call credentials of the page rendering request and the page rendering request based on the Hybrid environment comprises:
and rendering the target page according to the call certificate of the page rendering request and the processing result based on the Hybrid environment.
4. The method of claim 2, wherein processing the page rendering request based on the application to obtain a processing result comprises:
the page rendering request is sent to a server, the server receives the page rendering request, processes the page rendering request, and sends a processing result of the page rendering request to an application program; or,
and carrying out local processing on the page rendering request based on an application program to obtain a processing result of the page rendering request.
5. The method of claim 1, wherein responsive to a page rendering instruction initiated based on the application program, determining a pre-read file corresponding to a target page indicated by the page rendering instruction comprises:
Responsive to a page rendering instruction initiated based on the application, determining a target page indicated by the page rendering instruction;
and determining the pre-read file corresponding to the target page according to the uniform resource locator of the target page.
6. The method of claim 5, wherein determining the pre-read file corresponding to the target page based on the uniform resource locator of the target page comprises:
searching the pre-read file corresponding to the uniform resource locator of the target page according to the uniform resource locator of the target page and the association relation between the preset uniform resource locator and the candidate pre-read file.
7. The method of claim 1, wherein generating call credentials for the page rendering request based on the JS engine comprises:
and starting the JS engine, and generating a call certificate of each page rendering request in the pre-read file based on the JS engine running the pre-read file.
8. The method of claim 1, further comprising, after responding to the page rendering instruction initiated based on the application:
And initializing the JS environment where the JS engine is located according to environmental parameters preset in the application program.
9. The method of claim 1, further comprising, after responding to the page rendering instruction initiated based on the application:
and initializing the Hybrid environment based on initialization parameters preset by the Hybrid environment.
10. The method of claim 1, wherein generating call credentials for the page rendering request based on the JS engine comprises:
and calling bridging between the JS engine and an application program according to the page rendering request in the pre-read file, and generating a calling certificate corresponding to the page rendering request.
11. A page rendering apparatus, wherein the apparatus is applied to a terminal device, the terminal device is deployed with an application program, a JS engine, and a Hybrid environment, the apparatus comprising:
the pre-reading file determining module is used for responding to a page rendering instruction initiated by the application program and determining a pre-reading file corresponding to a target page indicated by the page rendering instruction; the page rendering instruction is used for indicating to render a target page, the pre-read file comprises at least one JS format page rendering request, and each page rendering request is used for indicating to render each element in the target page;
The call credential generation module is used for generating a call credential of the page rendering request based on the JS engine, wherein the call credential represents that the call of the page rendering request is initiated;
and the page rendering module is used for rendering the target page according to the call evidence of the page rendering request and the page rendering request based on the Hybrid environment.
12. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory, causing the processor to perform the page rendering method of any one of claims 1-10.
13. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the page rendering method of any one of claims 1-10.
14. A computer program product comprising a computer program which, when executed by a processor, implements the page rendering method as claimed in any one of claims 1 to 10.
CN202210635731.8A 2022-06-06 2022-06-06 Page rendering method, device, equipment and storage medium Pending CN117234502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210635731.8A CN117234502A (en) 2022-06-06 2022-06-06 Page rendering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210635731.8A CN117234502A (en) 2022-06-06 2022-06-06 Page rendering method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117234502A true CN117234502A (en) 2023-12-15

Family

ID=89091680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210635731.8A Pending CN117234502A (en) 2022-06-06 2022-06-06 Page rendering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117234502A (en)

Similar Documents

Publication Publication Date Title
US20210216875A1 (en) Method and apparatus for training deep learning model
CN110489101B (en) Interface simulation method, system, medium and electronic equipment
CN109857486B (en) Method, device, equipment and medium for processing program page data
US11210119B2 (en) Method and device for displaying interface, electronic equipment, server, and storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111581555B (en) Document loading method, device, equipment and storage medium
WO2020143555A1 (en) Method and device used for displaying information
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN114816795A (en) Interface extension method, device, remote calling server and system
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN110888773B (en) Method, device, medium and electronic equipment for acquiring thread identification
CN110618811B (en) Information presentation method and device
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN112422648B (en) Data synchronization method and system
CN117234502A (en) Page rendering method, device, equipment and storage medium
CN110648272B (en) Graphics resource conversion method and device, electronic equipment and storage medium
CN112596729A (en) Target application interface generation method and device, readable medium and electronic equipment
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN113961280A (en) View display method and device, electronic equipment and computer-readable storage medium
CN110908711A (en) Control development method and device of application program and electronic equipment
CN114047922B (en) Transcoding method, device, medium and equipment for precompiled device

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