Page rendering method, electronic device and storage medium
By using configuration files in the page rendering process to pre-request data, obtain and store data in advance, so as to prioritize the use of local data during page rendering, the problem of low data request efficiency in the prior art is solved and the efficiency and reliability of page rendering is improved.
Patent Information
- Application Number
- CN202111050924.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-08
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2041-09-08
AI Technical Summary
In the existing page rendering process, data request efficiency is low, resulting in slow page rendering and increased delays in background services, and the risks are uncontrollable.
Data pre-request through configuration files, obtain data requests from the page from the server in advance, and obtain data from local areas first, improving page rendering efficiency.
Improve page rendering efficiency, reduce data transmission time and the load on the background server, and reduce the risk of page rendering.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer networks, and in particular to a page rendering method. In addition, the present application also relates to related electronic devices and computer-readable storage media. Background Art
[0002] The existing page rendering process needs to parse Javascript (scripting language) first, then request the data required by the business, send a data request to the background, and combine all the data required for the project through the background service. If the project has sub-routes, the background cannot accurately return to each sub-route, resulting in waste of data requests. Secondly, the background service needs to combine multiple data requests, and an extra layer of data combination layer request causes waste of request links, and the corresponding data return time is also increased. If there are multiple data requests, a problem with one of them will cause a delay in the entire background service, resulting in slow business rendering and uncontrollable risks.
[0003] The content of this background technology description is only for facilitating understanding of the relevant technology in this field and is not regarded as an admission of the prior art. Summary of the invention
[0004] Therefore, the embodiment of the present invention intends to provide a page rendering method, which can pre-request data according to the configuration file, obtain the data request in the page from the server in advance, and when the required data is parsed, it is obtained from the local first, thereby improving the page rendering efficiency. Specifically, the embodiment of the present invention provides a page rendering method, including the following steps:
[0005] In response to the target service start operation, obtaining target service link information associated with the target service from a local location, wherein the target service link information includes a target service name and a pre-request support parameter;
[0006] According to the target service name, obtain the pre-downloaded target compressed package file from the local computer;
[0007] When it is determined that there is a pre-request configuration file in the target compressed package file and the pre-request support parameter indicates that the target service supports pre-request, access the target server according to the pre-request identifier set in the pre-request configuration file to obtain a pre-request data set;
[0008] Parsing and executing a page code corresponding to the target business, and in response to a data request in the page code, obtaining target data from the pre-request data set when it is determined that the pre-request identifier in the data request belongs to the pre-request identifier set;
[0009] The page is rendered according to the target data to display a page corresponding to the target business.
[0010] In some embodiments of the present invention, before responding to the target service startup operation, the page rendering method further includes:
[0011] In response to the target application startup operation, the compressed package and service link information of each service are downloaded from the server to the local to form a compressed package set service link information set, wherein when the service meets the pre-request condition, the compressed package includes a pre-request configuration file.
[0012] In some embodiments of the present invention, in response to the target service initiation operation, obtaining the target service link information associated with the target service locally includes:
[0013] In response to the target service start operation, obtaining the target service name;
[0014] According to the target service name, target service link information matching the target service name is found from the service link information set.
[0015] In some embodiments of the present invention, the step of obtaining a pre-downloaded target compressed package file from a local computer according to the target service name includes:
[0016] The target compressed package file is obtained from the compressed package set according to the target business name.
[0017] In some embodiments of the present invention, the pre-request configuration file includes: a pre-request identifier set and a namespace, a command word, and a structure name corresponding to the pre-request identifier in the pre-request identifier set; accessing the target server set according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes:
[0018] According to the pre-request identifier in the pre-request identifier set, obtain a namespace, a command word and a structure name;
[0019] Obtain the target server according to the namespace, command word and structure name;
[0020] A request is directly initiated to the target server to obtain pre-request data to form the pre-request data set.
[0021] In some embodiments of the present invention, the pre-request configuration file further includes: a data return object parameter corresponding to the pre-request identifier; and obtaining the pre-request data includes:
[0022] The pre-request data obtained from the target server is stored in the data return object parameter.
[0023] In some embodiments of the present invention, the acquiring target data from the pre-request data set includes:
[0024] The target data is obtained from a data return object parameter corresponding to the pre-request identifier in the pre-request configuration file.
[0025] In some embodiments of the present invention, the pre-request configuration file includes: a blocking request corresponding to the pre-request identifier; accessing the target server according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes:
[0026] When it is determined that the blocking request is turned on, stop acquiring the pre-request data corresponding to the pre-request identifier;
[0027] When it is determined that the blocking request is closed, pre-request data corresponding to the pre-request identifier is obtained.
[0028] In some embodiments of the present invention, when it is determined that the target compressed package file does not contain a pre-request configuration file or the pre-request support parameter indicates that the target service does not support pre-request,
[0029] Parse and execute the page code corresponding to the target business;
[0030] In response to a data request in the page code, a server is accessed according to the data request to obtain target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
[0031] In some embodiments of the present invention, when determining that the pre-request identifier in the data request belongs to the pre-request identifier set, obtaining target data from the pre-request data set includes:
[0032] In response to a failure to obtain the target data from the pre-request data set, a server is accessed according to the data request to obtain the target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
[0033] In an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the page rendering method of any embodiment of the present invention is implemented.
[0034] In an embodiment of the present invention, an electronic device is provided, including: a processor and a memory storing a computer program, wherein the processor is configured to execute the page rendering method of any embodiment of the present invention when running the computer program.
[0035] The embodiment of the present invention proposes a page rendering method, which downloads the business link information and compressed package of each business to the local client when the app application is started. When the user clicks on a certain business, the page rendering work is started, and the pre-request support parameters in the business link are queried according to the business name to see if they are valid. At the same time, the corresponding compressed package is queried according to the business name in the business link, and the compressed package is decompressed to determine whether there is a pre-request configuration file. If there is a pre-request configuration file, the pre-request identification information is obtained from the pre-request configuration file, thereby initiating a corresponding data request to the server and storing the pre-request data locally. Continue to parse and execute JavaScript. If there is a responsive data request, the pre-request data is read from the local first according to the pre-request identification in the data request, thereby improving the efficiency of data acquisition. After that, the page is rendered according to the acquired data, and the overall efficiency of page rendering is improved.
[0036] Other optional features and technical effects of the embodiments of the present invention are partially described below, and partially can be understood by reading this document. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The elements shown are not limited to the proportions shown in the accompanying drawings. The same or similar reference numerals in the accompanying drawings represent the same or similar elements, wherein:
[0038] Figure 1a A diagram of the system structure for normal rendering is shown;
[0039] Figure 1b A schematic diagram of the system structure of a page rendering method according to an embodiment of the present invention is shown;
[0040] Figure 1c An exemplary flow chart of a page rendering method according to an embodiment of the present invention is shown;
[0041] Figure 2 An exemplary flow chart of a page rendering method according to some other embodiments of the present invention is shown;
[0042] Figure 3 A schematic diagram of the structure of a page rendering device according to an embodiment of the present invention is shown;
[0043] Figure 4 An exemplary structural diagram of an electronic device capable of implementing the method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and drawings. Here, the exemplary implementation methods of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0045] In the embodiments of the present invention, "Hippy" refers to an open source cross-end solution, similar to React Native. "Pre-request" refers to making a data request in advance. "Normal rendering process" refers to the normal rendering process of the Hippy business, which first parses Javascript and then requests the data required by the business.
[0046] The embodiment of the present invention provides a page rendering method to improve page display efficiency, and the method includes: receiving a user's request to access a page, and judging whether the Hippy service supports pre-requesting data according to the user's request, for subsequent Hippy page rendering. If supported, the action of requesting the service data can be performed in advance, without waiting for the code to parse and execute the data request method before initiating the data request action, thereby improving the user access experience. The problem of request coupling is solved, and the interface is independent in the form of a configuration file, and the request does not need to be forwarded through the background service, and can directly reach the corresponding background service, reducing the server's expenses.
[0047] Reference Figure 1a The normal rendering logic is that when a data request is encountered during code execution, the client 210 sends it to the transfer node 220. The transfer node 220 forwards the data to each server 230 according to the data request. Each server 230 returns the data to the transfer node 220. The transfer node 220 combines the data and then returns it to the client 210. The client 210 renders the page. Figure 1b The rendering logic in the embodiment of the present invention is that when the client 310 starts, the compressed package file and service link information are downloaded from the server 320. When a certain service is selected to start, the client 310 obtains pre-request data from each server 320 in parallel according to the configuration file. When executing the page request data, the target data is obtained from the local pre-request data first. After failure, a request is initiated to the server, and finally rendering is performed, thereby improving the overall rendering efficiency.
[0048] Specifically, Figure 1c As shown, an embodiment of the present invention provides a page rendering method, comprising the following steps:
[0049] S110. In response to the target service startup operation, the target service link information associated with the target service is obtained locally, and the target service link information includes the target service name and pre-request support parameters; when the user clicks on a service in the application interface, for example, clicks on "My", it will jump to the "My" page accordingly, and the client queries the service link information that matches "My". The corresponding service link information is found by matching the service name information carried in the service link information. The service link information also includes pre-request support parameter information, which is used to indicate whether this service supports pre-requests. For example, for the "My" service, the service link information is: https: / / kg.qq.com?hippy=my&preRequestCgi=1 , where "hippy = my" means matching the "my" service, and preRequestCgi = 1 means supporting the pre-request scheme. In some links, this parameter is missing or is 0, indicating that the pre-request scheme is not supported.
[0050] S120, according to the target service name, obtain the pre-downloaded target compressed package file from the local; when the client starts the APP, it will download the compressed package files of each service to the local client in advance, and save them according to the service name when saving. For example, for the "my" service, query the "my" compressed package from the local. The compressed package file generally includes jsBundle file and signature file. The jsBundle file contains information such as page rendering code and data request code. The signature file is the signature file of the web page request, which is a hash value. When the client sends a request to the server, it will verify the signature file information in the request to verify whether the web page code has been changed again; if the service supports pre-request data, there will be a native_Config file (pre-request configuration file) in the compressed package file. In the pre-request configuration file, a pre-request identifier fid is set. For example, if there are multiple sub-routes under the "my" service, there is a pre-request identifier, corresponding to "my fans" There is a pre-request identifier fid_my fans, and corresponding to "my focus" There is a pre-request identifier fid_myfocus, and the background is set with different server storage locations for pre-request data corresponding to different sub-routes.
[0051] S130. When it is determined that there is a pre-request configuration file in the target compressed package file and the pre-request support parameter indicates that the target service supports pre-request, the target server is accessed according to the pre-request identification set in the pre-request configuration file to obtain the pre-request data set; when the client parses the compressed package file and finds that there is a pre-request configuration file, and there is also a pre-request support parameter in the service link information, or the pre-request support parameter is 1, the client starts the work of pre-requesting data. In practice, the two judgments can be made at the same time, or the parameter judgment can be made first, and then whether there is a pre-request configuration file. Through two rounds of judgment, it is determined that the pre-request can be reliably executed. In the embodiment of the present invention, the background server can use the pre-request support parameter to configure whether the corresponding pre-request of the service is turned on; by judging whether there is a pre-request configuration file, the execution environment configuration information is obtained to avoid the occurrence of execution error information.
[0052] In some embodiments, the server is accessed to obtain the corresponding pre-request data according to the pre-request identifier. For example, the pre-request identifier can be mapped to the corresponding server IP address, and the server can be accessed according to the server IP address to obtain data.
[0053] In some embodiments, in order to make the storage location of the pre-request data clearer and improve the efficiency of returning data, more mapping information is maintained on the client. Specifically, the pre-request configuration file includes: a pre-request identifier set and a namespace, a command word, and a structure name corresponding to the pre-request identifier in the pre-request identifier set; accessing the target server set according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes:
[0054] According to the pre-request identifier in the pre-request identifier set, obtain a namespace, a command word and a structure name;
[0055] According to the namespace, command word and structure name, the target server is obtained; through the namespace, command word and structure name, the specific data storage location can be quickly located, so that the server can quickly return the pre-request data. It can ensure that the pre-request data can be prepared when the parsing code encounters a data request;
[0056] A request is directly initiated to the target server to obtain pre-request data to form the pre-request data set.
[0057] In some embodiments, in order to facilitate the subsequent rapid location of the pre-request data, the pre-request data can be quickly found through the pre-request identifier, and the pre-request configuration file is also provided with storage parameters for the returned pre-request data. Specifically, the pre-request configuration file also includes: a data return object parameter corresponding to the pre-request identifier; the acquisition of the pre-request data includes:
[0058] The pre-request data obtained from the target server is stored in the data return object parameter.
[0059] S140, parse and execute the page code corresponding to the target business, respond to the data request in the page code, and when it is determined that the pre-request identifier in the data request belongs to the pre-request identifier set, obtain the target data from the pre-request data set; while requesting the pre-request data, the client also synchronously parses and executes the page code corresponding to the target business. When there is a data request in the page code, the pre-request data is obtained from the local server first according to the pre-request identifier information attached to the data request, and then obtained from the remote server if the acquisition fails. For example, for a business containing report data, when it is started, the data of the pre-request report is stored locally. When parsing the web page code and encountering a data request, the report data is obtained from the local server first, and the overall display efficiency of the page is improved.
[0060] In some embodiments, obtaining target data from the pre-request data set includes:
[0061] The target data is obtained from the data return object parameter corresponding to the pre-request identifier in the pre-request configuration file. According to the pre-request identifier, the corresponding data return object parameter is obtained from the pre-request configuration file, and the target data is taken out therefrom.
[0062] S150, rendering a page according to the target data to display a page corresponding to the target business. Fill the target data into the corresponding DOM node, render the DOM nodes in sequence, refresh the page, and display the page corresponding to the business.
[0063] The page rendering method in the embodiment of the present invention uses a pre-request mechanism to quickly load the required data to the local computer in advance. When the page code is executed, data needs to be obtained from the server and is obtained from the local query first, which saves the time for data transmission and the time for the background server to combine data, thereby improving the efficiency of page display.
[0064] In some embodiments of the present invention, before responding to the target service startup operation, the page rendering method further includes:
[0065] S101. In response to a target application startup operation, a compressed package and service link information of each service are downloaded from a server to a local computer to form a compressed package set service link information set, wherein when the service meets a pre-request condition, the compressed package includes a pre-request configuration file. In addition, when the service meets the pre-request condition, the service link information contains a pre-request support parameter. The service link information contains a service name, so that the corresponding service link information can be indexed according to the service startup operation.
[0066] In some embodiments, in response to the target service initiation operation, obtaining the target service link information associated with the target service locally includes:
[0067] In response to the target service start operation, obtaining the target service name;
[0068] According to the target business name, the target business link information matching the target business name is found from the business link information set. The business link information is obtained from the background server when the APP is started, or in some embodiments, the business link information can be solidified into the page code. Obtaining the business link information through the background facilitates background configuration.
[0069] In some embodiments of the present invention, the step of obtaining a pre-downloaded target compressed package file from a local computer according to the target service name includes:
[0070] The target compressed package file is obtained from the compressed package set according to the target business name.
[0071] In order to accurately control the data return logic of each sub-route and save unnecessary data transmission expenses, in some embodiments of the present invention, the pre-request of each sub-route can be accurately controlled. Specifically, the pre-request configuration file also includes: a blocking request corresponding to the pre-request identifier; accessing the target server according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes:
[0072] When it is determined that the blocking request is turned on, stop acquiring the pre-request data corresponding to the pre-request identifier;
[0073] When it is determined that the blocking request is closed, pre-request data corresponding to the pre-request identifier is obtained.
[0074] For example, for the "My" business, there are sub-routes "My Attention" and "My Fans". In order to save data transmission overhead and improve page rendering efficiency, for "My Fans" that users do not often click, the corresponding blocking request is configured to be turned on. In this way, when initiating a data pre-request, the pre-request data corresponding to "My Fans" will no longer be obtained in advance. When the backend updates the policy as needed, such as after a period of time, and changes the blocking switch in the configuration file, the client can pre-request the data in "My Fans". This setting makes it easier for the backend to adjust the policy.
[0075] In order to ensure reliable execution of data requests and avoid page rendering failure, normal data requests are made in a timely manner when pre-requests are not possible. Figure 2 As shown, it also includes,
[0076] S160: when it is determined that the target compressed package file does not contain a pre-request configuration file or the pre-request support parameter indicates that the target service does not support pre-request, parse and execute a page code corresponding to the target service;
[0077] S170. In response to a data request in the page code, access a server according to the data request to obtain target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
[0078] In order to avoid page rendering failure when the process of obtaining pre-request data from the local computer fails, some embodiments of the present invention provide a conventional data request process for failure situations. Specifically, when it is determined that the pre-request identifier in the data request belongs to the pre-request identifier set, obtaining target data from the pre-request data set includes:
[0079] In response to a failure to obtain the target data from the pre-request data set, a server is accessed according to the data request to obtain the target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
[0080] The page rendering method of the embodiment of the present invention improves the efficiency of page rendering through data pre-request, and the pre-request process of each sub-route can be accurately controlled through the blocking switch in the configuration file.
[0081] The page rendering method in the embodiment of the present invention can be run on various terminals, not only Android terminals, but also iOS terminals. For example, it can be used on Android mobile phones, tablet computers, iPhones, car terminals, smart watches, iWatch, smart speakers, smart bracelets and other terminals, so that the page loading speed is effectively improved.
[0082] The application business in the embodiment of the present invention can be written using the hippy framework or other front-end architectures.
[0083] The following is a detailed introduction using the hippy framework to write business.
[0084] In some embodiments of the present invention, a page rendering method is provided, and the specific steps are as follows:
[0085] 1. When the client starts the app, it will download the Hippy compressed package of each service in advance. The compressed package mainly contains the following items: jsBundle file (necessary), signature file (necessary), native_Config file (optional).
[0086] 2. When the user clicks on the Hippy service entrance, the client will parse the Hippy service link sent by the backend, and first find the corresponding Hippy compressed package based on the hippy parameter (Hippy service name) in the link. When the client is started, it will run two processes to download the hippy compressed package and the corresponding hippy service link.
[0087] 3. If the link carries the preRequestCgi parameter, it indicates that the Hippy service supports the pre-request solution. If not, the link is rendered normally.
[0088] 4. Check whether the Hippy compressed package contains the native_Config file. If the file does not exist, the normal rendering link is performed.
[0089] 5. If the pre-request configuration file exists, the client starts parsing the pre-request configuration file, which is in the format of a JSON object in the preRequests array. The preRequests array contains this object, which contains the following fields: fid (unique identifier of the pre-request), ns (namespace of the request interface), cmd (command word of the request interface), cmdName (request structure name of the request interface), rspStructName (data return structure name of the request interface), data (data object), fileName (file name of the request interface), Block (block request switch, for sub-routes), and limit (limit request switch).
[0090] 6. First check whether the pre-request configuration item preRequests in the configuration file exists. If so, parse each request configuration item, otherwise perform the normal rendering link.
[0091] 7. Through the Block parameter, precise control of the pre-request data of the sub-route is achieved, avoiding data waste.
[0092] 8. Through the preRequest array, multiple pre-request data concurrent requests are realized, which decouples the interdependence between the requests, achieves flexible control, and reduces the risk of reduced page rendering efficiency due to some of the interfaces.
[0093] 9. Through the combination of ns (namespace of request interface), cmd (command word of request interface), cmdName (request structure name of request interface), the pre-request data can directly access the corresponding background service without transit, thus reducing the waste of data request link and speeding up data return.
[0094] 10. Check the pre-request configuration items. If the pre-request configuration items meet the requirements, the client initiates the corresponding data request, otherwise it skips the item. If there are multiple configuration items, repeat the process of 1.4, otherwise the normal rendering link is performed.
[0095] 11. The client parses and executes Javascript. If a data request is encountered, it determines whether the fid parameter exists. If so, it obtains data through the client's pre-request interface without initiating a normal data request. This saves the time required for normal requests in the past and improves the user experience.
[0096] 12. When there is a fid and the data corresponding to the fid cannot be retrieved through the client pre-request, a normal data request is initiated to ensure that the data required by the user is obtained normally.
[0097] 13. After obtaining the data, the Hippy service renders the page and presents it to the user.
[0098] The embodiments of the present invention achieve the following effects after being applied to the hippy service: improving the rendering speed of the hippy service and improving the user experience; implementing configuration of pre-request files and reducing development costs; removing the Node transfer layer (for data combination and data request forwarding) and reducing server expenses.
[0099] In the embodiment of the present invention, Figure 3 As shown, a page rendering device 900 is shown, and the page rendering device 900 includes:
[0100] The service link information acquisition module 910 is configured to, in response to a target service startup operation, acquire target service link information associated with the target service from a local computer, wherein the target service link information includes a target service name and pre-request support parameters;
[0101] A compressed package file acquisition module 920 is configured to acquire a pre-downloaded target compressed package file from a local computer according to the target service name;
[0102] The pre-request data acquisition module 930 is configured to access the target server according to the pre-request identifier set in the pre-request configuration file to acquire the pre-request data set when it is determined that there is a pre-request configuration file in the target compressed package file and the pre-request support parameter indicates that the target service supports pre-request;
[0103] The target data acquisition module 940 is configured to parse and execute the page code corresponding to the target business, and in response to the data request in the page code, when it is determined that the pre-request identifier in the data request belongs to the pre-request identifier set, acquire the target data from the pre-request data set;
[0104] The rendering module 950 is configured to perform page rendering according to the target data and display a page corresponding to the target business.
[0105] In some embodiments, the page rendering device 900 also includes a pre-download module 960, which is configured to download compressed packages and business link information of various services from the server in response to a target application startup operation before responding to a target page startup operation, wherein when the service meets a pre-request condition, the compressed package includes a pre-request configuration file.
[0106] In some embodiments, the service link information acquisition module 910 is specifically configured to:
[0107] In response to the target service start operation, obtaining the target service name;
[0108] According to the target service name, target service link information matching the target service name is found from the locally stored service link information.
[0109] In some embodiments, the pre-request configuration file includes: a pre-request identifier set and a namespace, a command word, and a structure name corresponding to the pre-request identifier in the pre-request identifier set; the pre-request data acquisition module 930 is specifically configured as follows:
[0110] According to the pre-request identifier in the pre-request identifier set, obtain a namespace, a command word and a structure name;
[0111] Obtain the target server according to the namespace, command word and structure name;
[0112] A request is directly initiated to the target server to obtain pre-request data to form the pre-request data set.
[0113] In some embodiments, the pre-request configuration file further includes: a data return object parameter corresponding to the pre-request identifier; the pre-request data acquisition module 930 is further specifically configured as follows:
[0114] The pre-request data obtained from the target server is stored in the data return object parameter.
[0115] In some embodiments, the target data acquisition module 940 is specifically configured as follows:
[0116] The target data is obtained from a data return object parameter corresponding to the pre-request identifier in the pre-request configuration file.
[0117] In some embodiments, the pre-request configuration file further includes: a blocking request corresponding to the pre-request identifier; the pre-request data acquisition module 930 is further configured to:
[0118] When it is determined that the blocking request is turned on, stop acquiring the pre-request data corresponding to the pre-request identifier;
[0119] When it is determined that the blocking request is closed, pre-request data corresponding to the pre-request identifier is obtained.
[0120] In some embodiments, the page rendering device 900 also includes a normal rendering module 970, which is configured to: when it is determined that there is no pre-request configuration file in the target compressed package file or the pre-request support parameter indicates that the target business does not support pre-request, parse and execute the page code corresponding to the target business; in response to the data request in the page code, access the server according to the data request to obtain the target data, wherein the target data is generated by combining the target sub-data obtained from multiple servers.
[0121] In some embodiments, the target data acquisition module 940 is further configured to:
[0122] In response to a failure to obtain the target data from the pre-request data set, a server is accessed according to the data request to obtain the target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
[0123] In some embodiments, the page rendering device may be combined with features of the page rendering method of any embodiment, and vice versa, which will not be elaborated here.
[0124] In an embodiment of the present invention, an electronic device is provided, including: a processor and a memory storing a computer program, wherein the processor is configured to execute the page rendering method of any embodiment of the present invention when running the computer program.
[0125] Figure 4 A schematic diagram of an electronic device 1100 that can implement a method or implement an embodiment of the present invention is shown, and in some embodiments, more or fewer electronic devices than shown may be included. In some embodiments, it can be implemented using a single or multiple electronic devices. In some embodiments, it can be implemented using cloud or distributed electronic devices.
[0126] like Figure 4As shown, the electronic device 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate operations and processes according to the programs and / or data stored in the read-only memory (ROM) 1102 or the programs and / or data loaded from the storage part 1108 to the random access memory (RAM) 1103. CPU 1101 can be a multi-core processor, or it can include multiple processors. In some embodiments, CPU 1101 can include a general main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. In RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. CPU 1101, ROM 1102 and RAM 1103 are connected to each other via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.
[0127] The above-mentioned processor and memory are used together to execute the program stored in the memory. When the program is executed by the computer, it can implement the steps or functions of the high-resolution audio generation model training method, high-resolution audio generation method, and sound effect switching method described in the above-mentioned embodiments.
[0128] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, a touch screen, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed. Figure 4 Only some components are schematically shown in the figure, which does not mean that the computer system 1100 only includes Figure 4 Components shown.
[0129] In some embodiments, the electronic device 1100 refers to a mobile terminal, including a mobile phone, a car terminal, a smart TV, etc. Taking a mobile phone as an example, the electronic device 1100 also includes a display screen with a touch function, an external speaker, a gyroscope, a camera, a 4G / 5G antenna and other device modules.
[0130] The systems, devices, modules or units described in the above embodiments may be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, a smart phone, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a personal digital assistant, a media player, a navigation device, a game console, a tablet computer, a wearable device, a smart TV, an Internet of Things system, a smart home, an industrial computer, a server or a combination thereof.
[0131] Although not shown, in an embodiment of the present invention, a storage medium is provided, the storage medium storing a computer program, the computer program being configured to execute any page rendering method of the embodiments of the present invention when executed.
[0132] Storage media in embodiments of the present invention include permanent and non-permanent, removable and non-removable items that can be used to store information by any method or technology. Examples of storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0133] The methods, programs, systems, devices, etc. of the embodiments of the present invention may be executed or implemented in a single or multiple networked computers, or may be practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks may be performed by remote processing devices connected via a communication network.
[0134] Those skilled in the art should understand that the embodiments of the present specification may be provided as methods, systems or computer program products. Therefore, those skilled in the art may imagine that the functional modules / units or controllers and related method steps described in the above embodiments may be implemented in software, hardware or a combination of software / hardware.
[0135] Unless explicitly stated, the actions or steps of the methods, programs, and embodiments of the present invention do not have to be performed in a specific order and can still achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0136] In this article, multiple embodiments of the present invention are described, but for the sake of brevity, the description of each embodiment is not exhaustive, and the same or similar features or parts between the embodiments may be omitted. In this article, "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" are meant to be applicable to at least one embodiment or example according to the present invention, but not all embodiments. The above terms do not necessarily mean to refer to the same embodiment or example. In the absence of contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.
[0137] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best modes for implementing the present systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein when implementing the present systems and / or methods without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A page rendering method, characterized in that: The steps include: In response to the target service start operation, obtaining target service link information associated with the target service from a local location, wherein the target service link information includes a target service name and a pre-request support parameter; According to the target service name, obtain the pre-downloaded target compressed package file from the local computer; When it is determined that there is a pre-request configuration file in the target compressed package file and the pre-request support parameter indicates that the target service supports pre-request, access the target server according to the pre-request identifier set in the pre-request configuration file to obtain a pre-request data set; Parsing and executing a page code corresponding to the target business, and in response to a data request in the page code, obtaining target data from the pre-request data set when it is determined that the pre-request identifier in the data request belongs to the pre-request identifier set; Rendering a page according to the target data to display a page corresponding to the target business; The pre-request configuration file includes: a pre-request identifier set and a namespace, a command word, and a structure name corresponding to the pre-request identifier in the pre-request identifier set; The step of accessing the target server set according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes: According to the pre-request identifier in the pre-request identifier set, obtain a namespace, a command word and a structure name; Obtain a target server according to the namespace, command word and structure name; A request is directly initiated to the target server to obtain pre-request data to form the pre-request data set.
2. The page rendering method according to claim 1, characterized in that: Before responding to the target service startup operation, the page rendering method further includes: In response to the target application startup operation, the compressed package and service link information of each service are downloaded from the server to the local to form a compressed package set and a service link information set, wherein when the service meets the pre-request condition, the compressed package includes a pre-request configuration file.
3. The page rendering method according to claim 2, characterized in that: The step of obtaining, in response to the target service startup operation, target service link information associated with the target service from a local location includes: In response to the target service start operation, obtaining the target service name; According to the target service name, target service link information matching the target service name is found from the service link information set.
4. The page rendering method according to claim 2, characterized in that: The step of obtaining a pre-downloaded target compressed package file from a local computer according to the target service name includes: The target compressed package file is obtained from the compressed package set according to the target business name.
5. The page rendering method according to claim 1, characterized in that: The pre-request configuration file also includes: a data return object parameter corresponding to the pre-request identifier; The obtaining of pre-request data includes: The pre-request data obtained from the target server is stored in the data return object parameter.
6. The page rendering method according to claim 1, characterized in that: The acquiring target data from the pre-request data set includes: The target data is obtained from a data return object parameter corresponding to the pre-request identifier in the pre-request configuration file.
7. The page rendering method according to claim 1, characterized in that: The pre-request configuration file includes: a blocking request corresponding to the pre-request identifier; The step of accessing the target server according to the pre-request identifier set in the pre-request configuration file to obtain the pre-request data set includes: When it is determined that the blocking request is turned on, stop acquiring the pre-request data corresponding to the pre-request identifier; When it is determined that the blocking request is closed, pre-request data corresponding to the pre-request identifier is obtained.
8. The page rendering method according to claim 1, characterized in that: When it is determined that there is no pre-request configuration file in the target compressed package file or the pre-request support parameter indicates that the target service does not support pre-request, Parse and execute the page code corresponding to the target business; In response to a data request in the page code, a server is accessed according to the data request to obtain target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
9. The page rendering method according to claim 1, characterized in that: When determining that the pre-request identifier in the data request belongs to the pre-request identifier set, acquiring target data from the pre-request data set includes: In response to a failure to obtain the target data from the pre-request data set, a server is accessed according to the data request to obtain the target data, wherein the target data is generated by combining target sub-data obtained from multiple servers.
10. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
11. An electronic device, characterized in that: include: A processor and a memory storing a computer program, wherein the processor is configured to execute the method according to any one of claims 1 to 9 when running the computer program.
Citation Information
Patent Citations
Webpage rendering method and device, equipment and storage medium
CN112115396A